Jelajahi Sumber

Merge branch '20210512_yw_check' into test

songxinlu 4 tahun lalu
induk
melakukan
8ccc3b8da5

+ 2 - 0
src/main/java/com/diagbot/dto/CheckJobDTO.java

@@ -25,6 +25,8 @@ public class CheckJobDTO {
     private String leaveHospitalDate;
     //任务分配人员id
     private Long jobDistributor;
+    //任务分配人员名称
+    private String jobDistributorName;
 
     //筛选分值
     private int value;

+ 50 - 0
src/main/java/com/diagbot/enums/CheckStatusEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum CheckStatusEnum implements KeyedNamed {
+    Disable(0, "未核查"),
+    Enable(1, "已核查");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    CheckStatusEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static CheckStatusEnum getEnum(int key) {
+        for (CheckStatusEnum item : CheckStatusEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        CheckStatusEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

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

@@ -586,16 +586,20 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                 for(DeptCheckUserDTO jobNumDto:userJobs)
                 {
                     //这个科室有这个人
-                    if(deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId())&&
-                            deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId()))
+                    if(deptCheckUserDTO.getDeptId().equals(jobNumDto.getDeptId()))
                     {
-                        deptCheckUserDTO.setJobNum(jobNumDto.getJobNum());
-                    }
-                    //没有这个人
-                    else
-                    {
-                        deptCheckUserDTO.setJobNum(0);
+                        if(deptCheckUserDTO.getDoctorId().equals(jobNumDto.getDoctorId()))
+                        {
+                            deptCheckUserDTO.setJobNum(jobNumDto.getJobNum());
+                        }
+                        //没有这个人
+//                        else
+//                        {
+//                            deptCheckUserDTO.setJobNum(0);
+//                        }
+
                     }
+
                 }
             }
             checkRoleMap.get(roleId+"").add(checkDeptDTO);

+ 14 - 0
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -222,6 +222,20 @@ public class MedCheckWorkFacade {
         if (res == null || ListUtil.isEmpty(res.getRecords())) {
             return res;
         }
+        List<String> behospitalCodes = res.getRecords().stream()
+                .map(CheckWorkDTO::getBehospitalCode).collect(Collectors.toList());
+        checkWorkPageVO.setBehospitalCodes(behospitalCodes);
+        List<CheckWorkDTO>  ageCheckWorkDTO = medCheckInfoFacade.getBaseMapper().getCheckWorkAgeByCodes(checkWorkPageVO);
+        res.getRecords().stream().forEach(checkWorkDTO -> {
+            ageCheckWorkDTO.stream().forEach(agecheckWork-> {
+                if(checkWorkDTO.getBehospitalCode().equals(agecheckWork.getBehospitalCode()))
+                {
+                    checkWorkDTO.setAgeYear(agecheckWork.getAgeYear());
+                    checkWorkDTO.setAgeMon(agecheckWork.getAgeMon());
+                    checkWorkDTO.setAgeDay(agecheckWork.getAgeDay());
+                }
+            });
+        });
         res.getRecords().forEach(i -> {
             String age = "";
             if (StringUtil.isNotBlank(i.getAgeYear()) && !i.getAgeYear().equals("0")) {

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

@@ -8,6 +8,7 @@ import com.diagbot.entity.MedQcresultDetail;
 import com.diagbot.entity.SysUserDept;
 import com.diagbot.entity.SysUserRole;
 import com.diagbot.enums.CheckJobTypeEnum;
+import com.diagbot.enums.CheckStatusEnum;
 import com.diagbot.enums.CheckTypeEnum;
 import com.diagbot.enums.CheckerRoleEnum;
 import com.diagbot.exception.CommonErrorCode;
@@ -84,6 +85,8 @@ public class RecordCheckFacade {
             Map<String, Long> behospitalCodeCasesMap = medQcresultDetailService.list(medQcresultDetailQueryWrapper).stream().collect(Collectors.groupingBy(MedQcresultDetail::getBehospitalCode, Collectors.counting()));
             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())));
             });
         }
 

+ 2 - 0
src/main/java/com/diagbot/mapper/MedCheckInfoMapper.java

@@ -31,6 +31,8 @@ public interface MedCheckInfoMapper extends BaseMapper<MedCheckInfo> {
     List<DeptCheckUserDTO> getJobNumByUserId(CheckUserVO checkUserVO);
     //核查任务列表
     IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO);
+    //获取核查任务年龄
+    List<CheckWorkDTO> getCheckWorkAgeByCodes(CheckWorkPageVO checkWorkPageVO);
     //获取指定核查人员的核查任务
     List<CheckJobDTO> getCheckListByUserId(CheckJobVO checkJobVO);
     //取消核查任务

+ 5 - 0
src/main/java/com/diagbot/vo/CheckWorkPageVO.java

@@ -62,6 +62,11 @@ public class CheckWorkPageVO extends Page implements Serializable {
      */
     @ApiModelProperty("科室编号集合")
     private List<String> department;
+    /**
+     * 病人住院序号集合
+     */
+    @ApiModelProperty(hidden = true)
+    private List<String> behospitalCodes;
 
     /**
      * 病历等级

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: mrqc-sys
   profiles:
-    active: local
+    active: test
   main:
     allow-bean-definition-overriding: true
 

+ 1 - 1
src/main/resources/mapper/BasDeptInfoMapper.xml

@@ -27,7 +27,7 @@
             `bas_dept_info` t
         WHERE
             t.is_deleted = 'N'
-        AND t.station = '住院' or t.station = '质管'
+        AND (t.station = '住院' or t.station = '质管')
         AND t.hospital_id = #{hospitalId}
         <if test="inputStr !=null and inputStr != ''">
             AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'))

+ 37 - 10
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -133,12 +133,19 @@
                 <if test="name !=null and name != ''">
                     and a.`name` LIKE CONCAT('%',#{name},'%')
                 </if>
-                <if test="deptList !=null and deptList.size()!=0">
+                <if test="deptList !=null and deptList.size()!=0 and (jobType == 0 or jobType ==1)">
                     and a.beh_dept_id in
                     <foreach collection="deptList" item="item" open="(" close=")" separator=",">
                         #{item}
                     </foreach>
                 </if>
+                <if test="deptList !=null and deptList.size()!=0 and jobType == 2">
+                    and a.beh_dept_id not in
+                    <foreach collection="deptList" item="item" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+
 
         ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
         and a.hospital_id = b.hospital_id and b.is_deleted = 'N'
@@ -155,7 +162,8 @@
         a.`name`,
         b.`value`,
         a.id,
-        a.job_distributor jobDistributor
+        a.job_distributor jobDistributor,
+        a.job_distribution_name jobDistributorName
         from
         (select
             a.behospital_code,
@@ -166,7 +174,8 @@
             a.hospital_id,
             a.beh_dept_id,
             b.id,
-            b.job_distributor
+            b.job_distributor,
+            b.job_distribution_name
             from
             med_behospital_info a ,med_check_info b
             where a.behospital_code = b.behospital_code and a.hospital_id = b.hospital_id and a.is_deleted = 'N'
@@ -199,19 +208,16 @@
     <select id="getCheckWorkPage" resultType="com.diagbot.dto.CheckWorkDTO">
         SELECT
         mbi.behospital_code behospitalCode,
-        mbi.name,
+        mbi.`name`,
         mbi.file_code fileCode,
         mbi.sex,
         mhp.age,
-        TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) as ageYear,
-        TIMESTAMPDIFF(month,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) year),mbi.behospital_date) as ageMon,
-        TIMESTAMPDIFF(day,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(month,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) month),mbi.behospital_date) as ageDay,
         mbi.beh_dept_name behDeptName,
         mbi.leave_hospital_date leaveHospitalDate,
         mhp.behospital_day_num behospitalDayNum,
         mbi.doctor_name doctorName,
         mqi.score_res scoreRes,
-        mqi.level,
+        mqi.`level`,
         mbi.diagnose,
         CASE WHEN mbt.behospital_type='出院病人' THEN '6'
         WHEN mbt.behospital_type='死亡病人' THEN '6'
@@ -256,7 +262,7 @@
             AND mci.job_create_time is null
         </if>
         <if test="name != null and name != ''">
-            AND mbi.name like CONCAT('%',#{name},'%')
+            AND mbi.`name` like CONCAT('%',#{name},'%')
         </if>
         <if test="behospitalCode != null and behospitalCode != ''">
             AND mbi.behospital_code like CONCAT('%',#{behospitalCode},'%')
@@ -280,13 +286,34 @@
             AND mbi.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
         </if>
         <if test="level != null and level != ''">
-            AND mqi.level= #{level}
+            AND mqi.`level`= #{level}
         </if>
         <if test="isPlacefile != null and isPlacefile != ''">
             AND mbi.is_placefile = #{isPlacefile}
         </if>
     </select>
 
+    <!--获取核查任务年龄-->
+    <select id="getCheckWorkAgeByCodes" resultType="com.diagbot.dto.CheckWorkDTO">
+        SELECT
+        mbi.behospital_code behospitalCode,
+        mhp.age,
+        TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) as ageYear,
+        TIMESTAMPDIFF(month,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(year,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) year),mbi.behospital_date) as ageMon,
+        TIMESTAMPDIFF(day,DATE_ADD(ifnull(mhp.birthday,mbi.birthday),INTERVAL TIMESTAMPDIFF(month,ifnull(mhp.birthday,mbi.birthday),mbi.behospital_date) month),mbi.behospital_date) as ageDay
+        FROM
+        med_behospital_info mbi
+        LEFT JOIN med_home_page mhp
+        ON mbi.behospital_code=mhp.behospital_code
+        AND mbi.hospital_id = mhp.hospital_id AND mhp.is_deleted = 'N'
+        WHERE mbi.hospital_id=#{hospitalId} AND mbi.is_deleted = 'N'
+        <if test="behospitalCodes !=null and behospitalCodes.size > 0">
+            and mbi.behospital_code in
+            <foreach collection="behospitalCodes" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
     <!--通过住院号,取消核查任务-->
     <update id="deleteBatchCodes">
         <foreach collection="list" item="item"  separator=";">