|
@@ -18,7 +18,6 @@ import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDictItem;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysEnterpriseArea;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmDaAgent;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmDaDrugEntDrugtable;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmDaHospital;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmScorePackage;
|
|
@@ -33,7 +32,6 @@ import com.qunzhixinxi.hnqz.admin.controller.task.vo.TaskRespVO.ToDirectCheck;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.SysCheckChainNodeCheckHistoryMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.SysDeptMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.SysEnterpriseAreaMapper;
|
|
|
-import com.qunzhixinxi.hnqz.admin.mapper.WmDaAgentMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.WmTaskV2Mapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysUserAreaService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmDaHospitalService;
|
|
@@ -93,7 +91,6 @@ public class TaskManager {
|
|
|
@Resource private WmDaHospitalService wmDaHospitalService;
|
|
|
@Resource private SysEnterpriseAreaMapper enterpriseAreaMapper;
|
|
|
@Resource private SysDeptMapper deptMapper;
|
|
|
- @Resource private WmDaAgentMapper agentMapper;
|
|
|
|
|
|
// 丁凯总作为分管领导可见的服务商
|
|
|
private static final List<Integer> DING_KAI_DEPT_ID =
|
|
@@ -307,6 +304,9 @@ public class TaskManager {
|
|
|
// 当前登录人所拥有的区域
|
|
|
List<Long> areaIds = userAreaService.listUserAreas(Long.valueOf(user.getId()));
|
|
|
|
|
|
+ // 忽略测试企业id
|
|
|
+ Set<Integer> ignoreIds = Set.of(1716964676, -1020826, -1019986);
|
|
|
+
|
|
|
// 服务区域简称
|
|
|
Set<String> provAbbrs = new HashSet<>();
|
|
|
if (CollUtil.isNotEmpty(areaIds)) {
|
|
@@ -317,29 +317,23 @@ public class TaskManager {
|
|
|
|
|
|
List<SysEnterpriseArea> enterpriseAreas = enterpriseAreaMapper.selectList(Wrappers.emptyWrapper());
|
|
|
|
|
|
+ // 过滤只包含对应所属区域省份的企业
|
|
|
Set<Integer> entIds = enterpriseAreas.stream()
|
|
|
.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());
|
|
|
+ .map(entArea -> Math.toIntExact(entArea.getEntId()))
|
|
|
+ .filter(entId -> !ignoreIds.contains(entId)).collect(Collectors.toSet());
|
|
|
|
|
|
// 查询企业id对应的上级区域
|
|
|
- List<WmDaAgent> daAgents = agentMapper.selectList(Wrappers.<WmDaAgent>lambdaQuery()
|
|
|
- .in(WmDaAgent::getDeptId, entIds));
|
|
|
- if (CollUtil.isNotEmpty(daAgents)) {
|
|
|
- Set<Integer> parentDrugEntIds = daAgents.stream()
|
|
|
- .map(WmDaAgent::getExtDrugEnt).filter(StrUtil::isNotBlank)
|
|
|
- .flatMap(extDrugEnt -> Stream.of(extDrugEnt.split(",")))
|
|
|
- .map(Integer::parseInt).collect(Collectors.toSet());
|
|
|
-
|
|
|
- if (CollUtil.isNotEmpty(parentDrugEntIds)) {
|
|
|
- // 获取上级区域的省份简称
|
|
|
- List<SysDept> parentEnts = agentMapper.listDeptByAgentIds(parentDrugEntIds, DeptLevelEnum.CSO_L1.getVal());
|
|
|
- provAbbrs = parentEnts.stream()
|
|
|
- .map(SysDept::getProvAbbr)
|
|
|
- .filter(StrUtil::isNotBlank)
|
|
|
- .flatMap(abbr -> Stream.of(abbr.split(",")))
|
|
|
- .collect(Collectors.toSet());
|
|
|
- }
|
|
|
+ List<SysDept> depts = deptMapper.selectList(Wrappers.<SysDept>lambdaQuery().in(SysDept::getDeptId, entIds)
|
|
|
+ .eq(SysDept::getLevel, DeptLevelEnum.CSO_L1.getVal()));
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(depts)) {
|
|
|
+ provAbbrs = depts.stream()
|
|
|
+ .map(SysDept::getProvAbbr)
|
|
|
+ .filter(StrUtil::isNotBlank)
|
|
|
+ .flatMap(abbr -> Stream.of(abbr.split(",")))
|
|
|
+ .collect(Collectors.toSet());
|
|
|
}
|
|
|
}
|
|
|
return provAbbrs;
|