Commit 3334aa2b187c376ff92d6f668e9e53be6b955df2

Authored by yangfei
Exists in master

Merge branch 'master' of https://git.healthbaby.com.cn/jiangjiazhi/center

Showing 32 changed files

parent/base.common/src/main/java/com/lyms/base/common/service/sys/SysDictService.java View file @ 3334aa2
... ... @@ -32,6 +32,17 @@
32 32 * <li>修改时间:
33 33 */
34 34 public List<SysDict> getDictListByTypeCode(Serializable typeCode);
  35 +
  36 + /**
  37 + * <li>@Description:根据ID获取字典中对应的记录名称
  38 + * <li>@param id
  39 + * <li>@return
  40 + * <li>创建人:xujiahong
  41 + * <li>创建时间:2017年4月21日
  42 + * <li>修改人:
  43 + * <li>修改时间:
  44 + */
  45 + public String getDictNameById(String id);
35 46  
36 47 }
parent/base.common/src/main/java/com/lyms/base/common/service/sys/impl/SysDictServiceImpl.java View file @ 3334aa2
... ... @@ -27,5 +27,11 @@
27 27 public List<SysDict> getDictListByTypeCode(Serializable typeCode) {
28 28 return baseMapper.getDictListByTypeCode(typeCode);
29 29 }
  30 +
  31 + @Override
  32 + public String getDictNameById(String id) {
  33 + SysDict dic = baseMapper.selectById(id);
  34 + return dic==null?null:dic.getTxt();
  35 + }
30 36 }
parent/base.common/src/main/java/com/lyms/base/common/service/user/impl/UsersServiceImpl.java View file @ 3334aa2
... ... @@ -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/core.sdk/src/main/java/com/lyms/util/DateUtil.java View file @ 3334aa2
... ... @@ -531,7 +531,10 @@
531 531 long time1 = cal.getTimeInMillis();
532 532 cal.setTime(bdate);
533 533 long time2 = cal.getTimeInMillis();
534   - long between_days = (time2 - time1) / (1000 * 3600 * 24);
  534 + long between_days = (time2 - time1) / (1000L * 3600 * 24);
  535 + if(between_days<0){//add by xujiahong : we don't need to know the date sequence
  536 + between_days = 0-between_days;
  537 + }
535 538 return Integer.parseInt(String.valueOf(between_days));
536 539 } catch (ParseException e) {
537 540 e.printStackTrace();
parent/hospital.mac/pom.xml View file @ 3334aa2
... ... @@ -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 @ 3334aa2
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 @ 3334aa2
... ... @@ -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/dao/woman/WomanFetationRecordMapper.java View file @ 3334aa2
1 1 package com.lyms.hospital.dao.woman;
2 2  
  3 +import com.lyms.hospital.entity.woman.FetationStages;
3 4 import com.lyms.hospital.entity.woman.WomanFetationRecord;
4 5 import com.baomidou.mybatisplus.mapper.BaseMapper;
5 6  
... ... @@ -35,6 +36,29 @@
35 36 */
36 37 public List<Map<String, Object>> selectHistory(@Param("cardType") String cardType, @Param("cardNo") String cardNo,
37 38 @Param("vcCardNo") String vcCardNo);
  39 +
  40 + /**
  41 + * <li>@Description:关联&合并省市区信息,避免接口多次建立SQL链接
  42 + * <li>@param id
  43 + * <li>@return
  44 + * <li>创建人:xujiahong
  45 + * <li>创建时间:2017年4月24日
  46 + * <li>修改人:
  47 + * <li>修改时间:
  48 + */
  49 + public WomanFetationRecord selectDetailById(String id);
  50 +
  51 +
  52 + /**
  53 + * <li>@Description:根据居民表id获取用户产程记录
  54 + * <li>@param personId
  55 + * <li>@return
  56 + * <li>创建人:方承
  57 + * <li>创建时间:2017年4月26日
  58 + * <li>修改人:
  59 + * <li>修改时间:
  60 + */
  61 + public List<FetationStages> getFetationStages(Serializable personId);
38 62  
39 63 }
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/WomanFetationRecordMapper.xml View file @ 3334aa2
... ... @@ -56,19 +56,29 @@
56 56 <result column="IFDEL" property="ifdel" />
57 57 <result column="ENALBLE" property="enalble" />
58 58 <result column="WOMAN_PERSON_ID" property="womanPersonId" />
  59 + <result column="WOMAN_TYPE" property="womanType" />
  60 + <result column="DUE_STATUS" property="dueStatus" />
  61 + <result column="SOURCE_ID" property="sourceId" />
  62 +
  63 + <result column="liveAddress" property="liveAddress" />
  64 + <result column="registerAddress" property="registerAddress" />
  65 + <result column="postpartumAddress" property="postpartumAddress" />
59 66 </resultMap>
60 67  
61 68 <!-- 通用查询结果列 -->
62 69 <sql id="Base_Column_List">
63   - ID AS id, BASE_WOMAN_NAME AS baseWomanName, BASE_PAPERS_TYPE AS basePapersType, BASE_PAPERS_NUMBER AS basePapersNumber, BASE_WOMAN_COUNTRY AS baseWomanCountry, BASE_WOMAN_NATION AS baseWomanNation, BASE_WOMAN_BIRTH AS baseWomanBirth, BASE_REGISTER_TYPE AS baseRegisterType, BASE_DWELL_TYPE AS baseDwellType, BASE_OCCUPATION_TYPE AS baseOccupationType, BASE_WOMAN_CULTURE AS baseWomanCulture, BASE_FAMILY_INCOME AS baseFamilyIncome, CONTACT_WOMAN_WAY AS contactWomanWay, CONTACT_WORK_ADDRESS AS contactWorkAddress, CONTACT_DWELL_PROVINCE AS contactDwellProvince, CONTACT_DWELL_CITY AS contactDwellCity, CONTACT_DWELL_AREA AS contactDwellArea, CONTACT_DWELL_STREET AS contactDwellStreet, CONTACT_DWELL_DETAIL AS contactDwellDetail, CONTACT_REGISTER_PROVINCE AS contactRegisterProvince, CONTACT_REGISTER_CITY AS contactRegisterCity, CONTACT_REGISTER_AREA AS contactRegisterArea, CONTACT_REGISTER_STREET AS contactRegisterStreet, CONTACT_REGISTER_DETAIL AS contactRegisterDetail, CONTACT_POSTPARTUM_PROVINCE AS contactPostpartumProvince, CONTACT_POSTPARTUM_CITY AS contactPostpartumCity, CONTACT_POSTPARTUM_AREA AS contactPostpartumArea, CONTACT_POSTPARTUM_STREET AS contactPostpartumStreet, CONTACT_POSTPARTUM_DETAIL AS contactPostpartumDetail, HOSPITAL_LAST_MENSTRUATION AS hospitalLastMenstruation, HOSPITAL_CORRECT_LAST_MENSTRUATION AS hospitalCorrectLastMenstruation, HOSPITAL_EXPECTED_DATE AS hospitalExpectedDate, HOSPITAL_PATIENT_CARD AS hospitalPatientCard, HOSPITAL_BARCODE AS hospitalBarcode, HOSPITAL_RECORD_NUMBER AS hospitalRecordNumber, HOSPITAL_SERVICE_TYPE AS hospitalServiceType, HOSPITAL_SERVICE_STATUS AS hospitalServiceStatus, HOSPITAL_MEMBER AS hospitalMember, HOSPITAL_RECORD_DOCTOR AS hospitalRecordDoctor, HOSPITAL_RECORD_DATE AS hospitalRecordDate, HOSPITAL_RECORD_REMARK AS hospitalRecordRemark, HOSPITAL_MEMBER_DATE AS hospitalMemberDate, BUILD_DATE AS buildDate, HOSTPITAL_ID AS hostpitalId, BUILD_TYPE AS buildType, CREATE_ID AS createId, CREATE_TIME AS createTime, MODIFY_ID AS modifyId, MODIFY_TIME AS modifyTime, IFDEL AS ifdel, ENALBLE AS enalble, WOMAN_PERSON_ID AS womanPersonId
  70 + ID AS id, BASE_WOMAN_NAME AS baseWomanName, BASE_PAPERS_TYPE AS basePapersType, BASE_PAPERS_NUMBER AS basePapersNumber, BASE_WOMAN_COUNTRY AS baseWomanCountry, BASE_WOMAN_NATION AS baseWomanNation, BASE_WOMAN_BIRTH AS baseWomanBirth, BASE_REGISTER_TYPE AS baseRegisterType, BASE_DWELL_TYPE AS baseDwellType, BASE_OCCUPATION_TYPE AS baseOccupationType, BASE_WOMAN_CULTURE AS baseWomanCulture, BASE_FAMILY_INCOME AS baseFamilyIncome, CONTACT_WOMAN_WAY AS contactWomanWay, CONTACT_WORK_ADDRESS AS contactWorkAddress, CONTACT_DWELL_PROVINCE AS contactDwellProvince, CONTACT_DWELL_CITY AS contactDwellCity, CONTACT_DWELL_AREA AS contactDwellArea, CONTACT_DWELL_STREET AS contactDwellStreet, CONTACT_DWELL_DETAIL AS contactDwellDetail, CONTACT_REGISTER_PROVINCE AS contactRegisterProvince, CONTACT_REGISTER_CITY AS contactRegisterCity, CONTACT_REGISTER_AREA AS contactRegisterArea, CONTACT_REGISTER_STREET AS contactRegisterStreet, CONTACT_REGISTER_DETAIL AS contactRegisterDetail, CONTACT_POSTPARTUM_PROVINCE AS contactPostpartumProvince, CONTACT_POSTPARTUM_CITY AS contactPostpartumCity, CONTACT_POSTPARTUM_AREA AS contactPostpartumArea, CONTACT_POSTPARTUM_STREET AS contactPostpartumStreet, CONTACT_POSTPARTUM_DETAIL AS contactPostpartumDetail, HOSPITAL_LAST_MENSTRUATION AS hospitalLastMenstruation, HOSPITAL_CORRECT_LAST_MENSTRUATION AS hospitalCorrectLastMenstruation, HOSPITAL_EXPECTED_DATE AS hospitalExpectedDate, HOSPITAL_PATIENT_CARD AS hospitalPatientCard, HOSPITAL_BARCODE AS hospitalBarcode, HOSPITAL_RECORD_NUMBER AS hospitalRecordNumber, HOSPITAL_SERVICE_TYPE AS hospitalServiceType, HOSPITAL_SERVICE_STATUS AS hospitalServiceStatus, HOSPITAL_MEMBER AS hospitalMember, HOSPITAL_RECORD_DOCTOR AS hospitalRecordDoctor, HOSPITAL_RECORD_DATE AS hospitalRecordDate, HOSPITAL_RECORD_REMARK AS hospitalRecordRemark, HOSPITAL_MEMBER_DATE AS hospitalMemberDate, BUILD_DATE AS buildDate, HOSTPITAL_ID AS hostpitalId, BUILD_TYPE AS buildType, CREATE_ID AS createId, CREATE_TIME AS createTime, MODIFY_ID AS modifyId, MODIFY_TIME AS modifyTime, IFDEL AS ifdel, ENALBLE AS enalble, WOMAN_PERSON_ID AS womanPersonId,
  71 + WOMAN_TYPE AS womanType,DUE_STATUS AS dueStatus,SOURCE_ID AS sourceId
64 72 </sql>
65 73  
66 74 <select id="selectHistory" resultType="map">
67 75 SELECT wf.HOSPITAL_RECORD_DATE AS bookbuildDate,org.`NAME` AS bookbuildHospital,
68   - wf.`HOSTPITAL_ID` AS hospitalId,wf.`ID` AS id
  76 + wf.`HOSTPITAL_ID` AS hospitalId,wf.`ID` AS id,
  77 + 0 AS dueStatus,null AS fmTime,1 AS type <!-- TODO 部分未涉及字段 -->
69 78 FROM WOMAN_FETATION_RECORD wf
70 79 INNER JOIN SYS_ORGANIZATIONS org ON wf.`HOSTPITAL_ID`=org.`ID`
71 80 <where>
  81 + AND wf.IFDEL=0
72 82 <if test="cardType!=null">
73 83 AND wf.BASE_PAPERS_TYPE=#{cardType}
74 84 </if>
... ... @@ -81,6 +91,21 @@
81 91 </where>
82 92 ORDER BY wf.HOSPITAL_RECORD_DATE DESC
83 93 </select>
  94 +
  95 + <select id="selectDetailById" resultMap="BaseResultMap">
  96 + SELECT *,
  97 +CONCAT(CONTACT_DWELL_PROVINCE,CONTACT_DWELL_CITY,CONTACT_DWELL_AREA,CONTACT_DWELL_STREET,CONTACT_DWELL_DETAIL) AS liveAddress,
  98 +CONCAT(CONTACT_REGISTER_PROVINCE,CONTACT_REGISTER_CITY,CONTACT_REGISTER_AREA,CONTACT_REGISTER_STREET,CONTACT_REGISTER_DETAIL) AS registerAddress,
  99 +CONCAT(CONTACT_POSTPARTUM_PROVINCE,CONTACT_POSTPARTUM_CITY,CONTACT_POSTPARTUM_AREA,CONTACT_POSTPARTUM_STREET,CONTACT_POSTPARTUM_DETAIL) AS postpartumAddress
  100 + FROM WOMAN_FETATION_RECORD WHERE ID = #{id}
  101 + </select>
  102 +
  103 +
  104 + <select id="getFetationStages" resultMap="HighriskMapsResult">
  105 + select
  106 + <include refid="Maps_Column_List"></include>
  107 + from HIGHRISK_MAPS m left join HIGHRISK_CONF c on m.SOURCE_ID = c.SOURCE_ID where m.DIAGNOSE_ID = #{id}
  108 + </select>
84 109  
85 110 </mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthInfo.java View file @ 3334aa2
... ... @@ -24,7 +24,18 @@
24 24 */
25 25 @TableId(value="ID")
26 26 private String id;
27   - /**
  27 +
  28 + @TableId(value="PERSON_ID")
  29 + private String personId;
  30 + public String getPersonId() {
  31 + return personId;
  32 + }
  33 +
  34 + public void setPersonId(String personId) {
  35 + this.personId = personId;
  36 + }
  37 +
  38 + /**
28 39 * 孕妇ID
29 40 */
30 41 @TableField(value="WOMAN_ID")
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java View file @ 3334aa2
... ... @@ -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/entity/leave/LeaveInfo.java View file @ 3334aa2
... ... @@ -24,6 +24,9 @@
24 24 */
25 25 @TableId(value="ID")
26 26 private String id;
  27 +
  28 + @TableId(value="PERSON_ID")
  29 + private String personId;
27 30 /**
28 31 * 孕妇ID
29 32 */
... ... @@ -344,6 +347,14 @@
344 347 public void setEnable(Integer enable) {
345 348 this.enable = enable;
346 349 }
  350 +
  351 + public String getPersonId() {
  352 + return personId;
  353 + }
  354 +
  355 + public void setPersonId(String personId) {
  356 + this.personId = personId;
  357 + }
347 358  
348 359 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/recheck/PostpartumRee.java View file @ 3334aa2
... ... @@ -24,6 +24,9 @@
24 24 */
25 25 @TableId(value="ID")
26 26 private String id;
  27 +
  28 + @TableId(value="PERSON_ID")
  29 + private String personId;
27 30 /**
28 31 * 孕妇ID
29 32 */
... ... @@ -473,6 +476,14 @@
473 476 public void setWomanAge(Integer womanAge) {
474 477 this.womanAge = womanAge;
475 478 }
  479 +
  480 + public String getPersonId() {
  481 + return personId;
  482 + }
  483 +
  484 + public void setPersonId(String personId) {
  485 + this.personId = personId;
  486 + }
476 487  
477 488  
478 489 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/woman/FetationStages.java View file @ 3334aa2
  1 +package com.lyms.hospital.entity.woman;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * <li>@ClassName: 孕妇产程
  7 + * <li>@Description: TODO(类描述)
  8 + * <li>@author 方承
  9 + * <li>@date 2017年4月25日
  10 + * <li>
  11 + */
  12 +public class FetationStages {
  13 + private String id;
  14 + private String title;
  15 + private Date checkTime;
  16 + private Integer type;
  17 + private String hospitalId;
  18 + private String hospitalName;
  19 + public String getId() {
  20 + return id;
  21 + }
  22 + public void setId(String id) {
  23 + this.id = id;
  24 + }
  25 + public String getTitle() {
  26 + return title;
  27 + }
  28 + public void setTitle(String title) {
  29 + this.title = title;
  30 + }
  31 + public Date getCheckTime() {
  32 + return checkTime;
  33 + }
  34 + public void setCheckTime(Date checkTime) {
  35 + this.checkTime = checkTime;
  36 + }
  37 + public Integer getType() {
  38 + return type;
  39 + }
  40 + public void setType(Integer type) {
  41 + this.type = type;
  42 + }
  43 + public String getHospitalId() {
  44 + return hospitalId;
  45 + }
  46 + public void setHospitalId(String hospitalId) {
  47 + this.hospitalId = hospitalId;
  48 + }
  49 + public String getHospitalName() {
  50 + return hospitalName;
  51 + }
  52 + public void setHospitalName(String hospitalName) {
  53 + this.hospitalName = hospitalName;
  54 + }
  55 +
  56 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/woman/WomanFetationRecord.java View file @ 3334aa2
... ... @@ -24,6 +24,9 @@
24 24 */
25 25 @TableId(value="ID")
26 26 private String id;
  27 +
  28 + @TableId(value="PERSON_ID")
  29 + private String personId;
27 30 /**
28 31 * 孕妇姓名
29 32 */
30 33  
... ... @@ -256,10 +259,8 @@
256 259 */
257 260 @TableField(value="WOMAN_PERSON_ID")
258 261 private String womanPersonId;
259   -
260   -
261 262 /**
262   - * 孕妇出生============================================================================
  263 + * 孕妇出生
263 264 */
264 265 @TableField(value="BASE_WOMAN_BIRTH")
265 266 private Date baseWomanBirth;
... ... @@ -283,6 +284,33 @@
283 284 */
284 285 @TableField(value="HOSPITAL_RECORD_DATE")
285 286 private Date hospitalRecordDate;
  287 +
  288 + //妇女类别:1孕妇,3产妇
  289 + @TableField(value="WOMAN_TYPE")
  290 + private Integer womanType;
  291 + //分娩状态 0未终止妊娠 1终止妊娠
  292 + @TableField(value="DUE_STATUS")
  293 + private Integer dueStatus;
  294 + //隐藏建档源ID
  295 + @TableField(value="SOURCE_ID")
  296 + private String sourceId;
  297 +
  298 + /**
  299 + * 分娩日期
  300 + */
  301 + @TableField(value="FM_DATE")
  302 + private Date fmDate;
  303 + /**
  304 + * 是否自动分娩,0不是,1是
  305 + */
  306 + @TableField(value="IFAUTOFM")
  307 + private Integer ifautofm;
  308 +
  309 + /**
  310 + * 孕妇状态,1孕妇,3产妇
  311 + */
  312 + @TableField(value="STATE")
  313 + private Integer state;
286 314  
287 315 //格式化字段
288 316 @TableField(exist=false)
... ... @@ -295,6 +323,14 @@
295 323 private String hospitalExpectedDateStr;//预产期Str
296 324 @TableField(exist=false)
297 325 private String hospitalRecordDateStr;//建档日期Str
  326 +
  327 + //地址拼接字段
  328 + @TableField(exist=false)
  329 + private String liveAddress;//居住地
  330 + @TableField(exist=false)
  331 + private String registerAddress;//户籍地
  332 + @TableField(exist=false)
  333 + private String postpartumAddress;//产后休养地
298 334  
299 335 public String getId() {
300 336 return id;
... ... @@ -751,6 +787,86 @@
751 787 public void setHospitalRecordDateStr(String hospitalRecordDateStr) {
752 788 this.hospitalRecordDateStr = hospitalRecordDateStr;
753 789 }
  790 +
  791 + public String getLiveAddress() {
  792 + return liveAddress;
  793 + }
  794 +
  795 + public void setLiveAddress(String liveAddress) {
  796 + this.liveAddress = liveAddress;
  797 + }
  798 +
  799 + public String getRegisterAddress() {
  800 + return registerAddress;
  801 + }
  802 +
  803 + public void setRegisterAddress(String registerAddress) {
  804 + this.registerAddress = registerAddress;
  805 + }
  806 +
  807 + public String getPostpartumAddress() {
  808 + return postpartumAddress;
  809 + }
  810 +
  811 + public void setPostpartumAddress(String postpartumAddress) {
  812 + this.postpartumAddress = postpartumAddress;
  813 + }
  814 +
  815 + public Integer getWomanType() {
  816 + return womanType;
  817 + }
  818 +
  819 + public void setWomanType(Integer womanType) {
  820 + this.womanType = womanType;
  821 + }
  822 +
  823 + public Integer getDueStatus() {
  824 + return dueStatus;
  825 + }
  826 +
  827 + public void setDueStatus(Integer dueStatus) {
  828 + this.dueStatus = dueStatus;
  829 + }
  830 +
  831 + public String getSourceId() {
  832 + return sourceId;
  833 + }
  834 +
  835 + public void setSourceId(String sourceId) {
  836 + this.sourceId = sourceId;
  837 + }
  838 +
  839 + public Date getFmDate() {
  840 + return fmDate;
  841 + }
  842 +
  843 + public void setFmDate(Date fmDate) {
  844 + this.fmDate = fmDate;
  845 + }
  846 +
  847 + public String getPersonId() {
  848 + return personId;
  849 + }
  850 +
  851 + public void setPersonId(String personId) {
  852 + this.personId = personId;
  853 + }
  854 +
  855 + public Integer getIfautofm() {
  856 + return ifautofm;
  857 + }
  858 +
  859 + public void setIfautofm(Integer ifautofm) {
  860 + this.ifautofm = ifautofm;
  861 + }
  862 +
  863 + public Integer getState() {
  864 + return state;
  865 + }
  866 +
  867 + public void setState(Integer state) {
  868 + this.state = state;
  869 + }
754 870  
755 871  
756 872 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/woman/WomanRecord.java View file @ 3334aa2
... ... @@ -24,7 +24,17 @@
24 24 */
25 25 @TableId(value="ID")
26 26 private String id;
27   - /**
  27 + @TableId(value="PERSON_ID")
  28 + private String personId;
  29 + public String getPersonId() {
  30 + return personId;
  31 + }
  32 +
  33 + public void setPersonId(String personId) {
  34 + this.personId = personId;
  35 + }
  36 +
  37 + /**
28 38 * 孕妇姓名
29 39 */
30 40 @TableField(value="BASE_WOMAN_NAME")
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/ServiceStatusEnums.java View file @ 3334aa2
  1 +package com.lyms.hospital.enums;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * Created by Administrator on 2016/6/21.
  10 + */
  11 +public enum ServiceStatusEnums {
  12 +
  13 + //标准服务
  14 + STANDARD_ALL(101,"全部",0),
  15 + STANDARD_OPEN(0,"开通",0),
  16 + NO_OPEN(1,"不开通",0),
  17 + STANDARD_OVERDUE(2,"过期",0),
  18 +
  19 + //增值服务
  20 + ADD_ALL(102,"全部",1),
  21 + ADD_OPEN(3,"开通",1),
  22 + UNSUBSCRIBE(4,"退订",1),
  23 + ADD_OVERDUE(5,"过期",1),
  24 + SUSPEND(6,"暂停",1),
  25 +
  26 + //全部
  27 + ALL(103,"全部",100),
  28 + ALL_OPEN(7,"开通",100),
  29 + ALL_NO_OPEN(8,"不开通",100),
  30 + ALL_OVERDUE(9,"过期",100);
  31 +
  32 + private ServiceStatusEnums(int id, String name,int pid){
  33 + this.name=name;
  34 + this.id =id;
  35 + this.pid =pid;
  36 + }
  37 + private String name;
  38 + private int id;
  39 + private int pid;
  40 +
  41 +
  42 + public static List<Map<String,String>> getServiceStatusList()
  43 + {
  44 + List<Map<String,String>> list = new ArrayList<>();
  45 + for(ServiceStatusEnums s : ServiceStatusEnums.values()) {
  46 + if (s.getId() < 100)
  47 + {
  48 + Map<String,String> map = new HashMap<>();
  49 + map.put("id", String.valueOf(s.getId()));
  50 + map.put("name", s.getName());
  51 + map.put("pid", String.valueOf(s.getPid()));
  52 + list.add(map);
  53 + }
  54 +
  55 + }
  56 + return list;
  57 + }
  58 +
  59 + public static List<Map<String,String>> getServiceTypeList()
  60 + {
  61 + List<Map<String,String>> list = new ArrayList<>();
  62 + Map<String, String> stMap1 = new HashMap<>();
  63 + stMap1.put("id", "0");
  64 + stMap1.put("name", "标准服务");
  65 + Map<String, String> stMap2 = new HashMap<>();
  66 + stMap2.put("id", "1");
  67 + stMap2.put("name", "增值服务");
  68 + list.add(stMap1);
  69 + list.add(stMap2);
  70 + return list;
  71 + }
  72 +
  73 +
  74 + public static List<Map<String,String>> getServiceStatusByPid(int pid)
  75 + {
  76 + List<Map<String,String>> list = new ArrayList<>();
  77 + for(ServiceStatusEnums s : ServiceStatusEnums.values()) {
  78 + if (s.getPid() == pid)
  79 + {
  80 + Map<String,String> map = new HashMap<>();
  81 + map.put("id", String.valueOf(s.getId()));
  82 + map.put("name", s.getName());
  83 + map.put("pid", String.valueOf(s.getPid()));
  84 + list.add(map);
  85 + }
  86 +
  87 + }
  88 + return list;
  89 + }
  90 +
  91 + public static String getNameById(Integer id)
  92 + {
  93 + for(ServiceStatusEnums s : ServiceStatusEnums.values()) {
  94 + if (id != null && s.getId() == id)
  95 + {
  96 + return s.getName();
  97 + }
  98 +
  99 + }
  100 + return "";
  101 + }
  102 +
  103 + public String getName() {
  104 + return name;
  105 + }
  106 +
  107 + public void setName(String name) {
  108 + this.name = name;
  109 + }
  110 +
  111 + public int getId() {
  112 + return id;
  113 + }
  114 +
  115 + public void setId(int id) {
  116 + this.id = id;
  117 + }
  118 +
  119 + public int getPid() {
  120 + return pid;
  121 + }
  122 +
  123 + public void setPid(int pid) {
  124 + this.pid = pid;
  125 + }
  126 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/DiagnoseInfoService.java View file @ 3334aa2
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 @ 3334aa2
... ... @@ -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.mac/src/main/java/com/lyms/hospital/service/woman/WomanFetationRecordService.java View file @ 3334aa2
... ... @@ -4,6 +4,7 @@
4 4 import java.util.List;
5 5 import java.util.Map;
6 6  
  7 +import com.lyms.hospital.entity.woman.FetationStages;
7 8 import com.lyms.hospital.entity.woman.WomanFetationRecord;
8 9 import com.lyms.hospital.entity.woman.WomanHusband;
9 10 import com.lyms.web.service.BaseService;
... ... @@ -20,6 +21,29 @@
20 21 * @since 2017-03-31
21 22 */
22 23 public interface WomanFetationRecordService extends BaseService<WomanFetationRecord> {
  24 +
  25 +
  26 + /**
  27 + * <li>@Description:条件查询有效的(未被删除的,启用的,未终止妊娠的,未分娩的&其他指定条件)孕妇建档
  28 + * <li>@param obj
  29 + * <li>@return
  30 + * <li>创建人:xujiahong
  31 + * <li>创建时间:2017年4月25日
  32 + * <li>修改人:
  33 + * <li>修改时间:
  34 + */
  35 + public WomanFetationRecord queryEffectiveOne(WomanFetationRecord obj);
  36 +
  37 + /**
  38 + * <li>@Description:条件查询对象(未删除的)(主要用于验证条件下的存在性)
  39 + * <li>@param obj
  40 + * <li>@return
  41 + * <li>创建人:xujiahong
  42 + * <li>创建时间:2017年4月24日
  43 + * <li>修改人:
  44 + * <li>修改时间:
  45 + */
  46 + public WomanFetationRecord queryOne(WomanFetationRecord obj);
23 47  
24 48 /**
25 49 * <li>@Description:查询-查询历史建档记录(by证件信息和就诊卡号)
... ... @@ -36,7 +60,7 @@
36 60  
37 61 /**
38 62 * <li>@Description:查询-根据孕妇建档ID查询表单详情
39   - * <li>@return
  63 + * <li>@return (null if 没有建档信息 或 已删除)
40 64 * <li>创建人:xujiahong
41 65 * <li>创建时间:2017年4月19日
42 66 * <li>修改人:
... ... @@ -100,5 +124,28 @@
100 124 */
101 125 public WomanFetationRecord findByCard(String cardType, String cardNum, String patientNum, String orgid);
102 126  
  127 + /**
  128 + * <li>@Description:关联&合并省市区信息,避免接口多次建立SQL链接
  129 + * <li>@param id
  130 + * <li>@return
  131 + * <li>创建人:xujiahong
  132 + * <li>创建时间:2017年4月24日
  133 + * <li>修改人:
  134 + * <li>修改时间:
  135 + */
  136 + public WomanFetationRecord selectDetailById(String id);
  137 +
  138 +
  139 + /**
  140 + * <li>@Description:根据居民表id获取孕妇产程
  141 + * <li>@param personId
  142 + * <li>@return
  143 + * <li>创建人:方承
  144 + * <li>创建时间:2017年4月25日
  145 + * <li>修改人:
  146 + * <li>修改时间:
  147 + */
  148 + public List<List<FetationStages>> getFetationStages(Serializable personId);
  149 +
103 150 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java View file @ 3334aa2
... ... @@ -9,11 +9,14 @@
9 9 import org.springframework.beans.factory.annotation.Autowired;
10 10 import org.springframework.stereotype.Service;
11 11 import org.springframework.transaction.annotation.Transactional;
  12 +import org.springframework.util.StringUtils;
12 13  
  14 +import com.alibaba.fastjson.JSONObject;
13 15 import com.baomidou.mybatisplus.mapper.EntityWrapper;
14 16 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
15 17 import com.lyms.exception.SystemException;
16 18 import com.lyms.hospital.dao.woman.WomanFetationRecordMapper;
  19 +import com.lyms.hospital.entity.woman.FetationStages;
17 20 import com.lyms.hospital.entity.woman.WomanFetationRecord;
18 21 import com.lyms.hospital.entity.woman.WomanHusband;
19 22 import com.lyms.hospital.enums.IfdelEnum;
... ... @@ -22,6 +25,7 @@
22 25 import com.lyms.hospital.service.woman.WomanHusbandService;
23 26 import com.lyms.hospital.service.woman.WomanPersonService;
24 27 import com.lyms.util.CollectionUtils;
  28 +import com.lyms.util.InstanceUtils;
25 29 import com.lyms.util.StrUtils;
26 30  
27 31 /**
28 32  
... ... @@ -43,8 +47,18 @@
43 47 private WomanFetationRecordMapper fetationMapper;
44 48  
45 49 public Integer deleteLogicById(Serializable id){
46   - return baseMapper.deleteLogicById(id);
  50 + WomanFetationRecord w = selectById(id);
  51 + if(w==null){
  52 + return 0;
  53 + }
  54 + w.setIfdel(IfdelEnum.YES.getStatus());
  55 + return baseMapper.updateById(w);
47 56 }
  57 +
  58 + @Override
  59 + public WomanFetationRecord selectDetailById(String id){
  60 + return fetationMapper.selectDetailById(id);
  61 + }
48 62  
49 63 @Override
50 64 @Transactional
... ... @@ -100,6 +114,9 @@
100 114 }
101 115 String id = StrUtils.uuid();
102 116 obj.setId(id);
  117 + if(StringUtils.isEmpty(obj.getSourceId())){
  118 + obj.setSourceId(id);
  119 + }
103 120 obj.setCreateTime(new Date());
104 121 obj.setIfdel(IfdelEnum.NO.getStatus());
105 122 obj.setEnalble(StatusEnum.ENABLED.getStatus());
106 123  
... ... @@ -115,13 +132,14 @@
115 132 * (1)查询孕妇建档信息详情
116 133 * (2)查询相关的配偶信息详情
117 134 */
118   - Map<String, Object> map = new HashMap<>();
119   - WomanFetationRecord fetationRecord = this.selectById(id);
120   - if(fetationRecord!=null){
121   - WomanHusband womanHusband = womanHusbandService.selectByTarget(WomanHusband.TARGET_TYPE_ARCHIVE, fetationRecord.getId());
122   - map.put("fetationRecord", fetationRecord);
123   - map.put("womanHusband", womanHusband);
  135 + WomanFetationRecord fetationRecord = this.selectDetailById(id);
  136 + if(fetationRecord==null || fetationRecord.getIfdel()==IfdelEnum.YES.getStatus()){
  137 + return null;//没有建档信息 或 已删除
124 138 }
  139 + WomanHusband womanHusband = womanHusbandService.selectByTarget(WomanHusband.TARGET_TYPE_ARCHIVE, fetationRecord.getId());
  140 + Map<String, Object> map = new HashMap<>();
  141 + map.put("fetationRecord", fetationRecord);
  142 + map.put("womanHusband", womanHusband);
125 143 return map;
126 144 }
127 145  
... ... @@ -129,5 +147,119 @@
129 147 public List<Map<String, Object>> selectHistory(String cardType, String cardNo, String vcCardNo) {
130 148 return fetationMapper.selectHistory(cardType, cardNo, vcCardNo);
131 149 }
  150 +
  151 + @Override
  152 + public WomanFetationRecord queryOne(WomanFetationRecord obj) {
  153 + EntityWrapper<WomanFetationRecord> ew = new EntityWrapper<>();
  154 + ew.where("IFDEL={0}", IfdelEnum.NO.getStatus());//未被删除的
  155 + if(obj.getEnalble()!=null){
  156 + ew.and("ENALBLE={0}",obj.getEnalble());
  157 + }
  158 + if(obj.getWomanType()!=null){
  159 + ew.and("WOMAN_TYPE={0}",obj.getWomanType());
  160 + }
  161 + if(obj.getDueStatus()!=null){
  162 + ew.and("DUE_STATUS={0}",obj.getDueStatus());
  163 + }
  164 + if(obj.getHostpitalId()!=null){
  165 + ew.and("HOSTPITAL_ID={0}",obj.getHostpitalId());
  166 + }
  167 + if(obj.getBuildType()!=null){
  168 + ew.and("BUILD_TYPE={0}",obj.getBuildType());
  169 + }
  170 + //证件号,联系方式,就诊卡
  171 + if(obj.getBasePapersNumber()!=null){
  172 + ew.and("BASE_PAPERS_NUMBER={0}",obj.getBasePapersNumber());
  173 + }
  174 + if(obj.getContactWomanWay()!=null){
  175 + ew.and("CONTACT_WOMAN_WAY={0}",obj.getContactWomanWay());
  176 + }
  177 + if(obj.getHospitalPatientCard()!=null){
  178 + ew.and("HOSPITAL_PATIENT_CARD={0}",obj.getHospitalPatientCard());
  179 + }
  180 + return selectOne(ew);
  181 + }
  182 +
  183 + @Override
  184 + public WomanFetationRecord queryEffectiveOne(WomanFetationRecord query) {
  185 + query.setIfdel(IfdelEnum.NO.getStatus());//未被删除的
  186 + query.setEnalble(StatusEnum.ENABLED.getStatus());//启用的
  187 + query.setWomanType(1);//妇女类别:1孕妇,3产妇
  188 + query.setDueStatus(0);//分娩状态 0未终止妊娠 1终止妊娠
  189 + return queryOne(query);
  190 + }
  191 +
  192 + @Override
  193 + public List<List<FetationStages>> getFetationStages(Serializable personId) {
  194 + List<FetationStages> dataList = fetationMapper.getFetationStages(personId);
  195 + //产程列表
  196 + List<List<FetationStages>> ccList = InstanceUtils.newArrayList();
  197 + List<FetationStages> oneStages = InstanceUtils.newArrayList();//初始化第一个产程列表
  198 + Integer agoType = 0;//记录上一次阶段的type类型,用于是否新产程的判断
  199 + for(FetationStages entity : dataList){
  200 + if(agoType > 3){//代表是复诊以后的阶段
  201 + if(entity.getType() == 1){//agoType > 3 && entity.getType() == 1 代表一个新的产程
  202 + oneStages.add(entity);
  203 + ccList.add(oneStages);
  204 + oneStages = InstanceUtils.newArrayList();//新的一个产程
  205 + agoType = 1;
  206 + continue;
  207 + }else{
  208 + agoType = entity.getType();
  209 + oneStages.add(entity);
  210 + }
  211 + }else{
  212 + agoType = entity.getType();
  213 + oneStages.add(entity);
  214 + }
  215 + }
  216 + ccList.add(oneStages);
  217 + return ccList;
  218 + }
  219 +
  220 +
  221 + public static void main(String[] args) {
  222 + List<FetationStages> dataList = getTestData();
  223 + System.out.println(JSONObject.toJSONString(dataList));
  224 + //产程列表
  225 + List<List<FetationStages>> ccList = InstanceUtils.newArrayList();
  226 + List<FetationStages> oneStages = InstanceUtils.newArrayList();//初始化第一个产程列表
  227 + Integer agoType = 0;//记录上一次阶段的type类型,用于是否新产程的判断
  228 + for(FetationStages entity : dataList){
  229 + if(agoType > 3){//代表是复诊以后的阶段
  230 + if(entity.getType() == 1){//agoType > 3 && entity.getType() == 1 代表一个新的产程
  231 + oneStages.add(entity);
  232 + ccList.add(oneStages);
  233 + oneStages = InstanceUtils.newArrayList();//新的一个产程
  234 + agoType = 1;
  235 + continue;
  236 + }else{
  237 + agoType = entity.getType();
  238 + oneStages.add(entity);
  239 + }
  240 + }else{
  241 + agoType = entity.getType();
  242 + oneStages.add(entity);
  243 + }
  244 + }
  245 + ccList.add(oneStages);
  246 + System.out.println(JSONObject.toJSONString(ccList));
  247 + }
  248 +
  249 + public static List<FetationStages> getTestData(){
  250 + List<FetationStages> dataList = InstanceUtils.newArrayList();
  251 +
  252 + for(int i=1;i<8;i++){
  253 + FetationStages entity = new FetationStages();
  254 + entity.setType(i);
  255 + dataList.add(entity);
  256 + }
  257 + for(int i=1;i<6;i++){
  258 + FetationStages entity = new FetationStages();
  259 + entity.setType(i);
  260 + dataList.add(entity);
  261 + }
  262 + return dataList;
  263 + }
132 264 }
parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java View file @ 3334aa2
  1 +package com.lyms.hospital.controller;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Controller;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.ResponseBody;
  13 +
  14 +import com.lyms.base.common.entity.region.Regions;
  15 +import com.lyms.base.common.service.region.RegionsService;
  16 +import com.lyms.hospital.enums.ServiceStatusEnums;
  17 +import com.lyms.hospital.util.trans.OldDictionary;
  18 +import com.lyms.hospital.util.trans.XjhMapUtil;
  19 +import com.lyms.web.bean.AjaxResult;
  20 +import com.lyms.web.controller.BaseController;
  21 +
  22 +/**
  23 + * <p>
  24 + * 公用接口-前端控制器
  25 + * </p>
  26 + *
  27 + * @author xujiahong
  28 + * @since 2017-04-21
  29 + */
  30 +@Controller
  31 +@RequestMapping("/commonApi")
  32 +public class CommonApiController extends BaseController {
  33 +
  34 + @Autowired
  35 + private RegionsService regionService;
  36 +
  37 + /**
  38 + * <li>@Description:查询省市区数据
  39 + * <li>@param parentId
  40 + * <li>@return
  41 + * <li>创建人:xujiahong
  42 + * <li>创建时间:2017年4月24日
  43 + * <li>修改人:
  44 + * <li>修改时间:
  45 + */
  46 + @RequestMapping(value = "/queryRegions", method = RequestMethod.GET)
  47 + @ResponseBody
  48 + public AjaxResult queryRegions (String parentId){
  49 + List<Regions> list = regionService.selectRegions(parentId);
  50 + return AjaxResult.returnSuccess(list);
  51 + }
  52 +
  53 + /**
  54 + * <li>@Description:查询字典数据
  55 + * <li>@return
  56 + * <li>创建人:xujiahong
  57 + * <li>创建时间:2017年4月24日
  58 + * <li>修改人:
  59 + * <li>修改时间:
  60 + */
  61 + @RequestMapping(value = "/queryDictionary", method = RequestMethod.GET)
  62 + @ResponseBody
  63 + public AjaxResult queryDictionary (){
  64 + //TODO 模拟查询数据字典的数据
  65 + Map<String,Object> dictionary = new HashMap<>();
  66 + /*户口类型*/
  67 + List<Map<String, Object>> censusType = new ArrayList<>();
  68 + censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("001", "非农业户口")));
  69 + censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("002", "农业户口")));
  70 + /*证件类型*/
  71 + List<Map<String, Object>> certeType = new ArrayList<>();
  72 + certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("003", "身份证")));
  73 + certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("004", "手机号")));
  74 + /*国家*/
  75 + List<Map<String, Object>> country = new ArrayList<>();
  76 + country.add(XjhMapUtil.transBean2Map(new OldDictionary("005", "中国")));
  77 + country.add(XjhMapUtil.transBean2Map(new OldDictionary("006", "美国")));
  78 + /*vip体验类型*/
  79 + List<Map<String, Object>> expYunEnums = new ArrayList<>();
  80 + expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("007", "vip体验类型1")));
  81 + expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("008", "vip体验类型2")));
  82 + /*居住类型*/
  83 + List<Map<String, Object>> liveType = new ArrayList<>();
  84 + liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("009", "本地")));
  85 + liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("010", "非本地")));
  86 + /*民族*/
  87 + List<Map<String, Object>> nation = new ArrayList<>();
  88 + nation.add(XjhMapUtil.transBean2Map(new OldDictionary("011", "汉族")));
  89 + nation.add(XjhMapUtil.transBean2Map(new OldDictionary("012", "白族")));
  90 + /*职业类型*/
  91 + List<Map<String, Object>> professionType = new ArrayList<>();
  92 + professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("013", "医生")));
  93 + professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("014", "教师")));
  94 + /*服务状态*/
  95 + List<Map<String, String>> serviceStatus = ServiceStatusEnums.getServiceStatusList();
  96 + /*服务类型*/
  97 + List<Map<String, String>> serviceType = ServiceStatusEnums.getServiceTypeList();
  98 +
  99 + dictionary.put("censusType", censusType);
  100 + dictionary.put("certeType", certeType);
  101 + dictionary.put("country", country);
  102 + dictionary.put("expYunEnums", expYunEnums);
  103 + dictionary.put("liveType", liveType);
  104 + dictionary.put("nation", nation);
  105 + dictionary.put("professionType", professionType);
  106 + dictionary.put("serviceStatus", serviceStatus);
  107 + dictionary.put("serviceType", serviceType);
  108 + return AjaxResult.returnSuccess(dictionary);
  109 + }
  110 +}
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/CommonApiController.java View file @ 3334aa2
1   -package com.lyms.hospital.controller.woman;
2   -
3   -import java.util.ArrayList;
4   -import java.util.HashMap;
5   -import java.util.List;
6   -import java.util.Map;
7   -
8   -import org.springframework.stereotype.Controller;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.ResponseBody;
12   -
13   -import com.lyms.hospital.util.trans.OldDictionary;
14   -import com.lyms.hospital.util.trans.XjhMapUtil;
15   -import com.lyms.web.bean.AjaxResult;
16   -import com.lyms.web.controller.BaseController;
17   -
18   -/**
19   - * <p>
20   - * 公用接口-前端控制器
21   - * </p>
22   - *
23   - * @author xujiahong
24   - * @since 2017-04-21
25   - */
26   -@Controller
27   -@RequestMapping("/commonApi")
28   -public class CommonApiController extends BaseController {
29   -
30   - @RequestMapping(value = "/queryDictionary", method = RequestMethod.GET)
31   - @ResponseBody
32   - public AjaxResult queryDictionary (){
33   - //TODO 模拟查询数据字典的数据
34   - Map<String,Object> dictionary = new HashMap<>();
35   - /*户口类型*/
36   - List<Map<String, Object>> censusType = new ArrayList<>();
37   - censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("001", "非农业户口")));
38   - censusType.add(XjhMapUtil.transBean2Map(new OldDictionary("002", "农业户口")));
39   - /*证件类型*/
40   - List<Map<String, Object>> certeType = new ArrayList<>();
41   - certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("003", "身份证")));
42   - certeType.add(XjhMapUtil.transBean2Map(new OldDictionary("004", "手机号")));
43   - /*国家*/
44   - List<Map<String, Object>> country = new ArrayList<>();
45   - country.add(XjhMapUtil.transBean2Map(new OldDictionary("005", "中国")));
46   - country.add(XjhMapUtil.transBean2Map(new OldDictionary("006", "美国")));
47   - /*vip体验类型*/
48   - List<Map<String, Object>> expYunEnums = new ArrayList<>();
49   - expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("007", "vip体验类型1")));
50   - expYunEnums.add(XjhMapUtil.transBean2Map(new OldDictionary("008", "vip体验类型2")));
51   - /*居住类型*/
52   - List<Map<String, Object>> liveType = new ArrayList<>();
53   - liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("009", "本地")));
54   - liveType.add(XjhMapUtil.transBean2Map(new OldDictionary("010", "非本地")));
55   - /*民族*/
56   - List<Map<String, Object>> nation = new ArrayList<>();
57   - nation.add(XjhMapUtil.transBean2Map(new OldDictionary("011", "汉族")));
58   - nation.add(XjhMapUtil.transBean2Map(new OldDictionary("012", "白族")));
59   - /*职业类型*/
60   - List<Map<String, Object>> professionType = new ArrayList<>();
61   - professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("013", "医生")));
62   - professionType.add(XjhMapUtil.transBean2Map(new OldDictionary("014", "教师")));
63   - /*服务状态*/
64   - List<Map<String, Object>> serviceStatus = new ArrayList<>();
65   - serviceStatus.add(XjhMapUtil.transBean2Map(new OldDictionary("015", "开通")));
66   - serviceStatus.add(XjhMapUtil.transBean2Map(new OldDictionary("016", "未开通")));
67   - /*服务类型*/
68   - List<Map<String, Object>> serviceType = new ArrayList<>();
69   - serviceType.add(XjhMapUtil.transBean2Map(new OldDictionary("017", "标准服务")));
70   - serviceType.add(XjhMapUtil.transBean2Map(new OldDictionary("018", "增值服务")));
71   - dictionary.put("censusType", censusType);
72   - dictionary.put("certeType", certeType);
73   - dictionary.put("country", country);
74   - dictionary.put("expYunEnums", expYunEnums);
75   - dictionary.put("liveType", liveType);
76   - dictionary.put("nation", nation);
77   - dictionary.put("professionType", professionType);
78   - dictionary.put("serviceStatus", serviceStatus);
79   - dictionary.put("serviceType", serviceType);
80   - return AjaxResult.returnSuccess(dictionary);
81   - }
82   -}
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java View file @ 3334aa2
  1 +package com.lyms.hospital.controller.woman;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.stereotype.Controller;
  5 +import org.springframework.util.StringUtils;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.ResponseBody;
  9 +
  10 +import com.lyms.hospital.entity.woman.WomanFetationRecord;
  11 +import com.lyms.hospital.service.woman.WomanFetationRecordService;
  12 +import com.lyms.web.bean.AjaxResult;
  13 +import com.lyms.web.controller.BaseController;
  14 +
  15 +/**
  16 + * 孕妇产检 前端控制器<br>
  17 + *
  18 + * 依据cardNo或vcCardNo查询孕妇产检记录
  19 + *
  20 + * @author xujiahong
  21 + *
  22 + */
  23 +@Controller
  24 +@RequestMapping("/womanExam")
  25 +public class WomanExamController extends BaseController {
  26 +
  27 + @Autowired
  28 + private WomanFetationRecordService fetationService;
  29 +
  30 + /**
  31 + * <li>@Description:依据cardNo或vcCardNo查询孕妇产检记录
  32 + * <li>@param cardNo 证件号
  33 + * <li>@param vcCardNo 就诊卡号
  34 + * <li>@return
  35 + * <li>创建人:xujiahong
  36 + * <li>创建时间:2017年4月25日
  37 + * <li>修改人:
  38 + * <li>修改时间:
  39 + */
  40 + @RequestMapping(value = "/antexmanage", method = RequestMethod.POST)
  41 + @ResponseBody
  42 + public AjaxResult deletePregnant(String cardNo,String vcCardNo,String orgId){//orgId或来自token
  43 + /*
  44 + * (1)孕妇档案信息(通过证件号或就诊卡号查询)
  45 + * (2)高危因素列表 TODO
  46 + * (3)产检记录列表
  47 + */
  48 + //基本验证
  49 + if(StringUtils.isEmpty(orgId)){
  50 + return AjaxResult.returnFail("入参错误:医院ID为空");
  51 + }
  52 + if(StringUtils.isEmpty(cardNo) && StringUtils.isEmpty(vcCardNo)){
  53 + return AjaxResult.returnFail("入参错误:查询条件为空");
  54 + }
  55 + //(1)孕妇档案信息(通过证件号或就诊卡号查询)
  56 + WomanFetationRecord query = new WomanFetationRecord();
  57 + query.setHostpitalId(orgId);//医院ID
  58 + WomanFetationRecord dbFetationRecord = null;
  59 +
  60 + //证件号不为空,则通过证件号查询
  61 + if(!StringUtils.isEmpty(cardNo)){
  62 + query.setBasePapersNumber(cardNo);
  63 + dbFetationRecord = fetationService.queryEffectiveOne(query);
  64 + }
  65 + //上述查询未执行或没结果,且就诊卡号不为空,则通过就诊卡号查询
  66 + if(dbFetationRecord==null && !StringUtils.isEmpty(vcCardNo)){
  67 + query.setBasePapersNumber(null);
  68 + query.setContactWomanWay(vcCardNo);
  69 + dbFetationRecord = fetationService.queryEffectiveOne(query);
  70 + }
  71 + //未查询到孕妇建档信息
  72 + if(dbFetationRecord==null){
  73 + return AjaxResult.returnFail("未查询到孕妇建档信息");
  74 + }
  75 + //(2)高危因素列表 TODO
  76 + //(3)产检记录列表 TODO (此处需要查询当前产程中本院和外院的所有产检记录)
  77 +
  78 +
  79 +
  80 + return AjaxResult.returnFail();
  81 + }
  82 +
  83 +}
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanPregnantController.java View file @ 3334aa2
... ... @@ -7,33 +7,41 @@
7 7  
8 8 import org.springframework.beans.factory.annotation.Autowired;
9 9 import org.springframework.stereotype.Controller;
  10 +import org.springframework.web.bind.annotation.PathVariable;
10 11 import org.springframework.web.bind.annotation.RequestBody;
11 12 import org.springframework.web.bind.annotation.RequestMapping;
12 13 import org.springframework.web.bind.annotation.RequestMethod;
13 14 import org.springframework.web.bind.annotation.ResponseBody;
14 15  
  16 +import com.lyms.base.common.service.sys.SysDictService;
15 17 import com.lyms.hospital.entity.woman.WomanFetationRecord;
16 18 import com.lyms.hospital.entity.woman.WomanHusband;
  19 +import com.lyms.hospital.enums.IfdelEnum;
  20 +import com.lyms.hospital.enums.StatusEnum;
17 21 import com.lyms.hospital.request.woman.WomanFetationRequest;
18 22 import com.lyms.hospital.request.woman.WomanFetationRequestWrapper;
19 23 import com.lyms.hospital.response.keymap.WomanFetationRecordKeymap;
20 24 import com.lyms.hospital.response.woman.WomanFetationResponse;
21 25 import com.lyms.hospital.service.token.TokenService;
22 26 import com.lyms.hospital.service.woman.WomanFetationRecordService;
  27 +import com.lyms.hospital.util.HospitalUtil;
  28 +import com.lyms.hospital.util.UnitConstants;
23 29 import com.lyms.hospital.util.trans.XjhMapUtil;
24 30 import com.lyms.util.DateUtil;
25 31 import com.lyms.web.bean.AjaxResult;
26 32 import com.lyms.web.controller.BaseController;
27 33  
  34 +
28 35 /**
29 36 * <p>
30 37 * 孕妇档案-前端控制器
31 38 * </p>
32 39 *
33 40 * []依据cardNo或vcCardNo查询孕妇档案
34   - * []孕妇建档(新增或修改)
35   - * 依据id得到“孕妇建档”表单详情
36   - *
  41 + * [--]孕妇建档(新增或修改)
  42 + * []依据id得到“孕妇建档”表单详情
  43 + * []建档-查看页面数据
  44 + * 删除档案
37 45 * @author xujiahong
38 46 * @since 2017-04-17
39 47 */
40 48  
41 49  
42 50  
... ... @@ -42,11 +50,121 @@
42 50 public class WomanPregnantController extends BaseController {
43 51  
44 52 @Autowired
  53 + private TokenService tokenService;
  54 + @Autowired
45 55 private WomanFetationRecordService fetationService;
46 56 @Autowired
47   - private TokenService tokenService;
  57 + private SysDictService dictService;
48 58  
  59 + @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.DELETE)
  60 + @ResponseBody
  61 + public AjaxResult deletePregnant(@PathVariable("id")String id){
  62 + Integer count = fetationService.deleteLogicById(id);
  63 + if(count>0){
  64 + return AjaxResult.returnSuccess();
  65 + }else{
  66 + return AjaxResult.returnFail();
  67 + }
  68 + }
  69 +
49 70 /**
  71 + * <li>@Description:建档-查看页面数据
  72 + * <li>@param id
  73 + * <li>@return
  74 + * <li>创建人:xujiahong
  75 + * <li>创建时间:2017年4月21日
  76 + * <li>修改人:
  77 + * <li>修改时间:
  78 + */
  79 + @RequestMapping(value = "/findPatientData", method = RequestMethod.GET)
  80 + @ResponseBody
  81 + public AjaxResult findPatientData(String id){
  82 + //查询详情相关对象
  83 + Map<String, Object> serviceMap = fetationService.selectWomanFetationMapById(id);
  84 + if(serviceMap==null){
  85 + return AjaxResult.returnFail("档案不存在或已删除");
  86 + }
  87 + WomanFetationRecord f = (WomanFetationRecord)serviceMap.get("fetationRecord");
  88 + WomanHusband w = (WomanHusband)serviceMap.get("womanHusband");
  89 + /*
  90 + * 这里没有新建映射,拷贝 ViewFacade 的老代码
  91 + */
  92 + Map<String, Object> map = new HashMap<>();
  93 + map.put("id", f.getId());
  94 + /* 孕妇基础数据 */
  95 + map.put("username", f.getBaseWomanName());
  96 + map.put("pcerteType", dictService.getDictNameById(f.getBasePapersType()));//证件类型
  97 + map.put("cardNo", f.getBasePapersNumber());
  98 + map.put("phone", f.getContactWomanWay());
  99 + map.put("pworkUnit", f.getContactWorkAddress());
  100 + map.put("pcountry", dictService.getDictNameById(f.getBaseWomanCountry()));
  101 + map.put("pnation", dictService.getDictNameById(f.getBaseWomanNation()));
  102 + map.put("birth", DateUtil.getyyyy_MM_dd(f.getBaseWomanBirth()));
  103 + map.put("age", DateUtil.getAge(f.getBaseWomanBirth())+UnitConstants.SUI);
  104 + map.put("pcensusType", dictService.getDictNameById(f.getBaseRegisterType()));//户籍类型
  105 + map.put("pliveType", dictService.getDictNameById(f.getBaseDwellType()));//居住类别
  106 + map.put("pprofessionType", dictService.getDictNameById(f.getBaseOccupationType()));//职业类型
  107 + map.put("plevelType", dictService.getDictNameById(f.getBaseWomanCulture()));//
  108 + map.put("baseFamilyIncome", f.getBaseFamilyIncome());//家庭人均收入
  109 +
  110 + /* 孕妇联系方式 */
  111 + map.put("residence", f.getLiveAddress());
  112 + map.put("register", f.getRegisterAddress());
  113 + map.put("postRest", f.getPostpartumAddress());
  114 +
  115 + /* 丈夫信息 */
  116 + map.put("husbandName", w.getHusbandName());
  117 + map.put("hcertificateType", dictService.getDictNameById(w.getHusbandPapersType()));
  118 + map.put("hcertificateNum", w.getHusbandPapersNumber());
  119 + map.put("hcountry", dictService.getDictNameById(w.getHusbandCountry()));
  120 + map.put("hnation", dictService.getDictNameById(w.getHusbandNation()));
  121 + map.put("husbandPhone", w.getHusbandWay());
  122 + map.put("hprofessionType", dictService.getDictNameById(w.getHusbandOccupationType()));
  123 + map.put("hworkUnit", w.getHusbandWorkAddress());
  124 + String province = w.getHusbandRegisterProvince();
  125 + String city = w.getHusbandRegisterCity();
  126 + String area = w.getHusbandRegisterArea();
  127 + String street = w.getHusbandRegisterStreet();
  128 + String detail = w.getHusbandRegisterDetail();
  129 + map.put("hregister", (province==null?"":province)
  130 + +(city==null?"":city)
  131 + +(area==null?"":area)
  132 + +(street==null?"":street)
  133 + +(detail==null?"":detail)
  134 + );
  135 +
  136 + /* 院内信息 */
  137 + //末次月经
  138 + map.put("lastMenses", DateUtil.getyyyy_MM_dd(f.getHospitalLastMenstruation()));
  139 + //孕周(用末次月经去计算)
  140 + map.put("lastMensesWeek", HospitalUtil.getPregnantWeek(f.getHospitalLastMenstruation()));
  141 + //纠正末次月经,取末次月经数据
  142 + map.put("correctionLastMenses", DateUtil.getyyyy_MM_dd(f.getHospitalCorrectLastMenstruation()));
  143 + //纠正末次月经孕周
  144 + map.put("correctionLastMensesWeek", HospitalUtil.getPregnantWeek(f.getHospitalCorrectLastMenstruation()));
  145 +
  146 + map.put("dueDate", DateUtil.getyyyy_MM_dd(f.getHospitalExpectedDate()));
  147 + map.put("vcCardNo", f.getHospitalPatientCard());
  148 + //条码(暂时去掉)
  149 + //档案编号
  150 + map.put("fileCode", f.getHospitalRecordNumber());
  151 + //建档医生
  152 + map.put("bookbuildingDoctor", "暂时写死的医生名称");//TODO 查询医生姓名
  153 + //建档日期
  154 + map.put("bookbuildingDate", DateUtil.getyyyy_MM_dd(f.getHospitalRecordDate()));
  155 +
  156 + map.put("mremark", f.getHospitalRecordRemark());
  157 + //服务类型
  158 + map.put("serviceType",f.getHospitalServiceType() );
  159 + map.put("serviceStatus", f.getHospitalServiceStatus());
  160 +
  161 + //建档孕周
  162 + map.put("buildDueWeek",HospitalUtil.getPregnantWeek(f.getHospitalRecordDate()));
  163 +
  164 + return AjaxResult.returnSuccess(map);
  165 + }
  166 +
  167 + /**
50 168 * <li>@Description:依据id得到“孕妇建档”表单详情
51 169 * <li>@param id
52 170 * <li>@return
53 171  
54 172  
... ... @@ -55,11 +173,14 @@
55 173 * <li>修改人:
56 174 * <li>修改时间:
57 175 */
58   - @RequestMapping(value = "/queryPregnantBuildById", method = RequestMethod.GET)
  176 + @RequestMapping(value = "/queryPregnantBuildById/{id}", method = RequestMethod.GET)
59 177 @ResponseBody
60   - public AjaxResult queryPregnantBuildById(String id){
  178 + public AjaxResult queryPregnantBuildById(@PathVariable String id){
61 179 //查询详情相关对象
62 180 Map<String, Object> map = fetationService.selectWomanFetationMapById(id);
  181 + if(map==null){
  182 + return AjaxResult.returnFail("档案不存在或已删除");
  183 + }
63 184 WomanFetationRecord fetationRecord = (WomanFetationRecord)map.get("fetationRecord");
64 185 WomanHusband womanHusband = (WomanHusband)map.get("womanHusband");
65 186 //转换为与前端对接的response对象
... ... @@ -69,8 +190,7 @@
69 190 XjhMapUtil.getKeyMap(WomanFetationRecordKeymap.original, WomanFetationRecordKeymap.alias));
70 191 fetationRecordMap.putAll(womanHusbandMap);
71 192  
72   - System.out.println(fetationRecordMap);
73   - WomanFetationResponse response = (WomanFetationResponse)XjhMapUtil.transMap2Bean(fetationRecordMap, new WomanFetationResponse());
  193 + WomanFetationResponse response = (WomanFetationResponse)XjhMapUtil.transMap2Bean(fetationRecordMap, new WomanFetationResponse());
74 194 response.setId(fetationRecord.getId());
75 195 response.setPid(fetationRecord.getWomanPersonId());
76 196 return AjaxResult.returnSuccess(response);
77 197  
... ... @@ -94,10 +214,12 @@
94 214  
95 215 //TODO 查询历史建档记录
96 216 List<Map<String, Object>> history = fetationService.selectHistory(cardType, cardNo, vcCardNo);
97   -
98 217 Map<String,Object> dataMap = new HashMap<>();
99 218 dataMap.put("history", history);
100 219 dataMap.put("now", DateUtil.getyyyy_MM_dd(new Date()));
  220 + //TODO 部分未涉及字段
  221 + dataMap.put("initBuildDate", DateUtil.getyyyy_MM_dd(new Date()));
  222 + dataMap.put("rBType", true);
101 223 return AjaxResult.returnSuccess(dataMap);
102 224 }
103 225  
104 226  
105 227  
106 228  
107 229  
... ... @@ -112,31 +234,85 @@
112 234 @RequestMapping(value = "/addOrUpdateYunBuild", method = RequestMethod.POST)
113 235 @ResponseBody
114 236 public AjaxResult addOrUpdateYunBuild(@RequestBody WomanFetationRequest request) {
  237 + /*
  238 + * 需求:
  239 + * (1)同一孕妇在不同医院(orgId)对应两份档案,第一份为主档案,往后都是隐藏档案(sourceId=主档案ID) womanPersonId
  240 + * (2)TODO 同一医院同一孕妇,多个产程对应多个档案
  241 + */
115 242  
  243 + //TODO 登录 token 验证
  244 +
116 245 /*
117 246 * 转换业务对象
118 247 */
119 248 WomanFetationRequestWrapper wrapper = new WomanFetationRequestWrapper(request);
120 249 WomanFetationRecord womanFetationRecord = wrapper.getWomanFetationRecord();
121 250 WomanHusband womanHusband = wrapper.getWomanHusband();
122   - /*
123   - * 需求:
124   - * (1)同一孕妇在不同医院(orgId)对应两份档案
125   - * (2)TODO 同一医院同一孕妇,多个产程对应多个档案
126   - */
127   - //查询档案信息的存在性
128   - WomanFetationRecord dbObj = fetationService.findByCard(
129   - request.getPregnantCertificateTypeId(), request.getPregnantCertificateNum(),
130   - request.getVcCardNo(), request.getHospitalId());
  251 + if(womanFetationRecord.getHostpitalId()==null){
  252 + AjaxResult.returnFail("入参错误:缺少参数hostpitalId");
  253 + }
  254 +
  255 + //新增或修改
131 256 boolean flag = false;
132 257 if(request.getId()==null){//新增
133   - if(dbObj!=null){//本院已有档案,修改现有档案
134   - womanFetationRecord.setId(dbObj.getId());
135   - womanHusband.setTargetId(dbObj.getId());
136   - flag = fetationService.updatebuildRecord(womanFetationRecord, womanHusband);
137   - }else{
138   - flag = fetationService.insertbuildRecord(womanFetationRecord, womanHusband);
  258 +
  259 + //用于重复性验证的查询对象(确保新建的档案在同医院同产程未重复)
  260 + WomanFetationRecord query = new WomanFetationRecord();
  261 + query.setIfdel(IfdelEnum.NO.getStatus());//未被删除的
  262 + query.setEnalble(StatusEnum.ENABLED.getStatus());//启用的
  263 + query.setWomanType(1);//妇女类别:1孕妇,3产妇
  264 + query.setDueStatus(0);//分娩状态 0未终止妊娠 1终止妊娠
  265 + query.setHostpitalId(womanFetationRecord.getHostpitalId());//医院ID
  266 + query.setBuildType(0);//建档来源:0未分娩建档,1儿童建档时建档,2自动分娩类型,3转诊自动建档 ???
  267 + //验证证件号是否重复
  268 + if(womanFetationRecord.getBasePapersNumber()!=null){
  269 + query.setBasePapersNumber(womanFetationRecord.getBasePapersNumber());
  270 + WomanFetationRecord dbObj = fetationService.queryOne(query);
  271 + if(dbObj!=null){
  272 + AjaxResult.returnFail("该证件在医院已经建档");
  273 + }
139 274 }
  275 + //验证联系方式是否重复
  276 + if(womanFetationRecord.getContactWomanWay()!=null){
  277 + query.setBasePapersNumber(null);
  278 + query.setContactWomanWay(womanFetationRecord.getContactWomanWay());
  279 + WomanFetationRecord dbObj = fetationService.queryOne(query);
  280 + if(dbObj!=null){
  281 + AjaxResult.returnFail("该联系方式在医院已经建档");
  282 + }
  283 + }
  284 + //验证就诊卡号是否重复
  285 + if(womanFetationRecord.getHospitalPatientCard()!=null){
  286 + query.setBasePapersNumber(null);
  287 + query.setContactWomanWay(null);
  288 + query.setHospitalPatientCard(womanFetationRecord.getHospitalPatientCard());
  289 + WomanFetationRecord dbObj = fetationService.queryOne(query);
  290 + if(dbObj!=null){
  291 + AjaxResult.returnFail("该就诊卡号在医院已经建档");
  292 + }
  293 + }
  294 + //查询档案信息在外院的存在性(如存在,则建立sourceId一致的隐藏档案)
  295 + query.setHostpitalId(null);
  296 + query.setHospitalPatientCard(null);
  297 + String sourceId = "";
  298 + if(womanFetationRecord.getBasePapersNumber()!=null){
  299 + query.setBasePapersNumber(womanFetationRecord.getBasePapersNumber());
  300 + WomanFetationRecord dbObj = fetationService.queryOne(query);
  301 + if(dbObj!=null){
  302 + sourceId = dbObj.getId();
  303 + }
  304 + }
  305 + if(womanFetationRecord.getContactWomanWay()!=null){
  306 + query.setBasePapersNumber(null);
  307 + query.setContactWomanWay(womanFetationRecord.getContactWomanWay());
  308 + WomanFetationRecord dbObj = fetationService.queryOne(query);
  309 + if(dbObj!=null){
  310 + sourceId = dbObj.getId();
  311 + }
  312 + }
  313 + womanFetationRecord.setSourceId(sourceId);
  314 +
  315 + flag = fetationService.insertbuildRecord(womanFetationRecord, womanHusband);
140 316 }else{//修改
141 317 flag = fetationService.updatebuildRecord(womanFetationRecord, womanHusband);
142 318 }
parent/hospital.web/src/main/java/com/lyms/hospital/response/keymap/WomanFetationRecordKeymap.java View file @ 3334aa2
... ... @@ -123,7 +123,7 @@
123 123 "hospitalServiceType",//服务类型
124 124 "hospitalServiceStatus",//服务状态
125 125  
126   - "hospitalRecordDoctor",//建档医生
  126 +// "hospitalRecordDoctor",//建档医生
127 127 "hostpitalId",//建档医院
128 128 "hospitalRecordDateStr",//建档日期
129 129 "hospitalRecordRemark",//档案备注
... ... @@ -200,7 +200,7 @@
200 200 "serviceType",//服务类型
201 201 "serviceStatus",//服务状态
202 202  
203   - "bookbuildingDoctor",//建档医生ID
  203 +// "bookbuildingDoctor",//建档医生ID
204 204 "hospitalId",//建档医院ID
205 205 "bookbuildingDate",//建档日期
206 206 "mremark",//备注
parent/hospital.web/src/main/java/com/lyms/hospital/response/woman/WomanFetationResponse.java View file @ 3334aa2
... ... @@ -135,9 +135,28 @@
135 135  
136 136 //分娩状态 0未终止妊娠 1终止妊娠
137 137 private Integer dueStatus;
  138 + //1孕妇 3产妇
  139 + private Integer type; // add by xujiahong since 2017-04-24 13:17:21
  140 +
  141 + private String fmTime;
  142 +
  143 + public String getFmTime() {
  144 + return fmTime;
  145 + }
138 146  
  147 + public void setFmTime(String fmTime) {
  148 + this.fmTime = fmTime;
  149 + }
139 150  
140   - public Integer getDueStatus() {
  151 + public Integer getType() {
  152 + return type;
  153 + }
  154 +
  155 + public void setType(Integer type) {
  156 + this.type = type;
  157 + }
  158 +
  159 + public Integer getDueStatus() {
141 160 return dueStatus;
142 161 }
143 162  
parent/hospital.web/src/main/java/com/lyms/hospital/util/HospitalUtil.java View file @ 3334aa2
  1 +package com.lyms.hospital.util;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import com.lyms.util.DateUtil;
  6 +
  7 +/**
  8 + * 计算孕周<br>
  9 + * a<br>
  10 + *
  11 + * @author xujiahong
  12 + *
  13 + */
  14 +public class HospitalUtil {
  15 +
  16 + /**
  17 + * <li>@Description:
  18 + * <li>@param date 末次月经日期
  19 + * <li>@return
  20 + * <li>创建人:xujiahong
  21 + * <li>创建时间:2017年4月24日
  22 + * <li>修改人:
  23 + * <li>修改时间:
  24 + */
  25 + public static String getPregnantWeek(Date date) {
  26 + Date now = new Date();
  27 + int days = DateUtil.daysBetween(date, now);//返回两个日期的间隔天数
  28 + if (days < 0) {
  29 + return "";
  30 + }
  31 + if (days >= 294) {
  32 + return "已分娩";
  33 + }
  34 + int week = (days / 7);
  35 + int day = (days % 7);
  36 + return "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  37 + }
  38 +
  39 +}
parent/hospital.web/src/main/java/com/lyms/hospital/util/UnitConstants.java View file @ 3334aa2
  1 +package com.lyms.hospital.util;
  2 +
  3 +/**
  4 + *
  5 + * 单位常量,用以返回值拼接
  6 + *
  7 + * Created by Administrator on 2017/1/11 0011.
  8 + */
  9 +public class UnitConstants {
  10 +
  11 + public static final String CM = " cm";
  12 + public static final String KG = " kg";
  13 + public static final String MMHG = " mmHg";
  14 + public static final String CIFEN = " 次/分";
  15 + public static final String GL = " g/L";
  16 + public static final String MMOLL = " mmol/L";
  17 + public static final String CI = " 次";
  18 + public static final String UL = " U/L";
  19 + public static final String TEN_LKG = "&times;10<sup>9</sup>/L";
  20 +// public static final String TEN_LKG = " 10^9/L";
  21 + public static final String UMOLL = " umol/L";
  22 + public static final String ZHEN = " 针";
  23 + public static final String ML = " ml";
  24 + public static final String G = " g";
  25 + public static final String FEN = " 分";
  26 + public static final String FZ = " 分钟";
  27 + public static final String GE = " 个";
  28 + public static final String SUI = " 岁";
  29 + public static final String REN = " 人";
  30 + public static final String HD = " 时/日";
  31 + public static final String WENDU = " ℃";
  32 + public static final String WSSD = " IU/日";
  33 + public static final String DAY = " 天";
  34 +
  35 +
  36 +}
parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java View file @ 3334aa2
... ... @@ -27,10 +27,17 @@
27 27 * @throws IllegalAccessException
28 28 */
29 29 private static void invokeIgnoreType(PropertyDescriptor property,Object value,Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{
30   - Class<?> keyType = property.getPropertyType();
31   - Class<?> valueType = value.getClass();
  30 + if(obj==null || property==null){
  31 + return;
  32 + }
32 33 // 得到property对应的setter方法
33 34 Method setter = property.getWriteMethod();
  35 + if(value==null){//null值可匹配任何类型的对象
  36 + setter.invoke(obj, value);
  37 + return;
  38 + }
  39 + Class<?> keyType = property.getPropertyType();
  40 + Class<?> valueType = value.getClass();
34 41 //简单处理映射字段类型不匹配的情况
35 42 if (keyType.equals(valueType)) {
36 43 setter.invoke(obj, value);
... ... @@ -49,6 +56,9 @@
49 56 }
50 57  
51 58 public static Object transMap2Bean(Map<String, Object> map, Object obj) {
  59 + if(map==null || obj==null){
  60 + return null;
  61 + }
52 62 try {
53 63 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
54 64 PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
55 65  
... ... @@ -62,12 +72,16 @@
62 72 } catch (Exception e) {
63 73 System.err.println("映射"+obj.getClass().getName()+"对象时发生错误");
64 74 System.err.println("transMap2Bean Error " + e);
  75 + e.printStackTrace();
65 76 }
66 77 return obj;
67 78 }
68 79  
69 80 // 自动处理时间字段和对应的字符串字段(Str结尾)
70 81 public static Object transMap2FormatBean(Map<String, Object> map, Object obj) {
  82 + if(map==null || obj==null){
  83 + return null;
  84 + }
71 85 try {
72 86 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
73 87 PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
74 88  
... ... @@ -103,11 +117,15 @@
103 117 } catch (Exception e) {
104 118 System.err.println("映射"+obj.getClass().getName()+"对象时发生错误");
105 119 System.err.println("transMap2FormatBean Error " + e);
  120 + e.printStackTrace();
106 121 }
107 122 return obj;
108 123 }
109 124  
110 125 public static Map<String, Object> transBean2Map(Object obj) {
  126 + if(obj==null){
  127 + return null;
  128 + }
111 129 Map<String, Object> map = new HashMap<>();
112 130 try {
113 131 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
... ... @@ -125,6 +143,7 @@
125 143 } catch (Exception e) {
126 144 System.err.println("映射"+obj.getClass().getName()+"对象时发生错误");
127 145 System.err.println("transBean2Map Error " + e);
  146 + e.printStackTrace();
128 147 }
129 148 return map;
130 149 }
... ... @@ -154,6 +173,9 @@
154 173 }
155 174  
156 175 public static Map<String, Object> transBean2AliasMap(Object obj, HashMap<String, String> keyMap) {
  176 + if(keyMap==null || obj==null){
  177 + return null;
  178 + }
157 179 Map<String, Object> map = new HashMap<>();
158 180 try {
159 181 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
160 182  
... ... @@ -173,11 +195,15 @@
173 195 } catch (Exception e) {
174 196 System.err.println("映射"+obj.getClass().getName()+"对象时发生错误");
175 197 System.err.println("transBean2AliasMap Error " + e);
  198 + e.printStackTrace();
176 199 }
177 200 return map;
178 201 }
179 202  
180 203 public static Map<String, Object> transBean2FormatAliasMap(Object obj, HashMap<String, String> keyMap) {
  204 + if(keyMap==null || obj==null){
  205 + return null;
  206 + }
181 207 Map<String, Object> map = new HashMap<>();
182 208 try {
183 209 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
184 210  
185 211  
186 212  
... ... @@ -208,24 +234,25 @@
208 234 } catch (Exception e) {
209 235 System.err.println("映射"+obj.getClass().getName()+"对象时发生错误");
210 236 System.err.println("transBean2FormatAliasMap Error " + e);
  237 + e.printStackTrace();
211 238 }
212 239 return map;
213 240 }
214 241  
215   - public static void mappingAlias(Object original, Object alias, HashMap<String, String> keyMap) {
216   - Map<String, Object> aliasMap = transBean2AliasMap(original, keyMap);
217   - transMap2Bean(aliasMap, alias);
218   - }
  242 +// public static void mappingAlias(Object original, Object alias, HashMap<String, String> keyMap) {
  243 +// Map<String, Object> aliasMap = transBean2AliasMap(original, keyMap);
  244 +// transMap2Bean(aliasMap, alias);
  245 +// }
  246 +//
  247 +// public static void mappingFormatAlias(Object original, Object alias, HashMap<String, String> keyMap) {
  248 +// Map<String, Object> aliasMap = transBean2FormatAliasMap(original, keyMap);
  249 +// transMap2FormatBean(aliasMap, alias);
  250 +// }
219 251  
220   - public static void mappingFormatAlias(Object original, Object alias, HashMap<String, String> keyMap) {
221   - Map<String, Object> aliasMap = transBean2FormatAliasMap(original, keyMap);
222   - transMap2FormatBean(aliasMap, alias);
223   - }
224   -
225 252 /*
226 253 * 方便书写映射文件keyMap
227 254 */
228   - public static void printField(Object obj) {
  255 + private static void printField(Object obj) {
229 256 try {
230 257 BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
231 258 PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
232 259  
... ... @@ -237,14 +264,14 @@
237 264 }
238 265 }
239 266 } catch (Exception e) {
240   - System.err.println("printField Error " + e);
  267 + e.printStackTrace();
241 268 }
242 269 }
243 270  
244 271 /*
245 272 * 方便书写 json
246 273 */
247   - public static void printJsonByArray(String[] args) {
  274 + private static void printJsonByArray(String[] args) {
248 275 System.out.println("{");
249 276 for (int i = 0; i < args.length; i++) {
250 277 String str = "\"" + args[i] + "\":\"666\"";
... ... @@ -257,7 +284,7 @@
257 284 }
258 285  
259 286 public static void main(String[] args) {
260   - // printField(new WomanHusband());
  287 +// printField(new WomanHusband());
261 288 printJsonByArray(WomanFetationRecordKeymap.alias);
262 289 }
263 290  
parent/hospital.web/src/test/java/test/hospital/diagnose/DiagnoseMapsTest.java View file @ 3334aa2
... ... @@ -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 @ 3334aa2
... ... @@ -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 // 策略配置