Kaynağa Gözat

研究生流程加入预警

wangliang 10 ay önce
ebeveyn
işleme
eefd19b0ca

+ 0 - 7
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -116,9 +116,6 @@ public class TBSopInfoController {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
-//        Boolean result = tbSopInfoService.sopAllocation(sopAllocationParam);
-//        tbSopInfoService.sopProxySystemApprove(sopAllocationParam.getFlowId(), null);
-//        return ResultUtil.ok(result);
         return ResultUtil.ok(tbSopInfoService.sopAllocation(sopAllocationParam));
     }
 
@@ -161,10 +158,6 @@ public class TBSopInfoController {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
-//        Boolean result = tbSopInfoService.sopSave(sopSaveParam);
-//        TBSopInfo tbSopInfo = tbSopInfoService.getById(sopSaveParam.getId());
-//        tbSopInfoService.sopProxySystemApprove(null, tbSopInfo.getSopNo());
-//        return ResultUtil.ok(result);
         return ResultUtil.ok(tbSopInfoService.sopSave(sopSaveParam));
     }
 

+ 29 - 4
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1573,6 +1573,30 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 projectManagerUserIds.add(Long.parseLong(value));
             }
         }
+        if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
+            FlowTaskResult flowTaskResultTemp = this.getFormProperties(tfCustomFlowEntity, 1);
+            List<FlowFormWidgetResult> flowFormWidgetResultTempList = flowTaskResultTemp.getFormProperty();
+            for (FlowFormWidgetResult f : flowFormWidgetResultTempList) {
+                if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey()) && Objects.nonNull(
+                        f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                    JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
+                    for (int i = 0; i < jsonArray.size(); i++) {
+                        enginessUserIds.add(Long.parseLong(jsonArray.getString(i)));
+                    }
+                } else if (f.getFormId().contains(ProcessLimitedEnum.REGION_COORDINATOR_ID.getKey()) && Objects.nonNull(
+                        f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                    String value = jsonObject.getString(SystemConstant.VALUE);
+                    regionCoordinatorUserIds.add(Long.parseLong(value));
+                } else if (f.getFormId().contains(ProcessLimitedEnum.PROJECT_MANAGER_ID.getKey()) && Objects.nonNull(
+                        f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                    String value = jsonObject.getString(SystemConstant.VALUE);
+                    projectManagerUserIds.add(Long.parseLong(value));
+                }
+            }
+        }
         if (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END) {
             Map<String, Object> map = new HashMap<>();
             CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
@@ -1606,8 +1630,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 tbSopLogService.save(tbSopLog);
             }
 
+            List<AllocationParam> allocationParams = new ArrayList<>();
             if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW && scopeEnum != scopeOldEnum) {//教务处sop流程待审核人
-                List<AllocationParam> allocationParams = new ArrayList<>();
                 Task task = taskService.createTaskQuery().processInstanceId(tfCustomFlowEntity.getFlowId().toString())
                         .singleResult();
                 Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
@@ -1626,6 +1650,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                                     Arrays.asList(tfFlowLogExchange.getApproveId()) :
                                     Arrays.asList(crmProjectResult.getProjectManagerList().get(0).getUserId()),
                             "[系统]"));
+                    tbSopInfoService.sopApproverExchange(tbCrmDetail.getId(), new SopAllocationParam(
+                            new UserArchivesAllocationParam(allocationParams, tbCrmDetail.getId())));
                 }
                 if (!CollectionUtils.isEmpty(allocationParams)) {
                     tbSopInfoService.sopApproverExchange(tbCrmDetail.getId(), new SopAllocationParam(
@@ -1635,11 +1661,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                         allocationParams.add(new AllocationParam(SopRoleTypeEnum.REGION_COORDINATOR,
                                 Arrays.asList(crmProjectResult.getRegionCoordinatorList().get(0).getUserId()), "[系统]"));
                     }
-                    tbUserArchivesAllocationService.editCrmAllocation(
-                            new UserArchivesAllocationParam(allocationParams, tbCrmDetail.getId()));
                 }
             } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
-                List<AllocationParam> allocationParams = new ArrayList<>();
                 if (!CollectionUtils.isEmpty(projectManagerUserIds)) {
                     allocationParams.add(
                             new AllocationParam(SopRoleTypeEnum.PROJECT_MANAGER, projectManagerUserIds, "[系统]"));
@@ -1653,6 +1676,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     allocationParams.add(
                             new AllocationParam(SopRoleTypeEnum.REGION_COORDINATOR, regionCoordinatorUserIds, "[系统]"));
                 }
+            }
+            if (!CollectionUtils.isEmpty(allocationParams)) {
                 tbUserArchivesAllocationService.editCrmAllocation(
                         new UserArchivesAllocationParam(allocationParams, tbCrmDetail.getId()));
             }