Bläddra i källkod

延期预警规则修改

wangliang 10 månader sedan
förälder
incheckning
87466b1dc3

+ 2 - 3
sop-business/src/main/java/com/qmth/sop/business/activiti/listener/ProcessEventListener.java

@@ -163,9 +163,8 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                     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) {
                         //任务完成后统一设置延期预警任务enable为false
                         jobRemindService.updateJobRemind(Long.parseLong(task.getId()));
                     }

+ 8 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -202,6 +202,14 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      */
     SopStatusEnum findBySopNo(String sopNo);
 
+    /**
+     * 查询sop信息
+     *
+     * @param sopNo
+     * @return
+     */
+    TBSopInfo findByCode(String sopNo);
+
     /**
      * sop人员配置
      *

+ 8 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TFFlowLogService.java

@@ -57,4 +57,12 @@ public interface TFFlowLogService extends IService<TFFlowLog> {
      * @return
      */
     TFFlowLog findByLastFlowLogByTaskId(Long taskId, FlowApproveOperationEnum approveOperation);
+
+    /**
+     * 根据flowId查找最后一条
+     *
+     * @param flowId
+     * @return
+     */
+    TFFlowLog findByLastFlowLogByFlowId(Long flowId);
 }

+ 15 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmDetailServiceImpl.java

@@ -83,6 +83,9 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
     @Resource
     ActivitiService activitiService;
 
+    @Resource
+    TFFlowLogService tfFlowLogService;
+
     /**
      * 查找派单sop信息
      *
@@ -304,6 +307,18 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
                     tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(flowResult));
                     tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
                     tbDingService.resetDingExceptionBySopNo(tbCrmDetail.getSopNo());
+
+                    TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(tfCustomFlowEntity.getFlowId());
+                    TFFlowLog tfFlowLog = tfFlowLogService.findByLastFlowLogByFlowId(tfCustomFlowEntity.getFlowId());
+                    TBSopInfo tbSopInfo = tbSopInfoService.findByCode(tfCustomFlowEntity.getCode());
+                    Map<String, Object> map = new HashMap<>();
+                    map.put(SystemConstant.FLOW_CUSTOM, tfCustomFlow);
+                    map.put(SystemConstant.FLOW_ENTITY, tfCustomFlowEntity);
+                    map.put(SystemConstant.FLOW_APPROVE, tfFlowApprove);
+                    map.put(SystemConstant.FLOW_APPROVE_LOG, tfFlowLog);
+                    map.put(SystemConstant.CRM_INFO, crmProjectResult);
+                    map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
+                    tbSopInfoService.saveJobRemind(map);
                 }
             }
             if (Objects.nonNull(tbCrmDetail.getScanStartTime()) && Objects.nonNull(tbCrmDetail.getScanEndTime())

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

@@ -87,10 +87,10 @@ public class TBDelayWarnServiceImpl extends ServiceImpl<TBDelayWarnMapper, TBDel
         if (Objects.nonNull(fieldObj) && ProcessLimitedEnum.MARK_END_TIME.getTitle().contains(fieldObj.trim())) {
             fieldObjList.add(ProcessLimitedEnum.MARK_END_TIME.getKey());
         }
-        if (Objects.nonNull(fieldObj) && ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getTitle()
-                .contains(fieldObj.trim())) {
-            fieldObjList.add(ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
-        }
+//        if (Objects.nonNull(fieldObj) && ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getTitle()
+//                .contains(fieldObj.trim())) {
+//            fieldObjList.add(ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
+//        }
         if (Objects.nonNull(fieldObj) && ProcessLimitedEnum.ENV_DEPLOYMENT_TIME.getTitle().contains(fieldObj.trim())) {
             fieldObjList.add(ProcessLimitedEnum.ENV_DEPLOYMENT_TIME.getKey());
         }

+ 99 - 92
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -303,11 +303,13 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         Map<String, Object> map = activitiService.taskApprove(new FlowApproveParam(sopPublishParam));
         tfCustomFlow = Objects.isNull(tfCustomFlow) ? (TFCustomFlow) map.get(SystemConstant.FLOW_CUSTOM) : tfCustomFlow;
         TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
-
         TBSopInfo tbSopInfo = new TBSopInfo(sopPublishParam.getCrmNo(), tfCustomFlowEntity.getCode(),
                 crmProjectResult.getServiceUnitId(), crmProjectResult.getCustomId(), crmProjectResult.getProductId(),
                 tfCustomFlow.getType(), SopStatusEnum.valueOf(sopPublishParam.getApprove().name()), sysUser.getId());
 
+        map.put(SystemConstant.CRM_INFO, crmProjectResult);
+        map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
+        tbSopInfoService.saveJobRemind(map);
         tfCustomFlowEntity.setObjId(tbSopInfo.getId());
         tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
         tbCrmService.updateCrmStatus(sopPublishParam.getCrmNo(), CrmStatusEnum.PUBLISH);
@@ -500,9 +502,21 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      */
     @Override
     public SopStatusEnum findBySopNo(String sopNo) {
+        TBSopInfo tbSopInfo = this.findByCode(sopNo);
+        return tbSopInfo.getStatus();
+    }
+
+    /**
+     * 查询sop信息
+     *
+     * @param sopNo
+     * @return
+     */
+    @Override
+    public TBSopInfo findByCode(String sopNo) {
         TBSopInfo tbSopInfo = this.getOne(new QueryWrapper<TBSopInfo>().lambda().eq(TBSopInfo::getSopNo, sopNo));
         Objects.requireNonNull(tbSopInfo, "未找到sop信息");
-        return tbSopInfo.getStatus();
+        return tbSopInfo;
     }
 
     /**
@@ -812,7 +826,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (flowApproveParam.getApprove() != FlowApprovePassEnum.DRAFT) {
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
-            map.put(SystemConstant.SOURCE, "sopApprove");
             tbSopInfoService.saveJobRemind(map);
 
             //新增sop日志
@@ -1321,90 +1334,93 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         Long sopId = (Long) map.get(SystemConstant.SOP_ID);
         List<Task> taskList = taskService.createTaskQuery()
                 .processInstanceId(String.valueOf(tfCustomFlowEntity.getFlowId())).list();
-        if (!CollectionUtils.isEmpty(taskList) && (tfFlowApprove.getStatus() != FlowStatusEnum.DRAFT
-                && tfFlowApprove.getStatus() != FlowStatusEnum.FINISH
+        if (!CollectionUtils.isEmpty(taskList) && (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH
                 && tfFlowApprove.getStatus() != FlowStatusEnum.END)) {
             Long processLimitedTime = null;
             String execField = null;
-            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop
-                FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                if (tfFlowApprove.getSetup().intValue() == 2) {//扫描准备流程
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 3) {//扫描收尾检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 4) {//阅卷参数检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 5) {//阅卷收尾检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
+            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
+                    || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//教务处sop
+                FlowTaskResult flowTaskResult = null;
+                if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {
+                    flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
+                } else {
+                    flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
+                }
+                for (Task task : taskList) {
+                    tsJobRemindService.updateJobRemind(Long.parseLong(task.getId()));
                 }
+                processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
+                        ProcessLimitedEnum.SCAN_START_TIME.getKey());
+                execField = ProcessLimitedEnum.SCAN_START_TIME.getKey();
+                createJobRemind(execField, processLimitedTime, taskList, tfCustomFlowEntity, tfCustomFlow, tfFlowLog,
+                        sysUser.getId());
+
+                processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
+                        ProcessLimitedEnum.SCAN_END_TIME.getKey());
+                execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
+                createJobRemind(execField, processLimitedTime, taskList, tfCustomFlowEntity, tfCustomFlow, tfFlowLog,
+                        sysUser.getId());
+
+                processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
+                        ProcessLimitedEnum.MARK_START_TIME.getKey());
+                execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
+                createJobRemind(execField, processLimitedTime, taskList, tfCustomFlowEntity, tfCustomFlow, tfFlowLog,
+                        sysUser.getId());
+
+                processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
+                        ProcessLimitedEnum.MARK_END_TIME.getKey());
+                execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
+                createJobRemind(execField, processLimitedTime, taskList, tfCustomFlowEntity, tfCustomFlow, tfFlowLog,
+                        sysUser.getId());
                 tbSopInfoService.saveSopPlanDate(flowTaskResult, sopId, tfCustomFlowEntity.getFlowId(), sysUser.getId(),
                         tfCustomFlow.getType());
-            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop
-                FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                if (tfFlowApprove.getSetup().intValue() == 5) {//扫描准备流程
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 6) {//扫描收尾检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 7) {//阅卷参数检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 9) {//阅卷收尾检查
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
-                }
-                tbSopInfoService.saveSopPlanDate(this.getFormProperties(tfCustomFlowEntity, 1), sopId,
-                        tfCustomFlowEntity.getFlowId(), sysUser.getId(), tfCustomFlow.getType());
             }
-            if (Objects.nonNull(execField)) {
-                for (Task task : taskList) {
-                    tsJobRemindService.updateJobRemind(Long.parseLong(task.getId()));
-                    List<TSJobRemind> tsJobRemindList = new ArrayList<>();
-                    if (Objects.nonNull(task.getAssignee())) {
-                        tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
-                                Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
-                                JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
-                                processLimitedTime, execField, sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-                        tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
-                                Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
-                                JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
-                                processLimitedTime, execField, sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-                    } else {
-                        List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
-                        if (!CollectionUtils.isEmpty(identityLinkList)) {
-                            for (IdentityLink i : identityLinkList) {
-                                tsJobRemindList.add(
-                                        new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
-                                                Long.parseLong(i.getTaskId()),
-                                                tfCustomFlow.getType().getTitle() + ";" + task.getName(),
-                                                JobTypeEnum.BEFORE, Long.parseLong(i.getUserId()),
-                                                tfFlowLog.getApproveOperation(), processLimitedTime, execField,
-                                                sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-                                tsJobRemindList.add(
-                                        new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
-                                                Long.parseLong(i.getTaskId()),
-                                                tfCustomFlow.getType().getTitle() + ";" + task.getName(),
-                                                JobTypeEnum.AFTER, Long.parseLong(i.getUserId()),
-                                                tfFlowLog.getApproveOperation(), processLimitedTime, execField,
-                                                sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
-                            }
+        }
+    }
+
+    /**
+     * 创建定时任务
+     *
+     * @param execField
+     * @param processLimitedTime
+     * @param taskList
+     * @param tfCustomFlowEntity
+     * @param tfCustomFlow
+     * @param tfFlowLog
+     * @param userId
+     */
+    protected void createJobRemind(String execField, Long processLimitedTime, List<Task> taskList,
+            TFCustomFlowEntity tfCustomFlowEntity, TFCustomFlow tfCustomFlow, TFFlowLog tfFlowLog, Long userId) {
+        if (Objects.nonNull(execField) && Objects.nonNull(processLimitedTime)) {
+            for (Task task : taskList) {
+                List<TSJobRemind> tsJobRemindList = new ArrayList<>();
+                if (Objects.nonNull(task.getAssignee())) {
+                    tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
+                            Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
+                            JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
+                            processLimitedTime, execField, userId, tfCustomFlowEntity.getCrmNo()));
+                    tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
+                            Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
+                            JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
+                            processLimitedTime, execField, userId, tfCustomFlowEntity.getCrmNo()));
+                } else {
+                    List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
+                    if (!CollectionUtils.isEmpty(identityLinkList)) {
+                        for (IdentityLink i : identityLinkList) {
+                            tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
+                                    Long.parseLong(i.getTaskId()),
+                                    tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.BEFORE,
+                                    Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime,
+                                    execField, userId, tfCustomFlowEntity.getCrmNo()));
+                            tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
+                                    Long.parseLong(i.getTaskId()),
+                                    tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER,
+                                    Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), processLimitedTime,
+                                    execField, userId, tfCustomFlowEntity.getCrmNo()));
                         }
                     }
-                    tsJobRemindService.saveJobRemind(tsJobRemindList);
                 }
+                tsJobRemindService.saveJobRemind(tsJobRemindList);
             }
         }
     }
@@ -1603,10 +1619,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     tbCrmDetail.getId(), tfCustomFlowEntity.getCrmNo());
             Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
-            TFFlowLog tfFlowLog = tfFlowLogService.getOne(
-                    new QueryWrapper<TFFlowLog>().lambda().eq(TFFlowLog::getFlowId, tfCustomFlowEntity.getFlowId())
-                            .last(" order by create_time limit 1 "));
-            Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_LOG_NO_DATA.exception());
+            TFFlowLog tfFlowLog = tfFlowLogService.findByLastFlowLogByFlowId(tfCustomFlowEntity.getFlowId());
 
             map.put(SystemConstant.FLOW_CUSTOM, tfCustomFlow);
             map.put(SystemConstant.FLOW_ENTITY, tfCustomFlowEntity);
@@ -1614,7 +1627,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             map.put(SystemConstant.FLOW_APPROVE_LOG, tfFlowLog);
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
-            map.put(SystemConstant.SOURCE, "save");
             tbSopInfoService.saveJobRemind(map);
 
             if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
@@ -1733,10 +1745,10 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 break;
             }
         }
-        if (!fieldId.contains(ProcessLimitedEnum.SERVICE_FINISH_PLAN_BEGIN_DATE.getKey())) {
-            Optional.ofNullable(processLimitedTime).orElseThrow(() -> ExceptionResultEnum.ERROR.exception(
-                    ProcessLimitedEnum.convertKeyToEnum(fieldId).getTitle() + "处理时限时间为空"));
-        }
+        //        if (!fieldId.contains(ProcessLimitedEnum.SERVICE_FINISH_PLAN_BEGIN_DATE.getKey())) {
+        //            Optional.ofNullable(processLimitedTime).orElseThrow(() -> ExceptionResultEnum.ERROR.exception(
+        //                    ProcessLimitedEnum.convertKeyToEnum(fieldId).getTitle() + "处理时限时间为空"));
+        //        }
         return processLimitedTime;
     }
 
@@ -1754,12 +1766,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     public void saveSopPlanDate(FlowTaskResult flowTaskResult, Long sopId, Long flowId, Long userId,
             TFCustomTypeEnum type) {
         Long serviceFinishPlanBeginDate = null, serviceFinishPlanEndDate = null;
-        if (type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
-            serviceFinishPlanBeginDate = this.getProcessLimitedTime(flowTaskResult,
-                    ProcessLimitedEnum.SERVICE_FINISH_PLAN_BEGIN_DATE.getKey());
-            serviceFinishPlanEndDate = this.getProcessLimitedTime(flowTaskResult,
-                    ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
-        } else if (type == TFCustomTypeEnum.OFFICE_SOP_FLOW) {
+        if (type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW || type == TFCustomTypeEnum.OFFICE_SOP_FLOW) {
             serviceFinishPlanBeginDate = this.getProcessLimitedTime(flowTaskResult,
                     ProcessLimitedEnum.SCAN_START_TIME.getKey());
             serviceFinishPlanEndDate = this.getProcessLimitedTime(flowTaskResult,

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

@@ -1,5 +1,6 @@
 package com.qmth.sop.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.sop.business.bean.dto.OrgUserNameDto;
 import com.qmth.sop.business.bean.result.TFFlowLogResult;
@@ -8,6 +9,7 @@ import com.qmth.sop.business.mapper.TFFlowLogMapper;
 import com.qmth.sop.business.service.SysUserService;
 import com.qmth.sop.business.service.TFFlowLogService;
 import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.enums.FlowApproveOperationEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
@@ -16,6 +18,7 @@ import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -108,4 +111,18 @@ public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog
         return this.baseMapper.findByLastFlowLogByTaskId(taskId,
                 Objects.nonNull(approveOperation) ? approveOperation.name() : null);
     }
+
+    /**
+     * 根据flowId查找最后一条
+     *
+     * @param flowId
+     * @return
+     */
+    @Override
+    public TFFlowLog findByLastFlowLogByFlowId(Long flowId) {
+        TFFlowLog tfFlowLog = this.getOne(new QueryWrapper<TFFlowLog>().lambda().eq(TFFlowLog::getFlowId, flowId)
+                .last(" order by create_time limit 1 "));
+        Optional.ofNullable(tfFlowLog).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_LOG_NO_DATA.exception());
+        return tfFlowLog;
+    }
 }

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

@@ -349,7 +349,7 @@ public class SystemConstant {
     public static final String FLOW_SYS_USER = "sysUser";
     public static final String CRM_INFO = "crmInfo";
     public static final String SOP_ID = "sopId";
-    public static final String SOURCE = "source";
+//    public static final String SOURCE = "source";
     public static final String CRM_DETAIL = "crmDetail";
     public static final String PROCESS_VAR = "processVar";
 

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

@@ -21,9 +21,9 @@ public enum ProcessLimitedEnum {
 
     MARK_END_TIME("mark_end_time", "阅卷结束时间"),
 
-    SERVICE_FINISH_PLAN_DATE("service_finish_plan_date", "现场服务完成撤场计划时间"),
+//    SERVICE_FINISH_PLAN_DATE("service_finish_plan_date", "现场服务完成撤场计划时间"),
 
-    SERVICE_FINISH_PLAN_BEGIN_DATE("service_finish_plan_begin_date", "现场服务完成进场计划时间"),
+//    SERVICE_FINISH_PLAN_BEGIN_DATE("service_finish_plan_begin_date", "现场服务完成进场计划时间"),
 
     ENV_DEPLOYMENT_TIME("env_deployment_time", "环境部署时间"),