소스 검색

Merge branch 'develop' into dev/20200702_1.3.7

gaodm 5 년 전
부모
커밋
3ad437ca75

+ 21 - 0
doc/012.20200706v1.3.6.4/qc_initv1.3.6.4.sql

@@ -0,0 +1,21 @@
+use `qc`;
+
+ ALTER TABLE `qc`.`qc_cases_entry` CHANGE `remark` `remark` VARCHAR(1000) CHARSET utf8 COLLATE utf8_general_ci NULL COMMENT '备注';
+
+DROP TABLE IF EXISTS `sys_hospital_set`;
+CREATE TABLE `sys_hospital_set` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `hospital_id` bigint(20) DEFAULT '0' COMMENT '医院ID',
+  `name` varchar(100) DEFAULT NULL COMMENT '配置名称',
+  `code` varchar(100) DEFAULT NULL COMMENT '配置编码',
+  `value` varchar(255) DEFAULT NULL,
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='医院所有配置信息';
+
+INSERT INTO `sys_hospital_set` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '3', '评分类型', 'score_type', '1', '评分类型(0:120分制,1:100分制)');

+ 167 - 0
src/main/java/com/diagbot/entity/SysHospitalSet.java

@@ -0,0 +1,167 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院所有配置信息
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-07-06
+ */
+public class SysHospitalSet implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "SysHospitalSet{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", hospitalId=" + hospitalId +
+            ", name=" + name +
+            ", code=" + code +
+            ", value=" + value +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 8 - 0
src/main/java/com/diagbot/facade/AlgorithmFacade.java

@@ -9,6 +9,7 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.vo.AlgorithmVO;
 import com.diagbot.vo.MedQcresultCasesVO;
 import com.diagbot.vo.QcResultAlgVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
@@ -28,6 +29,9 @@ import java.util.Map;
 public class AlgorithmFacade {
     private final static List<Integer> types = Arrays.asList(0, 1, 2, 3);
 
+    @Autowired
+    private SysHospitalSetFacade sysHospitalSetFacade;
+
     /**
      * 获取评分结果和等级
      *
@@ -112,6 +116,10 @@ public class AlgorithmFacade {
                 .add(homePageExtRes)
                 .multiply(new BigDecimal(100))
                 .divide(new BigDecimal(120), 1, RoundingMode.HALF_UP);
+        // 判断是否是百分制
+        if (sysHospitalSetFacade.getScoreType(algorithmVO.getHospitalId()).equals("1")) {
+            res = cal(algorithmVO);
+        }
         return res;
     }
 

+ 31 - 0
src/main/java/com/diagbot/facade/SysHospitalSetFacade.java

@@ -0,0 +1,31 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysHospitalSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.SysHospitalSetServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/7/6 9:29
+ */
+@Component
+public class SysHospitalSetFacade extends SysHospitalSetServiceImpl {
+
+    public String getScoreType(Long hospitalId) {
+        String res = "0";
+        SysHospitalSet sysHospitalSet
+                = this.getOne(new QueryWrapper<SysHospitalSet>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_id", hospitalId)
+                        .eq("code", "score_type")
+                , false);
+        if (null != sysHospitalSet
+                && sysHospitalSet.getValue().equals("1")) {
+            res = "1";
+        }
+        return res;
+    }
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.SysHospitalSet;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 医院所有配置信息 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-07-06
+ */
+public interface SysHospitalSetMapper extends BaseMapper<SysHospitalSet> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.SysHospitalSet;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 医院所有配置信息 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-07-06
+ */
+public interface SysHospitalSetService extends IService<SysHospitalSet> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.SysHospitalSet;
+import com.diagbot.mapper.SysHospitalSetMapper;
+import com.diagbot.service.SysHospitalSetService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医院所有配置信息 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-07-06
+ */
+@Service
+public class SysHospitalSetServiceImpl extends ServiceImpl<SysHospitalSetMapper, SysHospitalSet> implements SysHospitalSetService {
+
+}

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

@@ -2735,7 +2735,7 @@
         t1.diagnose,
         t1.ward_name AS wardName,
         t2.age,
-        t2.file_code AS fileCode
+        t1.file_code AS fileCode
         FROM
         (
         SELECT DISTINCT
@@ -2746,6 +2746,7 @@
         a.hospital_id,
         a.behospital_code,
         a.bed_code,
+        a.file_code,
         b.LEVEL,
         b.grade_type,
         b.score_res,
@@ -2893,13 +2894,14 @@
         t1.diagnose,
         t1.ward_name AS wardName,
         t2.age,
-        t2.file_code AS fileCode
+        t1.file_code AS fileCode
         FROM
         (
         SELECT DISTINCT
         a.hospital_id,
         a.behospital_code,
         a.bed_code,
+        a.file_code,
         b.LEVEL,
         b.grade_type,
         b.score_res,

+ 20 - 0
src/main/resources/mapper/SysHospitalSetMapper.xml

@@ -0,0 +1,20 @@
+<?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.SysHospitalSetMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysHospitalSet">
+        <id column="id" property="id" />
+        <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" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="name" property="name" />
+        <result column="code" property="code" />
+        <result column="value" property="value" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "med_lis_result", "med_pacs_result"}); // 需要生成的表
+        strategy.setInclude(new String[] { "sys_hospital_set"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);