|
@@ -1,10 +1,14 @@
|
|
package com.platform.service.activiti.strategy;
|
|
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.common.exception.BusinessException;
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
import com.platform.dao.entity.activiti.ActivitiUserModel;
|
|
import com.platform.dao.entity.activiti.ActivitiUserModel;
|
|
import com.platform.dao.entity.upms.SysUserDept;
|
|
import com.platform.dao.entity.upms.SysUserDept;
|
|
import com.platform.dao.enums.ActivitiUserModelTypeEnum;
|
|
import com.platform.dao.enums.ActivitiUserModelTypeEnum;
|
|
|
|
+import com.platform.dao.enums.SysConfigEnum;
|
|
import com.platform.dao.vo.SysRoleVO;
|
|
import com.platform.dao.vo.SysRoleVO;
|
|
import com.platform.dao.vo.SysUserVO;
|
|
import com.platform.dao.vo.SysUserVO;
|
|
import com.platform.service.activiti.ActivitiAssignStrategy;
|
|
import com.platform.service.activiti.ActivitiAssignStrategy;
|
|
@@ -22,6 +26,7 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
+import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -87,6 +92,13 @@ public class ActivitiAssignStrategyStartUserDeptRole implements ActivitiAssignSt
|
|
sysUserDTO.setRoleIds(Arrays.asList(roleId));
|
|
sysUserDTO.setRoleIds(Arrays.asList(roleId));
|
|
// 找到和发起人部门一致的
|
|
// 找到和发起人部门一致的
|
|
sysUserDTO.setDeptIds(sysUserDeptService.selectByUserId(userId).stream().map(SysUserDept::getDeptId).collect(Collectors.toList()));
|
|
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);
|
|
List<SysUserVO> sysUserVOList = sysUserService.getDeptChildrenRoleUser(sysUserDTO);
|
|
if(CollectionUtils.isEmpty(sysUserVOList)){
|
|
if(CollectionUtils.isEmpty(sysUserVOList)){
|
|
SysRoleVO sysRoleVO = sysRoleService.selectRoleVOByRoleId(roleId);
|
|
SysRoleVO sysRoleVO = sysRoleService.selectRoleVOByRoleId(roleId);
|