From ad2898e6afdc0e585872b30c778b14f07ffbd143 Mon Sep 17 00:00:00 2001 From: hujiaqi Date: Tue, 13 Dec 2016 16:18:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=96=87=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/MatDeliverController.java | 12 +- .../operate/web/facade/MatDeliverFacade.java | 162 ++++++++++++++++++--- .../web/result/ChildbirthManagerQueryModel.java | 13 +- .../web/result/NewBabyManagerQueryModel.java | 28 ++-- 4 files changed, 167 insertions(+), 48 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java index 7959a09..7691ebb 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java @@ -204,18 +204,18 @@ public class MatDeliverController extends BaseController{ List> list = new ArrayList<>(); for (NewBabyManagerQueryModel newBabyManagerQueryModel : newBabyManagerQueryModelList) { Map map = BeanUtils.objectToObjectMap(newBabyManagerQueryModel); - Integer sex = newBabyManagerQueryModel.getSex(); - if (new Integer(0).equals(sex)) { + String sex = newBabyManagerQueryModel.getSex(); + if ("0".equals(sex)) { map.put("sex", "女"); } - if (new Integer(1).equals(sex)) { + if ("1".equals(sex)) { map.put("sex", "男"); } - Integer highRisk = newBabyManagerQueryModel.getHighRisk(); - if (new Integer(0).equals(highRisk)) { + String highRisk = newBabyManagerQueryModel.getHighRisk(); + if ("0".equals(highRisk)) { map.put("highRisk", "健康"); } - if (new Integer(1).equals(highRisk)) { + if ("1".equals(highRisk)) { map.put("highRisk", "高危"); } String dueType = newBabyManagerQueryModel.getDueType(); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 5b6be1f..8664d5b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -21,6 +21,7 @@ import com.lyms.platform.permission.service.UsersService; import com.lyms.platform.pojo.*; import com.lyms.platform.query.*; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import org.slf4j.Logger; @@ -929,14 +930,14 @@ public class MatDeliverFacade { patientsQuery.setName(childbirthManagerRequest.getUserName()); patientsQuery.setYn(YnEnums.YES.getId()); patientsQuery.setType(3); - patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId())); + // patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId())); patientsQuery.setCardNo(childbirthManagerRequest.getCardNo()); patientsQuery.setPhone(childbirthManagerRequest.getPhone()); patientsQuery.setHusbandPhone(childbirthManagerRequest.getHusbandPhone()); // 分娩方式去另外一张表查 List patientsList = patientsService.queryPatient(patientsQuery); List parentIdList = new ArrayList<>(); - if (patientsList == null || patientsList.size() == 0) { + if (CollectionUtils.isEmpty(patientsList)) { // 没有查到,直接抛出 childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); @@ -953,7 +954,7 @@ public class MatDeliverFacade { matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); matDeliverQuery.setNeed("Need"); List maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); - if (maternalDeliverModelList == null || maternalDeliverModelList.size() == 0) { + if (CollectionUtils.isEmpty(maternalDeliverModelList)) { // 没有查到,直接抛出 childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); @@ -972,33 +973,45 @@ public class MatDeliverFacade { try { childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); } catch (Exception e) { - // 什么都不干 + // 什么都不干,这么干是为了避开原始数据的问题 } childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); // 查询活产数 BabyModelQuery babyModelQuery = new BabyModelQuery(); babyModelQuery.setYn(YnEnums.YES.getId()); babyModelQuery.setParentId(patients.getId()); - babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); - try { - childbirthManagerQueryModel.setLivingNumber(babyService.queryBabyWithQuery(babyModelQuery).size()); - } catch (Exception e) { - // 什么都不干 + List babyModelList = babyService.queryBabyWithQuery(babyModelQuery); + int i = 0; + if (CollectionUtils.isNotEmpty(babyModelList)) { + for (BabyModel babyModel : babyModelList) { + if (RenShenJieJuEnums.O.getId().equals(babyModel.getPregnancyOut())) { + i++; + } + } } + childbirthManagerQueryModel.setLivingNumber(i); // 开始拼装自定义查询结果 // 胎方位,胎心率,胎先露 // 这个泛型不会出错,传入的就是这个 @SuppressWarnings("unchecked") List placentaList = maternalDeliverModel.getPlacentas(); - if (placentaList != null && placentaList.size() > 0) { + if (CollectionUtils.isNotEmpty(placentaList)) { String fetalPosition = ""; String heartRate = ""; String fetalPresentation = ""; - for (MatDeliverAddRequest.Placenta placenta : placentaList) { - fetalPosition += placenta.getFetalPosition() + ","; - heartRate += placenta.getHeartRate().toString() + ","; - fetalPresentation += placenta.getFetalPresentation() + ","; + try { + for (MatDeliverAddRequest.Placenta placenta : placentaList) { + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) { + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) { + fetalPosition += fetalPositionEnums.getName() + ","; + } + } + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ","; + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ","; + } + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 } childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1)); childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1)); @@ -1006,32 +1019,118 @@ public class MatDeliverFacade { } // 第一产程,第二产程,第三产程 Map> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess()); - if (prodprocessMap != null && prodprocessMap.size() > 0) { + if (MapUtils.isNotEmpty(prodprocessMap)) { Map prodprocessOne = prodprocessMap.get("one"); - if (prodprocessOne != null && prodprocessOne.size() > 0) { + if (MapUtils.isNotEmpty(prodprocessOne)) { childbirthManagerQueryModel.setProdprocessOne("h:" + prodprocessOne.get("h") + "," + "m:" + prodprocessOne.get("m")); } Map prodprocessTwo = prodprocessMap.get("two"); - if (prodprocessTwo != null && prodprocessTwo.size() > 0) { + if (MapUtils.isNotEmpty(prodprocessTwo)) { childbirthManagerQueryModel.setProdprocessTwo("h:" + prodprocessTwo.get("h") + "," + "m:" + prodprocessTwo.get("m")); } Map prodprocessThree = prodprocessMap.get("three"); - if (prodprocessThree != null && prodprocessThree.size() > 0) { + if (MapUtils.isNotEmpty(prodprocessThree)) { childbirthManagerQueryModel.setProdprocessThree("h:" + prodprocessThree.get("h") + "," + "m:" + prodprocessThree.get("m")); } } // 总产程 Map totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess()); - if (totalprocessMap != null && totalprocessMap.size() > 0) { + if (MapUtils.isNotEmpty(totalprocessMap)) { childbirthManagerQueryModel.setTotalprocess("h:" + totalprocessMap.get("h") + "," + "m:" + totalprocessMap.get("m")); } // 收缩压,舒张压 Map chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp()); - if (chBpMap != null && chBpMap.size() > 0) { + if (MapUtils.isNotEmpty(chBpMap)) { childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy")); childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy")); } - + // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型 + List extPlacentaList = maternalDeliverModel.getExtPlacentas(); + if (CollectionUtils.isNotEmpty(extPlacentaList)) { + String tpmcType = ""; + String tpSize = ""; + String tpWeight = ""; + String umbilicalCordLength = ""; + String umbilicalCordEx = ""; + String umbilicalCordExType = ""; + try { + for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) { + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) { + if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) { + tpmcType += tpmcTypeEnums.getName() + ","; + } + } + tpSize += extPlacenta.getTpSize() == null ? "" : extPlacenta.getTpSize() + ","; + tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ","; + umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ","; + umbilicalCordEx += extPlacenta.getUmbilicalCordEx() == null ? "" : extPlacenta.getUmbilicalCordEx() + ","; + umbilicalCordExType += extPlacenta.getUmbilicalCordExType() == null ? "" : extPlacenta.getUmbilicalCordExType() + ","; + } + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 + } + childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1)); + childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1)); + childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1)); + childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1)); + } + // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形 + if (CollectionUtils.isNotEmpty(babyModelList)) { + String pregnancyOut = ""; + String sex = ""; + String babyWeight = ""; + String babyHeight = ""; + String apgarScorePf1 = ""; + String apgarScorePf5 = ""; + String apgarScorePf10 = ""; + String asphyxiaM = ""; + String babyHealthy = ""; + String malformation = ""; + try { + for (BabyModel babyModel : babyModelList) { + for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) { + if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) { + pregnancyOut += renShenJieJuEnums.getName() + ","; + } + } + for (SexEnum sexEnum : SexEnum.values()) { + if (sexEnum.getId().equals(babyModel.getSex())) { + sex += sexEnum.getText() + ","; + } + } + babyWeight += babyModel.getBabyWeight() == null ? "" : babyModel.getBabyWeight() + ","; + babyHeight += babyModel.getBabyHeight() == null ? "" : babyModel.getBabyHeight() + ","; + asphyxiaM += babyModel.getAsphyxiaM() == null ? "" : babyModel.getAsphyxiaM() + ","; + babyHealthy += babyModel.getBabyHealthy() == null ? "" : babyModel.getBabyHealthy() + ","; + malformation += babyModel.getMalformation() == null ? "" : babyModel.getMalformation() + ","; + Map map = JsonUtil.getMap(babyModel.getApgarScore()); + if (MapUtils.isNotEmpty(map)) { + apgarScorePf1 += map.get("pf1") == null ? "" : map.get("pf1") + ","; + apgarScorePf5 += map.get("pf5") == null ? "" : map.get("pf5") + ","; + apgarScorePf10 += map.get("pf10") == null ? "" : map.get("pf10") + ","; + } + } + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 + } + childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1)); + childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1)); + childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1)); + childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1)); + childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1)); + childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1)); + childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1)); + childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1)); + } + try { + childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName()); + } catch (Exception e) { + // 什么都不干,这么干是为了避开原始数据的问题 + } // 拼装自定义查询结果结束 childbirthManagerQueryModelList.add(childbirthManagerQueryModel); @@ -1080,7 +1179,26 @@ public class MatDeliverFacade { newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModelList.get(0).getDeliverDoctor())).getName()); } } catch (Exception e) { - // 什么都不干 + // 什么都不干,这么干是为了避开原始数据的问题 + } + for (SexEnum sexEnum : SexEnum.values()) { + if (sexEnum.getId().equals(babyModel.getSex())) { + newBabyManagerQueryModel.setSex(sexEnum.getText()); + } + } + Integer highRisk = babyModel.getHighRisk(); + if (new Integer(0).equals(highRisk)) { + newBabyManagerQueryModel.setHighRisk("健康"); + } + if (new Integer(1).equals(highRisk)) { + newBabyManagerQueryModel.setHighRisk("高危"); + } + String dueType = newBabyManagerQueryModel.getDueType(); + if ("1".equals(dueType)) { + newBabyManagerQueryModel.setDueType("顺产"); + } + if ("2".equals(dueType)) { + newBabyManagerQueryModel.setDueType("刨宫产"); } newBabyManagerQueryModelList.add(newBabyManagerQueryModel); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java index 6a4f32e..dbc9fa9 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ChildbirthManagerQueryModel.java @@ -1,5 +1,6 @@ package com.lyms.platform.operate.web.result; + /** * @auther HuJiaqi * @createTime 2016年12月07日 15时51分 @@ -303,7 +304,7 @@ public class ChildbirthManagerQueryModel { * @createTime 2016年12月09日 15时59分 * @discription 儿童性别 */ - private Integer sex; + private String sex; /** * @auther HuJiaqi @@ -359,7 +360,7 @@ public class ChildbirthManagerQueryModel { * @createTime 2016年12月09日 16时00分 * @discription 畸形 */ - private Integer malformation; + private String malformation; // 新生儿信息结束 // 院内信息开始 @@ -705,11 +706,11 @@ public class ChildbirthManagerQueryModel { this.pregnancyOut = pregnancyOut; } - public Integer getSex() { + public String getSex() { return sex; } - public void setSex(Integer sex) { + public void setSex(String sex) { this.sex = sex; } @@ -769,11 +770,11 @@ public class ChildbirthManagerQueryModel { this.babyHealthy = babyHealthy; } - public Integer getMalformation() { + public String getMalformation() { return malformation; } - public void setMalformation(Integer malformation) { + public void setMalformation(java.lang.String malformation) { this.malformation = malformation; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerQueryModel.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerQueryModel.java index fcc4ed5..24f609f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerQueryModel.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerQueryModel.java @@ -20,7 +20,7 @@ public class NewBabyManagerQueryModel { * @discription 娩出时间 */ private String birthHM; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时54分 @@ -33,7 +33,7 @@ public class NewBabyManagerQueryModel { * @createTime 2016年12月08日 10时54分 * @discription 性别 */ - private Integer sex; + private String sex; /** * @auther HuJiaqi @@ -47,7 +47,7 @@ public class NewBabyManagerQueryModel { * @createTime 2016年12月08日 10时56分 * @discription 是否高危 */ - private Integer highRisk; + private String highRisk; /** * @auther HuJiaqi @@ -62,49 +62,49 @@ public class NewBabyManagerQueryModel { * @discription 分娩方式 */ private String dueType; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时56分 * @discription 出生身长/cm */ private String babyHeight; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 * @discription 出生体重/g */ private String babyWeight; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 * @discription 母亲姓名 */ private String mname; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 * @discription 母亲年龄 */ private Integer age; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 * @discription 母亲证件号 */ private String mcertNo; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 * @discription 联系方式 */ private String mphone; - + /** * @auther HuJiaqi * @createTime 2016年12月08日 10时57分 @@ -136,11 +136,11 @@ public class NewBabyManagerQueryModel { this.name = name; } - public Integer getSex() { + public String getSex() { return sex; } - public void setSex(Integer sex) { + public void setSex(String sex) { this.sex = sex; } @@ -152,11 +152,11 @@ public class NewBabyManagerQueryModel { this.birthDays = birthDays; } - public Integer getHighRisk() { + public String getHighRisk() { return highRisk; } - public void setHighRisk(Integer highRisk) { + public void setHighRisk(String highRisk) { this.highRisk = highRisk; } -- 1.8.3.1