فهرست منبع

处理时限加入禁用

wangliang 1 سال پیش
والد
کامیت
5f6111d2fd

+ 12 - 32
sop-business/src/main/java/com/qmth/sop/business/activiti/listener/ProcessEventListener.java

@@ -93,8 +93,6 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
             case TASK_CREATED:
                 log.info("流程任务创建_TASK_CREATED:ProcessInstanceId:{},ExecutionId:{},ProcessDefinitionId:{}", event.getProcessInstanceId(), event.getExecutionId(), event.getProcessDefinitionId());
                 TaskService taskService = SpringContextHolder.getBean(TaskService.class);
-
-                TSJobRemindService jobRemindService = SpringContextHolder.getBean(TSJobRemindService.class);
                 ActivitiEntityEvent activitiEntityEvent = (ActivitiEntityEvent) event;
                 if (activitiEntityEvent.getEntity() instanceof Task) {
                     Task task = (Task) activitiEntityEvent.getEntity();
@@ -111,36 +109,21 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                         TFFlowLog tfFlowLog = (TFFlowLog) taskService.getVariable(task.getId(), SystemConstant.FLOW_APPROVE_LOG);
                         Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_LOG_NO_DATA.exception());
 
-                        SysUser sysUser = (SysUser) taskService.getVariable(task.getId(), SystemConstant.FLOW_SYS_USER);
-                        Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.USER_NO_EXISTS.exception());
-
-//                        Map<String, Object> map = (Map) taskService.getVariable(task.getId(), SystemConstant.APPROVE_MAP_VAR);
-
                         //此处统一流程节点保存延期预警任务
                         if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)
                                 && tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.DRAFT
                                 && tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.END
                                 && tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.FINISH) {
-                            List<TSJobRemind> tsJobRemindArrayList = new ArrayList<>();
                             if (Objects.nonNull(task.getAssignee())) {
-                                tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-//                                if (CollectionUtils.isEmpty(map)) {//系统自动提交的不发待办短信
                                 this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(task.getAssignee()));
-//                                    jobRemindService.saveJobRemind(tsJobRemindArrayList);
-//                                }
                             } else {
                                 List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
                                 if (!CollectionUtils.isEmpty(identityLinkList)) {
                                     for (IdentityLink i : identityLinkList) {
-                                        tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-//                                        if (CollectionUtils.isEmpty(map)) {//系统自动提交的不发待办短信
                                         this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(i.getUserId()));
-//                                            jobRemindService.saveJobRemind(tsJobRemindArrayList);
-//                                        }
                                     }
                                 }
                             }
-                            jobRemindService.saveJobRemind(tsJobRemindArrayList);
                         }
                     }
                 }
@@ -149,7 +132,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                 // 任务被完成了。它会在ENTITY_DELETE事件之前触发。当任务是流程一部分时,事件会在流程继续运行之前, 后续事件将是ACTIVITY_COMPLETE,对应着完成任务的节点。
                 log.info("流程任务完成_TASK_COMPLETED:ProcessInstanceId:{},ExecutionId:{},ProcessDefinitionId:{}", event.getProcessInstanceId(), event.getExecutionId(), event.getProcessDefinitionId());
                 taskService = SpringContextHolder.getBean(TaskService.class);
-                jobRemindService = SpringContextHolder.getBean(TSJobRemindService.class);
+                TSJobRemindService jobRemindService = SpringContextHolder.getBean(TSJobRemindService.class);
                 activitiEntityEvent = (ActivitiEntityEvent) event;
                 if (activitiEntityEvent.getEntity() instanceof Task) {
                     Task task = (Task) activitiEntityEvent.getEntity();
@@ -160,8 +143,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                         TFFlowLog tfFlowLog = (TFFlowLog) taskService.getVariable(task.getId(), SystemConstant.FLOW_APPROVE_LOG);
                         Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_LOG_NO_DATA.exception());
 
-                        if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)
-                                && tfFlowLog.getApproveSetup().intValue() > 1) {//流程提交不需要提醒
+                        if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) && tfFlowLog.getApproveSetup().intValue() > 1) {//流程提交不需要提醒
                             //任务完成后统一设置延期预警任务enable为false
                             jobRemindService.updateJobRemind(Long.parseLong(task.getId()));
                         }
@@ -350,19 +332,17 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
     protected void sendSopFlowDoneSms(TFCustomTypeEnum type, TFCustomFlowEntity tfCustomFlowEntity, String taskName, Long userId) {
         SmsSendUtil smsSendUtil = SpringContextHolder.getBean(SmsSendUtil.class);
         TFCustomFlowEntityService tfCustomFlowEntityService = SpringContextHolder.getBean(TFCustomFlowEntityService.class);
-        if (type == TFCustomTypeEnum.OFFICE_SOP_FLOW || type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//发送待审批短信
-            FlowTaskSmsResult flowTaskSmsResult = tfCustomFlowEntityService.getFlowTaskRemindSmsInfo(tfCustomFlowEntity.getId(), userId);
-            if (Objects.isNull(flowTaskSmsResult)) {
-                flowTaskSmsResult = tfCustomFlowEntityService.getFlowTaskRemindSmsInfo(tfCustomFlowEntity.getCrmNo(), userId);
-            }
-            Optional.ofNullable(flowTaskSmsResult).orElseThrow(() -> ExceptionResultEnum.USER_NO_EXISTS.exception());
-            Map<String, Object> templateParam = new HashMap<>();
-            templateParam.put("userName", flowTaskSmsResult.getRealName());
-            templateParam.put("serviceName", flowTaskSmsResult.getServiceName());
-            templateParam.put("customName", flowTaskSmsResult.getCustomName());
-            templateParam.put("flowName", type.getTitle() + "【" + taskName + "】");
-            smsSendUtil.sendSms(flowTaskSmsResult.getMobileNumber(), SystemConstant.SMS_SOP_DONE_CODE, templateParam);
+        FlowTaskSmsResult flowTaskSmsResult = tfCustomFlowEntityService.getFlowTaskRemindSmsInfo(tfCustomFlowEntity.getId(), userId);
+        if (Objects.isNull(flowTaskSmsResult)) {
+            flowTaskSmsResult = tfCustomFlowEntityService.getFlowTaskRemindSmsInfo(tfCustomFlowEntity.getCrmNo(), userId);
         }
+        Optional.ofNullable(flowTaskSmsResult).orElseThrow(() -> ExceptionResultEnum.USER_NO_EXISTS.exception());
+        Map<String, Object> templateParam = new HashMap<>();
+        templateParam.put("userName", flowTaskSmsResult.getRealName());
+        templateParam.put("serviceName", flowTaskSmsResult.getServiceName());
+        templateParam.put("customName", flowTaskSmsResult.getCustomName());
+        templateParam.put("flowName", type.getTitle() + "【" + taskName + "】");
+        smsSendUtil.sendSms(flowTaskSmsResult.getMobileNumber(), SystemConstant.SMS_SOP_DONE_CODE, templateParam);
     }
 
     /**

+ 2 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -696,6 +696,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     execField = ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey();
                 } else if (tfFlowApprove.getSetup().intValue() == 3) {//内审
                     processLimitedTime = tfFlowApprove.getUpdateTime();
+                    execField = ProcessLimitedEnum.APPROVE_RADIO.getKey();
                 } else if (tfFlowApprove.getSetup().intValue() == 5) {//扫描准备
                     tbSopInfoService.sopDeviceInOutSave(map, 4);
                     FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
@@ -725,6 +726,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     execField = ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey();
                 } else if (tfFlowApprove.getSetup().intValue() == 3) {//内审
                     processLimitedTime = tfFlowApprove.getUpdateTime();
+                    execField = ProcessLimitedEnum.APPROVE_RADIO.getKey();
                 } else if (tfFlowApprove.getSetup().intValue() == 4) {//环境部署时间
                     FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
                     processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.ENV_DEPLOYMENT_TIME.getKey());

+ 2 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/ProcessLimitedEnum.java

@@ -11,6 +11,8 @@ public enum ProcessLimitedEnum {
 
     PROJECT_KEY_INFO_DATE("project_key_info_date", "项目关键信息提交截止时间"),
 
+    APPROVE_RADIO("approve_radio", "内审"),
+
     SCAN_START_TIME("project_key_info_date", "扫描开始时间"),
 
     SCAN_END_TIME("scan_end_time", "扫描结束时间"),