瀏覽代碼

新增sop快捷搜索

wangliang 1 年之前
父節點
當前提交
9a97403331

+ 3 - 5
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -3,9 +3,9 @@ package com.qmth.sop.server.api;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.activiti.service.ActivitiService;
 import com.qmth.sop.business.bean.params.FlowApproveParam;
+import com.qmth.sop.business.bean.params.SopAllocationParam;
 import com.qmth.sop.business.bean.params.SopInfoListParam;
 import com.qmth.sop.business.bean.params.SopSaveParam;
-import com.qmth.sop.business.bean.params.UserArchivesAllocationParam;
 import com.qmth.sop.business.bean.result.FlowResult;
 import com.qmth.sop.business.bean.result.FormWidgetMetadataResult;
 import com.qmth.sop.business.entity.SysUser;
@@ -112,13 +112,11 @@ public class TBSopInfoController {
     @ApiOperation(value = "sop人员配置")
     @RequestMapping(value = "/allocation", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
-    public Result allocation(@Valid @RequestBody UserArchivesAllocationParam userArchivesAllocationParam,
-            BindingResult bindingResult) {
-        //        tbSopInfoService.sopAllocation(flowId)
+    public Result allocation(@Valid @RequestBody SopAllocationParam sopAllocationParam, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }
-        return ResultUtil.ok();
+        return ResultUtil.ok(tbSopInfoService.sopAllocation(sopAllocationParam));
     }
 
     @ApiOperation(value = "sop删除")

+ 15 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/AllocationParam.java

@@ -30,6 +30,21 @@ public class AllocationParam {
     @ApiModelProperty("备注(为同批次新增全部人员赋值备注信息)")
     private String remark;
 
+    public AllocationParam() {
+
+    }
+
+    public AllocationParam(SopRoleTypeEnum sopRoleType, List<Long> archivesIdList, String remark) {
+        this.sopRoleType = sopRoleType;
+        this.archivesIdList = archivesIdList;
+        this.remark = remark;
+    }
+
+    public AllocationParam(SopRoleTypeEnum sopRoleType, List<Long> archivesIdList) {
+        this.sopRoleType = sopRoleType;
+        this.archivesIdList = archivesIdList;
+    }
+
     public SopRoleTypeEnum getSopRoleType() {
         return sopRoleType;
     }

+ 8 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/SopAllocationParam.java

@@ -21,6 +21,14 @@ public class SopAllocationParam extends UserArchivesAllocationParam implements S
     @NotNull(message = "流程id不能为空")
     private Long flowId;
 
+    public SopAllocationParam() {
+
+    }
+
+    public SopAllocationParam(UserArchivesAllocationParam userArchivesAllocationParam) {
+        super(userArchivesAllocationParam);
+    }
+
     public Long getFlowId() {
         return flowId;
     }

+ 14 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/UserArchivesAllocationParam.java

@@ -25,6 +25,20 @@ public class UserArchivesAllocationParam implements Serializable {
     @Range(min = 1L, message = "请提供服务单元id")
     private Long crmDetailId;
 
+    public UserArchivesAllocationParam() {
+
+    }
+
+    public UserArchivesAllocationParam(List<AllocationParam> allocationParams, Long crmDetailId) {
+        this.allocationParams = allocationParams;
+        this.crmDetailId = crmDetailId;
+    }
+
+    public UserArchivesAllocationParam(UserArchivesAllocationParam userArchivesAllocationParam) {
+        this.allocationParams = userArchivesAllocationParam.getAllocationParams();
+        this.crmDetailId = userArchivesAllocationParam.getCrmDetailId();
+    }
+
     public List<AllocationParam> getAllocationParams() {
         return allocationParams;
     }

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

@@ -2,10 +2,7 @@ package com.qmth.sop.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.sop.business.bean.params.FlowApproveParam;
-import com.qmth.sop.business.bean.params.SopInfoListParam;
-import com.qmth.sop.business.bean.params.SopPublishParam;
-import com.qmth.sop.business.bean.params.SopSaveParam;
+import com.qmth.sop.business.bean.params.*;
 import com.qmth.sop.business.bean.result.CrmProjectResult;
 import com.qmth.sop.business.bean.result.FlowResult;
 import com.qmth.sop.business.bean.result.FlowTaskResult;
@@ -161,9 +158,10 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      * sop转审
      *
      * @param crmDetailId
+     * @param sopAllocationParam
      * @return
      */
-    Boolean sopApproverExchange(Long crmDetailId) throws InterruptedException;
+    Boolean sopApproverExchange(Long crmDetailId, SopAllocationParam sopAllocationParam) throws InterruptedException;
 
     /**
      * 查询sop状态
@@ -176,19 +174,20 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
     /**
      * sop人员配置
      *
-     * @param flowId
+     * @param sopAllocationParam
      * @return
      */
-    Boolean sopAllocation(Long flowId);
+    Boolean sopAllocation(SopAllocationParam sopAllocationParam) throws InterruptedException;
 
     /**
      * 修改流程第一步
      *
      * @param flowId
      * @param crmDetailId
+     * @param engineerUserIdList
      * @return
      */
-    Boolean updateFlowSetupOne(Long flowId, Long crmDetailId);
+    Boolean updateFlowSetupOne(Long flowId, Long crmDetailId, List<String> engineerUserIdList);
 
     /**
      * 查询服务范围

+ 75 - 40
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -107,6 +107,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Resource
     MemoryLock memoryLock;
 
+    @Resource
+    TBUserArchivesAllocationService tbUserArchivesAllocationService;
+
     /**
      * 查询动态sop表名是否存在
      *
@@ -377,12 +380,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      * sop转审
      *
      * @param crmDetailId
+     * @param sopAllocationParam
      * @return
      * @throws InterruptedException
      */
     @Override
     @Transactional
-    public Boolean sopApproverExchange(Long crmDetailId) throws InterruptedException {
+    public Boolean sopApproverExchange(Long crmDetailId, SopAllocationParam sopAllocationParam)
+            throws InterruptedException {
         TBCrmDetail tbCrmDetail = tbCrmDetailService.getById(crmDetailId);
         Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
 
@@ -403,16 +408,20 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
             Task task = taskService.createTaskQuery().processInstanceId(tfCustomFlowEntity.getFlowId().toString())
                     .singleResult();
-            Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
-            //todo 需要调曹子轩人员配置方法,项目经理变更后调用转审
-            CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
-                    crmDetailId, tfCustomFlowEntity.getCrmNo());
-            Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
-            if (!CollectionUtils.isEmpty(crmProjectResult.getProjectManagerList())) {
-                activitiService.taskApproverExchange(crmProjectResult.getProjectManagerList().get(0).getUserId(),
-                        Long.parseLong(task.getId()));
-                //修改流程one里面的工程师
-                tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId());
+            List<AllocationParam> allocationParamList = sopAllocationParam.getAllocationParams();
+            if (!CollectionUtils.isEmpty(allocationParamList)) {
+                for (AllocationParam a : allocationParamList) {
+                    if (a.getSopRoleType() == SopRoleTypeEnum.PROJECT_MANAGER) {
+                        activitiService.taskApproverExchange(a.getArchivesIdList().get(0),
+                                Long.parseLong(task.getId()));
+                    } else if (a.getSopRoleType() == SopRoleTypeEnum.ENGINEER) {
+                        //修改流程one里面的工程师
+                        List<String> engineerUserIdList = a.getArchivesIdList().stream().map(s -> s.toString())
+                                .collect(Collectors.toList());
+                        tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId(),
+                                engineerUserIdList);
+                    }
+                }
             }
         }
         return true;
@@ -434,14 +443,15 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     /**
      * sop人员配置
      *
-     * @param flowId
+     * @param sopAllocationParam
      * @return
      */
     @Override
     @Transactional
-    public Boolean sopAllocation(Long flowId) {
+    public Boolean sopAllocation(SopAllocationParam sopAllocationParam) throws InterruptedException {
         TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
-                new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
+                new QueryWrapper<TFCustomFlowEntity>().lambda()
+                        .eq(TFCustomFlowEntity::getFlowId, sopAllocationParam.getFlowId()));
         Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
@@ -449,17 +459,24 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (Objects.nonNull(flowStatus) && (flowStatus == FlowStatusEnum.FINISH || flowStatus == FlowStatusEnum.END)) {
             throw ExceptionResultEnum.ERROR.exception("流程已结束,无法分配人员");
         }
-        Task task = taskService.createTaskQuery().processInstanceId(flowId.toString()).singleResult();
+        Task task = taskService.createTaskQuery().processInstanceId(sopAllocationParam.getFlowId().toString())
+                .singleResult();
         Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
-        //todo 需要调曹子轩人员配置方法,项目经理变更后调用转审
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
-                tbCrmDetail.getId(), tfCustomFlowEntity.getCrmNo());
-        Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
-        if (!CollectionUtils.isEmpty(crmProjectResult.getProjectManagerList())) {
-            activitiService.taskApproverExchange(crmProjectResult.getProjectManagerList().get(0).getUserId(),
-                    Long.parseLong(task.getId()));
-            //修改流程one里面的工程师
-            tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId());
+
+        List<AllocationParam> allocationParamList = sopAllocationParam.getAllocationParams();
+        if (!CollectionUtils.isEmpty(allocationParamList)) {
+            for (AllocationParam a : allocationParamList) {
+                if (a.getSopRoleType() == SopRoleTypeEnum.PROJECT_MANAGER) {
+                    activitiService.taskApproverExchange(a.getArchivesIdList().get(0), Long.parseLong(task.getId()));
+                } else if (a.getSopRoleType() == SopRoleTypeEnum.ENGINEER) {
+                    //修改流程one里面的工程师
+                    List<String> engineerUserIdList = a.getArchivesIdList().stream().map(s -> s.toString())
+                            .collect(Collectors.toList());
+                    tbSopInfoService.updateFlowSetupOne(tfCustomFlowEntity.getFlowId(), tbCrmDetail.getId(),
+                            engineerUserIdList);
+                }
+            }
+            tbUserArchivesAllocationService.editCrmAllocation(new UserArchivesAllocationParam(sopAllocationParam));
         }
         return true;
     }
@@ -469,11 +486,12 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      *
      * @param flowId
      * @param crmDetailId
+     * @param engineerUserIdList
      * @return
      */
     @Override
     @Transactional
-    public Boolean updateFlowSetupOne(Long flowId, Long crmDetailId) {
+    public Boolean updateFlowSetupOne(Long flowId, Long crmDetailId, List<String> engineerUserIdList) {
         boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_PROPERTIES_PREFIX + crmDetailId, crmDetailId,
                 SystemConstant.LOCK_FLOW_TIME_OUT);
         if (!lock) {
@@ -489,19 +507,31 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
             FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
             if (flowTaskResult.getSetup() > 0) {
-                CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
-                        crmDetailId, tfCustomFlowEntity.getCrmNo());
-                Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
                 List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
-                for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                    if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey())) {
-                        List<String> list = new ArrayList<>(crmProjectResult.getEngineerList().size());
-                        crmProjectResult.getEngineerList().stream().peek(s -> list.add(s.getUserId().toString()))
-                                .collect(Collectors.toList());
-                        JSONObject jsonObject = new JSONObject();
-                        jsonObject.put(SystemConstant.VALUE, list);
-                        f.setValue(jsonObject.toJSONString());
-                        break;
+                if (!CollectionUtils.isEmpty(engineerUserIdList)) {
+                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+                        if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey())) {
+                            JSONObject jsonObject = new JSONObject();
+                            jsonObject.put(SystemConstant.VALUE, engineerUserIdList);
+                            f.setValue(jsonObject.toJSONString());
+                            break;
+                        }
+                    }
+                } else {
+                    CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
+                            crmDetailId, tfCustomFlowEntity.getCrmNo());
+                    Optional.ofNullable(crmProjectResult)
+                            .orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
+                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+                        if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey())) {
+                            List<String> list = new ArrayList<>(crmProjectResult.getEngineerList().size());
+                            crmProjectResult.getEngineerList().stream().peek(s -> list.add(s.getUserId().toString()))
+                                    .collect(Collectors.toList());
+                            JSONObject jsonObject = new JSONObject();
+                            jsonObject.put(SystemConstant.VALUE, list);
+                            f.setValue(jsonObject.toJSONString());
+                            break;
+                        }
                     }
                 }
             }
@@ -583,7 +613,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             FlowTaskResult currFlowTaskResult = JSONObject.parseObject(flowApproveParam.getFormProperties(),
                     FlowTaskResult.class);
             List<String> approveUserIds = this.getNextApproveUserIds(tfCustomFlow.getType(), flowTaskResultOne,
-                    currFlowTaskResult, crmProjectResult);
+                    currFlowTaskResult, crmProjectResult, tbCrmDetail.getId());
             flowApproveParam.setApproveUserIds(approveUserIds);
         }
 
@@ -880,10 +910,11 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      * @param type
      * @param flowTaskResult
      * @param crmProjectResult
+     * @param crmDetailId
      * @return
      */
     public List<String> getNextApproveUserIds(TFCustomTypeEnum type, FlowTaskResult flowTaskResult,
-            FlowTaskResult currFlowTaskResult, CrmProjectResult crmProjectResult) {
+            FlowTaskResult currFlowTaskResult, CrmProjectResult crmProjectResult, Long crmDetailId) {
         List<String> approveUserIds = new ArrayList<>();
         ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(type, flowTaskResult);
         if (type == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop流程待审核人
@@ -897,10 +928,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                         approveUserIds.add(u.getUserId().toString());
                     }
                 } else {
-                    //todo 需要调用曹子轩项目经理变更的方法,并且注释是[系统]
                     Objects.requireNonNull(crmProjectResult.getRegionManagerId(), "未设置大区经理");
                     try {
                         tbUserArchivesService.findByUserId(crmProjectResult.getRegionManagerId());
+                        List<AllocationParam> allocationParams = new ArrayList<>();
+                        allocationParams.add(new AllocationParam(SopRoleTypeEnum.PROJECT_MANAGER,
+                                Arrays.asList(crmProjectResult.getRegionManagerId()), "[系统]"));
+                        tbUserArchivesAllocationService.editCrmAllocation(
+                                new UserArchivesAllocationParam(allocationParams, crmDetailId));
                     } catch (Exception e) {
                         log.error(SystemConstant.LOG_ERROR, e);
                         if (e instanceof ApiException) {

+ 21 - 20
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesAllocationServiceImpl.java

@@ -8,10 +8,7 @@ import com.qmth.sop.business.activiti.service.ActivitiService;
 import com.qmth.sop.business.bean.dto.AllocationDetailDto;
 import com.qmth.sop.business.bean.dto.DataPermissionDto;
 import com.qmth.sop.business.bean.dto.UserArchivesDto;
-import com.qmth.sop.business.bean.params.AllocationParam;
-import com.qmth.sop.business.bean.params.AutoAllocationParam;
-import com.qmth.sop.business.bean.params.SopPublishParam;
-import com.qmth.sop.business.bean.params.UserArchivesAllocationParam;
+import com.qmth.sop.business.bean.params.*;
 import com.qmth.sop.business.bean.result.*;
 import com.qmth.sop.business.entity.*;
 import com.qmth.sop.business.mapper.TBUserArchivesAllocationMapper;
@@ -142,7 +139,8 @@ public class TBUserArchivesAllocationServiceImpl
 
         // 该派单详情全部的人员分配关系
         List<TBUserArchivesAllocation> allocatedDatasource = this.list(
-                new QueryWrapper<TBUserArchivesAllocation>().lambda().eq(TBUserArchivesAllocation::getCrmDetailId, crmDetailId));
+                new QueryWrapper<TBUserArchivesAllocation>().lambda()
+                        .eq(TBUserArchivesAllocation::getCrmDetailId, crmDetailId));
 
         for (AllocationParam allocationParam : allocationParamList) {
             SopRoleTypeEnum sopRoleType = allocationParam.getSopRoleType();
@@ -153,15 +151,17 @@ public class TBUserArchivesAllocationServiceImpl
             List<TBUserArchivesAllocation> allocatedList = allocatedDatasource.stream()
                     .filter(e -> e.getSopRoleType().equals(sopRoleType)).collect(Collectors.toList());
             // 之前已分配的人员档案id集合
-            List<Long> allocatedIdList = allocatedList.stream().map(TBUserArchivesAllocation::getArchivesId).distinct().collect(Collectors.toList());
+            List<Long> allocatedIdList = allocatedList.stream().map(TBUserArchivesAllocation::getArchivesId).distinct()
+                    .collect(Collectors.toList());
 
             // 经过对比要删除的人员档案id集合
-            List<Long> removeList = allocatedIdList.stream().filter(e -> !archivesIdList.contains(e)).distinct().collect(Collectors.toList());
+            List<Long> removeList = allocatedIdList.stream().filter(e -> !archivesIdList.contains(e)).distinct()
+                    .collect(Collectors.toList());
             // 对删除的档案人员添加历史记录 (*发布的才记录历史)
             if (CrmStatusEnum.PUBLISH.equals(crmStatus)) {
                 List<TBUserArchivesAllocationLog> historicList = removeList.stream().flatMap(e -> {
-                    UserArchivesResult userArchivesResult = tbUserArchivesService.findUserArchivesByArchivesIdORUserId(e,
-                            null);
+                    UserArchivesResult userArchivesResult = tbUserArchivesService.findUserArchivesByArchivesIdORUserId(
+                            e, null);
                     TBUserArchivesAllocationLog historic = new TBUserArchivesAllocationLog();
                     historic.setCrmDetailId(crmDetailId);
                     historic.setSopRoleType(sopRoleType);
@@ -180,7 +180,8 @@ public class TBUserArchivesAllocationServiceImpl
                     .eq(TBUserArchivesAllocation::getCrmDetailId, crmDetailId));
 
             // 经过对比要新增的人员档案id集合
-            List<Long> addList = archivesIdList.stream().filter(e -> !allocatedIdList.contains(e)).distinct().collect(Collectors.toList());
+            List<Long> addList = archivesIdList.stream().filter(e -> !allocatedIdList.contains(e)).distinct()
+                    .collect(Collectors.toList());
             List<TBUserArchivesAllocation> addListData = addList.stream().flatMap(e -> {
                 TBUserArchivesAllocation allocation = new TBUserArchivesAllocation();
                 allocation.setCrmDetailId(crmDetailId);
@@ -205,13 +206,10 @@ public class TBUserArchivesAllocationServiceImpl
                 if (sopNo == null || sopNo.length() == 0) {
                     throw ExceptionResultEnum.ERROR.exception("未找到sopNo");
                 }
-                TBSopInfo tbSopInfo = tbSopInfoService.getOne(
-                        new QueryWrapper<TBSopInfo>().lambda().eq(TBSopInfo::getSopNo, sopNo).last(SystemConstant.LIMIT1));
-                if (Objects.isNull(tbSopInfo)) {
-                    throw ExceptionResultEnum.ERROR.exception("未找到sop信息");
-                }
-                if (SopStatusEnum.DRAFT.equals(tbSopInfo.getStatus())) {
-                    tbSopInfoService.sopApproverExchange(crmDetailId);
+                SopStatusEnum sopStatus = tbSopInfoService.findBySopNo(sopNo);
+                if (SopStatusEnum.DRAFT.equals(sopStatus)) {
+                    tbSopInfoService.sopApproverExchange(crmDetailId,
+                            new SopAllocationParam(userArchivesAllocationParam));
                 }
             }
         }
@@ -530,7 +528,8 @@ public class TBUserArchivesAllocationServiceImpl
         List<TBUserArchivesAllocation> allocatedList = this.list(new QueryWrapper<TBUserArchivesAllocation>().lambda()
                 .eq(TBUserArchivesAllocation::getCrmDetailId, crmDetailId)
                 .eq(TBUserArchivesAllocation::getSopRoleType, sopRoleTypeEnum));
-        List<Long> allocatedIdList = allocatedList.stream().map(TBUserArchivesAllocation::getArchivesId).distinct().collect(Collectors.toList());
+        List<Long> allocatedIdList = allocatedList.stream().map(TBUserArchivesAllocation::getArchivesId).distinct()
+                .collect(Collectors.toList());
 
         List<TBUserArchivesAllocation> datasource = this.list();
         List<Long> effectArchivesIdList = datasource.stream().map(TBUserArchivesAllocation::getArchivesId)
@@ -568,8 +567,10 @@ public class TBUserArchivesAllocationServiceImpl
         List<UserArchivesDto> enHistoricalList = tbUserArchivesAllocationLogService.findUserArchivesAllocationHistory(
                 crmDetailId, SopRoleTypeEnum.ENGINEER);
 
-        List<UserArchivesDto> rcCanChooseList = this.findCanChooseArchives(crmDetailId, SopRoleTypeEnum.REGION_COORDINATOR);
-        List<UserArchivesDto> pmCanChooseList = this.findCanChooseArchives(crmDetailId, SopRoleTypeEnum.PROJECT_MANAGER);
+        List<UserArchivesDto> rcCanChooseList = this.findCanChooseArchives(crmDetailId,
+                SopRoleTypeEnum.REGION_COORDINATOR);
+        List<UserArchivesDto> pmCanChooseList = this.findCanChooseArchives(crmDetailId,
+                SopRoleTypeEnum.PROJECT_MANAGER);
         List<UserArchivesDto> enCanChooseList = this.findCanChooseArchives(crmDetailId, SopRoleTypeEnum.ENGINEER);
 
         CrmDetailAllocationResult result = new CrmDetailAllocationResult();