|
@@ -193,19 +193,25 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
|
|
for (SysRole s : sysRoleList) {
|
|
for (SysRole s : sysRoleList) {
|
|
if (s.getType() == RoleTypeEnum.BUSSINESS) {
|
|
if (s.getType() == RoleTypeEnum.BUSSINESS) {
|
|
List<TBService> tbServiceList = tbServiceService.listByIds(Arrays.asList(serviceId));
|
|
List<TBService> tbServiceList = tbServiceService.listByIds(Arrays.asList(serviceId));
|
|
- tbServiceList = tbServiceList.stream().filter(i -> Objects.nonNull(i.getServiceLeadId()) ? true : false).collect(Collectors.toList());
|
|
|
|
- List<String> serviceLeadIdList = tbServiceList.stream().map(i -> String.valueOf(i.getServiceLeadId())).collect(Collectors.toList());
|
|
|
|
- userIdList.addAll(serviceLeadIdList);
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(tbServiceList)) {
|
|
|
|
+ tbServiceList = tbServiceList.stream().filter(i -> Objects.nonNull(i.getServiceLeadId()) ? true : false).collect(Collectors.toList());
|
|
|
|
+ List<String> serviceLeadIdList = tbServiceList.stream().map(i -> String.valueOf(i.getServiceLeadId())).collect(Collectors.toList());
|
|
|
|
+ userIdList.addAll(serviceLeadIdList);
|
|
|
|
+ }
|
|
} else if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
|
|
} else if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
|
|
List<TBCrm> tbCrmList = tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceId));
|
|
List<TBCrm> tbCrmList = tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceId));
|
|
- tbCrmList = tbCrmList.stream().filter(i -> Objects.nonNull(i.getLeadId()) ? true : false).collect(Collectors.toList());
|
|
|
|
- List<String> leadIdList = tbCrmList.stream().map(i -> String.valueOf(i.getLeadId())).collect(Collectors.toList());
|
|
|
|
- userIdList.addAll(leadIdList);
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(tbCrmList)) {
|
|
|
|
+ tbCrmList = tbCrmList.stream().filter(i -> Objects.nonNull(i.getLeadId()) ? true : false).collect(Collectors.toList());
|
|
|
|
+ List<String> leadIdList = tbCrmList.stream().map(i -> String.valueOf(i.getLeadId())).collect(Collectors.toList());
|
|
|
|
+ userIdList.addAll(leadIdList);
|
|
|
|
+ }
|
|
} else if (s.getType() == RoleTypeEnum.REGION_COORDINATOR) {
|
|
} else if (s.getType() == RoleTypeEnum.REGION_COORDINATOR) {
|
|
List<TBCrm> tbCrmList = tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceId));
|
|
List<TBCrm> tbCrmList = tbCrmService.list(new QueryWrapper<TBCrm>().lambda().eq(TBCrm::getServiceId, serviceId));
|
|
- tbCrmList = tbCrmList.stream().filter(i -> Objects.nonNull(i.getRegionCoordinatorId()) ? true : false).collect(Collectors.toList());
|
|
|
|
- List<String> regionCoordinatorIdList = tbCrmList.stream().map(i -> String.valueOf(i.getRegionCoordinatorId())).collect(Collectors.toList());
|
|
|
|
- userIdList.addAll(regionCoordinatorIdList);
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(tbCrmList)) {
|
|
|
|
+ tbCrmList = tbCrmList.stream().filter(i -> Objects.nonNull(i.getRegionCoordinatorId()) ? true : false).collect(Collectors.toList());
|
|
|
|
+ List<String> regionCoordinatorIdList = tbCrmList.stream().map(i -> String.valueOf(i.getRegionCoordinatorId())).collect(Collectors.toList());
|
|
|
|
+ userIdList.addAll(regionCoordinatorIdList);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
sysRoleOtherList.add(s.getId());
|
|
sysRoleOtherList.add(s.getId());
|
|
}
|
|
}
|