Forráskód Böngészése

Merge branch '20210512_yw_check' into test

songxinlu 4 éve
szülő
commit
708ab26ab3

+ 8 - 5
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -231,6 +231,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
 
                     if(deptIds!=null&&!deptIds.isEmpty()){
                         checkJobVO.setDeptList(deptIds);
+                        return getCheckList(checkJobVO);
                     }
                 }
                 //院区获取
@@ -254,15 +255,16 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
 //                        hospGeneralDeptIds.removeAll(deptIds);
 //                        checkJobVO.setDeptList(new ArrayList<>(hospGeneralDeptIds));
 //                    }
+                    return getCheckList(checkJobVO);
                 }
             }
 
-            return getCheckList(checkJobVO);
         }
         else
         {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户的角色和任务类型不对应!");
         }
+        return  new CheckJobPageVO();
     }
     /**
      * @Author songxl
@@ -771,18 +773,18 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
      * @Return java.util.List<com.diagbot.dto.CheckJobDTO>
      * @MethodName getCheckListByUserId
      */
-    public List<CheckJobDTO> getCheckListByUserId(CheckJobVO checkJobVO) {
+    public IPage<CheckJobDTO> getCheckListByUserId(CheckJobPageVO checkJobVO) {
         //非空校验
         if(StringUtil.isBlank(checkJobVO.getCheckId()))
         {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有传核查用户id!");
         }
-        List<CheckJobDTO> checkJobDTOS= baseMapper.getCheckListByUserId(checkJobVO);
+        IPage<CheckJobDTO> checkJobDTOS= baseMapper.getCheckListByUserId(checkJobVO);
         //获取当前登录人员
         Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
         List<CheckJobDTO> outCheckJobDTOS = new ArrayList<>();
         //判断分配人员是否是当前人员
-        for(CheckJobDTO checkJobDTO:checkJobDTOS)
+        for(CheckJobDTO checkJobDTO:checkJobDTOS.getRecords())
         {
             if (principleId.equals(checkJobDTO.getJobDistributor()))
             {
@@ -793,6 +795,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
             }
             outCheckJobDTOS.add(checkJobDTO);
         }
-        return outCheckJobDTOS;
+        checkJobDTOS.setRecords(outCheckJobDTOS);
+        return checkJobDTOS;
     }
 }

+ 0 - 7
src/main/java/com/diagbot/facade/RecordCheckFacade.java

@@ -6,7 +6,6 @@ import com.diagbot.dto.BehospitalInfoAgeDTO;
 import com.diagbot.dto.CheckedRecordListDTO;
 import com.diagbot.dto.SysUserDeptDTO;
 import com.diagbot.entity.MedCheckInfo;
-import com.diagbot.entity.MedQcresultDetail;
 import com.diagbot.entity.SysUserDept;
 import com.diagbot.entity.SysUserRole;
 import com.diagbot.enums.CheckJobTypeEnum;
@@ -91,14 +90,8 @@ public class RecordCheckFacade {
 
         if (ListUtil.isNotEmpty(iPage.getRecords())) {
             List<String> behospitalCodes = iPage.getRecords().stream().map(i -> i.getBehospitalCode()).collect(Collectors.toList());
-            QueryWrapper<MedQcresultDetail> medQcresultDetailQueryWrapper = new QueryWrapper<>();
-            medQcresultDetailQueryWrapper.eq("hospital_id", hospitalId);
-            medQcresultDetailQueryWrapper.in("behospital_code", behospitalCodes);
-            medQcresultDetailQueryWrapper.select("behospital_code", "cases_entry_id");
-            Map<String, Long> behospitalCodeCasesMap = medQcresultDetailService.list(medQcresultDetailQueryWrapper).stream().collect(Collectors.groupingBy(MedQcresultDetail::getBehospitalCode, Collectors.counting()));
             Map<String, BehospitalInfoAgeDTO> ageMap = behospitalInfoFacade.getBehospitalInfoAge(hospitalId, behospitalCodes).stream().collect(Collectors.toMap(i -> i.getBehospitalCode(), i -> i));
             iPage.getRecords().forEach(i -> {
-                i.setCasesEntryNum(behospitalCodeCasesMap.get(i.getBehospitalCode()) == null ? 0 : behospitalCodeCasesMap.get(i.getBehospitalCode()).intValue());
                 i.setMonth(i.getJobDistributionTime());
                 i.setStatus(CheckStatusEnum.getName(Integer.parseInt(i.getStatus())));
                 i.setAge(ageMap.get(i.getBehospitalCode()) == null ? "" : ageMap.get(i.getBehospitalCode()).getAge());

+ 1 - 1
src/main/java/com/diagbot/mapper/MedCheckInfoMapper.java

@@ -34,7 +34,7 @@ public interface MedCheckInfoMapper extends BaseMapper<MedCheckInfo> {
     //核查任务列表
     IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO);
     //获取指定核查人员的核查任务
-    List<CheckJobDTO> getCheckListByUserId(CheckJobVO checkJobVO);
+    IPage<CheckJobDTO> getCheckListByUserId(CheckJobPageVO checkJobVO);
     //取消核查任务
     int deleteBatchCodes(List<String> list);
 

+ 2 - 2
src/main/java/com/diagbot/web/MedCheckInfoController.java

@@ -98,8 +98,8 @@ public class MedCheckInfoController {
             notes = "checkId:核查用户id")
     @PostMapping("/getCheckListByUserId")
     @SysLogger("getCheckListByUserId")
-    public RespDTO<List<CheckJobDTO>> getCheckListByUserId(@RequestBody CheckJobVO checkJobVO) {
-        List<CheckJobDTO> userInfos = medCheckInfoFacade.getCheckListByUserId(checkJobVO);
+    public RespDTO<IPage<CheckJobDTO>> getCheckListByUserId(@RequestBody CheckJobPageVO checkJobVO) {
+        IPage<CheckJobDTO> userInfos = medCheckInfoFacade.getCheckListByUserId(checkJobVO);
         return RespDTO.onSuc(userInfos);
     }
 

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

@@ -334,7 +334,7 @@
     </update>
 
     <select id="checkedRecordList" resultType="com.diagbot.dto.CheckedRecordListDTO">
-        SELECT *
+        SELECT t1.*,SUM(if(t2.behospital_code is null,0,1)) as casesEntryNum
         from
         (select
         b.behospital_code as behospitalCode,
@@ -398,9 +398,9 @@
                 #{checkJobType}
             </foreach>
         </if>
-        ) tab
+        ) t1 left join med_qcresult_detail t2 on t1.behospitalCode=t2.behospital_code and t2.hospital_id=#{hospitalId} and t2.is_deleted='N'
         where isDel>0
-        order by jobDistributionTime desc
+        group by t1.behospitalCode
     </select>
 
 </mapper>