getTrainingExperience
This commit is contained in:
@@ -46,10 +46,16 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
|
|||||||
@Resource
|
@Resource
|
||||||
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
UserAuthMappingMapper userAuthMappingMapper;
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private CommonService commonService;
|
private CommonService commonService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
RegionMapper regionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean distribution(TrainingExperienceDistributionRequest request) {
|
public boolean distribution(TrainingExperienceDistributionRequest request) {
|
||||||
@@ -137,10 +143,18 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
|
|||||||
}
|
}
|
||||||
List<SysRoleDO> xfStoreManager = sysRoleMapper.getXFStoreManager(roleNames);
|
List<SysRoleDO> xfStoreManager = sysRoleMapper.getXFStoreManager(roleNames);
|
||||||
List<Long> roleIds = xfStoreManager.stream().map(SysRoleDO::getId).collect(Collectors.toList());
|
List<Long> roleIds = xfStoreManager.stream().map(SysRoleDO::getId).collect(Collectors.toList());
|
||||||
|
//店长角色的用户id
|
||||||
List<String> userIdsByRoleIdList = enterpriseUserRoleMapper.getUserIdsByRoleIdList(roleIds);
|
List<String> userIdsByRoleIdList = enterpriseUserRoleMapper.getUserIdsByRoleIdList(roleIds);
|
||||||
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserMapper.getUserInfoByUserIds(userIdsByRoleIdList);
|
//当前门店
|
||||||
String storeManagers = userInfoByUserIds.stream().map(EnterpriseUserDO::getName).collect(Collectors.toList()).toString();
|
RegionDO storeRegion = regionMapper.getRegionByStoreId(leaseBaseInfoDO.getStoreId());
|
||||||
leaseBaseInfoDO.setStoreManager(storeManagers);
|
//权限
|
||||||
|
List<String> userIdsByMappingIds = userAuthMappingMapper.getUserIdsByMappingIds(Collections.singletonList(storeRegion.getRegionId()));
|
||||||
|
//过滤
|
||||||
|
userIdsByMappingIds.retainAll(userIdsByRoleIdList);
|
||||||
|
//用户
|
||||||
|
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserMapper.getUserInfoByUserIds(userIdsByMappingIds);
|
||||||
|
String nameList = userInfoByUserIds.stream().map(EnterpriseUserDO::getName).collect(Collectors.toList()).toString();
|
||||||
|
leaseBaseInfoDO.setStoreManager(nameList);
|
||||||
return leaseBaseInfoDO;
|
return leaseBaseInfoDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user