|
|
@@ -1086,14 +1086,100 @@ public class StockLandService extends BaseService<StockLand> {
|
|
|
}else if(type == 13){
|
|
|
//简易流程分发,状态改为简易流程会签。由简易流程会签用户组操作
|
|
|
stockLand.setApprove_status(Constant.LandApproveStatus.JYLCHQ);
|
|
|
- //下一审核人,工业用地简易流程审核组
|
|
|
- String userIdInThisGroup = findUserIdByGroupName(Constant.JYLCSHXZ);
|
|
|
- //保存审核记录,并更新附件
|
|
|
- saveApprovalAndUpdateAttach(slad, id, comment,userIdInThisGroup,Constant.LandApproveStatus.JYLCHQ,Constant.OperType.APPROVED,approval_round);
|
|
|
- //新增待办
|
|
|
- String handler = userIdInThisGroup;
|
|
|
- waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + stockLand.getId(), Constant.WaitToDo_OperType.AUDIT, stockLand.getId(),
|
|
|
- Constant.DictionaryType.STOCKLAND,stockLand.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
|
|
|
+ // 改为简易流程工作组审核,流程与常规审核流程基本保持一致
|
|
|
+ StringBuffer sb = new StringBuffer("");
|
|
|
+ if(StringUtils.isNotBlank(departmentIds)){
|
|
|
+
|
|
|
+ // 从上面部门中再筛选出在工业用地简易流程审核组中的人
|
|
|
+ Group group = groupService.findByName(Constant.JYLCSHXZ, null);
|
|
|
+// 如果不为空
|
|
|
+ List<Integer> groupUserIdList = new ArrayList<>();
|
|
|
+ if(null != group){
|
|
|
+ // 根据工作组id查出UserGroup
|
|
|
+ List<UserGroup> list = userGroupService.findByGroupId(group.getId());
|
|
|
+ // 构建一个StringBuffer 存放下一审核人id
|
|
|
+// StringBuffer sb = new StringBuffer("");
|
|
|
+ for (UserGroup userGroup: list) {
|
|
|
+ Integer userId = userGroup.getUser_id();
|
|
|
+ groupUserIdList.add(userId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<User> nextChecker = new ArrayList<>();
|
|
|
+ String departmentIdArr [] = departmentIds.split(",");
|
|
|
+ String handler = "";//待办操作人,待办先发送经办人
|
|
|
+ for(String departId:departmentIdArr){
|
|
|
+ List<User> userList = userService.findUserBydepartmentId(departId);
|
|
|
+ if(null == userList || userList.size() == 0){
|
|
|
+ String departmentName = departmentService.findById(Integer.valueOf(departId)).getName();
|
|
|
+ return ResponseMessage.error(departmentName+"没有审核人!");
|
|
|
+ }else {
|
|
|
+ //是否有一级二级审批人
|
|
|
+ if(!checkAuditPerson(userList,Constant.LandApproveStatus.COMPLIANCE_AUDIT)) {
|
|
|
+ String departmentName = departmentService.findById(Integer.valueOf(departId)).getName();
|
|
|
+ return ResponseMessage.error(departmentName+"审核人不全,需要有一级二级审核人!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 去掉不在审批组中的人
|
|
|
+ List<User> userListTmp = new ArrayList<>();
|
|
|
+ for(User user:userList){
|
|
|
+ if (!groupUserIdList.contains(user.getId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ userListTmp.add(user);
|
|
|
+ sb.append(user.getId()+",");
|
|
|
+ nextChecker.add(user);
|
|
|
+ }
|
|
|
+ userList = userListTmp;
|
|
|
+
|
|
|
+ if(null == userList || userList.size() == 0){
|
|
|
+ String departmentName = departmentService.findById(Integer.valueOf(departId)).getName();
|
|
|
+ return ResponseMessage.error(departmentName+"在工业用地简易流程审核组中没有审核人!");
|
|
|
+ }
|
|
|
+ handler += getFirstLevelChecker(userList);
|
|
|
+ }
|
|
|
+
|
|
|
+ saveApprovalAndUpdateAttach(slad, id, comment, sb.toString(),Constant.LandApproveStatus.COMPLIANCE_AUDIT,Constant.OperType.APPROVED,approval_round);
|
|
|
+ // wangjiang@2022-10-09 20:31:40 添加发送人短信通知
|
|
|
+ if (!nextChecker.isEmpty() && isNeedNoticeAfterDispatch(stockLand.getApply_type())) {
|
|
|
+ String tempCode = Constant.SMS_TemplateCode.STOCKLAND_JUDGE_AFTER_DISPATCH;
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ params.put("applyno", stockLand.getApply_no());
|
|
|
+ for (User user : nextChecker) {
|
|
|
+ try {
|
|
|
+ AlibabaSMSUtil.sendSMS(
|
|
|
+ user.getPhone(),
|
|
|
+ tempCode,
|
|
|
+ Constant.SINGNAMW,
|
|
|
+ JSONObject.toJSONString(params)
|
|
|
+ );
|
|
|
+ } catch (ClientException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //新增待办
|
|
|
+ //String handler = getFirstLevelChecker(userList);
|
|
|
+ waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + stockLand.getId(), Constant.WaitToDo_OperType.AUDIT, stockLand.getId(),
|
|
|
+ Constant.DictionaryType.STOCKLAND,stockLand.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return ResponseMessage.error("请选择部门!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// //下一审核人,工业用地简易流程审核组
|
|
|
+// String userIdInThisGroup = findUserIdByGroupName(Constant.JYLCSHXZ);
|
|
|
+// //保存审核记录,并更新附件
|
|
|
+// saveApprovalAndUpdateAttach(slad, id, comment,userIdInThisGroup,Constant.LandApproveStatus.JYLCHQ,Constant.OperType.APPROVED,approval_round);
|
|
|
+// //新增待办
|
|
|
+// String handler = userIdInThisGroup;
|
|
|
+// waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + stockLand.getId(), Constant.WaitToDo_OperType.AUDIT, stockLand.getId(),
|
|
|
+// Constant.DictionaryType.STOCKLAND,stockLand.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
|
|
|
}else if(type == 15||type == 14){
|
|
|
//简易流程会签
|
|
|
if(null != approval){
|