浏览代码

Merge remote-tracking branch 'origin/dev/20200603_1.3.1' into dev/20200603_1.3.1

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
zhaops 5 年之前
父节点
当前提交
68e0d63a76

+ 6 - 1
doc/005.20200528v1.2.x/qc_init.sql

@@ -1048,4 +1048,9 @@ CREATE TABLE `med_module_mapping` (
 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='模板与文书映射关系表';
 
 
-ALTER TABLE `med_behospital_info` ADD INDEX `idx_hospital_id_behospital_code` (`hospital_id`,`behospital_code`) USING BTREE;
+ALTER TABLE `med_behospital_info` ADD INDEX `idx_hospital_id_behospital_code` (`hospital_id`,`behospital_code`) USING BTREE;
+
+alter table med_medical_record add COLUMN `status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '模板处理状态(0:未处理,1:已处理)' AFTER `rec_title`;
+
+alter table med_home_diagnose_info MODIFY COLUMN `diagnose_order_no` INT(11) NOT NULL COMMENT '诊断序号';
+alter table med_home_operation_info MODIFY COLUMN `operation_order_no` INT(11) NOT NULL COMMENT '手术序号';

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -65,6 +65,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/exportQcresult").permitAll()
                 .antMatchers("/qc/behospitalInfo/exportQcresultByDept").permitAll()
                 .antMatchers("/console/entryRejectPercent").permitAll()
+                .antMatchers("/qc/abnormal/getQcAnnormalMode").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -108,6 +108,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/exportQcresult", request)
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
                 || matchers("/console/entryRejectPercent", request)
+                || matchers("/qc/abnormal/getQcAnnormalMode", request)
                 || matchers("/", request)) {
             return true;
         }

+ 14 - 3
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -60,6 +60,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
@@ -252,6 +253,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("hospital_id", hospitalId)
                     .eq("home_page_id", homePage.getHomePageId())
+                    .orderByAsc("diagnose_order_no")
             );
 
             // 获取首页手术信息
@@ -259,6 +261,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("hospital_id", hospitalId)
                     .eq("home_page_id", homePage.getHomePageId())
+                    .orderByAsc("operation_order_no")
             );
         }
 
@@ -602,7 +605,11 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 if (map.containsKey(objKey)) {
                     if (firstPageDate.contains(objKey)) {
                         Date date = (Date) objectMap.get(objKey);
-                        content.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
+                        if ("birthday".equals(objKey)) {
+                            content.put(map.get(objKey), DateUtil.formatDate(date));
+                        } else {
+                            content.put(map.get(objKey), DateUtil.formatDateTime(date));
+                        }
                     } else {
                         content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
                     }
@@ -945,6 +952,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param exportQcresultVO
      */
     public void exportQcresult(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         exportQcresultVO.setHospitalId(hospitalId);
         Date startDate = exportQcresultVO.getLeaveHosDateStart();
@@ -959,8 +967,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
+        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, fileName, response);
     }
 
     /**
@@ -970,6 +979,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param exportQcresultVO
      */
     public void exportQcresultByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         String userId = SysUserUtils.getCurrentPrincipleID();
         exportQcresultVO.setHospitalId(hospitalId);
@@ -986,7 +996,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
+        String fileName = dateFormat.format(startDate) + "-" + dateFormat.format(endDate) + "抽查住院病历质量情况.xls";
         response.setContentType("text/html;charset=UTF-8");
-        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
+        ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, fileName, response);
     }
 }

+ 18 - 9
src/main/java/com/diagbot/facade/QcAbnormalFacade.java

@@ -92,15 +92,24 @@ public class QcAbnormalFacade extends QcAbnormalServiceImpl {
      * @return 是否成功
      */
     public Boolean saveQcAnnormalNameAll(QcAbnormalSaveNameVO qcAbnormalSaveNameVO) {
-        return this.update(new UpdateWrapper<QcAbnormal>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .eq("description", qcAbnormalSaveNameVO.getDescription())
-                .set("status", qcAbnormalSaveNameVO.getStatus())
-                .set("remark", qcAbnormalSaveNameVO.getRemark())
-                .set("gmt_modified", DateUtil.now())
-                .set("modifier", SysUserUtils.getCurrentPrincipleID())
-        );
+
+        boolean res = false;
+            res = this.update(new UpdateWrapper<QcAbnormal>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                    .eq("type", 1)//异常类型(1:数据模块 2:质控类型 3:XML结构)
+                    .eq("description", qcAbnormalSaveNameVO.getDescription())
+                    .set("status", qcAbnormalSaveNameVO.getStatus())
+                    .set("gmt_modified", DateUtil.now())
+                    .set("modifier", SysUserUtils.getCurrentPrincipleID())
+            );
+            //最后更新备注
+            res = this.update(new UpdateWrapper<QcAbnormal>()
+                    .eq("id", qcAbnormalSaveNameVO.getId())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .set("remark", qcAbnormalSaveNameVO.getRemark())
+            );
+        return res;
     }
 
 

+ 7 - 0
src/main/java/com/diagbot/vo/ExportQcresultVO.java

@@ -20,4 +20,11 @@ public class ExportQcresultVO {
     private String hospitalId;
     @ApiModelProperty(hidden = true)
     private Long userId;
+
+    private String behospitalCode;
+    private String level;
+    private String doctorName;
+    private String doctorCode;
+    private String deptId;
+    private String name;
 }

+ 2 - 0
src/main/java/com/diagbot/vo/QcAbnormalSaveNameVO.java

@@ -14,6 +14,8 @@ import javax.validation.constraints.NotNull;
 @Setter
 @Getter
 public class QcAbnormalSaveNameVO {
+    @NotNull(message = "请输入Id")
+    private  Long id;
     @NotBlank(message = "请输入异常描述")
     private  String description;
     @NotNull(message = "请输入处理状态")

+ 88 - 2
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -394,7 +394,6 @@
         WHERE
         a.is_deleted = 'N'
         AND a.is_placefile = '1'
-        <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -504,7 +503,6 @@
         AND a.hospital_id = c.hospital_id
         AND a.beh_dept_id = c.dept_id
         AND a.is_placefile = '1'
-        <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="userId!=null">
             AND c.user_id = #{userId}
         </if>
@@ -1840,6 +1838,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+                 OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+                 OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+                 OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+                 OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         ) t1,
         (
         SELECT
@@ -1865,6 +1885,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         GROUP BY
         a.beh_dept_id,
         a.beh_dept_name
@@ -1943,6 +1985,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         ) t1,
         (
         SELECT
@@ -1975,6 +2039,28 @@
         <if test="leaveHosDateEnd != null ">
             <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
         </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
         GROUP BY
         a.beh_dept_id,
         a.beh_dept_name

+ 0 - 1
src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -121,7 +121,6 @@
         AND t2.is_deleted = 'N'
         AND t3.is_deleted = 'N'
         AND t1.id = t2.cases_entry_id
-        AND t2.is_used = 1
         AND t1.mode_id = t3.id
         AND t2.hospital_id = #{hospitalId}
         ORDER BY t3.order_no,t1.order_no