Commit ff88aadd authored by 廖旭伟's avatar 廖旭伟

单事项申请增加siteId值写入,单事项预审增加批量审批接口

parent db549d57
...@@ -31,4 +31,6 @@ public class MatterApplyVo extends BaseEntityLong { ...@@ -31,4 +31,6 @@ public class MatterApplyVo extends BaseEntityLong {
private String applyTypeName; private String applyTypeName;
private List<MatterApplyDatumGroupVO> datumGroupList; private List<MatterApplyDatumGroupVO> datumGroupList;
private List<Long> idList;
} }
\ No newline at end of file
...@@ -30,4 +30,11 @@ public interface MatterApplyService extends ICRUDService<MatterApplyEntity,Long> ...@@ -30,4 +30,11 @@ public interface MatterApplyService extends ICRUDService<MatterApplyEntity,Long>
* @throws AppException * @throws AppException
*/ */
void reApply(MatterApplyEntity entity, Context context) throws AppException; void reApply(MatterApplyEntity entity, Context context) throws AppException;
/**
* 批量审批
* @param entity
* @throws AppException
*/
void applyExamineBatch(MatterApplyEntity entity, Context context) throws AppException;
} }
\ No newline at end of file
...@@ -71,7 +71,7 @@ public class MatterApplyServiceImpl extends AbstractCRUDServiceImpl<MatterApplyD ...@@ -71,7 +71,7 @@ public class MatterApplyServiceImpl extends AbstractCRUDServiceImpl<MatterApplyD
entity.setDeptCode(singleMatterEntity.getDeptCode()); entity.setDeptCode(singleMatterEntity.getDeptCode());
entity.setMatterName(singleMatterEntity.getMatterName()); entity.setMatterName(singleMatterEntity.getMatterName());
} }
entity.setSiteId(1l); //entity.setSiteId(1l);
entity.setApplyTime(entity.getCreateTime()); entity.setApplyTime(entity.getCreateTime());
entity.setApplyState(0); entity.setApplyState(0);
} }
...@@ -274,4 +274,29 @@ public class MatterApplyServiceImpl extends AbstractCRUDServiceImpl<MatterApplyD ...@@ -274,4 +274,29 @@ public class MatterApplyServiceImpl extends AbstractCRUDServiceImpl<MatterApplyD
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
matterApplyDatumService.remobeByApplyIds(ids,context); matterApplyDatumService.remobeByApplyIds(ids,context);
} }
@Override
public void applyExamineBatch(MatterApplyEntity entity, Context context) throws AppException {
if (CollectionUtils.isEmpty(entity.getIdList())) {
throw new AppException("申报id不能为空");
}
if (entity.getApplyState() == null) {
throw new AppException("审批状态不能为空");
}
List<MatterApplyEntity> updateList = new ArrayList<>();
for(Long id:entity.getIdList()) {
MatterApplyEntity update = new MatterApplyEntity();
update.setId(id);
update.setApplyState(entity.getApplyState());
update.setAdvisement(entity.getAdvisement());
if (context != null && context.getUser() != null) {
update.setUpdateUserId(context.getUser().getId());
}
update.setUpdateTime(new Date());
updateList.add(update);
}
if(updateList.size()>0) {
dao.updateBatch(updateList);
}
}
} }
\ No newline at end of file
...@@ -178,6 +178,40 @@ public class MatterApplyController extends BaseCRUDJsonBodyMappingController<Mat ...@@ -178,6 +178,40 @@ public class MatterApplyController extends BaseCRUDJsonBodyMappingController<Mat
return ret.toJSONString(); return ret.toJSONString();
} }
/**
* 批量审批
* @param entity
* @return
*/
@PostMapping({"examine/batch"})
public String applyExamineBatch(@RequestBody MatterApplyEntity entity) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "审批" + this.getModuleDesc();
int code;
try {
this.service.applyExamineBatch(entity,context);
model.put("id", entity.getId());
code = this.saveAfter(entity, model, context);
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
/** /**
* 重新申请 * 重新申请
* @param entity * @param entity
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment