Explorar o código

902部门划给977审批

guarantee-lsq hai 2 meses
pai
achega
b621b64f15

+ 1 - 0
platform-common/src/main/java/com/platform/common/enums/DictTypeEnum.java

@@ -49,6 +49,7 @@ public enum DictTypeEnum {
     REMOTE_DEGREE("REMOTE_DEGREE", "设备电度"),
     REMOTE_LINE("REMOTE_LINE", "设备线路"),
     REMOTE_OPC("REMOTE_OPC", "设备OPC"),
+    VERIFY_DEPT_TRANSFER_MAP("VERIFY_DEPT_TRANSFER_MAP","审批部门映射关系"),
     REMOTE_OPC_LINE("REMOTE_OPC", "设备OPC对应车间");
     private final String type;
     private final String typeName;

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/enums/SysConfigEnum.java

@@ -62,6 +62,7 @@ public enum SysConfigEnum {
     YI_BIAO_SB_REPAIR_PROFESSOR("仪表设备维修专业"),
     SUPER_OUT_STORE_DEPT_IDS("不限制领料仓库的部门集合"),
     PREPARATION_SPECIAL_DEPT_IDS("指定某些部门含默认审核主管和部门负责人"),
+    TRANSFER_DEPT_IDS("需要转化的部门ID集合"),
     PREPARATION_SPECIAL_USER_IDS("指定账号ID为默认审核主管和部门负责人");
     private final String typeName;
 

+ 1 - 1
platform-rest/src/main/java/com/platform/rest/controller/store/OutStoreFormController.java

@@ -120,7 +120,7 @@ public class OutStoreFormController {
      * @return R
      */
     @SysLog("修改出库登记单")
-    @PutMapping("/out/{id}")
+        @PutMapping("/out/{id}")
     @PreAuthorize("@pms.hasPermission('store-out-store-forms-edit')")
     public R update(@PathVariable("id") String id) {
         outStoreFormService.updateStore(id);

+ 12 - 0
platform-service/src/main/java/com/platform/service/activiti/strategy/ActivitiAssignStrategyStartUserDeptRole.java

@@ -1,10 +1,14 @@
 package com.platform.service.activiti.strategy;
 
+import com.platform.common.cache.ConfigCache;
+import com.platform.common.cache.DictCache;
+import com.platform.common.enums.DictTypeEnum;
 import com.platform.common.exception.BusinessException;
 import com.platform.dao.dto.upms.SysUserDTO;
 import com.platform.dao.entity.activiti.ActivitiUserModel;
 import com.platform.dao.entity.upms.SysUserDept;
 import com.platform.dao.enums.ActivitiUserModelTypeEnum;
+import com.platform.dao.enums.SysConfigEnum;
 import com.platform.dao.vo.SysRoleVO;
 import com.platform.dao.vo.SysUserVO;
 import com.platform.service.activiti.ActivitiAssignStrategy;
@@ -22,6 +26,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -87,6 +92,13 @@ public class ActivitiAssignStrategyStartUserDeptRole implements ActivitiAssignSt
         sysUserDTO.setRoleIds(Arrays.asList(roleId));
         // 找到和发起人部门一致的
         sysUserDTO.setDeptIds(sysUserDeptService.selectByUserId(userId).stream().map(SysUserDept::getDeptId).collect(Collectors.toList()));
+        String sourceDeptId = sysUserDTO.getDeptIds().get(0);
+        // 判断是否是要转化的部门
+        String transferDeptIds = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.TRANSFER_DEPT_IDS.name());
+        if(transferDeptIds.contains(sourceDeptId)){
+            sourceDeptId = DictCache.getLabelByValue(DictTypeEnum.VERIFY_DEPT_TRANSFER_MAP.getType(),sourceDeptId);
+        }
+        sysUserDTO.setDeptIds(Collections.singletonList(sourceDeptId));
         List<SysUserVO> sysUserVOList = sysUserService.getDeptChildrenRoleUser(sysUserDTO);
         if(CollectionUtils.isEmpty(sysUserVOList)){
             SysRoleVO sysRoleVO = sysRoleService.selectRoleVOByRoleId(roleId);

+ 10 - 0
platform-service/src/main/java/com/platform/service/business/impl/OutStoreFormActivitiServiceImpl.java

@@ -3,7 +3,9 @@ package com.platform.service.business.impl;
 import com.platform.activiti.dao.entity.ActAuditRequest;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.common.cache.ConfigCache;
+import com.platform.common.cache.DictCache;
 import com.platform.common.constant.CommonConstants;
+import com.platform.common.enums.DictTypeEnum;
 import com.platform.common.exception.BusinessException;
 import com.platform.common.model.UserInfo;
 import com.platform.common.util.*;
@@ -38,6 +40,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -100,6 +103,13 @@ public class OutStoreFormActivitiServiceImpl extends BaseFormCheckServiceAbstrac
         sysUserDTO.setRoleIds(Arrays.asList(roleId));
         // 找到和发起人部门一致的
         sysUserDTO.setDeptIds(sysUserDeptService.selectByUserId(SecurityUtils.getUserInfo().getUserId()).stream().map(SysUserDept::getDeptId).collect(Collectors.toList()));
+        String sourceDeptId = sysUserDTO.getDeptIds().get(0);
+        // 判断是否是要转化的部门
+        String transferDeptIds = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.TRANSFER_DEPT_IDS.name());
+        if(transferDeptIds.contains(sourceDeptId)){
+            sourceDeptId = DictCache.getLabelByValue(DictTypeEnum.VERIFY_DEPT_TRANSFER_MAP.getType(),sourceDeptId);
+        }
+        sysUserDTO.setDeptIds(Collections.singletonList(sourceDeptId));
         List<SysUserVO> sysUserVOList = sysUserMapper.selectDeptRoleUser(sysUserDTO);
         if(sysUserVOList != null && sysUserVOList.size() > 0){
             outStoreForm.setUpdateUserId(sysUserVOList.get(0).getUserId());