瀏覽代碼

流程修改

wangliang 1 年之前
父節點
當前提交
ab53d9f741

+ 58 - 7
sop-business/src/main/java/com/qmth/sop/business/activiti/listener/ProcessEventListener.java

@@ -8,17 +8,19 @@ import com.qmth.sop.business.bean.result.FlowFormWidgetResult;
 import com.qmth.sop.business.bean.result.FlowResult;
 import com.qmth.sop.business.bean.result.FlowTablePropResult;
 import com.qmth.sop.business.bean.result.FlowTaskResult;
-import com.qmth.sop.business.entity.TFCustomFlow;
+import com.qmth.sop.business.entity.*;
 import com.qmth.sop.business.service.TFCustomFlowService;
+import com.qmth.sop.business.service.TSJobRemindService;
 import com.qmth.sop.common.contant.SpringContextHolder;
 import com.qmth.sop.common.contant.SystemConstant;
-import com.qmth.sop.common.enums.TFCustomModelTypeEnum;
-import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import com.qmth.sop.common.enums.*;
 import com.qmth.sop.common.util.JacksonUtil;
+import org.activiti.engine.TaskService;
 import org.activiti.engine.delegate.event.ActivitiEntityEvent;
 import org.activiti.engine.delegate.event.ActivitiEvent;
 import org.activiti.engine.delegate.event.ActivitiEventListener;
 import org.activiti.engine.impl.persistence.entity.ResourceEntity;
+import org.activiti.engine.task.Task;
 import org.dom4j.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,15 +53,64 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                 // 流程结束
                 log.info("流程结束_PROCESS_COMPLETED:ProcessInstanceId:{},ExecutionId:{},ProcessDefinitionId:{}", event.getProcessInstanceId(), event.getExecutionId(), event.getProcessDefinitionId());
                 break;
+            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();
+                    if (Objects.nonNull(task)) {
+                        TFCustomFlow tfCustomFlow = (TFCustomFlow) taskService.getVariable(task.getId(), SystemConstant.FLOW_CUSTOM);
+                        Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
+
+                        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) taskService.getVariable(task.getId(), SystemConstant.FLOW_ENTITY);
+                        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
+
+                        TFFlowApprove tfFlowApprove = (TFFlowApprove) taskService.getVariable(task.getId(), SystemConstant.FLOW_APPROVE);
+                        Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
+
+                        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());
+
+                        //此处统一流程节点保存延期预警任务
+                        if (tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.DRAFT
+                                && tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.END
+                                && tfFlowLog.getApproveOperation() != FlowApproveOperationEnum.FINISH) {
+                            String[] strs = tfFlowLog.getPendApproveId().split(SystemConstant.LIST_JOIN_SPLIT);
+                            List<TSJobRemind> tsJobRemindArrayList = new ArrayList<>();
+                            for (int i = 0; i < strs.length; i++) {
+                                tsJobRemindArrayList.add(new TSJobRemind(tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle(), JobTypeEnum.AFTER, Long.parseLong(strs[i]), tfFlowLog.getApproveOperation(), sysUser.getId()));
+                            }
+                            jobRemindService.saveJobRemind(tsJobRemindArrayList);
+                        }
+                    }
+                }
+                break;
             case TASK_COMPLETED:
                 // 任务被完成了。它会在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);
+                activitiEntityEvent = (ActivitiEntityEvent) event;
+                if (activitiEntityEvent.getEntity() instanceof Task) {
+                    Task task = (Task) activitiEntityEvent.getEntity();
+                    if (Objects.nonNull(task)) {
+                        TFFlowLog tfFlowLog = (TFFlowLog) taskService.getVariable(task.getId(), SystemConstant.FLOW_APPROVE_LOG);
+                        Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_LOG_NO_DATA.exception());
+
+                        if (tfFlowLog.getApproveSetup().intValue() > 1) {//流程提交不需要提醒
+                            //任务完成后统一设置延期预警任务enable为false
+                            jobRemindService.updateJobRemind(Long.parseLong(task.getId()));
+                        }
+                    }
+                }
                 break;
-//            case TASK_ASSIGNED:
-//                log.info("流程分配人员_TASK_ASSIGNED:ProcessInstanceId:{},ExecutionId:{},ProcessDefinitionId:{}", event.getProcessInstanceId(), event.getExecutionId(), event.getProcessDefinitionId());
-//                break;
             case ENTITY_CREATED:
-                ActivitiEntityEvent activitiEntityEvent = (ActivitiEntityEvent) event;
+                activitiEntityEvent = (ActivitiEntityEvent) event;
                 if (activitiEntityEvent.getEntity() instanceof ResourceEntity) {
                     ResourceEntity resourceEntity = (ResourceEntity) activitiEntityEvent.getEntity();
                     log.info("ENTITY_CREATED,id:{},name:{},deploymentId:{},persistentState:{}", resourceEntity.getId(), resourceEntity.getName(), resourceEntity.getDeploymentId(), resourceEntity.getPersistentState());

+ 15 - 24
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -31,8 +31,8 @@ import org.activiti.engine.history.HistoricTaskInstance;
 import org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior;
 import org.activiti.engine.repository.DeploymentBuilder;
 import org.activiti.engine.runtime.ProcessInstance;
-import org.activiti.engine.task.IdentityLink;
 import org.activiti.engine.task.Task;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.core.io.ClassPathResource;
@@ -177,10 +177,12 @@ public class ActivitiServiceImpl implements ActivitiService {
         TFFlowApprove tfFlowApprove = null;
         Task taskTemp = null;
         FlowResult flowResult = null;
+        TFCustomFlow tfCustomFlow = null;
         if (Objects.nonNull(flowApproveParam.getFlowDeploymentId()) && Objects.isNull(flowApproveParam.getTaskId())) {
             Optional.ofNullable(flowApproveParam.getCrmNo()).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
-            TFCustomFlow tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowApproveParam.getFlowDeploymentId()));
+            tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowApproveParam.getFlowDeploymentId()));
+            Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
             Optional.ofNullable(tfCustomFlow.getFlowProcessVar()).orElseThrow(() -> ExceptionResultEnum.FLOW_PROCESS_VAR_NO_DATA.exception());
 
             map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + 1, approveUserIds);
@@ -210,6 +212,8 @@ public class ActivitiServiceImpl implements ActivitiService {
                 Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
                 flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
 
+                tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
+
                 tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, Long.parseLong(processFlowId)));
                 Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
                 taskList.add(taskTemp);
@@ -247,7 +251,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                     //流程流水日志
                     TFFlowLog tfFlowLog = new TFFlowLog(sysUser.getOrgId(), sysUser.getId(), sysUser.getId(),
                             currFlowTaskResult.getSetup(), Long.parseLong(processFlowId),
-                            Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), approveUserIds.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
+                            Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), StringUtils.join(approveUserIds, SystemConstant.LIST_JOIN_SPLIT));
                     if (flowApproveParam.getApprove() == FlowApprovePassEnum.PASS || flowApproveParam.getApprove() == FlowApprovePassEnum.DRAFT || flowApproveParam.getApprove() == FlowApprovePassEnum.START) {
                         if (Objects.nonNull(flowApproveParam.getSetup())) {
                             currSetup = flowApproveParam.getSetup();
@@ -299,7 +303,6 @@ public class ActivitiServiceImpl implements ActivitiService {
                                 flowApproveParam.getApproveRemark());
                     }
                     map.put(SystemConstant.APPROVE, nextFlowTaskResult.getTaskKey());
-                    map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveUserIds);
                     if (Objects.nonNull(formDataFlowTaskResult) && Objects.equals(task.getTaskDefinitionKey(), formDataFlowTaskResult.getTaskKey())) {
                         setupMap.put(task.getTaskDefinitionKey(), formDataFlowTaskResult);
                     }
@@ -327,30 +330,18 @@ public class ActivitiServiceImpl implements ActivitiService {
                                         }
                                     }
                                 }
+                                tfFlowLog.setPendApproveId(StringUtils.join(approveIdSet, SystemConstant.LIST_JOIN_SPLIT));
                                 map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), new ArrayList<>(approveIdSet));
                             }
                         }
+                        taskService.setVariable(task.getId(), SystemConstant.FLOW_CUSTOM, tfCustomFlow);
+                        taskService.setVariable(task.getId(), SystemConstant.FLOW_APPROVE, tfFlowApprove);
+                        taskService.setVariable(task.getId(), SystemConstant.FLOW_ENTITY, tfCustomFlowEntity);
+                        taskService.setVariable(task.getId(), SystemConstant.FLOW_APPROVE_LOG, tfFlowLog);
+                        taskService.setVariable(task.getId(), SystemConstant.FLOW_SYS_USER, sysUser);
                         taskService.complete(task.getId(), map);
-                        if (flowApproveParam.getApprove() == FlowApprovePassEnum.START || flowApproveParam.getApprove() == FlowApprovePassEnum.PASS) {
-                            List<Task> tasks = taskService.createTaskQuery().processInstanceId(processFlowId).list();
-                            if (!CollectionUtils.isEmpty(tasks)) {
-                                Set<String> approveIdSet = new LinkedHashSet<>();
-                                for (Task t : tasks) {
-                                    if (Objects.isNull(t.getAssignee())) {
-                                        List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(t.getId());
-                                        if (!CollectionUtils.isEmpty(identityLinkList)) {
-                                            for (IdentityLink i : identityLinkList) {
-                                                approveIdSet.add(i.getUserId());
-                                            }
-                                        }
-                                    } else {
-                                        approveIdSet.add(t.getAssignee());
-                                    }
-                                }
-                                tfFlowLog.setPendApproveId(approveIdSet.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
-                            }
-                        }
                     }
+                    map.put(SystemConstant.FLOW_APPROVE_LOG, tfFlowLog);
                     tfFlowLogList.add(tfFlowLog);
                 }
             }
@@ -358,7 +349,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             tfFlowApproveService.saveOrUpdate(tfFlowApprove);
             tfFlowLogService.saveBatch(tfFlowLogList);
             map.put(SystemConstant.FLOW_APPROVE, tfFlowApprove);
-            map.put(SystemConstant.CUSTOM_FLOW_ENTITY, tfCustomFlowEntity);
+            map.put(SystemConstant.FLOW_ENTITY, tfCustomFlowEntity);
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {

+ 31 - 1
sop-business/src/main/java/com/qmth/sop/business/entity/TSJobRemind.java

@@ -2,6 +2,7 @@ package com.qmth.sop.business.entity;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.FlowApproveOperationEnum;
 import com.qmth.sop.common.enums.JobTypeEnum;
 import io.swagger.annotations.ApiModel;
@@ -17,7 +18,7 @@ import java.io.Serializable;
  * @author wangliang
  * @since 2023-08-16
  */
-@ApiModel(value="TSJobRemind对象", description="任务提醒表")
+@ApiModel(value = "TSJobRemind对象", description = "任务提醒表")
 public class TSJobRemind implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -55,6 +56,9 @@ public class TSJobRemind implements Serializable {
     @ApiModelProperty(value = "审批操作,START:提交,DRAFT:草稿,APPROVE:审批,REJECT:驳回,END:终止,CANCEL:撤销,EXCHANGE:转他人审批,FINISH:结束")
     private FlowApproveOperationEnum approveOperation;
 
+    @ApiModelProperty(value = "是否启用,false:停用,true:启用")
+    private Boolean enable;
+
     @ApiModelProperty(value = "创建人id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long createId;
@@ -62,6 +66,32 @@ public class TSJobRemind implements Serializable {
     @ApiModelProperty(value = "创建时间")
     private Long createTime;
 
+    public TSJobRemind() {
+
+    }
+
+    public TSJobRemind(String code, Long objId, String objName, JobTypeEnum remindType, Long receiveUserId, FlowApproveOperationEnum approveOperation, Long userId) {
+        this.id = SystemConstant.getDbUuid();
+        this.code = code;
+        this.objId = objId;
+        this.objName = objName;
+        this.remindType = remindType;
+        this.exec = false;
+        this.receiveUserId = receiveUserId;
+        this.approveOperation = approveOperation;
+        this.createId = userId;
+        this.createTime = System.currentTimeMillis();
+        this.enable = true;
+    }
+
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
     public Long getReceiveUserId() {
         return receiveUserId;
     }

+ 17 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TSJobRemindService.java

@@ -3,6 +3,8 @@ package com.qmth.sop.business.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.entity.TSJobRemind;
 
+import java.util.List;
+
 /**
  * <p>
  * 任务提醒表 服务类
@@ -13,4 +15,19 @@ import com.qmth.sop.business.entity.TSJobRemind;
  */
 public interface TSJobRemindService extends IService<TSJobRemind> {
 
+    /**
+     * 保存任务提醒
+     *
+     * @param tsJobRemindList
+     * @return
+     */
+    Boolean saveJobRemind(List<TSJobRemind> tsJobRemindList);
+
+    /**
+     * 根据taskId更新任务提醒
+     *
+     * @param taskId
+     * @return
+     */
+    Boolean updateJobRemind(Long taskId);
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingApplyServiceImpl.java

@@ -58,7 +58,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
         Optional.ofNullable(tbDing).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("考勤记录为空"));
 
         Map<String, Object> map = activitiService.taskApprove(new FlowApproveParam(tbDingApply.getFlowDeploymentId(), FlowApprovePassEnum.START, Arrays.asList(String.valueOf(sysUser.getId())), tbDing.getCrmNo()));
-        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.CUSTOM_FLOW_ENTITY);
+        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
         tbDingApply.setCode(tfCustomFlowEntity.getCode(), tbDingApply.getAttachmentIdList(), sysUser.getId());
         tfCustomFlowEntity.setObjId(tbDingApply.getId());
         tfCustomFlowEntityService.updateById(tfCustomFlowEntity);

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBQualityProblemApplyServiceImpl.java

@@ -66,7 +66,7 @@ public class TBQualityProblemApplyServiceImpl extends ServiceImpl<TBQualityProbl
     public Boolean saveTBQualityProblemApply(TBQualityProblemApply tbQualityProblemApply) throws InterruptedException {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Map<String, Object> map = activitiService.taskApprove(new FlowApproveParam(tbQualityProblemApply.getFlowDeploymentId(), FlowApprovePassEnum.START, tbQualityProblemApply.getFormProperties(), Arrays.asList(String.valueOf(sysUser.getId())), tbQualityProblemApply.getCrmNo()));
-        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.CUSTOM_FLOW_ENTITY);
+        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
         tbQualityProblemApply.setCode(tfCustomFlowEntity.getCode(), tbQualityProblemApply.getAttachmentIdList(), tbQualityProblemApply.getUserIdList(), sysUser.getId());
         tfCustomFlowEntity.setObjId(tbQualityProblemApply.getId());
         tfCustomFlowEntityService.updateById(tfCustomFlowEntity);

+ 30 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TSJobRemindServiceImpl.java

@@ -1,10 +1,15 @@
 package com.qmth.sop.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.sop.business.entity.TSJobRemind;
 import com.qmth.sop.business.mapper.TSJobRemindMapper;
 import com.qmth.sop.business.service.TSJobRemindService;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
 
 /**
  * <p>
@@ -17,4 +22,29 @@ import org.springframework.stereotype.Service;
 @Service
 public class TSJobRemindServiceImpl extends ServiceImpl<TSJobRemindMapper, TSJobRemind> implements TSJobRemindService {
 
+    /**
+     * 保存任务提醒
+     *
+     * @param tsJobRemindList
+     * @return
+     */
+    @Override
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public Boolean saveJobRemind(List<TSJobRemind> tsJobRemindList) {
+        return this.saveBatch(tsJobRemindList);
+    }
+
+    /**
+     * 根据taskId更新任务提醒
+     *
+     * @param taskId
+     * @return
+     */
+    @Override
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public Boolean updateJobRemind(Long taskId) {
+        return this.update(new UpdateWrapper<TSJobRemind>().lambda()
+                .eq(TSJobRemind::getObjId, taskId)
+                .set(TSJobRemind::getEnable, false));
+    }
 }

+ 5 - 0
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -624,3 +624,8 @@ ALTER TABLE t_s_job_remind ADD receive_user_id BIGINT
 ALTER TABLE t_s_job_remind ADD approve_operation VARCHAR(20)
     COMMENT '审批操作,START:提交,DRAFT:草稿,APPROVE:审批,REJECT:驳回,END:终止,CANCEL:撤销,EXCHANGE:转他人审批,FINISH:结束' NOT NULL after receive_user_id;
 
+ALTER TABLE t_s_job_remind ADD enable TINYINT DEFAULT 1
+    COMMENT '是否启用,0:停用,1:启用' NOT NULL after approve_operation;
+
+ALTER TABLE t_s_job_remind CHANGE COLUMN exec_time exec_time BIGINT
+    COMMENT '执行时间' NULL;

+ 4 - 1
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -223,8 +223,11 @@ public class SystemConstant {
     public static final String NR_OF_COMPLETED_INSTANCES = "nrOfCompletedInstances";
     public static final String NR_OF_INSTANCES = "nrOfInstances";
     public static final String ARRROVE_REJECT_MAP = "approveRejectMap";
+    public static final String FLOW_CUSTOM = "tfCustomFlow";
     public static final String FLOW_APPROVE = "tfFlowApprove";
-    public static final String CUSTOM_FLOW_ENTITY = "tfCustomFlowEntity";
+    public static final String FLOW_APPROVE_LOG = "tfFlowApproveLog";
+    public static final String FLOW_ENTITY = "tfCustomFlowEntity";
+    public static final String FLOW_SYS_USER = "sysUser";
 
     /**
      * 锁

+ 4 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/ExceptionResultEnum.java

@@ -69,6 +69,10 @@ public enum ExceptionResultEnum {
 
     CRM_NO_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000021, "crm单号不能为空"),
 
+    FLOW_CUSTOM_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000022, "流程部署数据为空"),
+
+    FLOW_APPROVE_LOG_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000023, "流程没有审批日志数据"),
+
     /**
      * 401
      */

+ 7 - 12
sop-server/src/main/java/com/qmth/sop/server/api/TBCrmController.java

@@ -3,8 +3,6 @@ package com.qmth.sop.server.api;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.boot.api.annotation.Aac;
-import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.result.TBCrmResult;
 import com.qmth.sop.business.entity.TBCrm;
@@ -15,7 +13,6 @@ import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import io.swagger.annotations.*;
 import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -41,7 +38,7 @@ public class TBCrmController {
     @Resource
     TBCrmService tBCrmService;
 
-    
+
     @ApiOperation(value = "派单信息表查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "派单信息表查询结果", response = TBCrmResult.class)})
@@ -56,12 +53,12 @@ public class TBCrmController {
             @ApiParam(value = "派单时间结束", required = false) @RequestParam(required = false) Long endTime,
             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TBCrmResult> resultIPage = tBCrmService.query(new Page<>(pageNumber, pageSize), serviceId,leadId,crmUserId,type,custom,crmNo,startTime,endTime);
+        IPage<TBCrmResult> resultIPage = tBCrmService.query(new Page<>(pageNumber, pageSize), serviceId, leadId, crmUserId, type, custom, crmNo, startTime, endTime);
 
         return ResultUtil.ok(resultIPage);
     }
 
-    
+
     @ApiOperation(value = "派单信息表新增修改接口")
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
@@ -73,7 +70,6 @@ public class TBCrmController {
     }
 
 
-    
     @ApiOperation(value = "派单信息表删除接口")
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
@@ -82,7 +78,6 @@ public class TBCrmController {
     }
 
 
-    
     @ApiOperation(value = "派单信息表获取单个接口")
     @RequestMapping(value = "/get", method = RequestMethod.GET)
     @ApiResponses({@ApiResponse(code = 200, message = "派单信息表信息", response = TBCrm.class)})
@@ -91,17 +86,17 @@ public class TBCrmController {
     }
 
     //批量划定服务单元
-    
+
     @ApiOperation(value = "批量划定服务单元接口")
     @RequestMapping(value = "/batchZone", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result batchZone(@ApiParam(value = "服务单元id", required = true) @RequestParam(required = true) long serviceId,
-                           @ApiParam(value = "派单信息表id", required = true) @RequestParam(required = true) long[] crmIds) {
+                            @ApiParam(value = "派单信息表id", required = true) @RequestParam(required = true) long[] crmIds) {
         return ResultUtil.ok(tBCrmService.batchZone(serviceId, crmIds));
     }
 
     //批量禁用
-    
+
     @ApiOperation(value = "批量禁用接口")
     @RequestMapping(value = "/batchDisable", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
@@ -110,7 +105,7 @@ public class TBCrmController {
     }
 
     //统计待划定数量
-    
+
     @ApiOperation(value = "统计待划定数量接口")
     @RequestMapping(value = "/countWaitZone", method = RequestMethod.GET)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})

+ 1 - 1
sop-server/src/main/resources/dingExceptionFlow.bpmn

@@ -7,7 +7,7 @@
         <completionCondition>${nrOfCompletedInstances/nrOfInstances==1 || reject2==1}</completionCondition>
       </multiInstanceLoopCharacteristics>
     </userTask>
-    <startEvent id="startevent1" name="Start" activiti:formKey="ding_exception_start.form"></startEvent>
+    <startEvent id="startevent1" name="Start"></startEvent>
     <userTask id="f_usertask_ding_exception_apply_1" name="异常处理申请" activiti:assignee="${assignee1}">
       <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${assigneeList1}" activiti:elementVariable="assignee1">
         <completionCondition>${nrOfCompletedInstances/nrOfInstances==1 || reject1==1}</completionCondition>

二進制
sop-server/src/main/resources/dingExceptionFlow.zip


+ 0 - 1
sop-server/src/main/resources/ding_exception_start.form

@@ -1 +0,0 @@
-{"approveRejectMap":{"f_usertask_ding_exception_approve_2":[{"afterFlowTaskKey":"f_usertask_ding_exception_apply_1","setup":1}]}}