Commit 4f4382009d87e2b0cca038187715853b232a6aaf
1 parent
0adad33460
Exists in
master
分娩相关服务接口,包括:分娩、胎儿、胎盘、新生儿信息
Showing 19 changed files with 707 additions and 33 deletions
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthInfoMapper.xml
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthNewbornMapper.xml
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthTaiMapper.xml
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthTaipanMapper.xml
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/recheck/PostpartumReeMapper.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthInfo.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthInfoVo.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthNewborn.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthTai.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthTaipan.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthInfoService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthNewbornService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthTaiService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthTaipanService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthInfoServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java
- parent/hospital.web/src/test/java/test/hospital/service/ChildbirthServiceTest.java
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthInfoMapper.xml
View file @
4f43820
| ... | ... | @@ -48,11 +48,12 @@ |
| 48 | 48 | <result column="ORG_ID" property="orgId" /> |
| 49 | 49 | <result column="DOCTOR_ID" property="doctorId" /> |
| 50 | 50 | <result column="CREATE_TIME" property="createTime" /> |
| 51 | + <result column="IF_DEL" property="ifDel" /> | |
| 51 | 52 | </resultMap> |
| 52 | 53 | |
| 53 | 54 | <!-- 通用查询结果列 --> |
| 54 | 55 | <sql id="Base_Column_List"> |
| 55 | - ID AS id, WOMAN_ID AS womanId, CHILDBIRTH_TIME AS childbirthTime, CHILDBIRTH_TIME_TEXT AS childbirthTimeText, FETUS_NUM AS fetusNum, PLACENTA_NUM AS placentaNum, CHILDBIRTH_TYPE AS childbirthType, OPERATION_REASON AS operationReason, PROCESS_FIRST AS processFirst, PROCESS_SECOND AS processSecond, PROCESS_THIRD AS processThird, PROCESS_TOTAL AS processTotal, PERINEUM_SITUATION AS perineumSituation, PERINEUM_SPLIT AS perineumSplit, NEEDLE_NUM AS needleNum, WOMAN_SITUATION AS womanSituation, OTHER_DEATH_REASON_TEXT AS otherDeathReasonText, BLOOD_SHRINK AS bloodShrink, BLOOD_DIASTOLE AS bloodDiastole, BLOOD_SHRINK_LATER AS bloodShrinkLater, BLOOD_DIASTOLE_LATER AS bloodDiastoleLater, BREATH AS breath, PULSE AS pulse, LOSE_BLOOD_A AS loseBloodA, LOSE_BLOOD_B AS loseBloodB, LOSE_BLOOD_C AS loseBloodC, LOSE_BLOOD_D AS loseBloodD, LOSE_BLOOD_REASON AS loseBloodReason, LOSE_BLOOD_OTHER_TEXT AS loseBloodOtherText, COMPLICATION_QZTP AS complicationQztp, COMPLICATION_TPZB AS complicationTpzb, COMPLICATION_TPZL AS complicationTpzl, COMPLICATION_TMZP AS complicationTmzp, COMPLICATION_CHCX AS complicationChcx, COMPLICATION_RSQGXY AS complicationRsqgxy, COMPLICATION_ZXA AS complicationZxa, COMPLICATION_ZXB AS complicationZxb, COMPLICATION_ZXC AS complicationZxc, COMPLICATION_RSHBMXGXY AS complicationRshbmxgxy, COMPLICATION_OTHER AS complicationOther, COMPLICATION_OTHER_TEXT AS complicationOtherText, ORG_ID AS orgId, DOCTOR_ID AS doctorId, CREATE_TIME AS createTime | |
| 56 | + ID AS id, WOMAN_ID AS womanId, CHILDBIRTH_TIME AS childbirthTime, CHILDBIRTH_TIME_TEXT AS childbirthTimeText, FETUS_NUM AS fetusNum, PLACENTA_NUM AS placentaNum, CHILDBIRTH_TYPE AS childbirthType, OPERATION_REASON AS operationReason, PROCESS_FIRST AS processFirst, PROCESS_SECOND AS processSecond, PROCESS_THIRD AS processThird, PROCESS_TOTAL AS processTotal, PERINEUM_SITUATION AS perineumSituation, PERINEUM_SPLIT AS perineumSplit, NEEDLE_NUM AS needleNum, WOMAN_SITUATION AS womanSituation, OTHER_DEATH_REASON_TEXT AS otherDeathReasonText, BLOOD_SHRINK AS bloodShrink, BLOOD_DIASTOLE AS bloodDiastole, BLOOD_SHRINK_LATER AS bloodShrinkLater, BLOOD_DIASTOLE_LATER AS bloodDiastoleLater, BREATH AS breath, PULSE AS pulse, LOSE_BLOOD_A AS loseBloodA, LOSE_BLOOD_B AS loseBloodB, LOSE_BLOOD_C AS loseBloodC, LOSE_BLOOD_D AS loseBloodD, LOSE_BLOOD_REASON AS loseBloodReason, LOSE_BLOOD_OTHER_TEXT AS loseBloodOtherText, COMPLICATION_QZTP AS complicationQztp, COMPLICATION_TPZB AS complicationTpzb, COMPLICATION_TPZL AS complicationTpzl, COMPLICATION_TMZP AS complicationTmzp, COMPLICATION_CHCX AS complicationChcx, COMPLICATION_RSQGXY AS complicationRsqgxy, COMPLICATION_ZXA AS complicationZxa, COMPLICATION_ZXB AS complicationZxb, COMPLICATION_ZXC AS complicationZxc, COMPLICATION_RSHBMXGXY AS complicationRshbmxgxy, COMPLICATION_OTHER AS complicationOther, COMPLICATION_OTHER_TEXT AS complicationOtherText, ORG_ID AS orgId, DOCTOR_ID AS doctorId, CREATE_TIME AS createTime, IF_DEL AS ifDel | |
| 56 | 57 | </sql> |
| 57 | 58 | </mapper> |
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthNewbornMapper.xml
View file @
4f43820
| ... | ... | @@ -21,11 +21,12 @@ |
| 21 | 21 | <result column="TOUCH_STAY" property="touchStay" /> |
| 22 | 22 | <result column="SUCK" property="suck" /> |
| 23 | 23 | <result column="CREATE_TIME" property="createTime" /> |
| 24 | + <result column="IF_DEL" property="ifDel" /> | |
| 24 | 25 | </resultMap> |
| 25 | 26 | |
| 26 | 27 | <!-- 通用查询结果列 --> |
| 27 | 28 | <sql id="Base_Column_List"> |
| 28 | - ID AS id, CID AS cid, BIRTH_TIME AS birthTime, GESTATION_ENDING AS gestationEnding, DEFORMITY AS deformity, GENDER AS gender, WEIGHT AS weight, HEIGHT AS height, DISEASE AS disease, APGAR_SCORE_ONE AS apgarScoreOne, APGAR_SCORE_FIVE AS apgarScoreFive, APGAR_SCORE_TEN AS apgarScoreTen, ASPHYXIA AS asphyxia, TOUCH_BEGIN AS touchBegin, TOUCH_STAY AS touchStay, SUCK AS suck, CREATE_TIME AS createTime | |
| 29 | + ID AS id, CID AS cid, BIRTH_TIME AS birthTime, GESTATION_ENDING AS gestationEnding, DEFORMITY AS deformity, GENDER AS gender, WEIGHT AS weight, HEIGHT AS height, DISEASE AS disease, APGAR_SCORE_ONE AS apgarScoreOne, APGAR_SCORE_FIVE AS apgarScoreFive, APGAR_SCORE_TEN AS apgarScoreTen, ASPHYXIA AS asphyxia, TOUCH_BEGIN AS touchBegin, TOUCH_STAY AS touchStay, SUCK AS suck, CREATE_TIME AS createTime, IF_DEL AS ifDel | |
| 29 | 30 | </sql> |
| 30 | 31 | </mapper> |
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthTaiMapper.xml
View file @
4f43820
| ... | ... | @@ -10,11 +10,12 @@ |
| 10 | 10 | <result column="HEART_RATE" property="heartRate" /> |
| 11 | 11 | <result column="FIRST_EXPOSE" property="firstExpose" /> |
| 12 | 12 | <result column="CREATE_TIME" property="createTime" /> |
| 13 | + <result column="IF_DEL" property="ifDel" /> | |
| 13 | 14 | </resultMap> |
| 14 | 15 | |
| 15 | 16 | <!-- 通用查询结果列 --> |
| 16 | 17 | <sql id="Base_Column_List"> |
| 17 | - ID AS id, CID AS cid, POSITION AS position, HEART_RATE AS heartRate, FIRST_EXPOSE AS firstExpose, CREATE_TIME AS createTime | |
| 18 | + ID AS id, CID AS cid, POSITION AS position, HEART_RATE AS heartRate, FIRST_EXPOSE AS firstExpose, CREATE_TIME AS createTime, IF_DEL AS ifDel | |
| 18 | 19 | </sql> |
| 19 | 20 | </mapper> |
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/childbirth/ChildbirthTaipanMapper.xml
View file @
4f43820
| ... | ... | @@ -15,11 +15,12 @@ |
| 15 | 15 | <result column="UMBILICAL_LENGTH" property="umbilicalLength" /> |
| 16 | 16 | <result column="UMBILICAL_EXCEPTION" property="umbilicalException" /> |
| 17 | 17 | <result column="CREATE_TIME" property="createTime" /> |
| 18 | + <result column="IF_DEL" property="ifDel" /> | |
| 18 | 19 | </resultMap> |
| 19 | 20 | |
| 20 | 21 | <!-- 通用查询结果列 --> |
| 21 | 22 | <sql id="Base_Column_List"> |
| 22 | - ID AS id, CID AS cid, PLACENTA_BIRTH_TYPE AS placentaBirthType, BIRTH_TYPE AS birthType, PLACENTA_LENGTH AS placentaLength, PLACENTA_WIDTH AS placentaWidth, PLACENTA_THICK AS placentaThick, PLACENTA_WEIGHT AS placentaWeight, UMBILICAL_LENGTH AS umbilicalLength, UMBILICAL_EXCEPTION AS umbilicalException, CREATE_TIME AS createTime | |
| 23 | + ID AS id, CID AS cid, PLACENTA_BIRTH_TYPE AS placentaBirthType, BIRTH_TYPE AS birthType, PLACENTA_LENGTH AS placentaLength, PLACENTA_WIDTH AS placentaWidth, PLACENTA_THICK AS placentaThick, PLACENTA_WEIGHT AS placentaWeight, UMBILICAL_LENGTH AS umbilicalLength, UMBILICAL_EXCEPTION AS umbilicalException, CREATE_TIME AS createTime, IF_DEL AS ifDel | |
| 23 | 24 | </sql> |
| 24 | 25 | </mapper> |
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/recheck/PostpartumReeMapper.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.dao.recheck; |
| 2 | 2 | |
| 3 | -import com.lyms.hospital.entity.recheck.PostpartumRee; | |
| 4 | -import com.baomidou.mybatisplus.mapper.BaseMapper; | |
| 5 | -import org.springframework.stereotype.Repository; | |
| 6 | 3 | import java.io.Serializable; |
| 7 | -import java.util.List; | |
| 4 | + | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +import com.baomidou.mybatisplus.mapper.BaseMapper; | |
| 8 | +import com.lyms.hospital.entity.recheck.PostpartumRee; | |
| 8 | 9 | /** |
| 9 | 10 | * <p> |
| 10 | 11 | * Mapper接口 |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthInfo.java
View file @
4f43820
| ... | ... | @@ -239,6 +239,11 @@ |
| 239 | 239 | */ |
| 240 | 240 | @TableField(value="CREATE_TIME") |
| 241 | 241 | private Date createTime; |
| 242 | + /** | |
| 243 | + * 软删除标识:1删除,0正常 | |
| 244 | + */ | |
| 245 | + @TableField(value="IF_DEL") | |
| 246 | + private Integer ifDel; | |
| 242 | 247 | |
| 243 | 248 | |
| 244 | 249 | public String getId() { |
| ... | ... | @@ -591,6 +596,14 @@ |
| 591 | 596 | |
| 592 | 597 | public void setCreateTime(Date createTime) { |
| 593 | 598 | this.createTime = createTime; |
| 599 | + } | |
| 600 | + | |
| 601 | + public Integer getIfDel() { | |
| 602 | + return ifDel; | |
| 603 | + } | |
| 604 | + | |
| 605 | + public void setIfDel(Integer ifDel) { | |
| 606 | + this.ifDel = ifDel; | |
| 594 | 607 | } |
| 595 | 608 | |
| 596 | 609 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthInfoVo.java
View file @
4f43820
| 1 | +package com.lyms.hospital.entity.childbirth; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.Date; | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 分娩业务对象 | |
| 9 | + * @author xujiahong | |
| 10 | + * | |
| 11 | + */ | |
| 12 | +public class ChildbirthInfoVo { | |
| 13 | + | |
| 14 | + private ChildbirthInfo info; | |
| 15 | + private List<ChildbirthNewborn> newbornList; | |
| 16 | + private List<ChildbirthTaipan> taipanList; | |
| 17 | + private List<ChildbirthTai> taiList; | |
| 18 | + | |
| 19 | + public ChildbirthInfo getInfo() { | |
| 20 | + return info; | |
| 21 | + } | |
| 22 | + public void setInfo(ChildbirthInfo info) { | |
| 23 | + this.info = info; | |
| 24 | + } | |
| 25 | + public List<ChildbirthNewborn> getNewbornList() { | |
| 26 | + return newbornList; | |
| 27 | + } | |
| 28 | + public void setNewbornList(List<ChildbirthNewborn> newbornList) { | |
| 29 | + this.newbornList = newbornList; | |
| 30 | + } | |
| 31 | + public List<ChildbirthTaipan> getTaipanList() { | |
| 32 | + return taipanList; | |
| 33 | + } | |
| 34 | + public void setTaipanList(List<ChildbirthTaipan> taipanList) { | |
| 35 | + this.taipanList = taipanList; | |
| 36 | + } | |
| 37 | + public List<ChildbirthTai> getTaiList() { | |
| 38 | + return taiList; | |
| 39 | + } | |
| 40 | + public void setTaiList(List<ChildbirthTai> taiList) { | |
| 41 | + this.taiList = taiList; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public static ChildbirthInfoVo createTestInstance(int childNum){ | |
| 45 | + ChildbirthInfoVo vo = new ChildbirthInfoVo(); | |
| 46 | + //分娩信息 | |
| 47 | + ChildbirthInfo info = new ChildbirthInfo(); | |
| 48 | + info.setWomanId("test0405"); | |
| 49 | + info.setChildbirthTime(new Date()); | |
| 50 | + info.setFetusNum(childNum); | |
| 51 | + info.setPlacentaNum(childNum); | |
| 52 | + List<ChildbirthTai> taiList = new ArrayList<>(); | |
| 53 | + List<ChildbirthTaipan> taipanList = new ArrayList<>(); | |
| 54 | + List<ChildbirthNewborn> newbornList = new ArrayList<>(); | |
| 55 | + for(int i = 0;i<childNum;i++){ | |
| 56 | + ChildbirthTai tai = new ChildbirthTai(); | |
| 57 | + tai.setPosition(i+1); | |
| 58 | + taiList.add(tai); | |
| 59 | + ChildbirthTaipan taipan = new ChildbirthTaipan(); | |
| 60 | + taipan.setPlacentaLength(i+1); | |
| 61 | + taipanList.add(taipan); | |
| 62 | + ChildbirthNewborn newborn = new ChildbirthNewborn(); | |
| 63 | + newborn.setWeight(i+1); | |
| 64 | + newbornList.add(newborn); | |
| 65 | + } | |
| 66 | + vo.setInfo(info); | |
| 67 | + vo.setTaiList(taiList); | |
| 68 | + vo.setTaipanList(taipanList); | |
| 69 | + vo.setNewbornList(newbornList); | |
| 70 | + return vo; | |
| 71 | + } | |
| 72 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthNewborn.java
View file @
4f43820
| ... | ... | @@ -104,6 +104,11 @@ |
| 104 | 104 | */ |
| 105 | 105 | @TableField(value="CREATE_TIME") |
| 106 | 106 | private Date createTime; |
| 107 | + /** | |
| 108 | + * 软删除标识:1删除,0正常 | |
| 109 | + */ | |
| 110 | + @TableField(value="IF_DEL") | |
| 111 | + private Integer ifDel; | |
| 107 | 112 | |
| 108 | 113 | |
| 109 | 114 | public String getId() { |
| ... | ... | @@ -241,6 +246,16 @@ |
| 241 | 246 | public void setCreateTime(Date createTime) { |
| 242 | 247 | this.createTime = createTime; |
| 243 | 248 | } |
| 249 | + | |
| 250 | + public Integer getIfDel() { | |
| 251 | + return ifDel; | |
| 252 | + } | |
| 253 | + | |
| 254 | + public void setIfDel(Integer ifDel) { | |
| 255 | + this.ifDel = ifDel; | |
| 256 | + } | |
| 257 | + | |
| 258 | + | |
| 244 | 259 | |
| 245 | 260 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthTai.java
View file @
4f43820
| ... | ... | @@ -49,6 +49,11 @@ |
| 49 | 49 | */ |
| 50 | 50 | @TableField(value="CREATE_TIME") |
| 51 | 51 | private Date createTime; |
| 52 | + /** | |
| 53 | + * 软删除标识:1删除,0正常 | |
| 54 | + */ | |
| 55 | + @TableField(value="IF_DEL") | |
| 56 | + private Integer ifDel; | |
| 52 | 57 | |
| 53 | 58 | |
| 54 | 59 | public String getId() { |
| ... | ... | @@ -97,6 +102,14 @@ |
| 97 | 102 | |
| 98 | 103 | public void setCreateTime(Date createTime) { |
| 99 | 104 | this.createTime = createTime; |
| 105 | + } | |
| 106 | + | |
| 107 | + public Integer getIfDel() { | |
| 108 | + return ifDel; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setIfDel(Integer ifDel) { | |
| 112 | + this.ifDel = ifDel; | |
| 100 | 113 | } |
| 101 | 114 | |
| 102 | 115 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/childbirth/ChildbirthTaipan.java
View file @
4f43820
| ... | ... | @@ -74,6 +74,11 @@ |
| 74 | 74 | */ |
| 75 | 75 | @TableField(value="CREATE_TIME") |
| 76 | 76 | private Date createTime; |
| 77 | + /** | |
| 78 | + * 软删除标识:1删除,0正常 | |
| 79 | + */ | |
| 80 | + @TableField(value="IF_DEL") | |
| 81 | + private Integer ifDel; | |
| 77 | 82 | |
| 78 | 83 | |
| 79 | 84 | public String getId() { |
| ... | ... | @@ -162,6 +167,14 @@ |
| 162 | 167 | |
| 163 | 168 | public void setCreateTime(Date createTime) { |
| 164 | 169 | this.createTime = createTime; |
| 170 | + } | |
| 171 | + | |
| 172 | + public Integer getIfDel() { | |
| 173 | + return ifDel; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public void setIfDel(Integer ifDel) { | |
| 177 | + this.ifDel = ifDel; | |
| 165 | 178 | } |
| 166 | 179 | |
| 167 | 180 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthInfoService.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospital.entity.childbirth.ChildbirthInfo; |
| 4 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo; | |
| 4 | 5 | import com.lyms.web.service.BaseService; |
| 5 | 6 | import java.io.Serializable; |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * <p> |
| 9 | - * 服务类 | |
| 10 | + * 【分娩信息 服务类】 | |
| 11 | + * 新增-分娩信息 | |
| 12 | + * 修改-分娩信息 | |
| 13 | + * 查询-根据孕妇ID查询分娩信息详情 | |
| 14 | + * | |
| 15 | + * 新增vo(事务包括:新增分娩、胎盘、胎儿、新生儿信息) | |
| 16 | + * 修改vo(事务包括:修改分娩、物理删除再新增胎盘、胎儿、新生儿信息) | |
| 17 | + * 查询vo(事务包括:查询分娩详情,查询胎儿、胎盘、新生儿列表) | |
| 18 | + * 逻辑删除(事务)-分娩信息(同时逻辑删除:胎儿、胎盘、新生儿信息) | |
| 10 | 19 | * </p> |
| 11 | 20 | * |
| 12 | 21 | * @author xujiahong |
| ... | ... | @@ -20,6 +29,59 @@ |
| 20 | 29 | * <li>@return 大于0修改成功,否则为失败 |
| 21 | 30 | */ |
| 22 | 31 | public Integer deleteLogicById(Serializable id); |
| 32 | + | |
| 33 | + /* | |
| 34 | + * 单表的增、改、查操作 | |
| 35 | + */ | |
| 36 | + public String create(ChildbirthInfo obj); | |
| 37 | + public boolean update(ChildbirthInfo obj); | |
| 38 | + public ChildbirthInfo getDetailById(String id); | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * <li>@Description:新增vo(事务包括:新增分娩、胎盘、胎儿、新生儿信息) | |
| 42 | + * <li>@param vo | |
| 43 | + * <li>@return | |
| 44 | + * <li>创建人:xujiahong | |
| 45 | + * <li>创建时间:2017年4月1日 | |
| 46 | + * <li>修改人: | |
| 47 | + * <li>修改时间: | |
| 48 | + */ | |
| 49 | + public String createChildbirthVo(ChildbirthInfoVo vo); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * <li>@Description:修改vo(事务包括:修改分娩、物理删除再新增胎盘、胎儿、新生儿信息) | |
| 53 | + * <li>@param vo | |
| 54 | + * <li>@return | |
| 55 | + * <li>创建人:xujiahong | |
| 56 | + * <li>创建时间:2017年4月1日 | |
| 57 | + * <li>修改人: | |
| 58 | + * <li>修改时间: | |
| 59 | + */ | |
| 60 | + public boolean updateChildbirthVo(ChildbirthInfoVo vo); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * <li>@Description:查询vo(事务包括:查询分娩详情,查询胎儿、胎盘、新生儿列表) | |
| 64 | + * <li>@param id | |
| 65 | + * <li>@return | |
| 66 | + * <li>创建人:xujiahong | |
| 67 | + * <li>创建时间:2017年4月1日 | |
| 68 | + * <li>修改人: | |
| 69 | + * <li>修改时间: | |
| 70 | + */ | |
| 71 | + public ChildbirthInfoVo selectChildbirthVo(String id); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * <li>@Description:逻辑删除(事务)-分娩信息(同时逻辑删除:胎儿、胎盘、新生儿信息) | |
| 75 | + * <li>@param vo | |
| 76 | + * <li>@return | |
| 77 | + * <li>创建人:xujiahong | |
| 78 | + * <li>创建时间:2017年4月5日 | |
| 79 | + * <li>修改人: | |
| 80 | + * <li>修改时间: | |
| 81 | + */ | |
| 82 | + public boolean softDeleteChildbirthVo(String infoId); | |
| 83 | + | |
| 84 | + | |
| 23 | 85 | |
| 24 | 86 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthNewbornService.java
View file @
4f43820
| ... | ... | @@ -3,10 +3,16 @@ |
| 3 | 3 | import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; |
| 4 | 4 | import com.lyms.web.service.BaseService; |
| 5 | 5 | import java.io.Serializable; |
| 6 | +import java.util.List; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * <p> |
| 9 | - * 服务类 | |
| 10 | + * 【分娩-新生儿信息-服务类】 | |
| 11 | + * 新增-新生儿信息 | |
| 12 | + * 修改-新生儿信息 | |
| 13 | + * 查询-通过ID查询“新生儿信息”详情 | |
| 14 | + * 查询-通过CID查询“新生儿信息”详情列表 | |
| 15 | + * | |
| 10 | 16 | * </p> |
| 11 | 17 | * |
| 12 | 18 | * @author xujiahong |
| ... | ... | @@ -20,6 +26,50 @@ |
| 20 | 26 | * <li>@return 大于0修改成功,否则为失败 |
| 21 | 27 | */ |
| 22 | 28 | public Integer deleteLogicById(Serializable id); |
| 29 | + | |
| 30 | + /** | |
| 31 | + * <li>@Description:新增-新生儿信息 | |
| 32 | + * <li>@param c | |
| 33 | + * <li>@return | |
| 34 | + * <li>创建人:xujiahong | |
| 35 | + * <li>创建时间:2017年4月1日 | |
| 36 | + * <li>修改人: | |
| 37 | + * <li>修改时间: | |
| 38 | + */ | |
| 39 | + public String create(ChildbirthNewborn c); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * <li>@Description:修改-新生儿信息 | |
| 43 | + * <li>@param c | |
| 44 | + * <li>@return | |
| 45 | + * <li>创建人:xujiahong | |
| 46 | + * <li>创建时间:2017年4月1日 | |
| 47 | + * <li>修改人: | |
| 48 | + * <li>修改时间: | |
| 49 | + */ | |
| 50 | + public boolean update(ChildbirthNewborn c); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * <li>@Description:查询-通过ID查询“新生儿信息”详情 | |
| 54 | + * <li>@param id | |
| 55 | + * <li>@return | |
| 56 | + * <li>创建人:xujiahong | |
| 57 | + * <li>创建时间:2017年4月1日 | |
| 58 | + * <li>修改人: | |
| 59 | + * <li>修改时间: | |
| 60 | + */ | |
| 61 | + public ChildbirthNewborn getDetailById(String id); | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * <li>@Description:查询-通过CID查询“新生儿信息”详情列表 | |
| 65 | + * <li>@param cid | |
| 66 | + * <li>@return | |
| 67 | + * <li>创建人:xujiahong | |
| 68 | + * <li>创建时间:2017年4月1日 | |
| 69 | + * <li>修改人: | |
| 70 | + * <li>修改时间: | |
| 71 | + */ | |
| 72 | + public List<ChildbirthNewborn> listByCid(String cid); | |
| 23 | 73 | |
| 24 | 74 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthTaiService.java
View file @
4f43820
| ... | ... | @@ -3,10 +3,13 @@ |
| 3 | 3 | import com.lyms.hospital.entity.childbirth.ChildbirthTai; |
| 4 | 4 | import com.lyms.web.service.BaseService; |
| 5 | 5 | import java.io.Serializable; |
| 6 | +import java.util.List; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * <p> |
| 9 | - * 服务类 | |
| 10 | + * 【分娩-胎儿信息-服务类】 | |
| 11 | + * 新增-胎儿信息 | |
| 12 | + * 查询-通过CID查询“胎儿信息”详情列表 | |
| 10 | 13 | * </p> |
| 11 | 14 | * |
| 12 | 15 | * @author xujiahong |
| ... | ... | @@ -20,6 +23,28 @@ |
| 20 | 23 | * <li>@return 大于0修改成功,否则为失败 |
| 21 | 24 | */ |
| 22 | 25 | public Integer deleteLogicById(Serializable id); |
| 26 | + | |
| 27 | + /** | |
| 28 | + * <li>@Description:新增-胎儿信息 | |
| 29 | + * <li>@param obj | |
| 30 | + * <li>@return | |
| 31 | + * <li>创建人:xujiahong | |
| 32 | + * <li>创建时间:2017年4月1日 | |
| 33 | + * <li>修改人: | |
| 34 | + * <li>修改时间: | |
| 35 | + */ | |
| 36 | + public String create(ChildbirthTai obj); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * <li>@Description:查询-通过CID查询“胎儿信息”详情列表 | |
| 40 | + * <li>@param id | |
| 41 | + * <li>@return | |
| 42 | + * <li>创建人:xujiahong | |
| 43 | + * <li>创建时间:2017年4月1日 | |
| 44 | + * <li>修改人: | |
| 45 | + * <li>修改时间: | |
| 46 | + */ | |
| 47 | + public List<ChildbirthTai> listByCid(String cid); | |
| 23 | 48 | |
| 24 | 49 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/ChildbirthTaipanService.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth; |
| 2 | 2 | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 3 | 6 | import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; |
| 4 | 7 | import com.lyms.web.service.BaseService; |
| 5 | -import java.io.Serializable; | |
| 6 | 8 | |
| 7 | 9 | /** |
| 8 | 10 | * <p> |
| 9 | - * 服务类 | |
| 11 | + * 【分娩-胎盘信息-服务类】 | |
| 12 | + * 新增-胎盘信息 | |
| 13 | + * 查询-通过CID查询“胎盘信息”详情列表 | |
| 10 | 14 | * </p> |
| 11 | 15 | * |
| 12 | 16 | * @author xujiahong |
| ... | ... | @@ -20,6 +24,28 @@ |
| 20 | 24 | * <li>@return 大于0修改成功,否则为失败 |
| 21 | 25 | */ |
| 22 | 26 | public Integer deleteLogicById(Serializable id); |
| 27 | + | |
| 28 | + /** | |
| 29 | + * <li>@Description:新增-胎盘信息 | |
| 30 | + * <li>@param obj | |
| 31 | + * <li>@return | |
| 32 | + * <li>创建人:xujiahong | |
| 33 | + * <li>创建时间:2017年4月1日 | |
| 34 | + * <li>修改人: | |
| 35 | + * <li>修改时间: | |
| 36 | + */ | |
| 37 | + public String create(ChildbirthTaipan obj); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * <li>@Description:查询-通过CID查询“胎盘信息”详情列表 | |
| 41 | + * <li>@param id | |
| 42 | + * <li>@return | |
| 43 | + * <li>创建人:xujiahong | |
| 44 | + * <li>创建时间:2017年4月1日 | |
| 45 | + * <li>修改人: | |
| 46 | + * <li>修改时间: | |
| 47 | + */ | |
| 48 | + public List<ChildbirthTaipan> listByCid(String cid); | |
| 23 | 49 | |
| 24 | 50 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthInfoServiceImpl.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.hospital.entity.childbirth.ChildbirthInfo; | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.apache.commons.collections.CollectionUtils; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | +import org.springframework.util.StringUtils; | |
| 11 | + | |
| 12 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 13 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 14 | +import com.lyms.exception.SystemException; | |
| 4 | 15 | import com.lyms.hospital.dao.childbirth.ChildbirthInfoMapper; |
| 16 | +import com.lyms.hospital.dao.childbirth.ChildbirthNewbornMapper; | |
| 17 | +import com.lyms.hospital.dao.childbirth.ChildbirthTaiMapper; | |
| 18 | +import com.lyms.hospital.dao.childbirth.ChildbirthTaipanMapper; | |
| 19 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfo; | |
| 20 | +import com.lyms.hospital.entity.childbirth.ChildbirthInfoVo; | |
| 21 | +import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; | |
| 22 | +import com.lyms.hospital.entity.childbirth.ChildbirthTai; | |
| 23 | +import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; | |
| 24 | +import com.lyms.hospital.enums.IfdelEnum; | |
| 5 | 25 | import com.lyms.hospital.service.childbirth.ChildbirthInfoService; |
| 6 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import java.io.Serializable; | |
| 26 | +import com.lyms.hospital.service.childbirth.ChildbirthNewbornService; | |
| 27 | +import com.lyms.hospital.service.childbirth.ChildbirthTaiService; | |
| 28 | +import com.lyms.hospital.service.childbirth.ChildbirthTaipanService; | |
| 29 | +import com.lyms.util.StrUtils; | |
| 9 | 30 | |
| 10 | 31 | /** |
| 11 | 32 | * <p> |
| 12 | 33 | |
| ... | ... | @@ -18,8 +39,207 @@ |
| 18 | 39 | @Service |
| 19 | 40 | public class ChildbirthInfoServiceImpl extends ServiceImpl<ChildbirthInfoMapper, ChildbirthInfo> implements ChildbirthInfoService { |
| 20 | 41 | |
| 42 | + @Autowired | |
| 43 | + private ChildbirthNewbornService newbornService; | |
| 44 | + @Autowired | |
| 45 | + private ChildbirthTaipanService taipanService; | |
| 46 | + @Autowired | |
| 47 | + private ChildbirthTaiService taiService; | |
| 48 | + @Autowired | |
| 49 | + private ChildbirthNewbornMapper newbornMapper; | |
| 50 | + @Autowired | |
| 51 | + private ChildbirthTaipanMapper taipanMapper; | |
| 52 | + @Autowired | |
| 53 | + private ChildbirthTaiMapper taiMapper; | |
| 54 | + | |
| 21 | 55 | public Integer deleteLogicById(Serializable id){ |
| 22 | - return baseMapper.deleteLogicById(id); | |
| 56 | + ChildbirthInfo obj = baseMapper.selectById(id); | |
| 57 | + obj.setIfDel(IfdelEnum.YES.getStatus()); | |
| 58 | + return baseMapper.updateById(obj); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @Override | |
| 62 | + @Transactional | |
| 63 | + public String createChildbirthVo(ChildbirthInfoVo vo) { | |
| 64 | + if(vo==null){ | |
| 65 | + throw new SystemException("分娩业务对象VO为空"); | |
| 66 | + } | |
| 67 | + ChildbirthInfo info = vo.getInfo(); | |
| 68 | + List<ChildbirthTai> taiList = vo.getTaiList(); | |
| 69 | + List<ChildbirthTaipan> taipanList = vo.getTaipanList(); | |
| 70 | + List<ChildbirthNewborn> newbornList = vo.getNewbornList(); | |
| 71 | + //新增分娩基本信息 | |
| 72 | + String cid = this.create(info); | |
| 73 | + //【新增分娩信息的3个子列表】新增胎儿信息、新增胎盘信息、新增新生儿信息 | |
| 74 | + this.createChildbirth3Sublist(taiList, taipanList, newbornList, cid); | |
| 75 | + return cid; | |
| 76 | + } | |
| 77 | + | |
| 78 | + @Override | |
| 79 | + @Transactional | |
| 80 | + public boolean updateChildbirthVo(ChildbirthInfoVo vo) { | |
| 81 | + if(vo==null){ | |
| 82 | + throw new SystemException("分娩业务对象VO为空"); | |
| 83 | + } | |
| 84 | + ChildbirthInfo info = vo.getInfo(); | |
| 85 | + List<ChildbirthTai> taiList = vo.getTaiList(); | |
| 86 | + List<ChildbirthTaipan> taipanList = vo.getTaipanList(); | |
| 87 | + List<ChildbirthNewborn> newbornList = vo.getNewbornList(); | |
| 88 | + | |
| 89 | + if (info == null || StringUtils.isEmpty(info.getId())) { | |
| 90 | + throw new SystemException("分娩信息为空"); | |
| 91 | + } | |
| 92 | + //修改分娩信息 | |
| 93 | + this.update(info); | |
| 94 | + /* | |
| 95 | + * 删除再新增,胎儿信息列表 | |
| 96 | + * 删除再新增,胎盘信息列表 | |
| 97 | + * 删除再新增,新生儿信息列表 | |
| 98 | + */ | |
| 99 | + //删除 | |
| 100 | + EntityWrapper<ChildbirthTai> taiWrapper = new EntityWrapper<>(); | |
| 101 | + taiWrapper.eq("CID", info.getId()); | |
| 102 | + taiMapper.delete(taiWrapper); | |
| 103 | + | |
| 104 | + EntityWrapper<ChildbirthTaipan> taipanWrapper = new EntityWrapper<>(); | |
| 105 | + taipanWrapper.eq("CID", info.getId()); | |
| 106 | + taipanMapper.delete(taipanWrapper); | |
| 107 | + | |
| 108 | + EntityWrapper<ChildbirthNewborn> newbornWrapper = new EntityWrapper<>(); | |
| 109 | + newbornWrapper.eq("CID", info.getId()); | |
| 110 | + newbornMapper.delete(newbornWrapper); | |
| 111 | + | |
| 112 | + //【新增分娩信息的3个子列表】新增胎儿信息、新增胎盘信息、新增新生儿信息 | |
| 113 | + this.createChildbirth3Sublist(taiList, taipanList, newbornList, info.getId()); | |
| 114 | + return true; | |
| 115 | + } | |
| 116 | + | |
| 117 | + @Override | |
| 118 | + @Transactional | |
| 119 | + public ChildbirthInfoVo selectChildbirthVo(String id) { | |
| 120 | + // TODO Auto-generated method stub | |
| 121 | + ChildbirthInfoVo vo = new ChildbirthInfoVo(); | |
| 122 | + //查询分娩详情 | |
| 123 | + vo.setInfo(this.getDetailById(id)); | |
| 124 | + //查询胎儿列表 | |
| 125 | + vo.setTaiList(taiService.listByCid(id)); | |
| 126 | + //查询胎盘列表 | |
| 127 | + vo.setTaipanList(taipanService.listByCid(id)); | |
| 128 | + //查询新生儿列表 | |
| 129 | + vo.setNewbornList(newbornService.listByCid(id)); | |
| 130 | + return vo; | |
| 131 | + } | |
| 132 | + | |
| 133 | + @Override | |
| 134 | + @Transactional | |
| 135 | + public boolean softDeleteChildbirthVo(String infoId) { | |
| 136 | + if(StringUtils.isEmpty(infoId)){ | |
| 137 | + throw new SystemException("参数“分娩信息ID”为空"); | |
| 138 | + } | |
| 139 | + ChildbirthInfoVo vo = selectChildbirthVo(infoId); | |
| 140 | + ChildbirthInfo info = vo.getInfo(); | |
| 141 | + List<ChildbirthTai> taiList = vo.getTaiList(); | |
| 142 | + List<ChildbirthTaipan> taipanList = vo.getTaipanList(); | |
| 143 | + List<ChildbirthNewborn> newbornList = vo.getNewbornList(); | |
| 144 | + //逻辑删除:分娩信息 | |
| 145 | + if(info==null||info.getId()==null){ | |
| 146 | + throw new SystemException("分娩业务对象VO为空"); | |
| 147 | + } | |
| 148 | + this.deleteLogicById(info.getId()); | |
| 149 | + //逻辑删除:胎儿信息 | |
| 150 | + if(!CollectionUtils.isEmpty(taiList)){ | |
| 151 | + for(ChildbirthTai tai : taiList){ | |
| 152 | + taiService.deleteLogicById(tai.getId()); | |
| 153 | + } | |
| 154 | + } | |
| 155 | + //逻辑删除:胎盘信息 | |
| 156 | + if(!CollectionUtils.isEmpty(taipanList)){ | |
| 157 | + for(ChildbirthTaipan taipan : taipanList){ | |
| 158 | + taipanService.deleteLogicById(taipan.getId()); | |
| 159 | + } | |
| 160 | + } | |
| 161 | + //逻辑删除:新生儿信息 | |
| 162 | + if(!CollectionUtils.isEmpty(newbornList)){ | |
| 163 | + for(ChildbirthNewborn newborn : newbornList){ | |
| 164 | + newbornService.deleteLogicById(newborn.getId()); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + return true; | |
| 168 | + } | |
| 169 | + | |
| 170 | + @Override | |
| 171 | + public String create(ChildbirthInfo obj) { | |
| 172 | + if (obj == null) { | |
| 173 | + throw new SystemException("分娩信息为空"); | |
| 174 | + } | |
| 175 | + String id = StrUtils.uuid(); | |
| 176 | + obj.setId(id); | |
| 177 | + obj.setIfDel(IfdelEnum.NO.getStatus()); | |
| 178 | + obj.setCreateTime(new java.util.Date()); | |
| 179 | + if (insert(obj)) { | |
| 180 | + return id; | |
| 181 | + } | |
| 182 | + return null; | |
| 183 | + } | |
| 184 | + | |
| 185 | + @Override | |
| 186 | + public boolean update(ChildbirthInfo obj) { | |
| 187 | + if (obj == null || StringUtils.isEmpty(obj.getId())) { | |
| 188 | + throw new SystemException("分娩信息为空"); | |
| 189 | + } | |
| 190 | + return updateById(obj); | |
| 191 | + } | |
| 192 | + | |
| 193 | + @Override | |
| 194 | + public ChildbirthInfo getDetailById(String id) { | |
| 195 | + ChildbirthInfo info = selectById(id); | |
| 196 | + ChildbirthInfo empty = new ChildbirthInfo(); | |
| 197 | + if(info==null){ | |
| 198 | + return empty; | |
| 199 | + } | |
| 200 | + return IfdelEnum.isDelete(info.getIfDel())?empty:info;//只能查询出“非逻辑删除”的记录 | |
| 201 | + } | |
| 202 | + | |
| 203 | + /* | |
| 204 | + * 【新增分娩信息的3个子列表】新增胎儿信息、新增胎盘信息、新增新生儿信息 | |
| 205 | + */ | |
| 206 | + @Transactional | |
| 207 | + private boolean createChildbirth3Sublist( | |
| 208 | + List<ChildbirthTai> taiList, | |
| 209 | + List<ChildbirthTaipan> taipanList, | |
| 210 | + List<ChildbirthNewborn> newbornList, | |
| 211 | + String cid){ | |
| 212 | + //新增胎儿信息 | |
| 213 | + if(!CollectionUtils.isEmpty(taipanList)){ | |
| 214 | + for(ChildbirthTaipan taipan : taipanList){ | |
| 215 | + taipan.setCid(cid); | |
| 216 | + String uuid = taipanService.create(taipan); | |
| 217 | + if(StringUtils.isEmpty(uuid)){ | |
| 218 | + throw new SystemException("新增胎儿信息失败");//抛出非检查型异常,让事务回滚 | |
| 219 | + } | |
| 220 | + } | |
| 221 | + } | |
| 222 | + //新增胎盘信息 | |
| 223 | + if(!CollectionUtils.isEmpty(taiList)){ | |
| 224 | + for(ChildbirthTai tai : taiList){ | |
| 225 | + tai.setCid(cid); | |
| 226 | + String uuid = taiService.create(tai); | |
| 227 | + if(StringUtils.isEmpty(uuid)){ | |
| 228 | + throw new SystemException("新增胎盘信息失败");//抛出非检查型异常,让事务回滚 | |
| 229 | + } | |
| 230 | + } | |
| 231 | + } | |
| 232 | + //新增新生儿信息 | |
| 233 | + if(!CollectionUtils.isEmpty(newbornList)){ | |
| 234 | + for(ChildbirthNewborn newborn : newbornList){ | |
| 235 | + newborn.setCid(cid); | |
| 236 | + String uuid = newbornService.create(newborn); | |
| 237 | + if(StringUtils.isEmpty(uuid)){ | |
| 238 | + throw new SystemException("新增新生儿信息失败");//抛出非检查型异常,让事务回滚 | |
| 239 | + } | |
| 240 | + } | |
| 241 | + } | |
| 242 | + return true; | |
| 23 | 243 | } |
| 24 | 244 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthNewbornServiceImpl.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | +import org.springframework.transaction.annotation.Transactional; | |
| 8 | +import org.springframework.util.StringUtils; | |
| 9 | + | |
| 10 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 11 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 12 | +import com.lyms.exception.SystemException; | |
| 4 | 13 | import com.lyms.hospital.dao.childbirth.ChildbirthNewbornMapper; |
| 14 | +import com.lyms.hospital.entity.childbirth.ChildbirthNewborn; | |
| 15 | +import com.lyms.hospital.enums.IfdelEnum; | |
| 5 | 16 | import com.lyms.hospital.service.childbirth.ChildbirthNewbornService; |
| 6 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import java.io.Serializable; | |
| 17 | +import com.lyms.util.StrUtils; | |
| 9 | 18 | |
| 10 | 19 | /** |
| 11 | 20 | * <p> |
| 12 | 21 | |
| ... | ... | @@ -18,8 +27,48 @@ |
| 18 | 27 | @Service |
| 19 | 28 | public class ChildbirthNewbornServiceImpl extends ServiceImpl<ChildbirthNewbornMapper, ChildbirthNewborn> implements ChildbirthNewbornService { |
| 20 | 29 | |
| 30 | + @Override | |
| 31 | + @Transactional | |
| 21 | 32 | public Integer deleteLogicById(Serializable id){ |
| 22 | - return baseMapper.deleteLogicById(id); | |
| 33 | + ChildbirthNewborn obj = baseMapper.selectById(id); | |
| 34 | + obj.setIfDel(IfdelEnum.YES.getStatus()); | |
| 35 | + return baseMapper.updateById(obj); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public String create(ChildbirthNewborn obj) { | |
| 40 | + if (obj == null) { | |
| 41 | + throw new SystemException("新生儿信息为空"); | |
| 42 | + } | |
| 43 | + String id = StrUtils.uuid(); | |
| 44 | + obj.setId(id); | |
| 45 | + obj.setIfDel(IfdelEnum.NO.getStatus()); | |
| 46 | + obj.setCreateTime(new java.util.Date()); | |
| 47 | + if (insert(obj)) { | |
| 48 | + return id; | |
| 49 | + } | |
| 50 | + return null; | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public boolean update(ChildbirthNewborn obj) { | |
| 55 | + if (obj == null || StringUtils.isEmpty(obj.getId())) { | |
| 56 | + throw new SystemException("新生儿信息为空"); | |
| 57 | + } | |
| 58 | + return updateById(obj); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @Override | |
| 62 | + public ChildbirthNewborn getDetailById(String id) { | |
| 63 | + return selectById(id); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + public List<ChildbirthNewborn> listByCid(String cid) { | |
| 68 | + EntityWrapper<ChildbirthNewborn> wrapper = new EntityWrapper<ChildbirthNewborn>(); | |
| 69 | + wrapper.eq("CID", cid); | |
| 70 | + wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 | |
| 71 | + return baseMapper.selectList(wrapper); | |
| 23 | 72 | } |
| 24 | 73 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaiServiceImpl.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.hospital.entity.childbirth.ChildbirthTai; | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 9 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 10 | +import com.lyms.exception.SystemException; | |
| 4 | 11 | import com.lyms.hospital.dao.childbirth.ChildbirthTaiMapper; |
| 12 | +import com.lyms.hospital.entity.childbirth.ChildbirthTai; | |
| 13 | +import com.lyms.hospital.enums.IfdelEnum; | |
| 5 | 14 | import com.lyms.hospital.service.childbirth.ChildbirthTaiService; |
| 6 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import java.io.Serializable; | |
| 15 | +import com.lyms.util.StrUtils; | |
| 9 | 16 | |
| 10 | 17 | /** |
| 11 | 18 | * <p> |
| 12 | 19 | |
| ... | ... | @@ -19,7 +26,33 @@ |
| 19 | 26 | public class ChildbirthTaiServiceImpl extends ServiceImpl<ChildbirthTaiMapper, ChildbirthTai> implements ChildbirthTaiService { |
| 20 | 27 | |
| 21 | 28 | public Integer deleteLogicById(Serializable id){ |
| 22 | - return baseMapper.deleteLogicById(id); | |
| 29 | + ChildbirthTai obj = baseMapper.selectById(id); | |
| 30 | + obj.setIfDel(IfdelEnum.YES.getStatus()); | |
| 31 | + return baseMapper.updateById(obj); | |
| 23 | 32 | } |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public String create(ChildbirthTai obj) { | |
| 36 | + if (obj == null) { | |
| 37 | + throw new SystemException("胎儿信息为空"); | |
| 38 | + } | |
| 39 | + String id = StrUtils.uuid(); | |
| 40 | + obj.setId(id); | |
| 41 | + obj.setIfDel(IfdelEnum.NO.getStatus()); | |
| 42 | + obj.setCreateTime(new java.util.Date()); | |
| 43 | + if (insert(obj)) { | |
| 44 | + return id; | |
| 45 | + } | |
| 46 | + return null; | |
| 47 | + } | |
| 48 | + | |
| 49 | + @Override | |
| 50 | + public List<ChildbirthTai> listByCid(String cid) { | |
| 51 | + EntityWrapper<ChildbirthTai> wrapper = new EntityWrapper<>(); | |
| 52 | + wrapper.eq("CID", cid); | |
| 53 | + wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 | |
| 54 | + return baseMapper.selectList(wrapper); | |
| 55 | + } | |
| 56 | + | |
| 24 | 57 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/childbirth/impl/ChildbirthTaipanServiceImpl.java
View file @
4f43820
| 1 | 1 | package com.lyms.hospital.service.childbirth.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 9 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 10 | +import com.lyms.exception.SystemException; | |
| 4 | 11 | import com.lyms.hospital.dao.childbirth.ChildbirthTaipanMapper; |
| 12 | +import com.lyms.hospital.entity.childbirth.ChildbirthTaipan; | |
| 13 | +import com.lyms.hospital.enums.IfdelEnum; | |
| 5 | 14 | import com.lyms.hospital.service.childbirth.ChildbirthTaipanService; |
| 6 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import java.io.Serializable; | |
| 15 | +import com.lyms.util.StrUtils; | |
| 9 | 16 | |
| 10 | 17 | /** |
| 11 | 18 | * <p> |
| 12 | 19 | |
| ... | ... | @@ -19,7 +26,33 @@ |
| 19 | 26 | public class ChildbirthTaipanServiceImpl extends ServiceImpl<ChildbirthTaipanMapper, ChildbirthTaipan> implements ChildbirthTaipanService { |
| 20 | 27 | |
| 21 | 28 | public Integer deleteLogicById(Serializable id){ |
| 22 | - return baseMapper.deleteLogicById(id); | |
| 29 | + ChildbirthTaipan obj = baseMapper.selectById(id); | |
| 30 | + obj.setIfDel(IfdelEnum.YES.getStatus()); | |
| 31 | + return baseMapper.updateById(obj); | |
| 23 | 32 | } |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public String create(ChildbirthTaipan obj) { | |
| 36 | + if (obj == null) { | |
| 37 | + throw new SystemException("胎盘信息为空"); | |
| 38 | + } | |
| 39 | + String id = StrUtils.uuid(); | |
| 40 | + obj.setId(id); | |
| 41 | + obj.setIfDel(IfdelEnum.NO.getStatus()); | |
| 42 | + obj.setCreateTime(new java.util.Date()); | |
| 43 | + if (insert(obj)) { | |
| 44 | + return id; | |
| 45 | + } | |
| 46 | + return null; | |
| 47 | + } | |
| 48 | + | |
| 49 | + @Override | |
| 50 | + public List<ChildbirthTaipan> listByCid(String cid) { | |
| 51 | + EntityWrapper<ChildbirthTaipan> wrapper = new EntityWrapper<>(); | |
| 52 | + wrapper.eq("CID", cid); | |
| 53 | + wrapper.eq("IF_DEL", IfdelEnum.NO.getStatus());//只查询没有被软删除的项目 | |
| 54 | + return baseMapper.selectList(wrapper); | |
| 55 | + } | |
| 56 | + | |
| 24 | 57 | } |
parent/hospital.web/src/test/java/test/hospital/service/ChildbirthServiceTest.java
View file @
4f43820
| 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.childbirth.ChildbirthInfoVo; | |
| 7 | +import com.lyms.hospital.service.childbirth.ChildbirthInfoService; | |
| 8 | + | |
| 9 | +import test.hospital.BaseServiceTest; | |
| 10 | + | |
| 11 | +public class ChildbirthServiceTest extends BaseServiceTest{ | |
| 12 | + | |
| 13 | + @Autowired | |
| 14 | + private ChildbirthInfoService infoService; | |
| 15 | + | |
| 16 | +// @Test | |
| 17 | +// public void createChildbirthVo(){ | |
| 18 | +// ChildbirthInfoVo vo = ChildbirthInfoVo.createTestInstance(2); | |
| 19 | +// infoService.createChildbirthVo(vo); | |
| 20 | +// } | |
| 21 | + | |
| 22 | +// @Test | |
| 23 | +// public void updateChildbirthVo(){ | |
| 24 | +// ChildbirthInfoVo vo = ChildbirthInfoVo.createTestInstance(3); | |
| 25 | +// vo.getInfo().setId("8E180ED80A4E40E287F24CCE9EDF3703"); | |
| 26 | +// infoService.updateChildbirthVo(vo); | |
| 27 | +// } | |
| 28 | + | |
| 29 | +// @Test | |
| 30 | +// public void testSoftDelete(){ | |
| 31 | +// String infoId = "8E180ED80A4E40E287F24CCE9EDF3703"; | |
| 32 | +// infoService.softDeleteChildbirthVo(infoId); | |
| 33 | +// } | |
| 34 | + | |
| 35 | + @Test | |
| 36 | + public void selectChildbirthVo(){ | |
| 37 | + String id = "8E180ED80A4E40E287F24CCE9EDF3703"; | |
| 38 | + ChildbirthInfoVo vo = infoService.selectChildbirthVo(id); | |
| 39 | + outJson(vo); | |
| 40 | + //{"info":{},"newbornList":[],"taiList":[],"taipanList":[]} | |
| 41 | + } | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | +} |