Răsfoiți Sursa

sop快捷显示更改

wangliang 1 an în urmă
părinte
comite
b93e87e40f

+ 3 - 2
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -1035,8 +1035,9 @@ public class ActivitiServiceImpl implements ActivitiService {
         CrmProjectResult crmProjectResult = null;
         if (Objects.nonNull(tfCustomFlowEntity.getCrmNo())) {
             TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
-            crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(), tbCrmDetail.getId(),
-                    tfCustomFlowEntity.getCrmNo());
+            crmProjectResult = tbCrmService.findCrmProjectInfo(
+                    Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                    Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tfCustomFlowEntity.getCrmNo());
         }
         return new FlowViewResult(flowId, tfFlowApprove.getStatus(), tfCustomFlowEntity.getCode(), taskIdList,
                 flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList, crmProjectResult,

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

@@ -173,6 +173,7 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
             throw ExceptionResultEnum.SERVICE_DING_GROUP_NO_DATA.exception();
         }
         List<String> userIdList = null;
+
         for (SysDingGroup sysDingGroup : sysDingGroupList) {
             //首选找考勤对象
             List<SysDingObj> sysDingObjList = sysDingObjService.list(
@@ -218,15 +219,17 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
                     }
                 } else if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
                     TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(sopNo);
-                    CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(sopNo, tbCrmDetail.getId(),
-                            tbCrmDetail.getCrmNo());
+                    CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                            Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                            Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tbCrmDetail.getCrmNo());
                     if (Objects.nonNull(crmProjectResult) && Objects.nonNull(crmProjectResult.getRegionManagerId())) {
                         userIdList.addAll(Arrays.asList(String.valueOf(crmProjectResult.getRegionManagerId())));
                     }
                 } else if (s.getType() == RoleTypeEnum.REGION_COORDINATOR) {
                     TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(sopNo);
-                    CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(sopNo, tbCrmDetail.getId(),
-                            tbCrmDetail.getCrmNo());
+                    CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                            Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                            Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tbCrmDetail.getCrmNo());
                     if (Objects.nonNull(crmProjectResult)) {
                         List<UserArchivesDto> regionCoordinatorIdList = crmProjectResult.getRegionCoordinatorList();
                         if (CollectionUtils.isNotEmpty(regionCoordinatorIdList)) {

+ 14 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmDetailServiceImpl.java

@@ -412,9 +412,20 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
      */
     @Override
     public TBCrmDetail findBySopNo(String sopNo) {
-        TBCrmDetail tbCrmDetail = tbCrmDetailService.getOne(
-                new QueryWrapper<TBCrmDetail>().lambda().eq(TBCrmDetail::getSopNo, sopNo));
-        Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
+        TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
+                new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, sopNo));
+        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
+
+        TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
+        Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
+
+        TBCrmDetail tbCrmDetail = null;
+        if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
+                || tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {
+            tbCrmDetail = tbCrmDetailService.getOne(
+                    new QueryWrapper<TBCrmDetail>().lambda().eq(TBCrmDetail::getSopNo, sopNo));
+            Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
+        }
         return tbCrmDetail;
     }
 

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

@@ -106,11 +106,13 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
         if (count == 0) {
             throw ExceptionResultEnum.ERROR.exception("该用户剩余补卡次数为0");
         }
+
         TBCrmDetail tbCrmDetail = null;
         if (Objects.nonNull(sopNo)) {
             tbCrmDetail = tbCrmDetailService.findBySopNo(sopNo);
         }
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(sopNo,
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
                 Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, crmNo);
         Optional.ofNullable(crmProjectResult).orElseThrow(ExceptionResultEnum.CRM_NO_NO_DATA::exception);
 
@@ -353,13 +355,14 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
                 TBUserArchives tbUserArchives = tbUserArchivesService.getOne(new QueryWrapper<TBUserArchives>().lambda()
                         .eq(TBUserArchives::getMobileNumber, sysUser.getMobileNumber()));
 
-                List<SopRoleTypeEnum> roleType = tbUserArchivesAllocationService.findSopRoleTypeByUserSopNo(sysUser.getId(), tbDingApply.getSopNo());
-                if (org.apache.commons.collections4.CollectionUtils.isEmpty(roleType)){
+                List<SopRoleTypeEnum> roleType = tbUserArchivesAllocationService.findSopRoleTypeByUserSopNo(
+                        sysUser.getId(), tbDingApply.getSopNo());
+                if (org.apache.commons.collections4.CollectionUtils.isEmpty(roleType)) {
                     throw ExceptionResultEnum.ERROR.exception("未找到用户在当前sop的身份信息");
                 }
                 tbDing = new TBDing(tbDingApply.getSopNo(), tbDingApply.getCrmNo(), tbCrm.getServiceId(),
-                        tbUserArchives.getId(), JSON.toJSONString(roleType),
-                        sysUser.getId(), tfCustomFlowEntity.getFlowId());
+                        tbUserArchives.getId(), JSON.toJSONString(roleType), sysUser.getId(),
+                        tfCustomFlowEntity.getFlowId());
                 tbDing.setSignDate(
                         DateFormatUtils.format(tbDingApply.getApplyTime(), SystemConstant.DEFAULT_DATE_DAY_PATTERN));
                 tbDing.setSignYear(
@@ -435,8 +438,9 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
         Optional.ofNullable(tbDingApply).orElseThrow(() -> ExceptionResultEnum.DING_APPLY_NO_DATA.exception());
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
-                tbCrmDetail.getId(), tfCustomFlowEntity.getCrmNo());
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tfCustomFlowEntity.getCrmNo());
         Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
         List<UserArchivesDto> regionCoordinatorList = crmProjectResult.getRegionCoordinatorList();
@@ -470,8 +474,9 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
         Optional.ofNullable(tbDingApply).orElseThrow(() -> ExceptionResultEnum.DING_APPLY_NO_DATA.exception());
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tbDingApply.getSopNo());
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tbDingApply.getSopNo(), tbCrmDetail.getId(),
-                tbDingApply.getCrmNo());
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tbDingApply.getCrmNo());
         Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
         TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(

+ 3 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBProjectExchangeServiceImpl.java

@@ -235,8 +235,9 @@ public class TBProjectExchangeServiceImpl extends ServiceImpl<TBProjectExchangeM
                 .orElseThrow(() -> ExceptionResultEnum.PROJECT_EXCHANGE_NO_DATA.exception());
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tbProjectExchange.getSopNo());
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tbProjectExchange.getSopNo(),
-                tbCrmDetail.getId(), tbProjectExchange.getCrmNo());
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tbProjectExchange.getCrmNo());
         Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
         TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(

+ 20 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -446,8 +446,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             if (!CollectionUtils.isEmpty(allocationParamList)) {
                 for (AllocationParam a : allocationParamList) {
                     if (a.getSopRoleType() == SopRoleTypeEnum.PROJECT_MANAGER) {
-                        activitiService.taskApproverExchange(a.getUserIdList().get(0),
-                                Long.parseLong(task.getId()));
+                        activitiService.taskApproverExchange(a.getUserIdList().get(0), Long.parseLong(task.getId()));
                     } else if (a.getSopRoleType() == SopRoleTypeEnum.ENGINEER) {
                         //修改流程one里面的工程师
                         List<String> engineerUserIdList = a.getUserIdList().stream().map(s -> s.toString())
@@ -489,7 +488,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
-        FlowStatusEnum flowStatus = tbCrmDetailService.findById(tbCrmDetail.getId());
+        FlowStatusEnum flowStatus = tbCrmDetailService.findById(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null);
         if (Objects.nonNull(flowStatus) && (flowStatus == FlowStatusEnum.FINISH || flowStatus == FlowStatusEnum.END)) {
             throw ExceptionResultEnum.ERROR.exception("流程已结束,无法分配人员");
         }
@@ -1138,9 +1138,20 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         LinkedHashMap<String, FlowTaskResult> setupMapNew = new LinkedHashMap<>(setupMap.size());
         for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
             if (entry.getValue().getSetup().intValue() > 0) {
-                if (tfFlowApprove.getSetup().intValue() != 0 && tfFlowApprove.getSetup().intValue() <= entry.getValue()
+                if (entry.getValue().getSetup().intValue() == 1 && (tfFlowApprove.getStatus() == FlowStatusEnum.FINISH
+                        || tfFlowApprove.getStatus() == FlowStatusEnum.END)) {
+                    for (FlowFormWidgetResult f : entry.getValue().getFormProperty()) {
+                        if (f.getFormId().contains(ProcessLimitedEnum.SERVICE_SCOPE_RADIO.getKey()) || f.getFormId()
+                                .contains(ProcessLimitedEnum.DEPLOY_WAY_RADIO.getKey()) || f.getFormId()
+                                .contains(ProcessLimitedEnum.MARK_WAY_RADIO.getKey()) || f.getFormId()
+                                .contains(ProcessLimitedEnum.SCAN_NET_RADIO.getKey())) {
+                            f.setReadable(true);
+                            f.setWritable(false);
+                        }
+                    }
+                }
+                if (tfFlowApprove.getSetup().intValue() != 0 && tfFlowApprove.getSetup().intValue() < entry.getValue()
                         .getSetup().intValue()) {
-                    setupMapNew.put(entry.getKey(), entry.getValue());
                     break;
                 } else if (entry.getValue().getSetup().intValue() != tfFlowApprove.getSetup().intValue()) {
                     setupMapNew.put(entry.getKey(), entry.getValue());
@@ -1150,8 +1161,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         flowResultNew.setSetupMap(setupMapNew);
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
-        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
-                tbCrmDetail.getId(), tfCustomFlowEntity.getCrmNo());
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getSopNo() : null,
+                Objects.nonNull(tbCrmDetail) ? tbCrmDetail.getId() : null, tfCustomFlowEntity.getCrmNo());
         Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
         flowResultNew.setCrmInfo(crmProjectResult);
@@ -1203,6 +1215,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(flowResult));
 
         TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
+        Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
         FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
         if (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END) {
             Map<String, Object> map = new HashMap<>();

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

@@ -35,7 +35,13 @@ public enum ProcessLimitedEnum {
 
     MOBILE_NUMBER("mobile_number", "电话"),
 
-    ENGINEER_USERS_ID("engineer_users_id", "工程师");
+    ENGINEER_USERS_ID("engineer_users_id", "工程师"),
+
+    DEPLOY_WAY_RADIO("deploy_way_radio", "部署方式"),
+
+    MARK_WAY_RADIO("mark_way_radio", "阅卷方式"),
+
+    SCAN_NET_RADIO("scan_net_radio", "扫描场地网络情况");
 
     private String key;