songxinlu пре 4 година
родитељ
комит
a5172d901e
1 измењених фајлова са 18 додато и 1 уклоњено
  1. 18 1
      src/main/java/com/diagbot/facade/RecordCheckFacade.java

+ 18 - 1
src/main/java/com/diagbot/facade/RecordCheckFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.BehospitalInfoAgeDTO;
 import com.diagbot.dto.CheckedRecordListDTO;
 import com.diagbot.dto.SysUserDeptDTO;
+import com.diagbot.entity.BasDeptInfo;
 import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.entity.SysUserDept;
 import com.diagbot.entity.SysUserRole;
@@ -12,6 +13,7 @@ import com.diagbot.enums.CheckJobTypeEnum;
 import com.diagbot.enums.CheckStatusEnum;
 import com.diagbot.enums.CheckTypeEnum;
 import com.diagbot.enums.CheckerRoleEnum;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.MedQcresultDetailService;
@@ -49,6 +51,8 @@ public class RecordCheckFacade {
     MedQcresultDetailService medQcresultDetailService;
     @Autowired
     BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    BasDeptInfoFacade basDeptInfoFacade;
 
 
     public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
@@ -62,17 +66,27 @@ public class RecordCheckFacade {
         if (ListUtil.isNotEmpty(sysUserDeptDTO.getSelDepts())) {
             deptIds.addAll(sysUserDeptDTO.getSelDepts().stream().map(i -> i.getDeptId()).collect(Collectors.toList()));
         }
-
+        //1.2去除质管科
+        String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",hospitalId)
+                .eq("station","质管")).getDeptId();
         List<Long> userIds = Lists.newArrayList();
+        List<String> JobTypes = Lists.newArrayList();
         roleIds.forEach(roleId -> {
             if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey()
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + ""))) {
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, null, CheckerRoleEnum.HOSP_GENERAL.getKey()));
+                JobTypes.add(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + "");
             } else if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + ""))) {
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.QUAT_GENERAL.getKey()));
+                JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
             } else if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() && ListUtil.isNotEmpty(deptIds)
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + ""))) {
+                //移除质管科人员
+                deptIds.remove(zkkDeptId);
+                JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
             } else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
                     || roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
@@ -80,6 +94,9 @@ public class RecordCheckFacade {
             }
         });
 
+        if(ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes())){
+            checkedRecordListVO.setCheckJobTypes(JobTypes);
+        }
         if (ListUtil.isEmpty(userIds)) {
             userIds.add(999999999999999999l);
         }