|
@@ -310,16 +310,21 @@ public class TaskManager {
|
|
|
if (CollUtil.isNotEmpty(areaIds)) {
|
|
|
// 根据areaIds查区域/服务商(注意业务要求这里只用省级进行粗粒度的匹配,vendor的前两位为省级编码)
|
|
|
Set<String> provAreaIds = areaIds.stream()
|
|
|
- .map(vendor -> String.valueOf(vendor).substring(0, 2)).collect(Collectors.toSet());
|
|
|
+ .filter(areaId -> areaId != null && StrUtil.length(String.valueOf(areaId)) >= 2)
|
|
|
+ .map(areaId -> String.valueOf(areaId).substring(0, 2)).collect(Collectors.toSet());
|
|
|
|
|
|
List<SysEnterpriseArea> enterpriseAreas = enterpriseAreaMapper.selectList(Wrappers.emptyWrapper());
|
|
|
|
|
|
Set<Integer> entIds = enterpriseAreas.stream()
|
|
|
- .filter(entArea -> provAreaIds.contains(String.valueOf(entArea.getAreaId()).substring(0, 2)))
|
|
|
+ .filter(entArea -> String.valueOf(entArea.getAreaId()).length() >= 2
|
|
|
+ && provAreaIds.contains(String.valueOf(entArea.getAreaId()).substring(0, 2)))
|
|
|
.map(entArea -> Math.toIntExact(entArea.getEntId())).collect(Collectors.toSet());
|
|
|
|
|
|
List<SysDept> depts = deptMapper.selectBatchIds(entIds);
|
|
|
- provAbbrs = depts.stream().map(SysDept::getProvAbbr).filter(abbr -> !StrUtil.isBlank(abbr)).collect(Collectors.toSet());
|
|
|
+ provAbbrs = depts.stream().map(SysDept::getProvAbbr)
|
|
|
+ .filter(abbr -> !StrUtil.isBlank(abbr))
|
|
|
+ .flatMap(abbr -> Stream.of(abbr.split(",")))
|
|
|
+ .collect(Collectors.toSet());
|
|
|
}
|
|
|
return provAbbrs;
|
|
|
}
|