Commit 6b7b74096fa1729359cbb3fc35fe6df44b407d64

Authored by xujiahong
1 parent d8af9ec085
Exists in master

婚前检查相关Service,模块包括但不限于:婚检基础表、男性婚检表、女性婚检表、配偶信息表、辅助检查表

Showing 24 changed files with 683 additions and 101 deletions

parent/hospital.mac/src/main/java/com/lyms/hospital/dao/changehospital/HighriskChangeHospitalMapper.java View file @ 6b7b740
1 1 package com.lyms.hospital.dao.changehospital;
2 2  
3   -import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
4   -import com.baomidou.mybatisplus.mapper.BaseMapper;
5   -import org.springframework.stereotype.Repository;
6 3 import java.io.Serializable;
  4 +import java.util.List;
  5 +
  6 +import org.springframework.stereotype.Repository;
  7 +
  8 +import com.baomidou.mybatisplus.mapper.BaseMapper;
  9 +import com.baomidou.mybatisplus.plugins.pagination.Pagination;
  10 +import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
  11 +import com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo;
7 12 /**
8 13 * <p>
9 14 * Mapper接口
... ... @@ -16,6 +21,10 @@
16 21 public interface HighriskChangeHospitalMapper extends BaseMapper<HighriskChangeHospital> {
17 22  
18 23 public Integer deleteLogicById(Serializable id);
  24 +
  25 + //查询转出孕妇列表(条件筛选、分页、多表关联)
  26 + public List<HighriskChangeHospitalVo> listOfOutWomanVo(Pagination page,HighriskChangeHospitalVo vo);
  27 +
19 28  
20 29 }
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/changehospital/HighriskChangeHospitalMapper.xml View file @ 6b7b740
... ... @@ -18,10 +18,34 @@
18 18 <result column="CREATE_TIME" property="createTime" />
19 19 <result column="RECEIVE_TIME" property="receiveTime" />
20 20 </resultMap>
  21 +
  22 + <!-- 转诊信息业务实体映射 -->
  23 + <resultMap id="VoResultMap" type="com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo"
  24 + extends="BaseResultMap">
  25 + <result column="BASE_WOMAN_NAME" property="baseWomanName" />
  26 + <result column="BASE_WOMAN_BIRTH" property="baseWomanBirth" />
  27 + <result column="CONTACT_WOMAN_WAY" property="contactWomanWay" />
  28 + <result column="outOrgName" property="outOrgName" />
  29 + <result column="intoOrgName" property="intoOrgName" />
  30 + </resultMap>
21 31  
22 32 <!-- 通用查询结果列 -->
23 33 <sql id="Base_Column_List">
24 34 ID AS id, WOMAN_ID AS womanId, OUT_ORGID AS outOrgid, INTO_ORGID AS intoOrgid, DESCRIPTION AS description, MUSTDESC AS mustdesc, RISK AS risk, CHANGEWAY AS changeway, APPLY_DOCTORID AS applyDoctorid, CREATE_ID AS createId, CREATE_TIME AS createTime, STATUS AS status, RECEIVE_TIME AS receiveTime
25 35 </sql>
  36 +
  37 + <!-- 查询转出孕妇列表(条件筛选、分页、多表关联) -->
  38 + <select id="listOfOutWomanVo" resultMap="VoResultMap"
  39 + parameterType="com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo">
  40 + SELECT chg.*,woman.BASE_WOMAN_NAME,woman.BASE_WOMAN_BIRTH,woman.CONTACT_WOMAN_WAY,
  41 + outOrg.`NAME` AS outOrgName,intoOrg.`NAME` AS intoOrgName
  42 + FROM HIGHRISK_CHANGE_HOSPITAL AS chg
  43 + INNER JOIN SYS_ORGANIZATIONS AS outOrg ON chg.OUT_ORGID = outOrg.`ID`
  44 + INNER JOIN SYS_ORGANIZATIONS AS intoOrg ON chg.`INTO_ORGID` = intoOrg.`ID`
  45 + INNER JOIN WOMAN_FETATION_RECORD AS woman ON chg.`WOMAN_ID`=woman.`ID`
  46 + WHERE chg.OUT_ORGID = #{outOrgid}
  47 + </select>
  48 +
  49 +
26 50 </mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/inspect/MarrybeInspectMapper.java View file @ 6b7b740
1 1 package com.lyms.hospital.dao.inspect;
2 2  
  3 +import com.lyms.hospital.entity.inspect.InspectListVo;
3 4 import com.lyms.hospital.entity.inspect.MarrybeInspect;
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;
  9 +import java.util.Map;
7 10 /**
8 11 * <p>
9 12 * Mapper接口
... ... @@ -16,6 +19,28 @@
16 19 public interface MarrybeInspectMapper extends BaseMapper<MarrybeInspect> {
17 20  
18 21 public Integer deleteLogicById(Serializable id);
  22 +
  23 + /**
  24 + * <li>@Description:查询某人历史婚检记录列表(ID,档案ID,婚检日期,建档医院)
  25 + * <li>@param archiveId 档案ID
  26 + * <li>@return
  27 + * <li>创建人:xujiahong
  28 + * <li>创建时间:2017年4月10日
  29 + * <li>修改人:
  30 + * <li>修改时间:
  31 + */
  32 + public List<Map<String,Object>> getPersonalInspectHistoryList(String archiveId);
  33 +
  34 + /**
  35 + * <li>@Description:查询某医院婚检列表(多表关联条件查询)
  36 + * <li>@param vo
  37 + * <li>@return
  38 + * <li>创建人:xujiahong
  39 + * <li>创建时间:2017年4月10日
  40 + * <li>修改人:
  41 + * <li>修改时间:
  42 + */
  43 + public List<InspectListVo> listOfMarryBeforeInspect(InspectListVo vo);
19 44  
20 45 }
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/inspect/MarrybeInspectMapper.xml View file @ 6b7b740
... ... @@ -66,10 +66,68 @@
66 66 <result column="CREATE_TIME" property="createTime" />
67 67 <result column="IF_DEL" property="ifDel" />
68 68 </resultMap>
  69 +
  70 + <!-- 婚前检查-婚检管理列表的页面显示对象
  71 + private String id;// 婚检记录ID
  72 + private Date inspectDate;// 婚检日期
  73 + private String name;// 姓名
  74 + private String papersNumber;// 证件号 BASE_PAPERS_NUMBER
  75 + private String contactWay;// 联系方式 CONTACT_WOMAN_WAY
  76 + private String showResult;// 结果
  77 + private String medicalSuggestion;// 医学意见 MEDICAL_SUGGESTION
  78 + private String address;// 居住地址
  79 + private String doctorName;// 婚检医生
  80 + -->
  81 + <resultMap id="InspectListVoResultMap" type="com.lyms.hospital.entity.inspect.InspectListVo">
  82 + <id column="ID" property="id" />
  83 + <result column="INSPECT_DATE" property="inspectDate" />
  84 + <result column="BASE_WOMAN_NAME" property="name" />
  85 + <result column="BASE_PAPERS_NUMBER" property="papersNumber" />
  86 + <result column="CONTACT_WOMAN_WAY" property="contactWay" />
  87 + <result column="showResult" property="showResult" />
  88 + <result column="MEDICAL_SUGGESTION" property="medicalSuggestion" />
  89 + <result column="address" property="address" />
  90 + <result column="DOCTOR_ID" property="doctorName" />
  91 + </resultMap>
69 92  
70 93 <!-- 通用查询结果列 -->
71 94 <sql id="Base_Column_List">
72 95 ID AS id, ARCHIVE_ID AS archiveId, INSPECT_DATE AS inspectDate, ORG_ID AS orgId, SPIRIT AS spirit, SPIRIT_TEXT AS spiritText, LANGUAGE AS language, LANGUAGE_TEXT AS languageText, FACE AS face, FACE_TEXT AS faceText, BODY AS body, BODY_TEXT AS bodyText, HEIGHT AS height, WEIGHT AS weight, BLOOD_SHRINK AS bloodShrink, BLOOD_DIASTOLE AS bloodDiastole, SKIN AS skin, SKIN_PZ AS skinPz, SKIN_BH AS skinBh, SKIN_GJYC AS skinGjyc, HAIR AS hair, HAIR_FB AS hairFb, HAIR_COLOR AS hairColor, HAIR_TLBW AS hairTlbw, LIMB AS limb, LIMB_JWS AS limbJws, LIMB_MB AS limbMb, LIMB_JL AS limbJl, LIMB_ZC AS limbZc, LIMB_OTHER AS limbOther, LIMB_OTHER_TEXT AS limbOtherText, SPINE AS spine, SPINE_TEXT AS spineText, LYMPH AS lymph, EYE_LEFT AS eyeLeft, EYE_RIGHT AS eyeRight, EAR_LEFT AS earLeft, EAR_RIGHT AS earRight, DISTINGUISH_COLOR AS distinguishColor, DISTINGUISH_COLOR_TEXT AS distinguishColorText, THYROID AS thyroid, THYROID_TEXT AS thyroidText, CHEST AS chest, CHEST_TEXT AS chestText, LUNG AS lung, LUNG_TEXT AS lungText, HEART_RATE AS heartRate, HEART_RHYTHM AS heartRhythm, NOISE AS noise, NOISE_TEXT AS noiseText, BELLY_LIVER AS bellyLiver, BELLY_SPLEEN AS bellySpleen, BELLY_OTHER AS bellyOther, INSPECT_RESULT AS inspectResult, EXCEPTION_TEXT AS exceptionText, DISEASE_TEXT AS diseaseText, MEDICAL_SUGGESTION AS medicalSuggestion, DOCTOR_SUGGESTION AS doctorSuggestion, DOCTOR_ID AS doctorId, CREATE_TIME AS createTime, IF_DEL AS ifDel
73 96 </sql>
  97 +
  98 + <!-- 查询某人历史婚检记录列表 -->
  99 + <select id="getPersonalInspectHistoryList" parameterType="java.lang.String" resultType="map">
  100 + SELECT i.ID AS id,i.`ARCHIVE_ID` AS archiveId,i.`INSPECT_DATE` AS inspectDate,org.`NAME` AS orgName
  101 + FROM MARRYBE_INSPECT i
  102 + INNER JOIN SYS_ORGANIZATIONS org ON i.`ORG_ID`=org.`ID`
  103 + WHERE i.ARCHIVE_ID = #{archiveId}
  104 + </select>
  105 +
  106 + <!-- 查询某医院婚检列表 -->
  107 + <select id="listOfMarryBeforeInspect" parameterType="com.lyms.hospital.entity.inspect.InspectListVo" resultMap="InspectListVoResultMap">
  108 + SELECT i.ID,i.`INSPECT_DATE`,wr.`BASE_WOMAN_NAME`,wr.`BASE_PAPERS_NUMBER`,wr.`CONTACT_WOMAN_WAY`,
  109 + (CASE i.`INSPECT_RESULT` WHEN 1 THEN '正常' ELSE EXCEPTION_TEXT END) AS showResult,
  110 + i.`MEDICAL_SUGGESTION`,CONCAT(wr.`CONTACT_DWELL_PROVINCE`,wr.`CONTACT_DWELL_CITY`,
  111 + wr.`CONTACT_DWELL_AREA`,wr.`CONTACT_DWELL_STREET`,wr.`CONTACT_DWELL_DETAIL`) AS address,i.`DOCTOR_ID` AS doctorName
  112 + FROM MARRYBE_INSPECT i
  113 + INNER JOIN WOMAN_RECORD wr ON i.`ARCHIVE_ID`=wr.`ID`
  114 + INNER JOIN SYS_ORGANIZATIONS org ON i.`ORG_ID`=org.`ID`
  115 + <where>
  116 + <if test="orgId==null">and i.`ORG_ID`=-1</if>
  117 + <if test="orgId!=null">and i.`ORG_ID`=#{orgId}</if>
  118 + <!-- gender 性别查询预留占位 -->
  119 + <if test="name!=null">and wr.`BASE_WOMAN_NAME` like concat('%',#{name},'%')</if>
  120 + <if test="papersNumber!=null">and wr.`BASE_PAPERS_NUMBER` like concat('%',#{papersNumber},'%')</if>
  121 + <if test="contactWay!=null">and wr.`CONTACT_WOMAN_WAY` like concat('%',#{contactWay},'%')</if>
  122 + <if test="queryDateBegin!=null && queryDateEnd!=null">
  123 + <![CDATA[
  124 + and i.`INSPECT_DATE` > #{queryDateBegin} and i.`INSPECT_DATE` < #{queryDateEnd}
  125 + ]]>
  126 + </if>
  127 + <if test="medicalSuggestion!=null">and i.`MEDICAL_SUGGESTION` like concat('%',#{medicalSuggestion},'%')</if>
  128 + </where>
  129 + ORDER BY i.`CREATE_TIME` DESC
  130 + </select>
  131 +
74 132 </mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/changehospital/HighriskChangeHospital.java View file @ 6b7b740
1 1 package com.lyms.hospital.entity.changehospital;
2 2  
3   -import com.baomidou.mybatisplus.annotations.TableId;
4   -import com.baomidou.mybatisplus.annotations.TableField;
5   -import com.baomidou.mybatisplus.annotations.TableName;
6 3 import java.io.Serializable;
7 4 import java.util.Date;
8 5  
  6 +import com.baomidou.mybatisplus.annotations.TableField;
  7 +import com.baomidou.mybatisplus.annotations.TableId;
  8 +import com.baomidou.mybatisplus.annotations.TableName;
  9 +
9 10 /**
10 11 * <p>
11 12 * 高危转诊
... ... @@ -84,6 +85,7 @@
84 85 */
85 86 @TableField(value="RECEIVE_TIME")
86 87 private Date receiveTime;
  88 +
87 89  
88 90 public String getId() {
89 91 return id;
... ... @@ -188,8 +190,6 @@
188 190 public void setReceiveTime(Date receiveTime) {
189 191 this.receiveTime = receiveTime;
190 192 }
191   -
192   -
193 193  
194 194 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/changehospital/HighriskChangeHospitalVo.java View file @ 6b7b740
  1 +package com.lyms.hospital.entity.changehospital;
  2 +
  3 +import java.util.Date;
  4 +/**
  5 + * 转诊信息业务实体
  6 + * @author xujiahong
  7 + *
  8 + */
  9 +public class HighriskChangeHospitalVo extends HighriskChangeHospital {
  10 +
  11 + private static final long serialVersionUID = 1L;
  12 +
  13 + private String baseWomanName;//孕妇名称
  14 + private Date baseWomanBirth;//孕妇生日
  15 + private String contactWomanWay;//孕妇联联系方式
  16 + private String outOrgName;//转出医院名称
  17 + private String intoOrgName;//转入医院名称
  18 +
  19 + public String getBaseWomanName() {
  20 + return baseWomanName;
  21 + }
  22 + public void setBaseWomanName(String baseWomanName) {
  23 + this.baseWomanName = baseWomanName;
  24 + }
  25 + public Date getBaseWomanBirth() {
  26 + return baseWomanBirth;
  27 + }
  28 + public void setBaseWomanBirth(Date baseWomanBirth) {
  29 + this.baseWomanBirth = baseWomanBirth;
  30 + }
  31 + public String getContactWomanWay() {
  32 + return contactWomanWay;
  33 + }
  34 + public void setContactWomanWay(String contactWomanWay) {
  35 + this.contactWomanWay = contactWomanWay;
  36 + }
  37 + public String getOutOrgName() {
  38 + return outOrgName;
  39 + }
  40 + public void setOutOrgName(String outOrgName) {
  41 + this.outOrgName = outOrgName;
  42 + }
  43 + public String getIntoOrgName() {
  44 + return intoOrgName;
  45 + }
  46 + public void setIntoOrgName(String intoOrgName) {
  47 + this.intoOrgName = intoOrgName;
  48 + }
  49 +
  50 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/inspect/InspectListVo.java View file @ 6b7b740
  1 +package com.lyms.hospital.entity.inspect;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * 婚前检查-婚检管理列表的页面显示对象
  7 + *
  8 + * @author xujiahong
  9 + *
  10 + */
  11 +public class InspectListVo {
  12 +
  13 + private String id;// 婚检记录ID
  14 + private Date inspectDate;// 婚检日期
  15 + private String name;// 姓名
  16 + private String papersNumber;// 证件号 BASE_PAPERS_NUMBER
  17 + private String contactWay;// 联系方式 CONTACT_WOMAN_WAY
  18 + private String showResult;// 结果
  19 + private String medicalSuggestion;// 医学意见 MEDICAL_SUGGESTION
  20 + private String address;// 居住地址
  21 + private String doctorName;// 婚检医生
  22 +
  23 + private Integer gender;//性别-预留(需要时和建档对接)
  24 + private Integer orgId;//医院ID
  25 + private String queryDateBegin;//查询-婚检日期范围开始
  26 + private String queryDateEnd;//查询-婚检日期范围结束
  27 +
  28 + public String getId() {
  29 + return id;
  30 + }
  31 + public void setId(String id) {
  32 + this.id = id;
  33 + }
  34 + public Date getInspectDate() {
  35 + return inspectDate;
  36 + }
  37 + public void setInspectDate(Date inspectDate) {
  38 + this.inspectDate = inspectDate;
  39 + }
  40 + public String getName() {
  41 + return name;
  42 + }
  43 + public void setName(String name) {
  44 + this.name = name;
  45 + }
  46 + public String getPapersNumber() {
  47 + return papersNumber;
  48 + }
  49 + public void setPapersNumber(String papersNumber) {
  50 + this.papersNumber = papersNumber;
  51 + }
  52 + public String getContactWay() {
  53 + return contactWay;
  54 + }
  55 + public void setContactWay(String contactWay) {
  56 + this.contactWay = contactWay;
  57 + }
  58 + public String getShowResult() {
  59 + return showResult;
  60 + }
  61 + public void setShowResult(String showResult) {
  62 + this.showResult = showResult;
  63 + }
  64 + public String getMedicalSuggestion() {
  65 + return medicalSuggestion;
  66 + }
  67 + public void setMedicalSuggestion(String medicalSuggestion) {
  68 + this.medicalSuggestion = medicalSuggestion;
  69 + }
  70 + public String getAddress() {
  71 + return address;
  72 + }
  73 + public void setAddress(String address) {
  74 + this.address = address;
  75 + }
  76 + public String getDoctorName() {
  77 + return doctorName;
  78 + }
  79 + public void setDoctorName(String doctorName) {
  80 + this.doctorName = doctorName;
  81 + }
  82 + public Integer getGender() {
  83 + return gender;
  84 + }
  85 + public void setGender(Integer gender) {
  86 + this.gender = gender;
  87 + }
  88 + public Integer getOrgId() {
  89 + return orgId;
  90 + }
  91 + public void setOrgId(Integer orgId) {
  92 + this.orgId = orgId;
  93 + }
  94 + public String getQueryDateBegin() {
  95 + return queryDateBegin;
  96 + }
  97 + public void setQueryDateBegin(String queryDateBegin) {
  98 + this.queryDateBegin = queryDateBegin;
  99 + }
  100 + public String getQueryDateEnd() {
  101 + return queryDateEnd;
  102 + }
  103 + public void setQueryDateEnd(String queryDateEnd) {
  104 + this.queryDateEnd = queryDateEnd;
  105 + }
  106 +
  107 +
  108 +}
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/inspect/InspectManVo.java View file @ 6b7b740
... ... @@ -4,6 +4,12 @@
4 4  
5 5 private MarrybeInspectMan inspectMan;//男性婚检信息
6 6  
  7 + public InspectManVo(){}
  8 +
  9 + public InspectManVo(InspectVo vo){
  10 + super(vo);
  11 + }
  12 +
7 13 public MarrybeInspectMan getInspectMan() {
8 14 return inspectMan;
9 15 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/inspect/InspectVo.java View file @ 6b7b740
... ... @@ -9,6 +9,16 @@
9 9 private WomanHusband wh;//配偶信息
10 10 private DiagnoseAssit assist;//辅助检查
11 11  
  12 + public InspectVo(){}
  13 +
  14 + public InspectVo(InspectVo vo){
  15 + if(vo!=null){
  16 + this.inspect = vo.getInspect();
  17 + this.wh = vo.getWh();
  18 + this.assist = vo.getAssist();
  19 + }
  20 + }
  21 +
12 22 public MarrybeInspect getInspect() {
13 23 return inspect;
14 24 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/inspect/InspectWomanVo.java View file @ 6b7b740
... ... @@ -4,6 +4,12 @@
4 4  
5 5 private MarrybeInspectWoman inspectWoman;//女性婚检信息
6 6  
  7 + public InspectWomanVo(){}
  8 +
  9 + public InspectWomanVo(InspectVo vo){
  10 + super(vo);
  11 + }
  12 +
7 13 public MarrybeInspectWoman getInspectWoman() {
8 14 return inspectWoman;
9 15 }
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/woman/WomanHusband.java View file @ 6b7b740
... ... @@ -18,6 +18,11 @@
18 18 public class WomanHusband implements Serializable {
19 19  
20 20 private static final long serialVersionUID = 1L;
  21 + /*
  22 + * 记录来源:1孕妇建档,2婚前检查
  23 + */
  24 + public static int TARGET_TYPE_ARCHIVE = 1;
  25 + public static int TARGET_TYPE_INSPECT = 2;
21 26  
22 27 /**
23 28 *
parent/hospital.mac/src/main/java/com/lyms/hospital/service/assist/impl/DiagnoseAssitServiceImpl.java View file @ 6b7b740
... ... @@ -64,10 +64,10 @@
64 64 return null;
65 65 }
66 66 List<DiagnoseAssit> list = baseMapper.selectList(new EntityWrapper<DiagnoseAssit>().eq("DIAGNOSE_ID", diagnoseId));
67   - if(CollectionUtils.isEmpty(list)){
68   - return null;
  67 + if(list.size()>1){
  68 + throw new SystemException("发现多条匹配记录");
69 69 }
70   - return list.get(0);
  70 + return CollectionUtils.isEmpty(list)?null:list.get(0);
71 71 }
72 72 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/changehospital/HighriskChangeHospitalService.java View file @ 6b7b740
... ... @@ -4,6 +4,7 @@
4 4  
5 5 import com.baomidou.mybatisplus.plugins.Page;
6 6 import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
  7 +import com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo;
7 8 import com.lyms.web.service.BaseService;
8 9  
9 10 /**
... ... @@ -70,6 +71,8 @@
70 71 * <li>修改时间:
71 72 */
72 73 public Page<HighriskChangeHospital> pageOfOut(String orgId,Page<HighriskChangeHospital> page);
  74 +
  75 + public Page<HighriskChangeHospitalVo> pageOfOutVo(HighriskChangeHospitalVo vo,Page<HighriskChangeHospitalVo> page);
73 76  
74 77  
75 78 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/changehospital/impl/HighriskChangeHospitalServiceImpl.java View file @ 6b7b740
... ... @@ -4,6 +4,7 @@
4 4 import java.util.Date;
5 5 import java.util.List;
6 6  
  7 +import org.springframework.beans.factory.annotation.Autowired;
7 8 import org.springframework.stereotype.Service;
8 9  
9 10 import com.baomidou.mybatisplus.mapper.EntityWrapper;
... ... @@ -12,6 +13,7 @@
12 13 import com.lyms.exception.SystemException;
13 14 import com.lyms.hospital.dao.changehospital.HighriskChangeHospitalMapper;
14 15 import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
  16 +import com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo;
15 17 import com.lyms.hospital.enums.HighRiskChangeHospitalStatusEnum;
16 18 import com.lyms.hospital.service.changehospital.HighriskChangeHospitalService;
17 19 import com.lyms.util.StrUtils;
... ... @@ -27,6 +29,9 @@
27 29 @Service
28 30 public class HighriskChangeHospitalServiceImpl extends ServiceImpl<HighriskChangeHospitalMapper, HighriskChangeHospital>
29 31 implements HighriskChangeHospitalService {
  32 +
  33 + @Autowired
  34 + private HighriskChangeHospitalMapper mapper;
30 35  
31 36 public Integer deleteLogicById(Serializable id) {
32 37 return baseMapper.deleteLogicById(id);
... ... @@ -70,6 +75,18 @@
70 75 private Page<HighriskChangeHospital> pageOfInOrOut(String orgId, String flag, Page<HighriskChangeHospital> page) {
71 76 List<HighriskChangeHospital> list = baseMapper.selectPage(page,
72 77 new EntityWrapper<HighriskChangeHospital>().eq(flag, orgId).orderBy("CREATE_TIME", false));
  78 + page.setRecords(list);
  79 + return page;
  80 + }
  81 +
  82 + @Override
  83 + public Page<HighriskChangeHospitalVo> pageOfOutVo(HighriskChangeHospitalVo vo,
  84 + Page<HighriskChangeHospitalVo> page) {
  85 + if(vo==null||vo.getOutOrgid()==null){
  86 + throw new SystemException("查询条件【机构ID】不能为空");
  87 + }
  88 +
  89 + List<HighriskChangeHospitalVo> list = mapper.listOfOutWomanVo(page,vo);
73 90 page.setRecords(list);
74 91 return page;
75 92 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/MarrybeInspectManService.java View file @ 6b7b740
1 1 package com.lyms.hospital.service.inspect;
2 2  
  3 +import java.io.Serializable;
  4 +
3 5 import com.lyms.hospital.entity.inspect.MarrybeInspectMan;
4 6 import com.lyms.web.service.BaseService;
5   -import java.io.Serializable;
6 7  
7 8 /**
8 9 * <p>
... ... @@ -12,6 +13,8 @@
12 13 * 修改-男性婚检信息
13 14 * 查询详情-男性婚检信息
14 15 *
  16 + * 根据婚检ID查询-男性婚检信息
  17 + *
15 18 * </p>
16 19 *
17 20 * @author xujiahong
... ... @@ -58,6 +61,17 @@
58 61 * <li>修改时间:
59 62 */
60 63 public MarrybeInspectMan selectById(String id);
  64 +
  65 + /**
  66 + * <li>@Description:根据婚检ID查询-男性婚检信息
  67 + * <li>@param id
  68 + * <li>@return
  69 + * <li>创建人:xujiahong
  70 + * <li>创建时间:2017年4月10日
  71 + * <li>修改人:
  72 + * <li>修改时间:
  73 + */
  74 + public MarrybeInspectMan selectByInspectId(String id);
61 75  
62 76 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/MarrybeInspectService.java View file @ 6b7b740
1 1 package com.lyms.hospital.service.inspect;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
  5 +import java.util.Map;
4 6  
  7 +import com.lyms.hospital.entity.inspect.InspectListVo;
5 8 import com.lyms.hospital.entity.inspect.InspectManVo;
6 9 import com.lyms.hospital.entity.inspect.InspectWomanVo;
7 10 import com.lyms.hospital.entity.inspect.MarrybeInspect;
8 11  
... ... @@ -18,12 +21,12 @@
18 21 * []新增男性婚检vo(事务:基本婚检信息、配偶信息、男性婚育史/生殖信息、新增辅助信息)
19 22 * []修改女性婚检vo
20 23 * []修改男性婚检vo
21   - * 查询女性婚检详情(事务:基本婚检信息、配偶信息、女性婚育史/生殖信息、新增辅助信息)
22   - * 查询男性婚检详情(事务:基本婚检信息、配偶信息、男性婚育史/生殖信息、新增辅助信息)
  24 + * []查询女性婚检详情vo
  25 + * []查询男性婚检详情vo
  26 + * []逻辑删除婚检vo
23 27 *
24   - * 查询某人历史婚检记录列表
25   - * 查询某医院女性婚检列表(多表关联条件查询)
26   - * 查询某医院男性婚检列表(多表关联条件查询)
  28 + * []查询某人历史婚检记录列表(ID,时间,建档医院)
  29 + * []查询某医院婚检列表(多表关联条件查询)
27 30 * </p>
28 31 *
29 32 * @author xujiahong
... ... @@ -31,12 +34,16 @@
31 34 */
32 35 public interface MarrybeInspectService extends BaseService<MarrybeInspect> {
33 36  
34   - /**
35   - * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
36   - * <li>@param id 删除主键id
37   - * <li>@return 大于0修改成功,否则为失败
38   - */
39   - public Integer deleteLogicById(Serializable id);
  37 + /**
  38 + * <li>@Description:逻辑删除婚检vo
  39 + * <li>@param id
  40 + * <li>@return
  41 + * <li>创建人:xujiahong
  42 + * <li>创建时间:2017年4月10日
  43 + * <li>修改人:
  44 + * <li>修改时间:
  45 + */
  46 + public boolean deleteLogicById(Serializable id);
40 47  
41 48 /*
42 49 * 单表新增、修改操作
... ... @@ -84,6 +91,50 @@
84 91 * <li>修改时间:
85 92 */
86 93 public boolean updateInspectManVo(InspectManVo vo);
87   -
  94 +
  95 + /**
  96 + * <li>@Description:查询女性婚检详情vo
  97 + * <li>@param id
  98 + * <li>@return
  99 + * <li>创建人:xujiahong
  100 + * <li>创建时间:2017年4月10日
  101 + * <li>修改人:
  102 + * <li>修改时间:
  103 + */
  104 + public InspectWomanVo selectInspectWomanVoById(String id);
  105 +
  106 + /**
  107 + * <li>@Description:查询男性婚检详情vo
  108 + * <li>@param id
  109 + * <li>@return
  110 + * <li>创建人:xujiahong
  111 + * <li>创建时间:2017年4月10日
  112 + * <li>修改人:
  113 + * <li>修改时间:
  114 + */
  115 + public InspectManVo selectInspectManVoById(String id);
  116 +
  117 + /**
  118 + * <li>@Description:查询某人历史婚检记录列表(ID,时间,建档医院)
  119 + * <li>@param archiveId 档案ID
  120 + * <li>@return
  121 + * <li>创建人:xujiahong
  122 + * <li>创建时间:2017年4月10日
  123 + * <li>修改人:
  124 + * <li>修改时间:
  125 + */
  126 + public List<Map<String,Object>> getPersonalInspectHistoryList(String archiveId);
  127 +
  128 + /**
  129 + * <li>@Description:查询某医院婚检列表(多表关联条件查询)
  130 + * <li>@param vo
  131 + * <li>@return
  132 + * <li>创建人:xujiahong
  133 + * <li>创建时间:2017年4月10日
  134 + * <li>修改人:
  135 + * <li>修改时间:
  136 + */
  137 + public List<InspectListVo> listOfMarryBeforeInspect(InspectListVo vo);
  138 +
88 139 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/MarrybeInspectWomanService.java View file @ 6b7b740
... ... @@ -12,6 +12,8 @@
12 12 * 新增-女性婚检信息
13 13 * 修改-女性婚检信息
14 14 * 查询详情-女性婚检信息
  15 + *
  16 + * 根据婚检ID查询-女性婚检信息
15 17 * </p>
16 18 *
17 19 * @author xujiahong
... ... @@ -29,6 +31,16 @@
29 31 public String create(MarrybeInspectWoman obj);
30 32  
31 33 public boolean update(MarrybeInspectWoman obj);
  34 + /**
  35 + * <li>@Description:根据婚检ID查询-女性婚检信息
  36 + * <li>@param id
  37 + * <li>@return
  38 + * <li>创建人:xujiahong
  39 + * <li>创建时间:2017年4月10日
  40 + * <li>修改人:
  41 + * <li>修改时间:
  42 + */
  43 + public MarrybeInspectWoman selectByInspectId(String id);
32 44  
33 45 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/impl/MarrybeInspectManServiceImpl.java View file @ 6b7b740
1 1 package com.lyms.hospital.service.inspect.impl;
2 2  
3   -import com.lyms.hospital.entity.inspect.MarrybeInspectMan;
4   -import com.lyms.hospital.enums.IfdelEnum;
  3 +import java.io.Serializable;
  4 +import java.util.List;
  5 +
  6 +import org.apache.commons.collections.CollectionUtils;
  7 +import org.springframework.stereotype.Service;
  8 +import org.springframework.util.StringUtils;
  9 +
  10 +import com.baomidou.mybatisplus.mapper.EntityWrapper;
  11 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
5 12 import com.lyms.exception.SystemException;
6 13 import com.lyms.hospital.dao.inspect.MarrybeInspectManMapper;
  14 +import com.lyms.hospital.entity.inspect.MarrybeInspectMan;
  15 +import com.lyms.hospital.enums.IfdelEnum;
7 16 import com.lyms.hospital.service.inspect.MarrybeInspectManService;
8 17 import com.lyms.util.StrUtils;
9   -import com.baomidou.mybatisplus.service.impl.ServiceImpl;
10   -import org.springframework.stereotype.Service;
11   -import org.springframework.util.StringUtils;
12 18  
13   -import java.io.Serializable;
14   -
15 19 /**
16 20 * <p>
17 21 * 服务实现类
... ... @@ -53,6 +57,17 @@
53 57 @Override
54 58 public MarrybeInspectMan selectById(String id) {
55 59 return selectById(id);
  60 + }
  61 +
  62 + @Override
  63 + public MarrybeInspectMan selectByInspectId(String id) {
  64 + EntityWrapper<MarrybeInspectMan> wrapper = new EntityWrapper<>();
  65 + wrapper.eq("MID", id);
  66 + List<MarrybeInspectMan> list = baseMapper.selectList(wrapper);
  67 + if(list.size()>1){
  68 + throw new SystemException("发现多条匹配记录");
  69 + }
  70 + return CollectionUtils.isEmpty(list)?null:list.get(0);
56 71 }
57 72 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/impl/MarrybeInspectServiceImpl.java View file @ 6b7b740
1 1 package com.lyms.hospital.service.inspect.impl;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.Date;
4 7  
5 8 import org.springframework.beans.factory.annotation.Autowired;
6 9 import org.springframework.stereotype.Service;
... ... @@ -11,6 +14,7 @@
11 14 import com.lyms.exception.SystemException;
12 15 import com.lyms.hospital.dao.inspect.MarrybeInspectMapper;
13 16 import com.lyms.hospital.entity.assist.DiagnoseAssit;
  17 +import com.lyms.hospital.entity.inspect.InspectListVo;
14 18 import com.lyms.hospital.entity.inspect.InspectManVo;
15 19 import com.lyms.hospital.entity.inspect.InspectVo;
16 20 import com.lyms.hospital.entity.inspect.InspectWomanVo;
17 21  
... ... @@ -28,15 +32,16 @@
28 32  
29 33 /**
30 34 * <p>
31   - * 服务实现类
  35 + * 服务实现类
32 36 * </p>
33 37 *
34 38 * @author xujiahong
35 39 * @since 2017-04-06
36 40 */
37 41 @Service
38   -public class MarrybeInspectServiceImpl extends ServiceImpl<MarrybeInspectMapper, MarrybeInspect> implements MarrybeInspectService {
39   -
  42 +public class MarrybeInspectServiceImpl extends ServiceImpl<MarrybeInspectMapper, MarrybeInspect>
  43 + implements MarrybeInspectService {
  44 +
40 45 @Autowired
41 46 private MarrybeInspectManService inspectManService;
42 47 @Autowired
... ... @@ -45,9 +50,18 @@
45 50 private WomanHusbandService whService;
46 51 @Autowired
47 52 private DiagnoseAssitService assistService;
48   -
49   - public Integer deleteLogicById(Serializable id){
50   - return baseMapper.deleteLogicById(id);
  53 + @Autowired
  54 + private MarrybeInspectMapper mapper;
  55 +
  56 + @Override
  57 + @Transactional
  58 + public boolean deleteLogicById(Serializable id) {
  59 + MarrybeInspect inspect = this.selectById(id);
  60 + if(inspect==null){
  61 + throw new SystemException("基础婚检信息不存在");
  62 + }
  63 + inspect.setIfDel(IfdelEnum.YES.getStatus());
  64 + return this.update(inspect);
51 65 }
52 66  
53 67 @Override
... ... @@ -58,7 +72,10 @@
58 72 String id = StrUtils.uuid();
59 73 obj.setId(id);
60 74 obj.setIfDel(IfdelEnum.NO.getStatus());
61   - obj.setCreateTime(new java.util.Date());
  75 + obj.setCreateTime(new Date());
  76 + if(obj.getInspectDate()==null){
  77 + obj.setInspectDate(new Date());
  78 + }
62 79 if (insert(obj)) {
63 80 return id;
64 81 }
65 82  
66 83  
67 84  
68 85  
69 86  
70 87  
71 88  
72 89  
73 90  
74 91  
75 92  
76 93  
77 94  
78 95  
79 96  
80 97  
81 98  
... ... @@ -72,76 +89,154 @@
72 89 }
73 90 return updateById(obj);
74 91 }
75   -
  92 +
  93 + @Override
  94 + @Transactional
  95 + public String createInspectManVo(InspectManVo vo) {
  96 + return createInspectVo(vo);
  97 + }
  98 +
  99 + @Override
  100 + @Transactional
  101 + public String createInspectWomanVo(InspectWomanVo vo) {
  102 + return createInspectVo(vo);
  103 + }
  104 +
  105 + @Override
  106 + @Transactional
  107 + public boolean updateInspectManVo(InspectManVo vo) {
  108 + return updateInspectVo(vo);
  109 + }
  110 +
  111 + @Override
  112 + @Transactional
  113 + public boolean updateInspectWomanVo(InspectWomanVo vo) {
  114 + return updateInspectVo(vo);
  115 + }
  116 +
  117 + @Override
  118 + public InspectWomanVo selectInspectWomanVoById(String id) {
  119 +
  120 + InspectVo temp = this.selectCommonInfo(id);
  121 + InspectWomanVo vo = new InspectWomanVo(temp);
  122 + if (temp != null) {// 则 inspect、inspect.getId()均不为null
  123 + String mid = vo.getInspect().getId();// 基础婚检信息ID
  124 + MarrybeInspectWoman inspectWoman = inspectWomanService.selectByInspectId(mid);// 女性特有婚检信息
  125 + vo.setInspectWoman(inspectWoman);
  126 + }
  127 + return vo;
  128 + }
  129 +
  130 + @Override
  131 + public InspectManVo selectInspectManVoById(String id) {
  132 +
  133 + InspectVo temp = this.selectCommonInfo(id);
  134 + InspectManVo vo = new InspectManVo(temp);
  135 + if (temp != null) {// 则 inspect、inspect.getId()均不为null
  136 + String mid = vo.getInspect().getId();// 基础婚检信息ID
  137 + MarrybeInspectMan inspectMan = inspectManService.selectByInspectId(mid);// 男性特有婚检信息
  138 + vo.setInspectMan(inspectMan);
  139 + }
  140 + return vo;
  141 + }
  142 +
76 143 /*
  144 + * ==========================华丽的分割线(以下是私有方法)==============================
  145 + */
  146 +
  147 + /*
  148 + * 查询婚检详情的公用信息(包括:基础婚检信息、配偶信息、辅助检查)
  149 + */
  150 + private InspectVo selectCommonInfo(String id) {
  151 + if (StringUtils.isEmpty(id)) {
  152 + throw new SystemException("婚检ID不能为空");
  153 + }
  154 + MarrybeInspect inspect = this.selectById(id);// 基础婚检信息
  155 + // 基础婚检信息为空或者已逻辑删除,则返回null
  156 + if (inspect == null || inspect.getId() == null
  157 + || (inspect.getIfDel() == IfdelEnum.YES.getStatus())) {
  158 + return null;
  159 + }
  160 + InspectVo vo = new InspectVo();
  161 + vo.setInspect(inspect);
  162 + String mid = inspect.getId();// 基础婚检信息ID
  163 + WomanHusband wh = whService.selectByTarget(WomanHusband.TARGET_TYPE_INSPECT, mid);// 配偶信息
  164 + vo.setWh(wh);
  165 + DiagnoseAssit assist = assistService.getDetailByDiagnoseId(mid);// 辅助检查
  166 + vo.setAssist(assist);
  167 + return vo;
  168 + }
  169 +
  170 + /*
77 171 * 创建婚检(不分男女)
78 172 */
79 173 @Transactional
80   - private String createInspectVo(InspectVo vo){
81   - if(vo==null){
  174 + private String createInspectVo(InspectVo vo) {
  175 + if (vo == null) {
82 176 return null;
83 177 }
84   - MarrybeInspect inspect = vo.getInspect();//基础婚检信息
85   - WomanHusband wh = vo.getWh();//配偶信息
86   - DiagnoseAssit assist = vo.getAssist();//辅助检查
  178 + MarrybeInspect inspect = vo.getInspect();// 基础婚检信息
  179 + WomanHusband wh = vo.getWh();// 配偶信息
  180 + DiagnoseAssit assist = vo.getAssist();// 辅助检查
87 181 MarrybeInspectMan inspectMan;
88 182 MarrybeInspectWoman inspectWoman;
89   -
90   - if(inspect==null){
  183 +
  184 + if (inspect == null) {
91 185 throw new SystemException("基础婚检信息为空");
92 186 }
93   - String mid = this.create(inspect);//婚前检查ID
94   - if(wh!=null){
  187 + String mid = this.create(inspect);// 婚前检查ID
  188 + if (wh != null) {
  189 + wh.setTargetType(WomanHusband.TARGET_TYPE_INSPECT);
95 190 wh.setTargetId(mid);
96 191 whService.create(wh);
97 192 }
98   - if(assist!=null){
  193 + if (assist != null) {
99 194 assist.setDiagnoseId(mid);
100   - assist.setDiagnoseType(1);//诊断类型:1婚前检查,2产检
  195 + assist.setDiagnoseType(1);// 诊断类型:1婚前检查,2产检
101 196 assistService.create(assist);
102 197 }
103   - if(vo instanceof InspectManVo){//男性婚检信息
104   - InspectManVo manVo = (InspectManVo)vo;
  198 + if (vo instanceof InspectManVo) {// 男性婚检信息
  199 + InspectManVo manVo = (InspectManVo) vo;
105 200 inspectMan = manVo.getInspectMan();
106   - if(inspectMan!=null){
  201 + if (inspectMan != null) {
107 202 inspectMan.setMid(mid);
108 203 inspectManService.create(inspectMan);
109 204 }
110   - }else if(vo instanceof InspectWomanVo){//女性婚检信息
111   - InspectWomanVo womanVo = (InspectWomanVo)vo;
  205 + } else if (vo instanceof InspectWomanVo) {// 女性婚检信息
  206 + InspectWomanVo womanVo = (InspectWomanVo) vo;
112 207 inspectWoman = womanVo.getInspectWoman();
113   - if(inspectWoman!=null){
  208 + if (inspectWoman != null) {
114 209 inspectWoman.setMid(mid);
115 210 inspectWomanService.create(inspectWoman);
116 211 }
117 212 }
118 213 return mid;
119 214 }
120   -
  215 +
121 216 /*
122 217 * 修改婚检(不分男女)
123 218 */
124 219 @Transactional
125   - private boolean updateInspectVo(InspectVo vo){
126   - if(vo==null){
  220 + private boolean updateInspectVo(InspectVo vo) {
  221 + if (vo == null) {
127 222 return false;
128 223 }
129   - MarrybeInspect inspect = vo.getInspect();//基础婚检信息
130   - WomanHusband wh = vo.getWh();//配偶信息
131   - DiagnoseAssit assist = vo.getAssist();//辅助检查
  224 + MarrybeInspect inspect = vo.getInspect();// 基础婚检信息
  225 + WomanHusband wh = vo.getWh();// 配偶信息
  226 + DiagnoseAssit assist = vo.getAssist();// 辅助检查
132 227 MarrybeInspectMan inspectMan;
133 228 MarrybeInspectWoman inspectWoman;
134   -
  229 +
135 230 boolean flag;
136 231 flag = this.update(inspect);
137 232 flag = flag && whService.update(wh);
138 233 flag = flag && assistService.update(assist);
139   - if(vo instanceof InspectManVo){//男性婚检信息
140   - InspectManVo manVo = (InspectManVo)vo;
  234 + if (vo instanceof InspectManVo) {// 男性婚检信息
  235 + InspectManVo manVo = (InspectManVo) vo;
141 236 inspectMan = manVo.getInspectMan();
142 237 flag = flag && inspectManService.update(inspectMan);
143   - }else if(vo instanceof InspectWomanVo){//女性婚检信息
144   - InspectWomanVo womanVo = (InspectWomanVo)vo;
  238 + } else if (vo instanceof InspectWomanVo) {// 女性婚检信息
  239 + InspectWomanVo womanVo = (InspectWomanVo) vo;
145 240 inspectWoman = womanVo.getInspectWoman();
146 241 flag = flag && inspectWomanService.update(inspectWoman);
147 242 }
148 243  
149 244  
... ... @@ -149,29 +244,20 @@
149 244 }
150 245  
151 246 @Override
152   - @Transactional
153   - public String createInspectManVo(InspectManVo vo) {
154   - //新增男性婚检(事务:新增基本婚检信息、配偶信息、男性婚育史/生殖信息、辅助信息)
155   - return createInspectVo(vo);
  247 + public List<Map<String, Object>> getPersonalInspectHistoryList(String archiveId) {
  248 + return mapper.getPersonalInspectHistoryList(archiveId);
156 249 }
157 250  
158 251 @Override
159   - @Transactional
160   - public String createInspectWomanVo(InspectWomanVo vo) {
161   - //新增女性婚检(事务:基本婚检信息、配偶信息、女性婚育史/生殖信息、新增辅助信息)
162   - return createInspectVo(vo);
  252 + public List<InspectListVo> listOfMarryBeforeInspect(InspectListVo vo) {
  253 + if(vo==null){
  254 + return null;
  255 + }
  256 + if(StringUtils.isEmpty(vo.getOrgId())){
  257 + throw new SystemException("缺失参数:医院ID");
  258 + }
  259 + return mapper.listOfMarryBeforeInspect(vo);
163 260 }
164 261  
165   - @Override
166   - @Transactional
167   - public boolean updateInspectManVo(InspectManVo vo) {
168   - return updateInspectVo(vo);
169   - }
170   -
171   - @Override
172   - @Transactional
173   - public boolean updateInspectWomanVo(InspectWomanVo vo) {
174   - return updateInspectVo(vo);
175   - }
176 262 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/inspect/impl/MarrybeInspectWomanServiceImpl.java View file @ 6b7b740
1 1 package com.lyms.hospital.service.inspect.impl;
2 2  
3   -import com.lyms.hospital.entity.inspect.MarrybeInspectWoman;
4   -import com.lyms.hospital.enums.IfdelEnum;
  3 +import java.io.Serializable;
  4 +import java.util.List;
  5 +
  6 +import org.apache.commons.collections.CollectionUtils;
  7 +import org.springframework.stereotype.Service;
  8 +import org.springframework.util.StringUtils;
  9 +
  10 +import com.baomidou.mybatisplus.mapper.EntityWrapper;
  11 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
5 12 import com.lyms.exception.SystemException;
6 13 import com.lyms.hospital.dao.inspect.MarrybeInspectWomanMapper;
  14 +import com.lyms.hospital.entity.inspect.MarrybeInspectWoman;
  15 +import com.lyms.hospital.enums.IfdelEnum;
7 16 import com.lyms.hospital.service.inspect.MarrybeInspectWomanService;
8 17 import com.lyms.util.StrUtils;
9   -import com.baomidou.mybatisplus.service.impl.ServiceImpl;
10   -import org.springframework.stereotype.Service;
11   -import org.springframework.util.StringUtils;
12 18  
13   -import java.io.Serializable;
14   -
15 19 /**
16 20 * <p>
17 21 * 服务实现类
... ... @@ -48,6 +52,17 @@
48 52 throw new SystemException("女性婚检信息为空");
49 53 }
50 54 return updateById(obj);
  55 + }
  56 +
  57 + @Override
  58 + public MarrybeInspectWoman selectByInspectId(String id) {
  59 + EntityWrapper<MarrybeInspectWoman> wrapper = new EntityWrapper<>();
  60 + wrapper.eq("MID", id);
  61 + List<MarrybeInspectWoman> list = baseMapper.selectList(wrapper);
  62 + if(list.size()>1){
  63 + throw new SystemException("发现多条匹配记录");
  64 + }
  65 + return CollectionUtils.isEmpty(list)?null:list.get(0);
51 66 }
52 67 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanHusbandService.java View file @ 6b7b740
... ... @@ -10,6 +10,8 @@
10 10 *
11 11 * 新增-配偶信息
12 12 * 修改-配偶信息
  13 + *
  14 + * []根据目标ID(婚检ID或孕妇建档ID)查询一条配偶信息记录
13 15 * </p>
14 16 *
15 17 * @author fangcheng
... ... @@ -32,6 +34,12 @@
32 34 */
33 35 public String create(WomanHusband womanHusband);
34 36 public boolean update(WomanHusband womanHusband);
  37 +
  38 +
  39 + /**
  40 + * 根据目标ID(婚检ID或孕妇建档ID)查询一条配偶信息记录
  41 + */
  42 + public WomanHusband selectByTarget(int targetType,String targetId);
35 43  
36 44 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanHusbandServiceImpl.java View file @ 6b7b740
... ... @@ -2,7 +2,9 @@
2 2  
3 3 import java.io.Serializable;
4 4 import java.util.Date;
  5 +import java.util.List;
5 6  
  7 +import org.apache.commons.collections.CollectionUtils;
6 8 import org.springframework.stereotype.Service;
7 9 import org.springframework.transaction.annotation.Transactional;
8 10 import org.springframework.util.StringUtils;
... ... @@ -60,6 +62,18 @@
60 62 throw new SystemException("配偶信息为空");
61 63 }
62 64 return updateById(obj);
  65 + }
  66 +
  67 + @Override
  68 + public WomanHusband selectByTarget(int targetType, String targetId) {
  69 + EntityWrapper<WomanHusband> wrapper = new EntityWrapper<>();
  70 + wrapper.eq("TARGET_TYPE", targetType);
  71 + wrapper.eq("TARGET_ID", targetId);
  72 + List<WomanHusband> list = baseMapper.selectList(wrapper);
  73 + if(list.size()>1){
  74 + throw new SystemException("发现多条匹配记录");
  75 + }
  76 + return CollectionUtils.isEmpty(list)?null:list.get(0);
63 77 }
64 78 }
parent/hospital.web/src/main/java/com/lyms/hospital/controller/changehospital/HighriskChangeHospitalController.java View file @ 6b7b740
... ... @@ -6,7 +6,7 @@
6 6 import org.springframework.web.bind.annotation.RestController;
7 7  
8 8 import com.baomidou.mybatisplus.plugins.Page;
9   -import com.lyms.hospital.entity.changehospital.HighriskChangeHospital;
  9 +import com.lyms.hospital.entity.changehospital.HighriskChangeHospitalVo;
10 10 import com.lyms.hospital.service.changehospital.HighriskChangeHospitalService;
11 11 import com.lyms.hospital.util.AggridUtils;
12 12 import com.lyms.hospital.util.RequestUtil;
... ... @@ -14,7 +14,7 @@
14 14  
15 15 /**
16 16 * <p>
17   - * 高危转诊 前端控制器
  17 + * 高危转诊 前端控制器
18 18 * </p>
19 19 *
20 20 * @author xujiahong
21 21  
22 22  
23 23  
... ... @@ -23,15 +23,21 @@
23 23 @RestController
24 24 @RequestMapping("/highriskChangeHospital")
25 25 public class HighriskChangeHospitalController extends BaseController {
26   -
  26 +
27 27 @Autowired
28 28 private HighriskChangeHospitalService service;
29   -
30   - @RequestMapping(value="/list/out", produces={RequestUtil.JSON_ENCODING}, method = RequestMethod.GET)
31   - public String listOfOutWoman(){
32   - Page<HighriskChangeHospital> page = service.pageOfOut("1",new Page<HighriskChangeHospital>(1,20));
  29 +
  30 + @RequestMapping(value = "/list/out", produces = { RequestUtil.JSON_ENCODING }, method = RequestMethod.GET)
  31 + public String listOfOutWoman() {
  32 + // Page<HighriskChangeHospital> page = service.pageOfOut("1",new
  33 + // Page<HighriskChangeHospital>(1,20));
  34 +
  35 + HighriskChangeHospitalVo vo = new HighriskChangeHospitalVo();
  36 + vo.setOutOrgid("2");
  37 + Page<HighriskChangeHospitalVo> page = service.pageOfOutVo(vo, new Page<HighriskChangeHospitalVo>(1, 3));
33 38 return AggridUtils.toAggrid(page);
  39 +
34 40 }
35   -
  41 +
36 42 }
parent/hospital.web/src/test/java/test/hospital/service/InsepectServiceTest.java View file @ 6b7b740
  1 +package test.hospital.service;
  2 +
  3 +import org.junit.Test;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +
  6 +import com.lyms.hospital.entity.assist.DiagnoseAssit;
  7 +import com.lyms.hospital.entity.inspect.InspectWomanVo;
  8 +import com.lyms.hospital.entity.inspect.MarrybeInspect;
  9 +import com.lyms.hospital.entity.inspect.MarrybeInspectWoman;
  10 +import com.lyms.hospital.entity.woman.WomanHusband;
  11 +import com.lyms.hospital.service.inspect.MarrybeInspectService;
  12 +
  13 +import test.hospital.BaseServiceTest;
  14 +
  15 +public class InsepectServiceTest extends BaseServiceTest {
  16 +
  17 + @Autowired
  18 + private MarrybeInspectService service;
  19 +
  20 +// @Test
  21 +// public void createInspectVo(){
  22 +// //初始化
  23 +// MarrybeInspect inspect = new MarrybeInspect();// 基础婚检信息
  24 +// inspect.setArchiveId("test20170410");
  25 +// inspect.setOrgId("1");
  26 +// WomanHusband wh = new WomanHusband();// 配偶信息
  27 +// DiagnoseAssit assist = new DiagnoseAssit();// 辅助检查
  28 +// MarrybeInspectWoman inspectWoman = new MarrybeInspectWoman();
  29 +//
  30 +// //新增
  31 +// InspectWomanVo womanVo = new InspectWomanVo();
  32 +// womanVo.setAssist(assist);
  33 +// womanVo.setInspect(inspect);
  34 +// womanVo.setInspectWoman(inspectWoman);
  35 +// womanVo.setWh(wh);
  36 +// service.createInspectWomanVo(womanVo);
  37 +//
  38 +// }
  39 +
  40 +}