Browse Source

质控核查bug修改

songxinlu 4 years ago
parent
commit
ea33bda52f

+ 32 - 10
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -45,6 +45,8 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static java.sql.JDBCType.NULL;
+
 /**
  * @author wangfeng
  * @Description:
@@ -396,8 +398,21 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         checkUserVOS.setHospitalId(hospitalId);
         List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
         //2.1获取科室详情
-        Map<String,String> deptMap = checkUserDTOS.stream()
-                .collect(Collectors.toMap(CheckUserDTO::getDeptId,CheckUserDTO::getDeptName, (v1, v2) -> v2));
+        //2.1.1获取院区核查的人员id
+        List<Long> userIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("role_id",CheckerRoleEnum.HOSP_GENERAL.getKey())).stream()
+                .map(SysUserRole::getUserId).collect(Collectors.toList());
+        List<String> deptIds = sysUserDeptFacade.list(new QueryWrapper<SysUserDept>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",hospitalId)
+                .in("user_id",userIds)).stream()
+                .map(SysUserDept::getDeptId).collect(Collectors.toList());
+        Map<String,String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",hospitalId)
+                .in("dept_id",deptIds)).stream()
+                .collect(Collectors.toMap(BasDeptInfo::getDeptId,BasDeptInfo::getDeptName, (v1, v2) -> v2));
         if(deptMap!=null&&!deptMap.isEmpty())
         {
             //2.3获取所有医生信息的核查数
@@ -451,8 +466,11 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             checkUserVOS.setHospitalId(hospitalId);
             List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
             //2.1获取科室详情
-            Map<String,String> deptMap = checkUserDTOS.stream()
-                    .collect(Collectors.toMap(CheckUserDTO::getDeptId,CheckUserDTO::getDeptName, (v1, v2) -> v2));
+            Map<String,String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id",hospitalId)
+                    .in("dept_id",Lists.newArrayList(zkkDeptId))).stream()
+                    .collect(Collectors.toMap(BasDeptInfo::getDeptId,BasDeptInfo::getDeptName, (v1, v2) -> v2));
             if(deptMap!=null&&!deptMap.isEmpty())
             {
                 //2.3获取质控科核查人员的核查数
@@ -503,8 +521,11 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
         checkUserVOS.setHospitalId(hospitalId);
         List<CheckUserDTO> checkUserDTOS = baseMapper.getCheckUser(checkUserVOS);
         //2.1获取科室详情
-        Map<String,String> deptMap = checkUserDTOS.stream()
-                .collect(Collectors.toMap(CheckUserDTO::getDeptId,CheckUserDTO::getDeptName, (v1, v2) -> v2));
+        Map<String,String> deptMap = basDeptInfoFacade.list(new QueryWrapper<BasDeptInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",hospitalId)
+                .in("dept_id",deptIds)).stream()
+                .collect(Collectors.toMap(BasDeptInfo::getDeptId,BasDeptInfo::getDeptName, (v1, v2) -> v2));
         if(deptMap!=null&&!deptMap.isEmpty())
         {
             //2.3获取所有医生信息的核查数
@@ -691,15 +712,16 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             {
                 Date now = DateUtil.now();
                 //4.3取消分配
+                Long a = null;
                 return  this.update(new UpdateWrapper<MedCheckInfo>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("hospital_id", hospitalId)
                         .eq("check_id",  distributionJobVO.getCheckId())
                         .in("behospital_code", distributionJobVO.getBehospitalCodes())
-                        .set("job_distributor",-1)
-                        .set("job_distribution_name", null)
-                        .set("check_id", -1)
-                        .set("check_name", "")
+                        .set("job_distributor",a)
+                        .set("job_distribution_name", a)
+                        .set("check_id", a)
+                        .set("check_name", a)
                         .set("job_distribution_time", now));
             }
         }

+ 1 - 1
src/main/java/com/diagbot/vo/MedCheckWorkAddVO.java

@@ -30,5 +30,5 @@ public class MedCheckWorkAddVO {
     @ApiModelProperty("操作时间")
     private String createTime;          // 操作时间
     @ApiModelProperty("核查类型 0病历,1病案首页,2全部 默认")
-    private Integer checkType;          // 核查类型 0病历,1病案首页,2全部 默认
+    private Integer checkType=2;          // 核查类型 0病历,1病案首页,2全部 默认
 }

+ 2 - 2
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -81,7 +81,7 @@
                 #{item}
             </foreach>
         </if>
-        GROUP BY a.beh_dept_id
+        GROUP BY a.beh_dept_id,b.check_id
     </select>
 
     <!--获取待分配核查任务列表-->
@@ -237,7 +237,7 @@
         LEFT JOIN med_qcresult_info mqi
         ON mbi.behospital_code = mqi.behospital_code
         AND mbi.hospital_id = mqi.hospital_id AND mqi.is_deleted = 'N'
-        JOIN med_behospital_type mbt ON mbi.behospital_code = mbt.behospital_code
+        LEFT JOIN med_behospital_type mbt ON mbi.behospital_code = mbt.behospital_code
         AND mbi.hospital_id = mbt.hospital_id AND mbt.is_deleted = 'N'
         WHERE mbi.hospital_id=#{hospitalId} AND mbi.is_deleted = 'N' and mqi.score_res is not null
         <if test="startDate != null">