Bläddra i källkod

代码修正,去掉t_b_sop_info_detail

wangliang 1 år sedan
förälder
incheckning
13c2eff232
20 ändrade filer med 156 tillägg och 1208 borttagningar
  1. 0 15
      sop-api/install/mysql/init/init.sql
  2. 2 2
      sop-api/src/main/java/com/qmth/sop/server/api/TBDingController.java
  3. 2 1
      sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java
  4. 0 85
      sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java
  5. 0 129
      sop-business/src/main/java/com/qmth/sop/business/entity/TBSopInfoDetail.java
  6. 0 16
      sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoDetailMapper.java
  7. 13 22
      sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java
  8. 0 16
      sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoDetailService.java
  9. 6 67
      sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java
  10. 48 49
      sop-business/src/main/java/com/qmth/sop/business/service/impl/ServiceAnalyseServiceImpl.java
  11. 27 28
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingServiceImpl.java
  12. 0 20
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoDetailServiceImpl.java
  13. 19 634
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java
  14. 1 1
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesServiceImpl.java
  15. 4 4
      sop-business/src/main/resources/mapper/QualityAnalyseMapper.xml
  16. 3 3
      sop-business/src/main/resources/mapper/SopAnalyseMapper.xml
  17. 2 2
      sop-business/src/main/resources/mapper/SopScheduleMapper.xml
  18. 0 5
      sop-business/src/main/resources/mapper/TBSopInfoDetailMapper.xml
  19. 7 87
      sop-business/src/main/resources/mapper/TBSopInfoMapper.xml
  20. 22 22
      sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

+ 0 - 15
sop-api/install/mysql/init/init.sql

@@ -1112,21 +1112,6 @@ CREATE TABLE `t_b_sop_info` (
                                 UNIQUE KEY `t_b_sop_info_un_sop_no` (`sop_no`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='sop表';
 
--- ----------------------------
--- Table structure for t_b_sop_info_detail
--- ----------------------------
-DROP TABLE IF EXISTS `t_b_sop_info_detail`;
-CREATE TABLE `t_b_sop_info_detail` (
-                                       `id` bigint NOT NULL COMMENT '主键',
-                                       `sop_info_id` bigint NOT NULL COMMENT 'sop信息id',
-                                       `lead_id` bigint NOT NULL COMMENT '大区经理id',
-                                       `region_user_id` bigint DEFAULT NULL COMMENT '区域负责人id',
-                                       `engineer_user_id` bigint DEFAULT NULL COMMENT '实施工程师id',
-                                       `assistant_engineer_user_ids` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '助理实施工程师id数组',
-                                       `after_region_to_enginess` tinyint DEFAULT '0' COMMENT '之后是否由区域协调人替换实施工程师,true:是,false:不是',
-                                       PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='sop明细表';
-
 -- ----------------------------
 -- Table structure for t_b_sop_log
 -- ----------------------------

+ 2 - 2
sop-api/src/main/java/com/qmth/sop/server/api/TBDingController.java

@@ -261,7 +261,7 @@ public class TBDingController {
                         .collect(Collectors.toList());
                 for (TBCrm tbCrm : crmInServiceList) {
                     CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(null,null, tbCrm.getCrmNo());
-                    List<String> sopNoList = tbSopInfoService.findFlowPassageByCrmNo(tbCrm.getCrmNo(), requestUserId);
+                    List<String> sopNoList = tbSopInfoService.findFlowPassageByCrmNo(tbCrm.getCrmNo());
                     if (CollectionUtils.isEmpty(sopNoList)){
                         continue;
                     }
@@ -298,7 +298,7 @@ public class TBDingController {
     public Result findDingAllSop() {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         List<DingSopInfo> resultList = new ArrayList<>();
-        List<SopInfoResult> list = tbSopInfoService.findFlowByServiceId(null, requestUser.getId());
+        List<SopInfoResult> list = tbSopInfoService.findFlowByServiceId(null);
         List<Long> serviceUnitIdList = list.stream().map(SopInfoResult::getServiceId).distinct().collect(Collectors.toList());
         for (Long serviceUnitId : serviceUnitIdList) {
             DingSopInfo cell = new DingSopInfo();

+ 2 - 1
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -151,7 +151,8 @@ public class TBSopInfoController {
     @RequestMapping(value = "/user/list", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SysUser.class) })
     public Result userList(@ApiParam(value = "sopId", required = true) @RequestParam Long sop_info_id) {
-        return ResultUtil.ok(tbSopInfoService.userList(sop_info_id));
+//        return ResultUtil.ok(tbSopInfoService.userList(sop_info_id));
+        return ResultUtil.ok(true);
     }
 
     public static void main(String[] args) {

+ 0 - 85
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -117,9 +117,6 @@ public class ActivitiServiceImpl implements ActivitiService {
     @Resource
     TBCrmService tbCrmService;
 
-    @Resource
-    SysUserRoleService sysUserRoleService;
-
     @Resource
     TSJobRemindService tsJobRemindService;
 
@@ -147,7 +144,6 @@ public class ActivitiServiceImpl implements ActivitiService {
     @Override
     public Map<String, Object> upload(MultipartFile file) throws Exception {
         basicAttachmentService.validateAttachment(file);
-        Map<String, Object> map = new HashMap<>();
         DeploymentBuilder builder = repositoryService.createDeployment();
         ZipInputStream zip = new ZipInputStream(file.getInputStream());
         builder.addZipInputStream(zip);
@@ -971,87 +967,6 @@ public class ActivitiServiceImpl implements ActivitiService {
                 }
             }
         }
-        //        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        //        if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
-        //                || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)) {
-        //            if (Objects.nonNull(currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() == 3) {
-        //                List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
-        //                List<FlowFormWidgetResult> flowFormWidgetResultListNew = new ArrayList<>();
-        //                if (!CollectionUtils.isEmpty(taskList) && taskList.size() > 1) {
-        //                    SysRole sysRole = null;
-        //                    jump:
-        //                    for (Task task : taskList) {
-        //                        if (task.getAssignee().equals(sysUser.getId().toString())) {
-        //                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
-        //                            if (!CollectionUtils.isEmpty(sysRoleList)) {
-        //                                for (SysRole s : sysRoleList) {
-        //                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
-        //                                        sysRole = s;
-        //                                        break jump;
-        //                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-        //                                        sysRole = s;
-        //                                        break jump;
-        //                                    }
-        //                                }
-        //                            }
-        //                        }
-        //                    }
-        //                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-        //                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-        //                        if (Objects.nonNull(sysRole)) {
-        //                            //                            if (f.getRoleType() == sysRole.getType() && (
-        //                            //                                    sysRole.getType() == RoleTypeEnum.REGION_MANAGER
-        //                            //                                            || sysRole.getType() == RoleTypeEnum.EFFECT_ENGINEER)) {
-        //                            //                                flowFormWidgetResultListNew.add(f);
-        //                            //                            }
-        //                        } else {
-        //                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
-        //                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
-        //                                    .contains(SystemConstant.SIGN_REGION)) {
-        //                                flowFormWidgetResultListNew.add(f);
-        //                            }
-        //                        }
-        //                    }
-        //                    currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
-        //                } else if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
-        //                    SysRole sysRole = null;
-        //                    jump:
-        //                    for (Task task : taskList) {
-        //                        if (task.getAssignee().equals(sysUser.getId().toString())) {
-        //                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
-        //                            if (!CollectionUtils.isEmpty(sysRoleList)) {
-        //                                for (SysRole s : sysRoleList) {
-        //                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
-        //                                        sysRole = s;
-        //                                        break jump;
-        //                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-        //                                        sysRole = s;
-        //                                        break jump;
-        //                                    }
-        //                                }
-        //                            }
-        //                        }
-        //                    }
-        //                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-        //                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-        //                        if (Objects.nonNull(sysRole)) {
-        //                            //                                && f.getRoleType() != sysRole.getType()) {
-        //                            f.setReadable(true);
-        //                            f.setWritable(false);
-        //                        } else {
-        //                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
-        //                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
-        //                                    .contains(SystemConstant.SIGN_REGION)) {
-        //                                flowFormWidgetResultListNew.add(f);
-        //                            }
-        //                        }
-        //                    }
-        //                    if (Objects.isNull(sysRole) && Objects.nonNull(currFlowTaskResult)) {
-        //                        currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
-        //                    }
-        //                }
-        //            }
-        //        } else
         if (tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW && Objects.nonNull(currFlowTaskResult) && (
                 currFlowTaskResult.getSetup().intValue() == 3 || currFlowTaskResult.getSetup().intValue() == 4)) {
             List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();

+ 0 - 129
sop-business/src/main/java/com/qmth/sop/business/entity/TBSopInfoDetail.java

@@ -1,129 +0,0 @@
-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 io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * sop明细表
- * </p>
- *
- * @author wangliang
- * @since 2023-08-31
- */
-@ApiModel(value = "TBSopInfoDetail对象", description = "sop明细表")
-public class TBSopInfoDetail implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "主键")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
-
-    @ApiModelProperty(value = "sop信息id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long sopInfoId;
-
-    @ApiModelProperty(value = "大区经理id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long leadId;
-
-    @ApiModelProperty(value = "区域负责人id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long regionUserId;
-
-    @ApiModelProperty(value = "实施工程师id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long engineerUserId;
-
-    @ApiModelProperty(value = "助理实施工程师id数组")
-    private String assistantEngineerUserIds;
-
-    @ApiModelProperty(value = "之后是否由区域协调人替换实施工程师,true:是,false:不是")
-    private Boolean afterRegionToEnginess = false;
-
-    public TBSopInfoDetail() {
-
-    }
-
-    public TBSopInfoDetail(Long sopInfoId, Long leadId) {
-        this.id = SystemConstant.getDbUuid();
-        this.sopInfoId = sopInfoId;
-        this.leadId = leadId;
-    }
-
-    public TBSopInfoDetail(Long leadId, Long regionUserId, Long engineerUserId, String assistantEngineerUserIds) {
-        this.id = SystemConstant.getDbUuid();
-        this.leadId = leadId;
-        this.regionUserId = regionUserId;
-        this.engineerUserId = engineerUserId;
-        this.assistantEngineerUserIds = assistantEngineerUserIds;
-    }
-
-    public void updateUserIdInfo(Long regionUserId, Long engineerUserId, String assistantEngineerUserIds) {
-        this.regionUserId = regionUserId;
-        this.engineerUserId = engineerUserId;
-        this.assistantEngineerUserIds = assistantEngineerUserIds;
-    }
-
-    public Boolean getAfterRegionToEnginess() {
-        return afterRegionToEnginess;
-    }
-
-    public void setAfterRegionToEnginess(Boolean afterRegionToEnginess) {
-        this.afterRegionToEnginess = afterRegionToEnginess;
-    }
-
-    public Long getLeadId() {
-        return leadId;
-    }
-
-    public void setLeadId(Long leadId) {
-        this.leadId = leadId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getSopInfoId() {
-        return sopInfoId;
-    }
-
-    public void setSopInfoId(Long sopInfoId) {
-        this.sopInfoId = sopInfoId;
-    }
-
-    public Long getRegionUserId() {
-        return regionUserId;
-    }
-
-    public void setRegionUserId(Long regionUserId) {
-        this.regionUserId = regionUserId;
-    }
-
-    public Long getEngineerUserId() {
-        return engineerUserId;
-    }
-
-    public void setEngineerUserId(Long engineerUserId) {
-        this.engineerUserId = engineerUserId;
-    }
-
-    public String getAssistantEngineerUserIds() {
-        return assistantEngineerUserIds;
-    }
-
-    public void setAssistantEngineerUserIds(String assistantEngineerUserIds) {
-        this.assistantEngineerUserIds = assistantEngineerUserIds;
-    }
-}

+ 0 - 16
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoDetailMapper.java

@@ -1,16 +0,0 @@
-package com.qmth.sop.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.sop.business.entity.TBSopInfoDetail;
-
-/**
- * <p>
- * sop明细表 Mapper 接口
- * </p>
- *
- * @author wangliang
- * @since 2023-08-31
- */
-public interface TBSopInfoDetailMapper extends BaseMapper<TBSopInfoDetail> {
-
-}

+ 13 - 22
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.sop.business.bean.dto.DataPermissionDto;
 import com.qmth.sop.business.bean.result.SopInfoResult;
-import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBSopInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -38,7 +37,8 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @param fieldValue
      * @return
      */
-    Boolean saveDynamicSop(@Param("tableName") String tableName, @Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue);
+    Boolean saveDynamicSop(@Param("tableName") String tableName, @Param("fieldName") String fieldName,
+            @Param("fieldValue") String fieldValue);
 
     /**
      * 更新动态sop信息
@@ -49,7 +49,8 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @param fieldValue
      * @return
      */
-    Boolean updateDynamicSop(@Param("tableName") String tableName, @Param("flowDeploymentId") String flowDeploymentId, @Param("flowId") Long flowId, @Param("fieldValue") String fieldValue);
+    Boolean updateDynamicSop(@Param("tableName") String tableName, @Param("flowDeploymentId") String flowDeploymentId,
+            @Param("flowId") Long flowId, @Param("fieldValue") String fieldValue);
 
     /**
      * 查询动态sop数据
@@ -59,7 +60,8 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @param flowId
      * @return
      */
-    int selectDynamicSop(@Param("tableName") String tableName, @Param("flowDeploymentId") String flowDeploymentId, @Param("flowId") Long flowId);
+    int selectDynamicSop(@Param("tableName") String tableName, @Param("flowDeploymentId") String flowDeploymentId,
+            @Param("flowId") Long flowId);
 
     /**
      * 查询所有列
@@ -85,35 +87,24 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @return
      */
     @SuppressWarnings("MybatisXMapperMethodInspection")
-    IPage<Map> list(IPage<Map> iPage, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("tableName") String tableName, @Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue, @Param("dpr") DataPermissionDto dpr, @Param("fieldOrder") String fieldOrder);
+    IPage<Map> list(IPage<Map> iPage, @Param("type") String type, @Param("serviceId") Long serviceId,
+            @Param("tableName") String tableName, @Param("fieldName") String fieldName,
+            @Param("fieldValue") String fieldValue, @Param("dpr") DataPermissionDto dpr,
+            @Param("fieldOrder") String fieldOrder);
 
     /**
      * 根据crmNo查询在途的sop信息
      *
      * @param crmNo
-     * @param userId
-     * @param roleType
      * @return
      */
-    List<String> findFlowPassageByCrmNo(@Param("crmNo") String crmNo, @Param("userId") Long userId, @Param("roleType") String roleType);
+    List<String> findFlowPassageByCrmNo(@Param("crmNo") String crmNo);
 
     /**
-     * 根据serviceId和userId查询所有sop信息
+     * 根据serviceId查询所有sop信息
      *
      * @param serviceId
-     * @param userId
-     * @param roleType
      * @return
      */
-    List<SopInfoResult> findFlowByServiceId(@Param("serviceId") Long serviceId, @Param("userId") Long userId, @Param("roleType") String roleType);
-
-    List<SysUser> userList(@Param("id") Long id);
-
-    /**
-     * 根据服务单元查找在途的区域协调人、实施工程师、助理工程师
-     *
-     * @param serviceId
-     * @return
-     */
-    List<Map<String, Object>> findSopPassage(@Param("serviceId") Long serviceId);
+    List<SopInfoResult> findFlowByServiceId(@Param("serviceId") Long serviceId);
 }

+ 0 - 16
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoDetailService.java

@@ -1,16 +0,0 @@
-package com.qmth.sop.business.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.sop.business.entity.TBSopInfoDetail;
-
-/**
- * <p>
- * sop明细表 服务类
- * </p>
- *
- * @author wangliang
- * @since 2023-08-31
- */
-public interface TBSopInfoDetailService extends IService<TBSopInfoDetail> {
-
-}

+ 6 - 67
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -10,7 +10,9 @@ import com.qmth.sop.business.bean.result.CrmProjectResult;
 import com.qmth.sop.business.bean.result.FlowResult;
 import com.qmth.sop.business.bean.result.FlowTaskResult;
 import com.qmth.sop.business.bean.result.SopInfoResult;
-import com.qmth.sop.business.entity.*;
+import com.qmth.sop.business.entity.TBSopInfo;
+import com.qmth.sop.business.entity.TFCustomFlow;
+import com.qmth.sop.business.entity.TFCustomFlowEntity;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 
 import java.util.List;
@@ -56,15 +58,6 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      */
     int selectDynamicSop(String tableName, String flowDeploymentId, Long flowId);
 
-    //    /**
-    //     * sop发布信息
-    //     *
-    //     * @param sopPublishParam
-    //     * @return
-    //     */
-    //    @Deprecated
-    //    Boolean sopPublish(SopPublishParam sopPublishParam) throws InterruptedException;
-
     /**
      * sop发布信息
      *
@@ -73,15 +66,6 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      */
     String sopPublish(SopPublishParam sopPublishParam) throws Exception;
 
-    /**
-     * sop申请信息
-     *
-     * @param sopApplyParam
-     * @return
-     */
-    //    @Deprecated
-    //    Boolean sopApply(SopApplyParam sopApplyParam) throws InterruptedException;
-
     /**
      * sop填报信息
      *
@@ -98,47 +82,21 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      */
     IPage<Map> list(SopInfoListParam sopInfoListParam);
 
-    //    /**
-    //     * sop申请或发布
-    //     *
-    //     * @param sopNo
-    //     * @param crmNo
-    //     * @param flowDeploymentId
-    //     * @param approve
-    //     * @param formProperties
-    //     * @return
-    //     * @throws InterruptedException
-    //     */
-    //    @Deprecated
-    //    public Boolean sopApplyOrPublish(String sopNo, String crmNo, String flowDeploymentId, FlowApprovePassEnum approve,
-    //            String formProperties) throws InterruptedException;
-
     /**
      * 根据crmNo查询在途的sop信息
      *
      * @param crmNo
      * @return
      */
-    List<String> findFlowPassageByCrmNo(String crmNo, Long requestUserId);
+    List<String> findFlowPassageByCrmNo(String crmNo);
 
     /**
-     * 根据serviceId和userId查询所有sop信息
+     * 根据serviceId查询所有sop信息
      *
      * @param serviceId
      * @return
      */
-    List<SopInfoResult> findFlowByServiceId(Long serviceId, Long userId);
-
-    /**
-     * sop自动审批
-     *
-     * @param tfCustomFlow
-     * @param tfCustomFlowEntity
-     * @param tfFlowApprove
-     * @param crmNo
-     */
-    public void sopSystemApprove(TFCustomFlow tfCustomFlow, TFCustomFlowEntity tfCustomFlowEntity,
-            TFFlowApprove tfFlowApprove, String crmNo) throws InterruptedException;
+    List<SopInfoResult> findFlowByServiceId(Long serviceId);
 
     /**
      * 保存提醒/延时任务
@@ -160,15 +118,6 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
     public void saveSopPlanDate(FlowTaskResult flowTaskResult, Long sopId, Long flowId, Long userId,
             TFCustomTypeEnum type) throws InterruptedException;
 
-    /**
-     * sop保存设备信息
-     *
-     * @param map
-     * @param setup
-     * @throws InterruptedException
-     */
-    public void sopDeviceInOutSave(Map<String, Object> map, Integer setup) throws InterruptedException;
-
     /**
      * sop编辑
      *
@@ -185,16 +134,6 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      */
     public Boolean sopSave(SopSaveParam sopSaveParam) throws InterruptedException;
 
-    List<SysUser> userList(Long id);
-
-    /**
-     * 根据服务单元查找在途的区域协调人、实施工程师、助理工程师
-     *
-     * @param serviceId
-     * @return
-     */
-    List<Map<String, Object>> findSopPassage(Long serviceId);
-
     /**
      * 获取表单内容
      *

+ 48 - 49
sop-business/src/main/java/com/qmth/sop/business/service/impl/ServiceAnalyseServiceImpl.java

@@ -97,31 +97,31 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
                 OutboundTotal = BigDecimal.valueOf(Integer.parseInt(map.get("equipmentOutboundTotal").toString())),
                 deviceRate = totalDevices > 0 ? OutboundTotal.divide(totalDevicesBig, 2, BigDecimal.ROUND_HALF_UP).multiply(percent).setScale(2, BigDecimal.ROUND_HALF_UP) : OutboundTotal;
         map.put("equipmentOccupancyRate", deviceRate);
-        List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
+//        List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
         Integer distributed = 0;
-        if (!CollectionUtils.isEmpty(sopPassageMap)) {
-            for (Map m : sopPassageMap) {
-                //需要去重
-                String regionUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("regionUserIds")) ? m.get("regionUserIds").toString() : null;
-                if (Objects.nonNull(regionUserStr)) {
-                    String[] strs = regionUserStr.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    distributed = distributed + set.size();
-                }
-                String engineerUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ? m.get("engineerUserIds").toString() : null;
-                if (Objects.nonNull(engineerUserStr)) {
-                    String[] strs = engineerUserStr.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    distributed = distributed + set.size();
-                }
-                String assistantEngineerUserId = Objects.nonNull(m) && Objects.nonNull(m.get("assistantEngineerUserIds")) ? m.get("assistantEngineerUserIds").toString() : null;
-                if (Objects.nonNull(assistantEngineerUserId)) {
-                    String[] strs = assistantEngineerUserId.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    distributed = distributed + set.size();
-                }
-            }
-        }
+//        if (!CollectionUtils.isEmpty(sopPassageMap)) {
+//            for (Map m : sopPassageMap) {
+//                //需要去重
+//                String regionUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("regionUserIds")) ? m.get("regionUserIds").toString() : null;
+//                if (Objects.nonNull(regionUserStr)) {
+//                    String[] strs = regionUserStr.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    distributed = distributed + set.size();
+//                }
+//                String engineerUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ? m.get("engineerUserIds").toString() : null;
+//                if (Objects.nonNull(engineerUserStr)) {
+//                    String[] strs = engineerUserStr.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    distributed = distributed + set.size();
+//                }
+//                String assistantEngineerUserId = Objects.nonNull(m) && Objects.nonNull(m.get("assistantEngineerUserIds")) ? m.get("assistantEngineerUserIds").toString() : null;
+//                if (Objects.nonNull(assistantEngineerUserId)) {
+//                    String[] strs = assistantEngineerUserId.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    distributed = distributed + set.size();
+//                }
+//            }
+//        }
         map.put("servicePersonnelTotal", distributed);
         //认证有效的人员总数
         int totalUserArchives = tbUserArchivesSupplierService.countAuthentication();
@@ -196,32 +196,31 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
         }
 
         // -- 在服务人员总数 --
-        List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
+//        List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
         Integer servicePersonnelTotal = 0;
-        if (!CollectionUtils.isEmpty(sopPassageMap)) {
-            for (Map m : sopPassageMap) {
-                //需要去重
-                String regionUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("regionUserIds")) ? m.get("regionUserIds").toString() : null;
-                if (Objects.nonNull(regionUserStr)) {
-                    String[] strs = regionUserStr.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    servicePersonnelTotal = servicePersonnelTotal + set.size();
-                }
-                String engineerUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ? m.get("engineerUserIds").toString() : null;
-                if (Objects.nonNull(engineerUserStr)) {
-                    String[] strs = engineerUserStr.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    servicePersonnelTotal = servicePersonnelTotal + set.size();
-                }
-                String assistantEngineerUserId = Objects.nonNull(m) && Objects.nonNull(m.get("assistantEngineerUserIds")) ? m.get("assistantEngineerUserIds").toString() : null;
-                if (Objects.nonNull(assistantEngineerUserId)) {
-                    String[] strs = assistantEngineerUserId.split(",");
-                    Set<String> set = new HashSet<>(Arrays.asList(strs));
-                    servicePersonnelTotal = servicePersonnelTotal + set.size();
-                }
-            }
-        }
-
+//        if (!CollectionUtils.isEmpty(sopPassageMap)) {
+//            for (Map m : sopPassageMap) {
+//                //需要去重
+//                String regionUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("regionUserIds")) ? m.get("regionUserIds").toString() : null;
+//                if (Objects.nonNull(regionUserStr)) {
+//                    String[] strs = regionUserStr.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    servicePersonnelTotal = servicePersonnelTotal + set.size();
+//                }
+//                String engineerUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ? m.get("engineerUserIds").toString() : null;
+//                if (Objects.nonNull(engineerUserStr)) {
+//                    String[] strs = engineerUserStr.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    servicePersonnelTotal = servicePersonnelTotal + set.size();
+//                }
+//                String assistantEngineerUserId = Objects.nonNull(m) && Objects.nonNull(m.get("assistantEngineerUserIds")) ? m.get("assistantEngineerUserIds").toString() : null;
+//                if (Objects.nonNull(assistantEngineerUserId)) {
+//                    String[] strs = assistantEngineerUserId.split(",");
+//                    Set<String> set = new HashSet<>(Arrays.asList(strs));
+//                    servicePersonnelTotal = servicePersonnelTotal + set.size();
+//                }
+//            }
+//        }
 
         //认证有效的人员总数
         int totalUserArchives = tbUserArchivesSupplierService.countAuthentication();

+ 27 - 28
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingServiceImpl.java

@@ -615,33 +615,32 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
 
         for (TBService tbService : tbServiceList) {
             Long serviceUnitId = tbService.getId();
-            List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
-            if (CollectionUtils.isNotEmpty(sopPassageMap)) {
-                Map<String, Object> map = sopPassageMap.get(0);
-                if (Objects.nonNull(map)) {
-                    String engineerUserIds = String.valueOf(map.get("engineerUserIds"));
-                    String assistantEngineerUserIds = String.valueOf(map.get("assistantEngineerUserIds"));
-
-                    if (engineerUserIds != null && engineerUserIds.length() > 0 && !engineerUserIds.equals("null")) {
-                        List<Long> engineerUserIdCell = Arrays.stream(engineerUserIds.split(","))
-                                .map(Long::parseLong)
-                                .filter(userId -> Objects.nonNull(this.findDingRule(userId, serviceUnitId)))
-                                .distinct()
-                                .collect(Collectors.toList());
-                        needDingUserIdSet.addAll(engineerUserIdCell);
-                    }
-
-                    if (assistantEngineerUserIds != null && assistantEngineerUserIds.length() > 0 && !assistantEngineerUserIds.equals("null")) {
-                        List<Long> assistantEngineerUserIdCell = Arrays.stream(assistantEngineerUserIds.split(","))
-                                .map(Long::parseLong)
-                                .filter(userId -> Objects.nonNull(this.findDingRule(userId, serviceUnitId)))
-                                .distinct()
-                                .collect(Collectors.toList());
-                        needDingUserIdSet.addAll(assistantEngineerUserIdCell);
-                    }
-                }
-            }
-
+//            List<Map<String, Object>> sopPassageMap = tbSopInfoService.findSopPassage(serviceUnitId);
+//            if (CollectionUtils.isNotEmpty(sopPassageMap)) {
+//                Map<String, Object> map = sopPassageMap.get(0);
+//                if (Objects.nonNull(map)) {
+//                    String engineerUserIds = String.valueOf(map.get("engineerUserIds"));
+//                    String assistantEngineerUserIds = String.valueOf(map.get("assistantEngineerUserIds"));
+//
+//                    if (engineerUserIds != null && engineerUserIds.length() > 0 && !engineerUserIds.equals("null")) {
+//                        List<Long> engineerUserIdCell = Arrays.stream(engineerUserIds.split(","))
+//                                .map(Long::parseLong)
+//                                .filter(userId -> Objects.nonNull(this.findDingRule(userId, serviceUnitId)))
+//                                .distinct()
+//                                .collect(Collectors.toList());
+//                        needDingUserIdSet.addAll(engineerUserIdCell);
+//                    }
+//
+//                    if (assistantEngineerUserIds != null && assistantEngineerUserIds.length() > 0 && !assistantEngineerUserIds.equals("null")) {
+//                        List<Long> assistantEngineerUserIdCell = Arrays.stream(assistantEngineerUserIds.split(","))
+//                                .map(Long::parseLong)
+//                                .filter(userId -> Objects.nonNull(this.findDingRule(userId, serviceUnitId)))
+//                                .distinct()
+//                                .collect(Collectors.toList());
+//                        needDingUserIdSet.addAll(assistantEngineerUserIdCell);
+//                    }
+//                }
+//            }
         }
 
         List<TBDing> willAddDingList = new ArrayList<>();
@@ -649,7 +648,7 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
             List<TBCrm> tbCrmList = tbCrmService.findOccupiedCrm(userId, null);
             for (TBCrm tbCrm : tbCrmList) {
                 String crmNo = tbCrm.getCrmNo();
-                List<String> sopNoList = tbSopInfoService.findFlowPassageByCrmNo(tbCrm.getCrmNo(), userId);
+                List<String> sopNoList = tbSopInfoService.findFlowPassageByCrmNo(tbCrm.getCrmNo());
                 for (String sopNo : sopNoList) {
                     TBDing tbDing = this.getOne(new QueryWrapper<TBDing>().lambda()
                             .eq(TBDing::getSopNo, sopNo)

+ 0 - 20
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoDetailServiceImpl.java

@@ -1,20 +0,0 @@
-package com.qmth.sop.business.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.sop.business.entity.TBSopInfoDetail;
-import com.qmth.sop.business.mapper.TBSopInfoDetailMapper;
-import com.qmth.sop.business.service.TBSopInfoDetailService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * sop明细表 服务实现类
- * </p>
- *
- * @author wangliang
- * @since 2023-08-31
- */
-@Service
-public class TBSopInfoDetailServiceImpl extends ServiceImpl<TBSopInfoDetailMapper, TBSopInfoDetail> implements TBSopInfoDetailService {
-
-}

+ 19 - 634
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -18,7 +18,6 @@ import com.qmth.sop.business.mapper.TBSopInfoMapper;
 import com.qmth.sop.business.service.*;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.*;
-import com.qmth.sop.common.util.GsonUtil;
 import com.qmth.sop.common.util.JacksonUtil;
 import com.qmth.sop.common.util.ResultUtil;
 import com.qmth.sop.common.util.ServletUtil;
@@ -65,9 +64,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Resource
     TaskService taskService;
 
-    @Resource
-    TBSopInfoDetailService tbSopInfoDetailService;
-
     @Resource
     TBSopInfoService tbSopInfoService;
 
@@ -89,24 +85,15 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Value("${db.name}")
     String databaseName;
 
-    @Resource
-    TBDeviceInOutService tbDeviceInOutService;
-
     @Resource
     TFFlowLogService tfFlowLogService;
 
-    @Resource
-    SysUserRoleService sysUserRoleService;
-
     @Resource
     TBServiceService tbServiceService;
 
     @Resource
     TBSopPlanDateLogService tbSopPlanDateLogService;
 
-    @Resource
-    TBDeviceDeliveryService tbDeviceDeliveryService;
-
     @Resource
     TBSopLogService tbSopLogService;
 
@@ -238,27 +225,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         return this.baseMapper.selectDynamicSop(tableName, flowDeploymentId, flowId);
     }
 
-    //    /**
-    //     * sop发布信息
-    //     *
-    //     * @param sopPublishParam
-    //     * @return
-    //     * @throws InterruptedException
-    //     */
-    //    @Override
-    //    @Transactional
-    //    @Deprecated
-    //    public Boolean sopPublish(SopPublishParam sopPublishParam) throws InterruptedException {
-    //        Optional.ofNullable(sopPublishParam.getCrmNo())
-    //                .orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("crm编号不能为空"));
-    ////        if (sopPublishParam.getApprove() != FlowApprovePassEnum.DRAFT) {
-    ////            throw ExceptionResultEnum.PARAMS_ERROR.exception("sop发布只能为草稿");
-    ////        }
-    //        return tbSopInfoService.sopApplyOrPublish(sopPublishParam.getSopNo(), sopPublishParam.getCrmNo(),
-    //                sopPublishParam.getFlowDeploymentId(), sopPublishParam.getApprove(),
-    //                sopPublishParam.getFormProperties());
-    //    }
-
     /**
      * sop发布信息
      *
@@ -403,26 +369,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         return sopPublishParam;
     }
 
-    //    /**
-    //     * sop申请信息
-    //     *
-    //     * @param sopApplyParam
-    //     * @return
-    //     */
-    //    @Override
-    //    @Transactional
-    //    @Deprecated
-    //    public Boolean sopApply(SopApplyParam sopApplyParam) throws InterruptedException {
-    //        Optional.ofNullable(sopApplyParam.getCrmNo())
-    //                .orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("crm编号不能为空"));
-    //        if (sopApplyParam.getApprove() != FlowApprovePassEnum.START
-    //                && sopApplyParam.getApprove() != FlowApprovePassEnum.DRAFT) {
-    //            throw ExceptionResultEnum.PARAMS_ERROR.exception("sop申请只能为提交或草稿");
-    //        }
-    //        return tbSopInfoService.sopApplyOrPublish(sopApplyParam.getSopNo(), sopApplyParam.getCrmNo(),
-    //                sopApplyParam.getFlowDeploymentId(), sopApplyParam.getApprove(), sopApplyParam.getFormProperties());
-    //    }
-
     /**
      * sop填报信息
      *
@@ -473,27 +419,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 new QueryWrapper<TBSopInfo>().lambda().eq(TBSopInfo::getSopNo, tfCustomFlowEntity.getCode()));
         Optional.ofNullable(tbSopInfo).orElseThrow(() -> ExceptionResultEnum.SOP_INFO_NO_DATA.exception());
 
-        //        TBSopInfoDetail tbSopInfoDetail = tbSopInfoDetailService.getOne(
-        //                new QueryWrapper<TBSopInfoDetail>().lambda().eq(TBSopInfoDetail::getSopInfoId, tbSopInfo.getId()));
-        //        Optional.ofNullable(tbSopInfoDetail).orElseThrow(() -> ExceptionResultEnum.SOP_DETAIL_INFO_NO_DATA.exception());
-
-        //更新表单信息
-        //        FlowTaskResult flowTaskResult = JSONObject.parseObject(flowApproveParam.getFormProperties(),
-        //                FlowTaskResult.class);
-        //        Long engineerUserId = null;
-        //        if (flowTaskResult.getSetup().intValue() == 1) {
-        //            //            Long regionUserId = null;
-        //            String assistantEngineerUserIds = null;
-        ////            Map<String, Object> map = this.getApproveUserIds(flowTaskResult);
-        //            //            regionUserId = (Long) map.get(SystemConstant.REGION_USER_ID);
-        ////            engineerUserId = (Long) map.get(SystemConstant.ENGINEER_USER_ID);
-        //            //            assistantEngineerUserIds = (String) map.get(SystemConstant.ASSISTANT_ENGINEER_USER_ID);
-        //
-        //            //            tbSopInfoDetail.updateUserIdInfo(regionUserId, engineerUserId, assistantEngineerUserIds);
-        //            tbSopInfoDetailService.updateById(tbSopInfoDetail);
-        //        } else {
-        //            engineerUserId = Long.parseLong(taskApproveUserList.get(0));
-        //        }
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
         Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
         CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
@@ -502,9 +427,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
         if (flowApproveParam.getApprove() == FlowApprovePassEnum.PASS
                 || flowApproveParam.getApprove() == FlowApprovePassEnum.START) {
-            //            List<String> approveUserIds = this.getNextApproveUserIds(tfCustomFlow.getType(), flowTaskResult,
-            //                    tbSopInfoDetail, Long.parseLong(task.getProcessInstanceId()));
-            //            flowApproveParam.setApproveUserIds(approveUserIds);
             FlowTaskResult flowTaskResultOne = this.getFormProperties(tfCustomFlowEntity, 1);
             FlowTaskResult currFlowTaskResult = JSONObject.parseObject(flowApproveParam.getFormProperties(),
                     FlowTaskResult.class);
@@ -513,23 +435,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             flowApproveParam.setApproveUserIds(approveUserIds);
         }
 
-        //        if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
-        //                && flowTaskResult.getSetup().intValue() == 3) {//内审时要set全部值
-        //            FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
-        //            FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(
-        //                    GsonUtil.toJson(flowResult.getSetupMap().get(flowTaskResult.getTaskKey())), FlowTaskResult.class);
-        //            List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-        //            Map<String, FlowFormWidgetResult> flowTaskResultMap = flowTaskResult.getFormProperty().stream().collect(
-        //                    Collectors.toMap(FlowFormWidgetResult::getFormId, Function.identity(), (dto1, dto2) -> dto1));
-        //            for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-        //                if (flowTaskResultMap.containsKey(f.getFormId())) {
-        //                    f.setValue(flowTaskResultMap.get(f.getFormId()).getValue());
-        //                }
-        //            }
-        //            flowTaskResult.setFormProperty(flowFormWidgetResultList);
-        //            flowApproveParam.setFormProperties(JacksonUtil.parseJson(flowTaskResult));
-        //        }
-
         String oldFlowProcessVar = tfCustomFlowEntity.getFlowProcessVar();
         Map<String, Object> map = activitiService.taskApprove(flowApproveParam);
         if (flowApproveParam.getApprove() != FlowApprovePassEnum.DRAFT) {
@@ -554,12 +459,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                         SopStatusEnum.START);
         tbSopInfo.updateInfo(sysUser.getId());
         tbSopInfoService.updateById(tbSopInfo);
-
-        //        //如果下一步审批是大区经理内审并且区域协调人和大区经理为同一人时,后台自动审批
-        //        if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
-        //            tbSopInfoService.sopSystemApprove(tfCustomFlow, tfCustomFlowEntity, tfFlowApprove,
-        //                    flowApproveParam.getCrmNo());
-        //        }
         return true;
     }
 
@@ -737,30 +636,20 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 sopInfoListParam.getServiceId(), tableName, fieldName, fieldValue, dpr, fieldOrder);
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         for (Map m : list.getRecords()) {
-            String regionUserId = (String) m.get("region_user_id_1");
-            String engineerUserId = (String) m.get("engineer_user_id_1");
-            String assistantEngineerUserId = (String) m.get("assistant_engineer_user_id_1");
+            String engineerUsersId = (String) m.get("engineer_users_id");
             List<Long> userIdList = new ArrayList<>(3);
             Map<Long, String> map = new HashMap<>(3);
-            Map<Long, String> assistantEngineerMap = new HashMap<>();//助理工程师map
-            if (Objects.nonNull(regionUserId)) {
-                userIdList.add(Long.parseLong(regionUserId));
-                map.put(Long.parseLong(regionUserId), "region_user_id_1");
-            }
-            if (Objects.nonNull(engineerUserId)) {
-                userIdList.add(Long.parseLong(engineerUserId));
-                map.put(Long.parseLong(engineerUserId), "engineer_user_id_1");
-            }
-            if (Objects.nonNull(assistantEngineerUserId)) {
-                if (assistantEngineerUserId.contains(SystemConstant.LIST_JOIN_SPLIT)) {
-                    String[] strs = assistantEngineerUserId.split(",");
+            Map<Long, String> engineerMap = new HashMap<>();//助理工程师map
+            if (Objects.nonNull(engineerUsersId)) {
+                if (engineerUsersId.contains(SystemConstant.LIST_JOIN_SPLIT)) {
+                    String[] strs = engineerUsersId.split(",");
                     for (int i = 0; i < strs.length; i++) {
                         userIdList.add(Long.parseLong(strs[i]));
-                        assistantEngineerMap.put(Long.parseLong(strs[i]), "assistant_engineer_user_id_1");
+                        engineerMap.put(Long.parseLong(strs[i]), "engineer_users_id_1");
                     }
                 } else {
-                    userIdList.add(Long.parseLong(assistantEngineerUserId));
-                    assistantEngineerMap.put(Long.parseLong(assistantEngineerUserId), "assistant_engineer_user_id_1");
+                    userIdList.add(Long.parseLong(engineerUsersId));
+                    engineerMap.put(Long.parseLong(engineerUsersId), "engineer_users_id_1");
                 }
             }
             if (!CollectionUtils.isEmpty(userIdList)) {
@@ -770,12 +659,12 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     if (map.containsKey(s.getId())) {
                         m.put(map.get(s.getId()), s.getOrgUserName());
                     }
-                    if (assistantEngineerMap.containsKey(s.getId())) {
+                    if (engineerMap.containsKey(s.getId())) {
                         stringJoiner.add(s.getOrgUserName());
                     }
                 }
-                if (!CollectionUtils.isEmpty(assistantEngineerMap)) {
-                    m.put("assistant_engineer_user_id_1", stringJoiner.toString());
+                if (!CollectionUtils.isEmpty(engineerMap)) {
+                    m.put("engineer_users_id_1", stringJoiner.toString());
                 }
             }
 
@@ -833,64 +722,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         return list;
     }
 
-    /**
-     * sop自动审批
-     *
-     * @param tfCustomFlow
-     * @param tfCustomFlowEntity
-     * @param tfFlowApprove
-     * @param crmNo
-     * @throws InterruptedException
-     */
-    @Override
-    @Transactional
-    public void sopSystemApprove(TFCustomFlow tfCustomFlow, TFCustomFlowEntity tfCustomFlowEntity,
-            TFFlowApprove tfFlowApprove, String crmNo) throws InterruptedException {
-        //如果下一步审批是内审并且区域协调人和大区经理为同一人时,后台自动审批
-        if (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END
-                && tfFlowApprove.getStatus() == FlowStatusEnum.AUDITING && tfFlowApprove.getSetup().intValue() == 3) {
-            //TODO 研究生SOP待修改
-            //                && tbSopInfoDetail.getLeadId().longValue() == tbSopInfoDetail.getRegionUserId().longValue()) {
-            //            Task taskNew = taskService.createTaskQuery().processInstanceId(String.valueOf(tfFlowApprove.getFlowId()))
-            //                    .taskAssignee(String.valueOf(tbSopInfoDetail.getLeadId())).singleResult();
-            //            Optional.ofNullable(taskNew).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
-
-            FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
-            LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
-            FlowTaskResult nextFlowTaskResult = null;
-            for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
-                if (entry.getValue().getSetup().intValue() == 3) {
-                    nextFlowTaskResult = entry.getValue();
-                    break;
-                }
-            }
-
-            if (Objects.nonNull(nextFlowTaskResult)) {
-                List<FlowFormWidgetResult> flowFormWidgetResultList = nextFlowTaskResult.getFormProperty();
-                for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                    if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION)) {
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put(SystemConstant.VALUE, "1");
-                        f.setValue(jsonObject.toString());
-                    } else if (f.getFormId().contains(SystemConstant.APPROVE_REMARK_REGION)) {
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put(SystemConstant.VALUE, SystemConstant.SYSTEM_AUTO_APPROVE);
-                        f.setValue(jsonObject.toString());
-                    } else if (f.getFormId().contains(SystemConstant.SIGN_REGION)) {
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put(SystemConstant.VALUE, "https://sop-file.qmth.com.cn/logo/logo.png");
-                        f.setValue(jsonObject.toString());
-                    }
-                }
-            }
-            //TODO 研究生SOP待修改
-            //            activitiService.taskApprove(new FlowApproveParam(Long.parseLong(taskNew.getId()), FlowApprovePassEnum.PASS,
-            //                    this.getNextApproveUserIds(tfCustomFlow.getType(), nextFlowTaskResult, tbSopInfoDetail,
-            //                            tfCustomFlowEntity.getFlowId()), crmNo, SystemConstant.SYSTEM_AUTO_APPROVE,
-            //                    JacksonUtil.parseJson(nextFlowTaskResult)));
-        }
-    }
-
     /**
      * 获取下一级审批人
      *
@@ -939,204 +770,12 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     approveUserIds.add(crmProjectResult.getRegionManagerId().toString());
                 }
             }
-            //            if (flowTaskResult.getSetup().intValue() == 1) {
-            //                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getRegionUserId()));
-            //            } else if (flowTaskResult.getSetup().intValue() == 2) {
-            //                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()),
-            //                        String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //            } else if (flowTaskResult.getSetup().intValue() == 3) {
-            //                List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
-            //                if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()));
-            //                } else {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()),
-            //                            String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //                }
-            //            } else {
-            //                if (flowTaskResult.getSetup().intValue() >= 8 && tbSopInfoDetail.getAfterRegionToEnginess()) {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getRegionUserId()));
-            //                } else {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //                }
-            //            }
         } else if (type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop流程待审核人
-            //            if (flowTaskResult.getSetup().intValue() == 1) {
-            //                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getRegionUserId()));
-            //            } else if (flowTaskResult.getSetup().intValue() == 2) {
-            //                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()),
-            //                        String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //            } else if (flowTaskResult.getSetup().intValue() == 3) {
-            //                List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
-            //                if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()));
-            //                } else {
-            //                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()),
-            //                            String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //                }
-            //            } else {
-            //                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getEngineerUserId()));
-            //            }
+
         }
         return approveUserIds;
     }
 
-    //        /**
-    //         * 获取审批人
-    //         *
-    //         * @param flowTaskResult
-    //         * @return
-    //         */
-    //        public Map<String, Object> getApproveUserIds(FlowTaskResult flowTaskResult) {
-    //            Map<String, Object> map = new HashMap<>();
-    //            //        Long regionUserId = null, engineerUserId = null;
-    //            //        String assistantEngineerUserIds = null;
-    //            String engineerUsersIds = null;
-    //            List<FlowFormWidgetResult> formProperty = flowTaskResult.getFormProperty();
-    //            for (FlowFormWidgetResult f : formProperty) {
-    //                //            if (f.getFormId().contains(SystemConstant.REGION_USER_ID) && Objects.nonNull(f.getValue())
-    //                //                    && !Objects.equals(f.getValue(), "{\"value\":null}")) {
-    //                //                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-    //                //                String value = jsonObject.getString(SystemConstant.VALUE);
-    //                //                regionUserId = Long.parseLong(value);
-    //                //            } else if (f.getFormId().contains(SystemConstant.ASSISTANT_ENGINEER_USER_ID) && Objects.nonNull(
-    //                //                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
-    //                //                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-    //                //                JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
-    //                //                StringJoiner stringJoiner = new StringJoiner(",");
-    //                //                for (int i = 0; i < jsonArray.size(); i++) {
-    //                //                    stringJoiner.add(jsonArray.getString(i));
-    //                //                }
-    //                //                assistantEngineerUserIds = stringJoiner.toString();
-    //                //            }
-    //                //            else if ((f.getFormId().contains(SystemConstant.ENGINEER_USER_ID) && Objects.nonNull(f.getValue()))
-    //                //                    && !Objects.equals(f.getValue(), "{\"value\":null}")) {
-    //                //                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-    //                //                String value = jsonObject.getString(SystemConstant.VALUE);
-    //                //                engineerUserId = Long.parseLong(value);
-    //                //            }
-    //                if (f.getFormId().contains(SystemConstant.ENGINEER_USERS_ID) && Objects.nonNull(f.getValue())
-    //                        && !Objects.equals(f.getValue(), "{\"value\":null}")) {
-    //                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-    //                    JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
-    //                    StringJoiner stringJoiner = new StringJoiner(",");
-    //                    for (int i = 0; i < jsonArray.size(); i++) {
-    //                        stringJoiner.add(jsonArray.getString(i));
-    //                    }
-    //                    engineerUsersIds = stringJoiner.toString();
-    //                }
-    //                if (Objects.nonNull(engineerUsersIds)) {
-    //                    break;
-    //                }
-    //            }
-    //            //        Optional.ofNullable(regionUserId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("区域协调人不能为空"));
-    //            Optional.ofNullable(engineerUsersIds).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("工程师不能为空"));
-    //            //        map.put(SystemConstant.REGION_USER_ID, regionUserId);
-    //            //        map.put(SystemConstant.ENGINEER_USERS_ID, engineerUsersIds);
-    //            //        map.put(SystemConstant.ASSISTANT_ENGINEER_USER_ID, assistantEngineerUserIds);
-    //            return map;
-    //        }
-
-    //    /**
-    //     * sop申请或发布
-    //     *
-    //     * @param sopNo
-    //     * @param crmNo
-    //     * @param flowDeploymentId
-    //     * @param approve
-    //     * @param formProperties
-    //     * @return
-    //     * @throws InterruptedException
-    //     */
-    //    @Override
-    //    @Transactional
-    //    @Deprecated
-    //    public Boolean sopApplyOrPublish(String sopNo, String crmNo, String flowDeploymentId, FlowApprovePassEnum approve,
-    //            String formProperties) throws InterruptedException {
-    //        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-    //        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(sopNo, crmNo);
-    //        Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
-    //        Optional.ofNullable(crmProjectResult.getRegionManagerId())
-    //                .orElseThrow(() -> ExceptionResultEnum.ERROR.exception("该派单号[" + crmNo + "]未设置大区经理"));
-    //
-    //        TBService tbService = tbServiceService.getById(crmProjectResult.getServiceUnitId());
-    //        Optional.ofNullable(tbService).orElseThrow(() -> ExceptionResultEnum.SERVICE_NO_DATA.exception());
-    //        Optional.ofNullable(tbService.getStatus()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("服务单元状态为空"));
-    //
-    //        if (Objects.isNull(tbService.getEnable()) || !tbService.getEnable()) {
-    //            throw ExceptionResultEnum.ERROR.exception("服务单元已作废");
-    //        }
-    //        if (tbService.getStatus() != ServiceStatusEnum.PUBLISH) {
-    //            throw ExceptionResultEnum.ERROR.exception("只有发布状态的服务单元才能新增sop");
-    //        }
-    //
-    //        TFCustomFlow tfCustomFlow = null;
-    //        TBSopInfoDetail tbSopInfoDetail = null;
-    //        List<String> approveUserIds = new ArrayList<>();
-    //        if (approve == FlowApprovePassEnum.DRAFT) {
-    //            approveUserIds.add(String.valueOf(crmProjectResult.getRegionManagerId()));
-    //        } else if (approve == FlowApprovePassEnum.START) {
-    //            Optional.ofNullable(formProperties)
-    //                    .orElseThrow(() -> ExceptionResultEnum.FLOW_FORM_PROPERTIES_IS_NULL.exception());
-    //
-    //            tfCustomFlow = tfCustomFlowService.getOne(
-    //                    new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowDeploymentId));
-    //            Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
-    //            TFCustomFlow maxTfCustomFlow = tfCustomFlowService.findMaxVersion(null, null, tfCustomFlow.getType());
-    //            Optional.ofNullable(maxTfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
-    //            if (maxTfCustomFlow.getVersion().intValue() != tfCustomFlow.getVersion().intValue()) {//说明版本发生变化
-    //                BeanUtils.copyProperties(maxTfCustomFlow, tfCustomFlow);
-    //            }
-    //
-    //            if (tfCustomFlow.getType() != TFCustomTypeEnum.OFFICE_SOP_FLOW
-    //                    && tfCustomFlow.getType() != TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
-    //                throw ExceptionResultEnum.ERROR.exception("sop流程类型错误");
-    //            }
-    //
-    //            FlowTaskResult flowTaskResult = JSONObject.parseObject(formProperties, FlowTaskResult.class);
-    //            //            Map<String, Object> map = this.getApproveUserIds(flowTaskResult);
-    //            //            Long regionUserId = (Long) map.get(SystemConstant.REGION_USER_ID);
-    //            //            Long engineerUserId = (Long) map.get(SystemConstant.ENGINEER_USER_ID);
-    //            //            String assistantEngineerUserIds = (String) map.get(SystemConstant.ASSISTANT_ENGINEER_USER_ID);
-    //            //            tbSopInfoDetail = new TBSopInfoDetail(crmProjectResult.getRegionManagerId(), regionUserId, engineerUserId,
-    //            //                    assistantEngineerUserIds);
-    //            approveUserIds = this.getNextApproveUserIds(tfCustomFlow.getType(), flowTaskResult, tbSopInfoDetail, null);
-    //        }
-    //
-    //        Map<String, Object> map = activitiService.taskApprove(
-    //                new FlowApproveParam(flowDeploymentId, approve, approveUserIds, crmNo, formProperties));
-    //        if (approve != FlowApprovePassEnum.DRAFT) {
-    //            map.put(SystemConstant.CRM_INFO, crmProjectResult);
-    //            map.put(SystemConstant.SOP_ID, null);
-    //            map.put(SystemConstant.SOURCE, "sopApplyOrPublish");
-    //            tbSopInfoService.saveJobRemind(map);
-    //        }
-    //
-    //        tfCustomFlow = Objects.isNull(tfCustomFlow) ? (TFCustomFlow) map.get(SystemConstant.FLOW_CUSTOM) : tfCustomFlow;
-    //        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
-    //
-    //        TBSopInfo tbSopInfo = new TBSopInfo(crmNo, tfCustomFlowEntity.getCode(), crmProjectResult.getServiceUnitId(),
-    //                crmProjectResult.getCustomId(), crmProjectResult.getProductId(), tfCustomFlow.getType(),
-    //                SopStatusEnum.valueOf(approve.name()), sysUser.getId());
-    //        if (Objects.isNull(tbSopInfoDetail)) {
-    //            tbSopInfoDetail = new TBSopInfoDetail(tbSopInfo.getId(), crmProjectResult.getRegionManagerId());
-    //        } else {
-    //            tbSopInfoDetail.setSopInfoId(tbSopInfo.getId());
-    //        }
-    //        tbSopInfoDetailService.save(tbSopInfoDetail);
-    //        TBSopPlanDateLog tbSopPlanDateLog = tbSopPlanDateLogService.getOne(new QueryWrapper<TBSopPlanDateLog>().lambda()
-    //                .eq(TBSopPlanDateLog::getFlowId, tfCustomFlowEntity.getFlowId())
-    //                .orderByDesc(TBSopPlanDateLog::getCreateTime).last(" limit 1 "));
-    //        if (Objects.nonNull(tbSopPlanDateLog)) {
-    //            tbSopPlanDateLog.setSopId(tbSopInfo.getId());
-    //            tbSopPlanDateLogService.updateById(tbSopPlanDateLog);
-    //        }
-    //
-    //        tfCustomFlowEntity.setObjId(tbSopInfo.getId());
-    //        tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
-    //        tbCrmService.updateCrmStatus(crmNo, CrmStatusEnum.PUBLISH);
-    //        return tbSopInfoService.save(tbSopInfo);
-    //    }
-
     /**
      * 保存提醒/延时任务
      *
@@ -1172,144 +811,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 execField = ProcessLimitedEnum.FLOW_TASK.getKey();
                 tbSopInfoService.saveSopPlanDate(flowTaskResult, sopId, tfCustomFlowEntity.getFlowId(), sysUser.getId(),
                         tfCustomFlow.getType());
-                //                if (tfFlowApprove.getSetup().intValue() == 2) {//项目关键信息
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey());
-                //                    execField = ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey();
-                //                    tbSopInfoService.saveSopPlanDate(flowTaskResult, sopId, tfCustomFlowEntity.getFlowId(),
-                //                            sysUser.getId());
-                //                } else if (tfFlowApprove.getSetup().intValue() == 3) {//内审
-                //                    processLimitedTime = tfFlowApprove.getUpdateTime();
-                //                    execField = ProcessLimitedEnum.APPROVE_RADIO.getKey();
-                //                } else if (tfFlowApprove.getSetup().intValue() == 5) {//扫描准备
-                //                    String source = (String) map.get(SystemConstant.SOURCE);
-                //                    if (Objects.nonNull(source) && !Objects.equals(source, "save")) {
-                //                        tbSopInfoService.sopDeviceInOutSave(map, 4);
-                //                    }
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.SCAN_START_TIME.getKey());
-                //                    execField = ProcessLimitedEnum.SCAN_START_TIME.getKey();
-                //                } else if (tfFlowApprove.getSetup().intValue() == 7) {//校验收尾
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.SCAN_END_TIME.getKey());
-                //                    execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
-                //                } else if (tfFlowApprove.getSetup().intValue() == 8) {//设备入库登记
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                //                    String source = (String) map.get(SystemConstant.SOURCE);
-                //                    //审批过程中,如果外包服务范围为"仅扫描",则释放实施工程师资源,后续有区域协调人兼任
-                //                    if (Objects.nonNull(source) && Objects.equals(source, "sopApprove")) {
-                //                        List<FlowFormWidgetResult> formProperty = flowTaskResult.getFormProperty();
-                //                        Long engineerUserId = null;
-                //                        for (FlowFormWidgetResult f : formProperty) {
-                //                            if (f.getFormId().contains(SystemConstant.THIRD_SERVICE_REGION_CB) && Objects.nonNull(
-                //                                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
-                //                                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-                //                                String value = jsonObject.getString(SystemConstant.VALUE);
-                //                                if (Objects.nonNull(value) && Objects.nonNull(sopId) && value.equals("SCAN")) {
-                //                                    TBSopInfoDetail tbSopInfoDetail = tbSopInfoDetailService.getOne(
-                //                                            new QueryWrapper<TBSopInfoDetail>().lambda()
-                //                                                    .eq(TBSopInfoDetail::getSopInfoId, sopId));
-                //                                    engineerUserId = tbSopInfoDetail.getEngineerUserId();
-                //                                    tbSopInfoDetail.setAfterRegionToEnginess(true);
-                //                                    tbSopInfoDetailService.updateById(tbSopInfoDetail);
-                //                                    break;
-                //                                }
-                //                            }
-                //                        }
-                //                        if (Objects.nonNull(engineerUserId)) {
-                //                            List<Map<String, Object>> sopPassageMap = this.findSopPassage(null);
-                //                            if (!CollectionUtils.isEmpty(sopPassageMap)) {
-                //                                for (Map m : sopPassageMap) {
-                //                                    String engineerUserStr =
-                //                                            Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ?
-                //                                                    m.get("engineerUserIds").toString() :
-                //                                                    null;
-                //                                    if (Objects.nonNull(engineerUserStr)) {
-                //                                        String[] strs = engineerUserStr.split(",");
-                //                                        Set<String> set = new HashSet<>(Arrays.asList(strs));
-                //                                        if (!set.contains(engineerUserId)) {
-                //                                            TBUserArchives tbUserArchives = tbUserArchivesService.findByUserId(
-                //                                                    engineerUserId);
-                //                                            if (Objects.nonNull(tbUserArchives)) {
-                //                                                tbUserArchives.setStatus(UserArchivesStatusEnum.FREE);
-                //                                                tbUserArchives.updateInfo(sysUser.getId());
-                //                                                tbUserArchivesService.updateById(tbUserArchives);
-                //                                            }
-                //                                        }
-                //                                        break;
-                //                                    }
-                //                                }
-                //                            }
-                //                        }
-                //                    }
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
-                //                    execField = ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey();
-                //                } else if (tfFlowApprove.getSetup().intValue() == 9) {//评卷准备
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.MARK_START_TIME.getKey());
-                //                    execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
-                //                } else if (tfFlowApprove.getSetup().intValue() == 10) {//评卷收尾
-                //                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                //                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                //                            ProcessLimitedEnum.MARK_END_TIME.getKey());
-                //                    execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
-                //                }
             } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop
-                if (tfFlowApprove.getSetup().intValue() == 2) {//项目关键信息
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey());
-                    execField = ProcessLimitedEnum.PROJECT_KEY_INFO_DATE.getKey();
-                    tbSopInfoService.saveSopPlanDate(flowTaskResult, sopId, tfCustomFlowEntity.getFlowId(),
-                            sysUser.getId(), tfCustomFlow.getType());
-                } else if (tfFlowApprove.getSetup().intValue() == 3) {//内审
-                    processLimitedTime = tfFlowApprove.getUpdateTime();
-                    execField = ProcessLimitedEnum.APPROVE_RADIO.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 5) {//现场环境测试/环境部署时间
-                    String source = (String) map.get(SystemConstant.SOURCE);
-                    if (Objects.nonNull(source) && !Objects.equals(source, "save")) {
-                        tbSopInfoService.sopDeviceInOutSave(map, 4);
-                    }
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.ENV_DEPLOYMENT_TIME.getKey());
-                    execField = ProcessLimitedEnum.ENV_DEPLOYMENT_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 6) {//扫描准备
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_START_TIME.getKey();
-
-                    //现场环境测试后,设备发货管理里的设备通过序列号匹配更新为签收
-                    FlowTaskResult flowTaskResultDeviceOut = this.getFormProperties(tfCustomFlowEntity, 4);
-                    tbDeviceDeliveryService.updateStatusBySop(flowTaskResultDeviceOut, DeviceDeliveryStatusEnum.RECEIVE,
-                            sysUser.getId());
-                } else if (tfFlowApprove.getSetup().intValue() == 7) {//校验收尾
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SCAN_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 8) {//评卷准备
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_START_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 9) {//成绩复核
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.MARK_END_TIME.getKey());
-                    execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 11) {//设备入库登记
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult,
-                            ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
-                    execField = ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey();
-                }
+
             }
             if (Objects.nonNull(execField)) {
                 for (Task task : taskList) {
@@ -1349,67 +852,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 }
             }
         }
-        //        else if (tfFlowApprove.getStatus() == FlowStatusEnum.FINISH) {
-        //            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop
-        //                tbSopInfoService.sopDeviceInOutSave(map, 10);
-        //            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop
-        //                tbSopInfoService.sopDeviceInOutSave(map, 11);
-        //            }
-        //        }
-    }
-
-    /**
-     * sop保存设备信息
-     *
-     * @param map
-     * @param setup
-     * @throws InterruptedException
-     */
-    @Override
-    @Transactional
-    public void sopDeviceInOutSave(Map<String, Object> map, Integer setup) throws InterruptedException {
-        TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
-        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
-
-        FlowTaskResult flowTaskResultDeviceTable = this.getFormProperties(tfCustomFlowEntity, setup);
-        if (Objects.nonNull(flowTaskResultDeviceTable)) {
-            CrmProjectResult crmProjectResult = (CrmProjectResult) map.get(SystemConstant.CRM_INFO);
-            List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResultDeviceTable.getFormProperty();
-            List<DeviceInOutForm> deviceInOutFormList = new ArrayList<>();
-            InOutTypeEnum type = null;
-            Long deviceInOutTime = null;
-            for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                if ((f.getFormId().contains(SystemConstant.DEVICE_OUT_TIME) || f.getFormId()
-                        .contains(SystemConstant.DEVICE_IN_TIME)) && Objects.nonNull(f.getValue()) && !Objects.equals(
-                        f.getValue(), "{\"value\":null}")) {
-                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-                    String value = jsonObject.getString(SystemConstant.VALUE);
-                    deviceInOutTime = Long.parseLong(value);
-                    type = f.getFormId().contains(SystemConstant.DEVICE_OUT_TIME) ?
-                            InOutTypeEnum.OUT :
-                            InOutTypeEnum.IN;
-                } else if ((f.getFormId().contains(SystemConstant.DEVICE_OUT_TABLE) || f.getFormId()
-                        .contains(SystemConstant.DEVICE_IN_TABLE)) && Objects.nonNull(f.getValue()) && !Objects.equals(
-                        f.getValue(), "{\"value\":null}")) {
-                    if (Objects.isNull(type)) {
-                        type = f.getFormId().contains(SystemConstant.DEVICE_OUT_TABLE) ?
-                                InOutTypeEnum.OUT :
-                                InOutTypeEnum.IN;
-                    }
-                    JSONObject jsonObject = JSONObject.parseObject(f.getValue());
-                    JSONArray jsonArray = jsonObject.getJSONArray(SystemConstant.VALUE);
-                    for (int i = 0; i < jsonArray.size(); i++) {
-                        deviceInOutFormList.add(
-                                GsonUtil.fromJson(GsonUtil.toJson(jsonArray.getJSONObject(i)), DeviceInOutForm.class));
-                    }
-                }
-            }
-            if (!CollectionUtils.isEmpty(deviceInOutFormList)) {
-                tbDeviceInOutService.deviceInOutSubmit(
-                        new DeviceInOutSubmitParam(crmProjectResult.getServiceUnitId(), tfCustomFlowEntity.getCrmNo(),
-                                tfCustomFlowEntity.getCode(), deviceInOutTime, type, true, deviceInOutFormList));
-            }
-        }
     }
 
     /**
@@ -1526,19 +968,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             map.put(SystemConstant.SOURCE, "save");
             tbSopInfoService.saveJobRemind(map);
 
-            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
-                    && tfFlowApprove.getSetup().intValue() >= 4) {
-                tbSopInfoService.sopDeviceInOutSave(map, 4);
-            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
-                    && tfFlowApprove.getSetup().intValue() >= 4) {
-                tbSopInfoService.sopDeviceInOutSave(map, 4);
-                if (tfFlowApprove.getSetup().intValue() > 5) {
-                    FlowTaskResult flowTaskResultDeviceOut = this.getFormProperties(tfCustomFlowEntity, 4);
-                    tbDeviceDeliveryService.updateStatusBySop(flowTaskResultDeviceOut, DeviceDeliveryStatusEnum.RECEIVE,
-                            sysUser.getId());
-                }
-            }
-
             FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
             tbSopInfoService.saveSopPlanDate(flowTaskResult, tbSopInfo.getId(), tfCustomFlowEntity.getFlowId(),
                     sysUser.getId(), tfCustomFlow.getType());
@@ -1554,22 +983,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         return tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
     }
 
-    @Override
-    public List<SysUser> userList(Long id) {
-        return this.baseMapper.userList(id);
-    }
-
-    /**
-     * 根据服务单元查找在途的区域协调人、实施工程师、助理工程师
-     *
-     * @param serviceId
-     * @return
-     */
-    @Override
-    public List<Map<String, Object>> findSopPassage(Long serviceId) {
-        return this.baseMapper.findSopPassage(serviceId);
-    }
-
     /**
      * 获取表单内容
      *
@@ -1670,48 +1083,20 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      * @return
      */
     @Override
-    public List<String> findFlowPassageByCrmNo(String crmNo, Long requestUserId) {
+    public List<String> findFlowPassageByCrmNo(String crmNo) {
         Optional.ofNullable(crmNo).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
-        SysUser sysUser = sysUserService.getById(requestUserId);
-        List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
-        RoleTypeEnum roleTypeEnum = null;
-        if (!CollectionUtils.isEmpty(sysRoleList)) {
-            for (SysRole sysRole : sysRoleList) {
-                if (sysRole.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-                    roleTypeEnum = sysRole.getType();
-                    break;
-                } else if (sysRole.getType() == RoleTypeEnum.ASSISTANT_ENGINEER) {
-                    roleTypeEnum = sysRole.getType();
-                }
-            }
-        }
-        return this.baseMapper.findFlowPassageByCrmNo(crmNo, sysUser.getId(),
-                Objects.nonNull(roleTypeEnum) ? roleTypeEnum.name() : null);
+        return this.baseMapper.findFlowPassageByCrmNo(crmNo);
     }
 
     /**
-     * 根据serviceId和userId查询所有sop信息
+     * 根据serviceId查询所有sop信息
      *
      * @param serviceId
-     * @param userId
      * @return
      */
     @Override
-    public List<SopInfoResult> findFlowByServiceId(Long serviceId, Long userId) {
-        Optional.ofNullable(userId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("用户id不能为空"));
-        List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(userId);
-        RoleTypeEnum roleTypeEnum = null;
-        if (!CollectionUtils.isEmpty(sysRoleList)) {
-            for (SysRole sysRole : sysRoleList) {
-                if (sysRole.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-                    roleTypeEnum = sysRole.getType();
-                    break;
-                } else if (sysRole.getType() == RoleTypeEnum.ASSISTANT_ENGINEER) {
-                    roleTypeEnum = sysRole.getType();
-                }
-            }
-        }
-        return this.baseMapper.findFlowByServiceId(serviceId, userId,
-                Objects.nonNull(roleTypeEnum) ? roleTypeEnum.name() : null);
+    public List<SopInfoResult> findFlowByServiceId(Long serviceId) {
+        Objects.requireNonNull(serviceId, "服务单元id不能为空");
+        return this.baseMapper.findFlowByServiceId(serviceId);
     }
 }

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

@@ -414,7 +414,7 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
                     throw ExceptionResultEnum.ERROR.exception(String.format("[%s]的认证状态为有效,不能作废", userArchivesResult.getName()));
                 }
                 // 作废校验2 - 没有进行中的SOP
-                List<SopInfoResult> sopInfoResultList = tbSopInfoService.findFlowByServiceId(null, userArchivesResult.getUserId());
+                List<SopInfoResult> sopInfoResultList = tbSopInfoService.findFlowByServiceId(null);
                 if (CollectionUtils.isNotEmpty(sopInfoResultList)) {
                     throw ExceptionResultEnum.ERROR.exception("该用户存在正在进行的SOP不能作废");
                 }

+ 4 - 4
sop-business/src/main/resources/mapper/QualityAnalyseMapper.xml

@@ -30,7 +30,7 @@
         FROM
         t_b_quality_problem_apply a
         LEFT JOIN t_b_sop_info si ON si.sop_no = a.sop_no
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
         left join t_b_crm c on c.crm_no=si.crm_no
         LEFT JOIN sys_user u ON u.id = c.region_coordinator_id
         LEFT JOIN t_b_user_archives ua ON ua.mobile_number = u.mobile_number
@@ -58,7 +58,7 @@
         FROM
         t_b_quality_problem_apply a
         LEFT JOIN t_b_sop_info si ON si.sop_no = a.sop_no
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
         left join t_b_crm c on c.crm_no=si.crm_no
         left join t_b_service_region r on r.id=c.region_id
         LEFT JOIN sys_user u ON u.id = c.region_coordinator_id
@@ -103,7 +103,7 @@
         FROM
         t_b_quality_problem_apply a
         LEFT JOIN t_b_sop_info si on si.sop_no = a.sop_no
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
         left join t_b_crm c on c.crm_no=si.crm_no
         LEFT JOIN sys_user u ON u.id = c.region_coordinator_id
         LEFT JOIN t_b_user_archives ua ON ua.mobile_number = u.mobile_number
@@ -185,7 +185,7 @@
         LEFT JOIN t_b_sop_info si ON si.sop_no = a.sop_no
         LEFT JOIN t_f_custom_flow_entity fe ON fe.`code` = a.problem_no
         LEFT JOIN t_f_flow_approve fa ON fa.flow_id = fe.flow_id
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = si.id
         left join t_b_crm c on c.crm_no=si.crm_no
         left join t_b_service_region r on r.id=c.region_id
         LEFT JOIN sys_user u ON u.id = c.region_coordinator_id

+ 3 - 3
sop-business/src/main/resources/mapper/SopAnalyseMapper.xml

@@ -46,7 +46,7 @@
         left join t_b_service_region r on r.id=c.region_id
         LEFT join t_f_custom_flow_entity tfcfe on tfcfe.code = s.sop_no
         LEFT join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
         <if test="type != null and type != ''">
             <choose>
                 <when test="type == 'CRM' or type == 'SUPPLIER'">
@@ -103,7 +103,7 @@
         FROM
         t_b_sop_info s
         left join t_b_crm c on c.crm_no=s.crm_no
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
         LEFT JOIN sys_user u ON u.id = c.region_coordinator_id
         LEFT JOIN t_b_user_archives ua ON ua.mobile_number = u.mobile_number
         LEFT JOIN t_b_user_archives_supplier us ON us.user_archives_id = ua.id
@@ -138,7 +138,7 @@
         t_b_sop_info s
         left join t_b_crm c on c.crm_no=s.crm_no
         left join t_b_service_region r on r.id=c.region_id
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = s.id
         <if test="type != null and type != ''">
             <choose>
                 <when test="type == 'CRM' or type == 'SUPPLIER'">

+ 2 - 2
sop-business/src/main/resources/mapper/SopScheduleMapper.xml

@@ -12,8 +12,8 @@
         tffa.status,
         tffa.setup
         FROM t_b_sop_info tbsi
-        LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = tbsi.id
-        LEFT JOIN sys_user su2 on su2.id = sd.engineer_user_id
+--         LEFT JOIN t_b_sop_info_detail sd ON sd.sop_info_id = tbsi.id
+--         LEFT JOIN sys_user su2 on su2.id = sd.engineer_user_id
         LEFT JOIN sys_custom sc ON sc.id = tbsi.custom_id
         LEFT JOIN t_b_user_archives_allocation tbuaa on tbuaa.crm_no = tbsi.crm_no
         LEFT JOIN t_f_custom_flow_entity tfcfe ON tfcfe.CODE = tbsi.sop_no

+ 0 - 5
sop-business/src/main/resources/mapper/TBSopInfoDetailMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qmth.sop.business.mapper.TBSopInfoDetailMapper">
-
-</mapper>

+ 7 - 87
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -164,20 +164,9 @@
             tbsi.sop_no
         from
             t_b_sop_info tbsi
-                join t_b_sop_info_detail tbsid on tbsid.sop_info_id = tbsi.id
-                join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
-                join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+            join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+            join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
         <where> 1 = 1
-            <if test="userId != null and userId != ''">
-                <choose>
-                    <when test="roleType != null and roleType != '' and roleType == 'EFFECT_ENGINEER'">
-                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId} and tbsid.after_region_to_enginess = 0)
-                    </when>
-                    <otherwise>
-                        and (tbsid.assistant_engineer_user_ids is not null and FIND_IN_SET(#{userId},tbsid.assistant_engineer_user_ids))
-                    </otherwise>
-                </choose>
-            </if>
             <if test="crmNo != null and crmNo != ''">
                 and tbsi.crm_no = #{crmNo}
             </if>
@@ -198,23 +187,12 @@
             tbs.name as serviceName
         from
             t_b_sop_info tbsi
-        left join t_b_sop_info_detail tbsid on tbsid.sop_info_id = tbsi.id
-        left join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
-        left join sys_custom sc on sc.id = tbsi.custom_id
-        left join t_b_service tbs on tbs.id = tbsi.service_id
-        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
-        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+            left join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
+            left join sys_custom sc on sc.id = tbsi.custom_id
+            left join t_b_service tbs on tbs.id = tbsi.service_id
+            left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+            left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
         <where>
-            <if test="userId != null and userId != ''">
-                <choose>
-                    <when test="roleType != null and roleType != '' and roleType == 'EFFECT_ENGINEER'">
-                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId} and tbsid.after_region_to_enginess = 0)
-                    </when>
-                    <otherwise>
-                        and (tbsid.assistant_engineer_user_ids is not null and FIND_IN_SET(#{userId},tbsid.assistant_engineer_user_ids))
-                    </otherwise>
-                </choose>
-            </if>
             <if test="serviceId != null and serviceId != ''">
                 and tbsi.service_id = #{serviceId}
             </if>
@@ -222,62 +200,4 @@
                 and tffa.status not in('END')
         </where>
     </select>
-
-    <select id="userList" resultType="com.qmth.sop.business.entity.SysUser">
-        SELECT *  FROM sys_user  WHERE
-        id IN (
-        SELECT a.lead_id  FROM t_b_sop_info_detail a  WHERE a.sop_info_id = #{id}
-        UNION ALL
-        SELECT a.region_user_id  FROM t_b_sop_info_detail a  WHERE a.sop_info_id = #{id}
-        UNION ALL
-        SELECT a.engineer_user_id  FROM t_b_sop_info_detail a  WHERE a.sop_info_id = #{id}
-        )
-    </select>
-
-    <select id="findSopPassage" resultType="java.util.Map">
-        select
-        group_concat(distinct t.regionUserIds) as regionUserIds,
-        group_concat(distinct t.engineerUserIds) as engineerUserIds,
-        group_concat(distinct t.assistantEngineerUserIds) as assistantEngineerUserIds
-        from
-        (select
-            group_concat(distinct tbsid.region_user_id) as regionUserIds,
-            group_concat(distinct tbsid.engineer_user_id) as engineerUserIds,
-            group_concat(distinct tbsid.assistant_engineer_user_ids) as assistantEngineerUserIds
-        from t_b_sop_info_detail tbsid
-        where
-        exists(
-        select tbsi.id from t_b_sop_info tbsi
-        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
-        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
-        <where> 1 = 1
-        <if test="serviceId != null and serviceId != ''">
-            and tbsi.service_id = #{serviceId}
-        </if>
-            and tbsi.status = 'START'
-            and tffa.status not in('FINISH', 'END')
-            and tbsid.sop_info_id = tbsi.id
-            and tbsid.after_region_to_enginess = 0
-        </where>)
-        union all
-        select
-            group_concat(distinct tbsid.region_user_id) as regionUserIds,
-            null as engineerUserIds,
-            group_concat(distinct tbsid.assistant_engineer_user_ids) as assistantEngineerUserIds
-        from t_b_sop_info_detail tbsid
-        where
-        exists(
-        select tbsi.id from t_b_sop_info tbsi
-        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
-        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
-        <where> 1 = 1
-        <if test="serviceId != null and serviceId != ''">
-            and tbsi.service_id = #{serviceId}
-        </if>
-            and tbsi.status = 'START'
-            and tffa.status not in('FINISH', 'END')
-            and tbsid.sop_info_id = tbsi.id
-            and tbsid.after_region_to_enginess = 1
-        </where>)) t
-    </select>
 </mapper>

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

@@ -54,17 +54,17 @@ public class SystemConstant {
     public static final String ORG = "org";
     public static final String ORG_ID = "orgId";
     public static final String MD5 = "MD5";
-    public static final String SIGNATURE = "signature";
-    public static final String GET = "get";
+//    public static final String SIGNATURE = "signature";
+//    public static final String GET = "get";
     public static final String GET_UNKNOWN = "?";
     public static final String GET_SYMBOL = "&";
     public static final String GET_EQUAL = "=";
-    public static final String PATH_MATCH = "*";
-    public static final String PATH_SUBSTR = "/#";
-    public static final String METHOD = "post";
+//    public static final String PATH_MATCH = "*";
+//    public static final String PATH_SUBSTR = "/#";
+//    public static final String METHOD = "post";
     public static final String ERROR = "/error";
     public static final String PT = "PT";
-    public static final String USER_DIR = "user.dir";
+//    public static final String USER_DIR = "user.dir";
     public static final String OS_NAME = "os.name";
     public static final String TMP_DIR = "java.io.tmpdir";
     public static final String FILE = "file";
@@ -72,7 +72,7 @@ public class SystemConstant {
     public static final String WINDOWS = "Windows";
     public static final String ORG_SPLIT = "/";
     public static final String HYPHEN = "-";
-    public static final String SYS_ADMIN = "sysadmin";
+//    public static final String SYS_ADMIN = "sysadmin";
     public static final String VERSION_VALUE = "1.0.0.1";
     public static final String PATH = "path";
     public static final String TYPE = "type";
@@ -91,7 +91,7 @@ public class SystemConstant {
     public static final String DEFAULT_DATE_YMD_S_QUERY_PATTERN = "yyyy年-MM月dd日";
     public static final String JSON_PREFIX = ".json";
     public static final String XLSX_PREFIX = ".xlsx";
-    public static final String XLS_PREFIX = "xls";
+//    public static final String XLS_PREFIX = "xls";
     public static final String EXCEL_DATA = "excelData";
     public static final String EXCEL_DATA_ERROR = "excelDataError";
     public static final String EXCEL_ATTACHMENT = "excelAttachment";
@@ -170,7 +170,7 @@ public class SystemConstant {
      */
     public static final String REGULAR_EXPRESSION_OF_PHONE = "((\\d{3,4})|(\\(\\d{3,4}\\)-))?\\d{7,8}";
     // 有效邮箱校验表达式
-    public static final String EMAIL_REGEX = "^[A-Za-z0-9]+([._%+-][A-Za-z0-9]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
+//    public static final String EMAIL_REGEX = "^[A-Za-z0-9]+([._%+-][A-Za-z0-9]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
 
     /**
      * 系统配置
@@ -179,7 +179,7 @@ public class SystemConstant {
     //    public static final String SYS_MESSAGE_ENABLE = "sys.message.enable";
 //    public static final String SYS_MESSAGE_RESEND_COUNT = "sys.message.resendCount";
     public static final String SYS_CONFIG_KEY_CHARSETS = "sys.txt.charset";
-    public static final String ADMIN_LOGO_URL = "admin.logo.url";
+//    public static final String ADMIN_LOGO_URL = "admin.logo.url";
     public static final String ATTACHMENT_TYPE = "attachment.type";
     public static final String ATTACHMENT_LENGTH = "attachment.length";
     public static final String ATTACHMENT_SIZE = "attachment.size";
@@ -301,7 +301,7 @@ public class SystemConstant {
 
     public static final int DEFAULT_SESSION_EXPIRE = 1;//过期时间1天
     public static final long DEFAULT_EXPIRE_TIME = 24 * 60L * 60L;//过期时间24小时
-    public static final long THIRD_USER_AUTH_EXPIRE_TIME = 2 * 60L;//过期时间2分钟
+//    public static final long THIRD_USER_AUTH_EXPIRE_TIME = 2 * 60L;//过期时间2分钟
 
     /**
      * http设置
@@ -472,17 +472,17 @@ public class SystemConstant {
         return newDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
     }
 
-    /**
-     * 时间相减
-     *
-     * @param duration
-     * @return
-     */
-    public static Long processMiniuteMinus(Duration duration) {
-        LocalDateTime nowTime = LocalDateTime.now();
-        LocalDateTime newDateTime = nowTime.minus(duration);
-        return newDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
-    }
+//    /**
+//     * 时间相减
+//     *
+//     * @param duration
+//     * @return
+//     */
+//    public static Long processMiniuteMinus(Duration duration) {
+//        LocalDateTime nowTime = LocalDateTime.now();
+//        LocalDateTime newDateTime = nowTime.minus(duration);
+//        return newDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
+//    }
 
     /**
      * 指定时间相加