Commit 4e20858bb9a32cae7cd8a496eb93cb5c9bacaa97

Authored by fangcheng
1 parent 670f95bd3d
Exists in master

获取最后一次高危

Showing 10 changed files with 138 additions and 32 deletions

parent/base.common/src/main/java/com/lyms/base/common/service/user/impl/UsersServiceImpl.java View file @ 4e20858
... ... @@ -6,6 +6,7 @@
6 6 import org.apache.commons.lang3.StringUtils;
7 7 import org.springframework.beans.factory.annotation.Autowired;
8 8 import org.springframework.stereotype.Service;
  9 +import org.springframework.transaction.annotation.Propagation;
9 10 import org.springframework.transaction.annotation.Transactional;
10 11  
11 12 import com.baomidou.mybatisplus.mapper.EntityWrapper;
parent/center.manager/src/main/resources/rebel.xml View file @ 4e20858
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<application generated-by="eclipse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
3   -
4   - <classpath>
5   - <dir name="D:/lyms_wrok/parent/parent/center.manager/target/classes">
6   - </dir>
7   - </classpath>
8   -
9   - <web>
10   - <link target="/">
11   - <dir name="D:/lyms_wrok/parent/parent/center.manager/target/m2e-wtp/web-resources">
12   - <exclude name="/"/>
13   - </dir>
14   - </link>
15   - <link target="/">
16   - <dir name="D:/lyms_wrok/parent/parent/center.manager/src/main/webapp">
17   - </dir>
18   - </link>
19   - </web>
20   -
21   -</application>
parent/hospital.mac/pom.xml View file @ 4e20858
... ... @@ -16,6 +16,11 @@
16 16 <dependencies>
17 17 <dependency>
18 18 <groupId>com.lyms</groupId>
  19 + <artifactId>base.common</artifactId>
  20 + <version>1.0</version>
  21 + </dependency>
  22 + <dependency>
  23 + <groupId>com.lyms</groupId>
19 24 <artifactId>core.sdk</artifactId>
20 25 <version>1.0</version>
21 26 </dependency>
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/diagnose/DiagnoseInfoMapper.java View file @ 4e20858
1 1 package com.lyms.hospital.dao.diagnose;
2 2  
  3 +import com.lyms.base.common.entity.conf.HighriskConf;
3 4 import com.lyms.hospital.entity.diagnose.DiagnoseInfo;
4 5 import com.baomidou.mybatisplus.mapper.BaseMapper;
5 6 import org.springframework.stereotype.Repository;
6 7 import java.io.Serializable;
  8 +import java.util.List;
7 9 /**
8 10 * <p>
9 11 * Mapper接口
... ... @@ -16,6 +18,8 @@
16 18 public interface DiagnoseInfoMapper extends BaseMapper<DiagnoseInfo> {
17 19  
18 20 public Integer deleteLogicById(Serializable id);
  21 +
  22 + public List<HighriskConf> getLastHighrisk(Serializable personId);
19 23  
20 24 }
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/diagnose/DiagnoseInfoMapper.xml View file @ 4e20858
... ... @@ -43,10 +43,25 @@
43 43 <result column="ORG_ID" property="orgId" />
44 44 <result column="DIAGNOSE_TIME" property="diagnoseTime" />
45 45 </resultMap>
46   -
  46 +
47 47 <!-- 通用查询结果列 -->
48 48 <sql id="Base_Column_List">
49 49 ID AS id, WOMAN_ID AS womanId, TYPE AS type, YUN_NUM AS yunNum, CHAN_NUM AS chanNum, SHUN_NUM AS shunNum, PAO_NUM AS paoNum, LIU_NUM AS liuNum, ZIRAN_NUM AS ziranNum, RENGONG_NUM AS rengongNum, SITAI_NUM AS sitaiNum, SICHAN_NUM AS sichanNum, CHILDDIE_NUM AS childdieNum, BIRTHDEFECT_NUM AS birthdefectNum, HEIGHT AS height, WEIGHT AS weight, HEIGHT_AGO AS heightAgo, WEIGHT_INDEX AS weightIndex, BLOOD_SHRINK AS bloodShrink, BLOOD_DIASTOLE AS bloodDiastole, HEART AS heart, LUNG AS lung, WAIYIN_WOMAN AS waiyinWoman, YINDAO_WOMAN AS yindaoWoman, GONGJING_WOMAN AS gongjingWoman, ZIGONG_WOMAN AS zigongWoman, FUJIAN_WOMAN AS fujianWoman, GONGGAO_OBSTETRICS AS gonggaoObstetrics, FUWEI_OBSTETRICS AS fuweiObstetrics, FUZHONG_OBSTETRICS AS fuzhongObstetrics, TAISHU_OBSTETRICS AS taishuObstetrics, DISPOSE_SUGGEST AS disposeSuggest, GUIDE_SUGGEST AS guideSuggest, NEXTINSPECT_NUM AS nextinspectNum, NEXTINSPECT_TIME AS nextinspectTime, DOCTOR_ID AS doctorId, ORG_ID AS orgId, DIAGNOSE_TIME AS diagnoseTime
50 50 </sql>
  51 +
  52 +
  53 + <select id="getLastHighrisk" resultType="HighriskConf">
  54 + select c.* from (
  55 + select m.* from DIAGNOSE_MAPS m where m.DIAGNOSE_ID in (
  56 + select id from (
  57 + select * from DIAGNOSE_INFO d where d.person_id = #{personId} and d.HAS_HIGHRISK = 1 ORDER BY d.DIAGNOSE_TIME desc limit 0,1
  58 + ) as t
  59 + )
  60 + ) m left join HIGHRISK_CONF c on m.SOURCE_ID = c.id
  61 + union all
  62 + select * from (
  63 + select null as ID,'other' as source_ID , null as VERSION_ID,cus_hr_name as name,CUS_HR_COLORCODE as colorcode,CUS_HR_COLORTEXT as colortext ,999 as grouporder,999 as itemorder,dd.cus_hr_grade as grade,1 as enable from DIAGNOSE_INFO dd where dd.person_id = #{personId} and dd.HAS_HIGHRISK = 1 ORDER BY dd.DIAGNOSE_TIME desc limit 0,1
  64 + ) as tt
  65 + </select>
51 66 </mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java View file @ 4e20858
... ... @@ -25,6 +25,8 @@
25 25 */
26 26 @TableId(value = "ID")
27 27 private String id;
  28 + @TableField(value = "PERSON_ID")
  29 + private String persionId;
28 30 /**
29 31 *
30 32 */
... ... @@ -175,6 +177,19 @@
175 177 */
176 178 @TableField(value = "TAISHU_OBSTETRICS")
177 179 private Integer taishuObstetrics;
  180 +
  181 + @TableField(value = "HAS_HIGHRISK")
  182 + private Integer hasHighrisk;
  183 + @TableField(value = "CUS_HR_COLORCODE")
  184 + private String cusHrColorcode;
  185 + @TableField(value = "CUS_HR_COLORTEXT")
  186 + private String cusHrColortext;
  187 + @TableField(value = "CUS_HR_NAME")
  188 + private String cusHrName;
  189 + @TableField(value = "CUS_HR_GRADE")
  190 + private String cusHrGrade;
  191 + @TableField(value = "HAS_DIAGNOSE")
  192 + private Integer hasDiagnose;
178 193 /**
179 194 * 处理意见
180 195 */
... ... @@ -514,6 +529,65 @@
514 529 public void setDiagnoseTime(Date diagnoseTime) {
515 530 this.diagnoseTime = diagnoseTime;
516 531 }
  532 +
  533 + public String getPersionId() {
  534 + return persionId;
  535 + }
  536 +
  537 + public void setPersionId(String persionId) {
  538 + this.persionId = persionId;
  539 + }
  540 +
  541 + public Integer getHasHighrisk() {
  542 + return hasHighrisk;
  543 + }
  544 +
  545 + public void setHasHighrisk(Integer hasHighrisk) {
  546 + this.hasHighrisk = hasHighrisk;
  547 + }
  548 +
  549 + public Integer getHasDiagnose() {
  550 + return hasDiagnose;
  551 + }
  552 +
  553 + public void setHasDiagnose(Integer hasDiagnose) {
  554 + this.hasDiagnose = hasDiagnose;
  555 + }
  556 +
  557 + public String getCusHrColorcode() {
  558 + return cusHrColorcode;
  559 + }
  560 +
  561 + public void setCusHrColorcode(String cusHrColorcode) {
  562 + this.cusHrColorcode = cusHrColorcode;
  563 + }
  564 +
  565 + public String getCusHrColortext() {
  566 + return cusHrColortext;
  567 + }
  568 +
  569 + public void setCusHrColortext(String cusHrColortext) {
  570 + this.cusHrColortext = cusHrColortext;
  571 + }
  572 +
  573 + public String getCusHrName() {
  574 + return cusHrName;
  575 + }
  576 +
  577 + public void setCusHrName(String cusHrName) {
  578 + this.cusHrName = cusHrName;
  579 + }
  580 +
  581 + public String getCusHrGrade() {
  582 + return cusHrGrade;
  583 + }
  584 +
  585 + public void setCusHrGrade(String cusHrGrade) {
  586 + this.cusHrGrade = cusHrGrade;
  587 + }
  588 +
  589 +
  590 +
517 591  
518 592 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/DiagnoseInfoService.java View file @ 4e20858
1 1 package com.lyms.hospital.service.diagnose;
2 2  
  3 +import com.lyms.base.common.entity.conf.HighriskConf;
3 4 import com.lyms.hospital.entity.diagnose.DiagnoseInfo;
4 5 import com.lyms.web.service.BaseService;
5 6 import java.io.Serializable;
  7 +import java.util.List;
6 8  
7 9 /**
8 10 * <p>
9 11  
... ... @@ -14,12 +16,23 @@
14 16 */
15 17 public interface DiagnoseInfoService extends BaseService<DiagnoseInfo> {
16 18  
17   - /**
  19 + /**
18 20 * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
19 21 * <li>@param id 删除主键id
20 22 * <li>@return 大于0修改成功,否则为失败
21 23 */
22   - public Integer deleteLogicById(Serializable id);
23   -
  24 + public Integer deleteLogicById(Serializable id);
  25 +
  26 + /**
  27 + * <li>@Description:根据居民ID获取末次高危
  28 + * <li>@param personId 居民ID
  29 + * <li>@return
  30 + * <li>创建人:方承
  31 + * <li>创建时间:2017年4月25日
  32 + * <li>修改人:
  33 + * <li>修改时间:
  34 + */
  35 + public List<HighriskConf> getLastHighrisk(Serializable personId);
  36 +
24 37 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java View file @ 4e20858
... ... @@ -10,6 +10,7 @@
10 10  
11 11 import com.baomidou.mybatisplus.mapper.EntityWrapper;
12 12 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  13 +import com.lyms.base.common.entity.conf.HighriskConf;
13 14 import com.lyms.hospital.dao.diagnose.DiagnoseInfoMapper;
14 15 import com.lyms.hospital.entity.assist.DiagnoseAssit;
15 16 import com.lyms.hospital.entity.diagnose.DiagnoseInfo;
... ... @@ -101,6 +102,11 @@
101 102 EntityWrapper<DiagnoseInfo> ew = new EntityWrapper<DiagnoseInfo>();
102 103 ew.where("pid={0}", pid);
103 104 return selectList(ew);
  105 + }
  106 +
  107 + @Override
  108 + public List<HighriskConf> getLastHighrisk(Serializable personId) {
  109 + return baseMapper.getLastHighrisk(personId);
104 110 }
105 111 }
parent/hospital.web/src/test/java/test/hospital/diagnose/DiagnoseMapsTest.java View file @ 4e20858
... ... @@ -5,6 +5,7 @@
5 5  
6 6 import com.lyms.base.common.entity.conf.DiagnoseMaps;
7 7 import com.lyms.base.common.service.conf.DiagnoseMapsService;
  8 +import com.lyms.hospital.service.diagnose.DiagnoseInfoService;
8 9 import com.lyms.util.StrUtils;
9 10  
10 11 import test.hospital.BaseServiceTest;
... ... @@ -14,6 +15,9 @@
14 15 @Autowired
15 16 private DiagnoseMapsService diagnoseMapsService;
16 17  
  18 + @Autowired
  19 + private DiagnoseInfoService diagnoseInfoService;
  20 +
17 21 /**
18 22 * <li>@Description:根据诊断id获取所有诊断项
19 23 * <li>
... ... @@ -34,6 +38,11 @@
34 38 entity.setDiagnoseId("1");
35 39 entity.setSourceId("123");
36 40 diagnoseMapsService.insert(entity);
  41 + }
  42 +
  43 + @Test
  44 + public void getLastHighrisk(){
  45 + outJson(diagnoseInfoService.getLastHighrisk("1"));
37 46 }
38 47 }
parent/mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/generator/MysqlGenerator.java View file @ 4e20858
... ... @@ -44,16 +44,16 @@
44 44  
45 45 private static void customSet(GlobalConfig gc, StrategyConfig strategy, PackageConfig pc) {
46 46 gc.setOutputDir("D://mybatis-plus-generate");
47   - gc.setAuthor("xujiahong");
  47 + gc.setAuthor("fangcheng");
48 48  
49 49 // strategy.setInclude(new String[] {
50 50 // "SYS_USERS","SYS_USER_ROLE_MAPS","SYS_ROLES" }); // 需要生成的表
51   - strategy.setInclude(new String[] { "WOMAN_FOLIC_ACID"}); // 需要生成的表
52   - pc.setParent("com.lyms.hospital");
53   -// pc.setParent("com.lyms.base.common");
  51 + strategy.setInclude(new String[] { "SYS_USER_DATA_PERMISSIONS"}); // 需要生成的表
  52 +// pc.setParent("com.lyms.hospital");
  53 + pc.setParent("com.lyms.base.common");
54 54  
55 55 // 加在controller后面
56   - pc.setFunctionName("woman"); // com.lyms.hospital.web.controller.sys
  56 + pc.setFunctionName("user"); // com.lyms.hospital.web.controller.sys
57 57 // pc.setModuleName("sys"); //com.lyms.hospital.sys.controller
58 58 // 加在controller前面
59 59  
60 60  
... ... @@ -103,9 +103,9 @@
103 103 DataSourceConfig dsc = new DataSourceConfig();
104 104 dsc.setDbType(DbType.MYSQL);
105 105 dsc.setDriverName("com.mysql.jdbc.Driver");
106   - dsc.setUsername("hospital");
  106 + dsc.setUsername("center");
107 107 dsc.setPassword("lyms2015");
108   - dsc.setUrl("jdbc:mysql://119.90.57.26:3306/hospital?characterEncoding=utf8");
  108 + dsc.setUrl("jdbc:mysql://119.90.57.26:3306/center?characterEncoding=utf8");
109 109 mpg.setDataSource(dsc);
110 110  
111 111 // 策略配置