Commit 0bf92856cba1079ed80c26ef1b8e7895cf7e896b
1 parent
79f75f2fab
Exists in
master
and in
6 other branches
出院小结接口,验证baby是否有效
Showing 2 changed files with 44 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
0bf9285
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | import com.lyms.platform.permission.service.OrganizationService; |
15 | 15 | import com.lyms.platform.permission.service.UsersService; |
16 | 16 | import com.lyms.platform.pojo.*; |
17 | +import com.lyms.platform.query.BabyModelQuery; | |
17 | 18 | import com.lyms.platform.query.DischargeAbstractBabyQuery; |
18 | 19 | import org.apache.commons.collections.CollectionUtils; |
19 | 20 | import org.apache.commons.collections.MapUtils; |
... | ... | @@ -51,6 +52,8 @@ |
51 | 52 | private DischargeAbstractMotherService dischargeAbstractMotherService; |
52 | 53 | @Autowired |
53 | 54 | private DischargeAbstractBabyService dischargeAbstractBabyService; |
55 | + @Autowired | |
56 | + private BabyService babyService; | |
54 | 57 | |
55 | 58 | |
56 | 59 | public BaseObjectResponse findPatientData(String id) { |
... | ... | @@ -203,7 +206,7 @@ |
203 | 206 | map.put("highRisk",highScoreResult); |
204 | 207 | |
205 | 208 | Map<String,Object> otherRisk = new HashMap<>(); |
206 | - if (StringUtils.isNotEmpty(data.getOtherHighRisk())){ | |
209 | + if (StringUtils.isNotEmpty(data.getOtherHighRisk()) && !"{}".equals(data.getOtherHighRisk())){ | |
207 | 210 | ResolveUtils.queryOtherRisk(data.getOtherHighRisk(),otherRisk,basicConfigService); |
208 | 211 | } |
209 | 212 | map.put("otherHighRisk",otherRisk); |
... | ... | @@ -425,7 +428,7 @@ |
425 | 428 | } |
426 | 429 | |
427 | 430 | map.put("ydfmw",ydfmw); |
428 | - map.put("ydqjd",ydqjd); | |
431 | + map.put("ydqjd",FunvCommonUtil.getBaseicConfigByid(ydqjd,basicConfigService)); | |
429 | 432 | map.put("bChao",data.getbChao()); |
430 | 433 | |
431 | 434 | |
... | ... | @@ -495,7 +498,7 @@ |
495 | 498 | map.put("id",data.getId()); |
496 | 499 | map.put("username",patients.getUsername()); |
497 | 500 | map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth())); |
498 | - map.put("age",DateUtil.getAge(patients.getBirth())); | |
501 | + map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI)); | |
499 | 502 | map.put("phone",patients.getPhone()); |
500 | 503 | map.put("fmWeek",patients.getFmWeek()); |
501 | 504 | map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
... | ... | @@ -511,7 +514,7 @@ |
511 | 514 | map.put("highRisk",highScoreResult); |
512 | 515 | |
513 | 516 | Map<String,Object> otherRisk = new HashMap<>(); |
514 | - if (StringUtils.isNotEmpty(data.getOtherRisk())){ | |
517 | + if (StringUtils.isNotEmpty(data.getOtherRisk()) && !"{}".equals(data.getOtherRisk())){ | |
515 | 518 | ResolveUtils.queryOtherRisk(data.getOtherRisk(),otherRisk,basicConfigService); |
516 | 519 | } |
517 | 520 | map.put("otherHighRisk",otherRisk); |
... | ... | @@ -1110,7 +1113,6 @@ |
1110 | 1113 | return br; |
1111 | 1114 | } |
1112 | 1115 | |
1113 | - | |
1114 | 1116 | DischargeAbstractMotherModel data = dischargeAbstractMotherService.findOneById(id); |
1115 | 1117 | if (data==null){ |
1116 | 1118 | br.setErrorcode(ErrorCodeConstants.NO_DATA); |
... | ... | @@ -1150,7 +1152,14 @@ |
1150 | 1152 | map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN)); |
1151 | 1153 | map.put("leaveHospitalDate", DateUtil.getyyyy_MM_dd(data.getLeaveHospitalDate())); |
1152 | 1154 | map.put("afterMakeBabyDays", data.getAfterMakeBabyDays()==null?"":"产后"+data.getAfterMakeBabyDays()+"天"); |
1153 | - map.put("inputMan",data.getInputMan()); | |
1155 | + String inputMan = ""; | |
1156 | + if (StringUtils.isNotEmpty(data.getInputMan()) && FunvCommonUtil.isNumeric(data.getInputMan())){ | |
1157 | + Users users = usersService.getUsers(Integer.parseInt(data.getInputMan())); | |
1158 | + if (users!=null && users.getYn()==YnEnums.YES.getId()){ | |
1159 | + inputMan = users.getName(); | |
1160 | + } | |
1161 | + } | |
1162 | + map.put("inputMan",inputMan); | |
1154 | 1163 | /* 出院信息 */ |
1155 | 1164 | map.put("description",data.getDescription()); |
1156 | 1165 | |
... | ... | @@ -1161,6 +1170,18 @@ |
1161 | 1170 | List<DischargeAbstractBabyModel> babyModelList = dischargeAbstractBabyService.query(babyQuery); |
1162 | 1171 | if (CollectionUtils.isNotEmpty(babyModelList)){ |
1163 | 1172 | for (DischargeAbstractBabyModel temp : babyModelList){ |
1173 | + if (temp.getpId()==null){ | |
1174 | + continue; | |
1175 | + } | |
1176 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
1177 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
1178 | + babyModelQuery.setPid(temp.getpId()); | |
1179 | + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); | |
1180 | + List<BabyModel> babyModels = babyService.queryBabyWithQuery(babyModelQuery); | |
1181 | + if (CollectionUtils.isEmpty(babyModels)){ | |
1182 | + continue; | |
1183 | + } | |
1184 | + | |
1164 | 1185 | Map<String,Object> babyMap = new HashMap<>(); |
1165 | 1186 | babyMap.put("description",temp.getDescription()); |
1166 | 1187 | babyMap.put("birthCertificateId",temp.getBirthCertificateId()); |
... | ... | @@ -1191,7 +1212,6 @@ |
1191 | 1212 | } |
1192 | 1213 | } |
1193 | 1214 | map.put("babys",babys); |
1194 | - | |
1195 | 1215 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
1196 | 1216 | br.setErrormsg("成功"); |
1197 | 1217 | br.setData(map); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
View file @
0bf9285
... | ... | @@ -12,6 +12,8 @@ |
12 | 12 | import org.apache.commons.lang.math.NumberUtils; |
13 | 13 | |
14 | 14 | import java.util.*; |
15 | +import java.util.regex.Matcher; | |
16 | +import java.util.regex.Pattern; | |
15 | 17 | |
16 | 18 | /** |
17 | 19 | * 妇女模块公共方法 |
... | ... | @@ -111,6 +113,21 @@ |
111 | 113 | } |
112 | 114 | return ""; |
113 | 115 | } |
116 | + | |
117 | + /** | |
118 | + * 判断是否为数字 | |
119 | + * @param str | |
120 | + * @return | |
121 | + */ | |
122 | + public static boolean isNumeric(String str){ | |
123 | + Pattern pattern = Pattern.compile("[0-9]*"); | |
124 | + Matcher isNum = pattern.matcher(str); | |
125 | + if( !isNum.matches() ){ | |
126 | + return false; | |
127 | + } | |
128 | + return true; | |
129 | + } | |
130 | + | |
114 | 131 | |
115 | 132 | /** |
116 | 133 | * 获取生日(****年**月**日) |