|
@@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.sop.business.bean.dto.FlowRejectSequenceDto;
|
|
|
import com.qmth.sop.business.bean.result.*;
|
|
|
import com.qmth.sop.business.entity.*;
|
|
|
-import com.qmth.sop.business.service.SysMessageService;
|
|
|
-import com.qmth.sop.business.service.TFCustomFlowEntityService;
|
|
|
-import com.qmth.sop.business.service.TFCustomFlowService;
|
|
|
-import com.qmth.sop.business.service.TSJobRemindService;
|
|
|
+import com.qmth.sop.business.service.*;
|
|
|
import com.qmth.sop.business.util.SmsSendUtil;
|
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
@@ -56,6 +53,9 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
|
case PROCESS_COMPLETED:
|
|
|
// 流程结束
|
|
|
log.info("流程结束_PROCESS_COMPLETED:ProcessInstanceId:{},ExecutionId:{},ProcessDefinitionId:{}", event.getProcessInstanceId(), event.getExecutionId(), event.getProcessDefinitionId());
|
|
|
+ //todo 流程结束修改派单状态
|
|
|
+ TBCrmService tbCrmService = SpringContextHolder.getBean(TBCrmService.class);
|
|
|
+ TFFlowApproveService tfFlowApproveService = SpringContextHolder.getBean(TFFlowApproveService.class);
|
|
|
HistoryService historyService = SpringContextHolder.getBean(HistoryService.class);
|
|
|
|
|
|
List<HistoricVariableInstance> historicVariableInstanceList = historyService.createHistoricVariableInstanceQuery().processInstanceId(event.getProcessInstanceId()).list();
|
|
@@ -83,6 +83,10 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
|
}
|
|
|
}
|
|
|
this.sendFlowFinishSms(tfCustomFlow.getType(), tfCustomFlowEntity, tfFlowApprove.getStatus(), tfFlowLog);
|
|
|
+ int count = tfFlowApproveService.findFlowPassageSopByCrmNo(tfCustomFlowEntity.getCrmNo());
|
|
|
+ if (count == 0) {
|
|
|
+ tbCrmService.updateCrmStatus(tfCustomFlowEntity.getCrmNo(), CrmStatusEnum.FINISH);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case TASK_CREATED:
|
|
@@ -120,7 +124,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
|
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()));
|
|
|
// if (CollectionUtils.isEmpty(map)) {//系统自动提交的不发待办短信
|
|
|
- this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(task.getAssignee()));
|
|
|
+ this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(task.getAssignee()));
|
|
|
// jobRemindService.saveJobRemind(tsJobRemindArrayList);
|
|
|
// }
|
|
|
} else {
|
|
@@ -129,7 +133,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
|
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()));
|
|
|
// if (CollectionUtils.isEmpty(map)) {//系统自动提交的不发待办短信
|
|
|
- this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(i.getUserId()));
|
|
|
+ this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(i.getUserId()));
|
|
|
// jobRemindService.saveJobRemind(tsJobRemindArrayList);
|
|
|
// }
|
|
|
}
|