Pārlūkot izejas kodu

返回提示信息对应页面key

zhoutg 5 gadi atpakaļ
vecāks
revīzija
9e69a51fa2

+ 4 - 0
src/main/java/com/diagbot/dto/MsgDTO.java

@@ -4,6 +4,8 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @Description:
@@ -33,4 +35,6 @@ public class MsgDTO {
     private BigDecimal casesScore;
     // 条目ID
     private Long casesEntryId;
+    // 条目id对应页面数据的key值
+    private List<String> pageKeyList = new ArrayList<>();
 }

+ 30 - 0
src/main/java/com/diagbot/dto/QcCasesEntryPagedataDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 质控条目对应页面数据映射表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-20
+ */
+@Data
+public class QcCasesEntryPagedataDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 质控条目id
+     */
+    private Long casesEntryId;
+
+    /**
+     * 页面数据对应的key
+     */
+    private String pageKey;
+}
+

+ 73 - 0
src/main/java/com/diagbot/entity/QcCasesEntryPagedata.java

@@ -0,0 +1,73 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 质控条目对应页面数据映射表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-20
+ */
+@Data
+public class QcCasesEntryPagedata implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 质控条目id
+     */
+    private Long casesEntryId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 页面数据对应的key
+     */
+    private String pageKey;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+}

+ 19 - 37
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -21,6 +21,7 @@ import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.entity.HomeOperationInfo;
 import com.diagbot.entity.HomePage;
+import com.diagbot.entity.QcCasesEntryPagedata;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -45,7 +46,6 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -86,6 +86,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     QcModeFacade qcModeFacade;
     @Autowired
     AuthServiceClient authServiceClient;
+    @Autowired
+    QcCasesEntryPagedataFacade qcCasesEntryPagedataFacade;
 
     public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
         //入参验证
@@ -158,6 +160,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             AnalyzeVO analyzeVO = new AnalyzeVO();
             BeanUtil.copyProperties(getDetailVO, analyzeVO);
             List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+            List<Long> caseEntryId = msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList());
+            if (ListUtil.isNotEmpty(caseEntryId)) {
+                List<QcCasesEntryPagedata> qcCasesEntryPagedataList = qcCasesEntryPagedataFacade.list(new QueryWrapper<QcCasesEntryPagedata>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", hospitalId)
+                        .in("cases_entry_id", caseEntryId)
+                );
+                Map<Long, List<QcCasesEntryPagedata>> pageKey = EntityUtil.makeEntityListMap(qcCasesEntryPagedataList, "casesEntryId");
+                for (MsgDTO msgDTO : msgDTOList) {
+                    List<QcCasesEntryPagedata> pagedata = pageKey.get(msgDTO.getCasesEntryId());
+                    if (ListUtil.isNotEmpty(pagedata)) {
+                        msgDTO.setPageKeyList(pagedata.stream().map(r -> r.getPageKey()).collect(Collectors.toList()));
+                    }
+                }
+            }
+
             Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
             res.put("msg", msgMap);
         }
@@ -515,42 +533,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
 
-    /**
-     * 通过日期计算年龄
-     *
-     * @param birthDay
-     * @return
-     */
-    public int getAge(Date birthDay) {
-        Calendar cal = Calendar.getInstance();
-        if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
-            return 0;
-            //            throw new IllegalArgumentException(
-            //                    "The birthDay is before Now.It's unbelievable!");
-        }
-        int yearNow = cal.get(Calendar.YEAR);  //当前年份
-        int monthNow = cal.get(Calendar.MONTH);  //当前月份
-        int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
-        cal.setTime(birthDay);
-        int yearBirth = cal.get(Calendar.YEAR);
-        int monthBirth = cal.get(Calendar.MONTH);
-        int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
-        int age = yearNow - yearBirth;   //计算整岁数
-        if (monthNow <= monthBirth) {
-            if (monthNow == monthBirth) {
-                if (dayOfMonthNow < dayOfMonthBirth) {
-                    age--;//当前日期在生日之前,年龄减一
-                }
-            } else {
-                age--;//当前月份在生日之前,年龄减一
-            }
-        }
-        if (age < 0) {
-            return 0;
-        }
-        return age;
-    }
-
     /**
      * 执行未评分的病历
      */

+ 13 - 0
src/main/java/com/diagbot/facade/QcCasesEntryPagedataFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.QcCasesEntryPagedataServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/13 20:20
+ */
+@Component
+public class QcCasesEntryPagedataFacade extends QcCasesEntryPagedataServiceImpl {
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/QcCasesEntryPagedataMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.QcCasesEntryPagedata;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 质控条目对应页面数据映射表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-20
+ */
+public interface QcCasesEntryPagedataMapper extends BaseMapper<QcCasesEntryPagedata> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/QcCasesEntryPagedataService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.QcCasesEntryPagedata;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 质控条目对应页面数据映射表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-20
+ */
+public interface QcCasesEntryPagedataService extends IService<QcCasesEntryPagedata> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/QcCasesEntryPagedataServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.QcCasesEntryPagedata;
+import com.diagbot.mapper.QcCasesEntryPagedataMapper;
+import com.diagbot.service.QcCasesEntryPagedataService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 质控条目对应页面数据映射表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-20
+ */
+@Service
+public class QcCasesEntryPagedataServiceImpl extends ServiceImpl<QcCasesEntryPagedataMapper, QcCasesEntryPagedata> implements QcCasesEntryPagedataService {
+
+}

+ 4 - 0
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -61,5 +61,9 @@ public class BehospitalPageVO extends Page implements Serializable {
      */
     private Date leaveHosDateEnd;
 
+    /**
+     * 等级
+     */
+    private String level;
 
 }

+ 19 - 0
src/main/resources/mapper/QcCasesEntryPagedataMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.QcCasesEntryPagedataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QcCasesEntryPagedata">
+        <id column="id" property="id" />
+        <result column="cases_entry_id" property="casesEntryId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="page_key" property="pageKey" />
+        <result column="remark" property="remark" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+</mapper>