Commit 14e6efa602b90a726010405a5cffe3cb7b65897c
Exists in
master
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyGrowthCountResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/GrowthCountTask.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
14e6efa
... | ... | @@ -228,7 +228,24 @@ |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | + public static Date parseYMDEnd(String s) { | |
232 | + if (s == null) { | |
233 | + return null; | |
234 | + } | |
231 | 235 | |
236 | + try { | |
237 | + lock.lock(); | |
238 | + Date d = y_m_d.parse(s); | |
239 | + long resultMis = d.getTime() + (1000 * 60 * 60 * 24 - 1); | |
240 | + return new Date(resultMis); | |
241 | + } catch (Exception e) { | |
242 | + return null; | |
243 | + } finally { | |
244 | + lock.unlock(); | |
245 | + } | |
246 | + } | |
247 | + | |
248 | + | |
232 | 249 | public static Date parseMD(String s) { |
233 | 250 | if (s == null) { |
234 | 251 | return null; |
235 | 252 | |
... | ... | @@ -864,10 +881,10 @@ |
864 | 881 | /** |
865 | 882 | * @auther HuJiaqi |
866 | 883 | * @createTime 2016年12月13日 17时10分 |
867 | - * @discription 格式化传入时间的方法,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式 | |
884 | + * @discription 格式化传入时间的方法,注意这里是获取的前面时间的00和后面时间的59,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式 | |
868 | 885 | */ |
869 | 886 | public static Date[] getSNDate(String snDateString) { |
870 | - return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMD(snDateString.substring(13, 23))}; | |
887 | + return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMDEnd(snDateString.substring(13, 23))}; | |
871 | 888 | } |
872 | 889 | |
873 | 890 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java
View file @
14e6efa
1 | +package com.lyms.platform.common.utils; | |
2 | + | |
3 | +/** | |
4 | + * @auther HuJiaqi | |
5 | + * @createTime 2016年12月26日 14时24分 | |
6 | + * @discription | |
7 | + */ | |
8 | +public class DefenceUtils { | |
9 | + | |
10 | + /** | |
11 | + * @auther HuJiaqi | |
12 | + * @createTime 2016年12月26日 14时25分 | |
13 | + * @discription 加密手机号:17381968107:173****8107 | |
14 | + */ | |
15 | + public static String getPhone(String phone) { | |
16 | + if (org.apache.commons.lang.StringUtils.isEmpty(phone)) { | |
17 | + return ""; | |
18 | + } | |
19 | + if (phone.length() == 11) { | |
20 | + return phone.substring(0, 3) + "****" + phone.substring(7); | |
21 | + } | |
22 | + return ""; | |
23 | + } | |
24 | + | |
25 | + /** | |
26 | + * @auther HuJiaqi | |
27 | + * @createTime 2016年12月26日 14时28分 | |
28 | + * @discription 加密身份证号,屏蔽出生年月及后四位中的中间两位(王平规则) | |
29 | + */ | |
30 | + public static String getId(String id) { | |
31 | + if (org.apache.commons.lang.StringUtils.isEmpty(id)) { | |
32 | + return ""; | |
33 | + } | |
34 | + if (id.length() == 15) { | |
35 | + return id.substring(0, 6) + "****" + id.substring(10, 13) + "*" + id.substring(14); | |
36 | + } | |
37 | + if (id.length() == 18) { | |
38 | + return id.substring(0, 6) + "******" + id.substring(12, 15) + "**" + id.substring(17); | |
39 | + } | |
40 | + return ""; | |
41 | + } | |
42 | + | |
43 | +} |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
14e6efa
... | ... | @@ -190,9 +190,6 @@ |
190 | 190 | //查询号 |
191 | 191 | private String queryNo; |
192 | 192 | |
193 | - //另一个查询号 | |
194 | - private String queryNo1; | |
195 | - | |
196 | 193 | public String getQueryNo() { |
197 | 194 | return queryNo; |
198 | 195 | } |
... | ... | @@ -201,14 +198,6 @@ |
201 | 198 | this.queryNo = queryNo; |
202 | 199 | } |
203 | 200 | |
204 | - public String getQueryNo1() { | |
205 | - return queryNo1; | |
206 | - } | |
207 | - | |
208 | - public void setQueryNo1(String queryNo1) { | |
209 | - this.queryNo1 = queryNo1; | |
210 | - } | |
211 | - | |
212 | 201 | public Integer getPostViewTimes() { |
213 | 202 | return postViewTimes; |
214 | 203 | } |
... | ... | @@ -342,7 +331,7 @@ |
342 | 331 | */ |
343 | 332 | private Integer yn = -1; |
344 | 333 | /** |
345 | - * 1:孕妇,2:儿童 | |
334 | + * 1:孕妇,2:儿童,3产妇(2暂时没有了,儿童单独建标) | |
346 | 335 | */ |
347 | 336 | private Integer type = -1; |
348 | 337 | private List<Integer> typeList; |
... | ... | @@ -383,7 +372,8 @@ |
383 | 372 | // 分娩相关信息 |
384 | 373 | // 分娩医院 |
385 | 374 | private String fmHospital; |
386 | - private List<String> fmHospitalList; | |
375 | + // 这个是分娩医院+建档医院的综合查询 | |
376 | + private List<String> fmHospitalQueryList; | |
387 | 377 | // 分娩年龄 |
388 | 378 | private Integer fmAgeStart; |
389 | 379 | private Integer fmAgeEnd; |
390 | 380 | |
... | ... | @@ -972,12 +962,11 @@ |
972 | 962 | c1= c.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria(); |
973 | 963 | } |
974 | 964 | |
975 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(queryNo1)) { | |
965 | + if (CollectionUtils.isNotEmpty(fmHospitalQueryList)) { | |
976 | 966 | MongoCondition c = MongoCondition.newInstance(); |
977 | - MongoCondition con1 = MongoCondition.newInstance("phone", queryNo1, MongoOper.IS); | |
978 | - MongoCondition con2 = MongoCondition.newInstance("username", queryNo1, MongoOper.IS); | |
979 | - MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo1, MongoOper.IS); | |
980 | - c1= c.orCondition(new MongoCondition[]{con1, con2, con3}).getCriteria(); | |
967 | + MongoCondition con1 = MongoCondition.newInstance("hospitalId", fmHospitalQueryList, MongoOper.IN); | |
968 | + MongoCondition con2 = MongoCondition.newInstance("fmHospital", fmHospitalQueryList, MongoOper.IN); | |
969 | + c1= c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
981 | 970 | } |
982 | 971 | |
983 | 972 | if (lastCheckEmployeeId != null) { |
... | ... | @@ -1236,10 +1225,6 @@ |
1236 | 1225 | condition = condition.and("fmHospital", fmHospital, MongoOper.IS); |
1237 | 1226 | } |
1238 | 1227 | |
1239 | - if (null != fmHospitalList) { | |
1240 | - condition = condition.and("fmHospital", fmHospitalList, MongoOper.IN); | |
1241 | - } | |
1242 | - | |
1243 | 1228 | if (null != fmType) { |
1244 | 1229 | condition = condition.and("fmType", fmType, MongoOper.LIKE); |
1245 | 1230 | } |
... | ... | @@ -1251,15 +1236,6 @@ |
1251 | 1236 | |
1252 | 1237 | return condition.toMongoQuery(); |
1253 | 1238 | } |
1254 | - | |
1255 | - public List<String> getFmHospitalList() { | |
1256 | - return fmHospitalList; | |
1257 | - } | |
1258 | - | |
1259 | - public void setFmHospitalList(List<String> fmHospitalList) { | |
1260 | - this.fmHospitalList = fmHospitalList; | |
1261 | - } | |
1262 | - | |
1263 | 1239 | public Integer gethScoreEnd() { |
1264 | 1240 | return hScoreEnd; |
1265 | 1241 | } |
... | ... | @@ -1314,6 +1290,14 @@ |
1314 | 1290 | |
1315 | 1291 | public void setBookbuildingDoctorList(List<String> bookbuildingDoctorList) { |
1316 | 1292 | this.bookbuildingDoctorList = bookbuildingDoctorList; |
1293 | + } | |
1294 | + | |
1295 | + public List<String> getFmHospitalQueryList() { | |
1296 | + return fmHospitalQueryList; | |
1297 | + } | |
1298 | + | |
1299 | + public void setFmHospitalQueryList(List<String> fmHospitalQueryList) { | |
1300 | + this.fmHospitalQueryList = fmHospitalQueryList; | |
1317 | 1301 | } |
1318 | 1302 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
14e6efa
... | ... | @@ -376,13 +376,13 @@ |
376 | 376 | * 儿童生长统计 |
377 | 377 | * @return |
378 | 378 | */ |
379 | - @RequestMapping(method = RequestMethod.GET, value = "/getBabyGroupCount") | |
379 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyGrowthCount") | |
380 | 380 | @ResponseBody |
381 | 381 | @TokenRequired |
382 | - public BaseResponse getBabyGroupCount(@Valid BabyManageRequest babyManageRequest, | |
382 | + public BaseResponse getBabyGrowthCount(@Valid BabyManageRequest babyManageRequest, | |
383 | 383 | HttpServletRequest request) { |
384 | 384 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
385 | - return babyBookbuildingFacade.getBabyGroupCount(babyManageRequest, loginState.getId()); | |
385 | + return babyBookbuildingFacade.getBabyGrowthCount(babyManageRequest, loginState.getId()); | |
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
389 | 389 | |
390 | 390 | |
... | ... | @@ -390,14 +390,14 @@ |
390 | 390 | * @param babyManageRequest |
391 | 391 | * @return |
392 | 392 | */ |
393 | - @RequestMapping(method = RequestMethod.GET, value = "/getBabyGroupRightCount") | |
393 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyGrowthRightList") | |
394 | 394 | @ResponseBody |
395 | 395 | @TokenRequired |
396 | - public BaseResponse getBabyGroupRightCount(@Valid BabyManageRequest babyManageRequest,HttpServletRequest request, | |
396 | + public BaseResponse getBabyGrowthRightList(@Valid BabyManageRequest babyManageRequest,HttpServletRequest request, | |
397 | 397 | @RequestParam("page") Integer page, |
398 | 398 | @RequestParam("limit") Integer limit){ |
399 | 399 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
400 | - return babyBookbuildingFacade.getBabyGroupRightCount(babyManageRequest,loginState.getId(),page,limit); | |
400 | + return babyBookbuildingFacade.getBabyGrowthRightList(babyManageRequest,loginState.getId(),page,limit); | |
401 | 401 | } |
402 | 402 | |
403 | 403 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
14e6efa
... | ... | @@ -2142,7 +2142,7 @@ |
2142 | 2142 | * @param userId |
2143 | 2143 | * @return |
2144 | 2144 | */ |
2145 | - public BaseResponse getBabyGroupCount(BabyManageRequest request, Integer userId) { | |
2145 | + public BaseResponse getBabyGrowthCount(BabyManageRequest request, Integer userId) { | |
2146 | 2146 | String hospitalId = ""; |
2147 | 2147 | //得到当前登录的医院id |
2148 | 2148 | if (userId != null) { |
2149 | 2149 | |
... | ... | @@ -2175,14 +2175,14 @@ |
2175 | 2175 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); |
2176 | 2176 | babyQuery.setCheckDateStart(end); |
2177 | 2177 | } |
2178 | - Map<String,List<BabyGrowthCountResult>> result = new HashMap<>(); | |
2178 | + List<BabyGrowthCountResult> result = new ArrayList<>(); | |
2179 | 2179 | |
2180 | 2180 | Map<String,List<BabyGrowthCountResult>> mapItems = getCountGroupItemMaps(); |
2181 | 2181 | for(String key : mapItems.keySet()) |
2182 | 2182 | { |
2183 | 2183 | List<BabyGrowthCountResult> groups = mapItems.get(key); |
2184 | 2184 | GrowthCountTask task = new GrowthCountTask(groups,babyQuery,babyCheckService,key); |
2185 | - result.put(key,task.getResults()); | |
2185 | + result.addAll(task.getResults()); | |
2186 | 2186 | } |
2187 | 2187 | |
2188 | 2188 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
... | ... | @@ -2201,7 +2201,7 @@ |
2201 | 2201 | * @param userId |
2202 | 2202 | * @return |
2203 | 2203 | */ |
2204 | - public BaseResponse getBabyGroupRightCount(BabyManageRequest request, Integer userId,Integer page,Integer limit) { | |
2204 | + public BaseResponse getBabyGrowthRightList(BabyManageRequest request, Integer userId,Integer page,Integer limit) { | |
2205 | 2205 | String hospitalId = ""; |
2206 | 2206 | //得到当前登录的医院id |
2207 | 2207 | if (userId != null) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
14e6efa
... | ... | @@ -1017,7 +1017,7 @@ |
1017 | 1017 | patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId()); |
1018 | 1018 | patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone()); |
1019 | 1019 | patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo()); |
1020 | - patientsQuery.setFmHospitalList(hospitalList); | |
1020 | + patientsQuery.setFmHospitalQueryList(hospitalList); | |
1021 | 1021 | String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); |
1022 | 1022 | patientsQuery.setFmType(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); |
1023 | 1023 | patientsQuery.setFmAgeStart(StringUtils.isEmpty(childbirthManagerRequest.getStartAge()) ? null : Integer.valueOf(childbirthManagerRequest.getStartAge())); |
... | ... | @@ -1065,8 +1065,8 @@ |
1065 | 1065 | // 居住地 |
1066 | 1066 | childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); |
1067 | 1067 | // 电话转换 |
1068 | - childbirthManagerQueryModel.setPhone(StringUtils.isEmpty(patients.getPhone()) ? "" : patients.getPhone().substring(0, 3) + "****" + patients.getPhone().substring(7)); | |
1069 | - childbirthManagerQueryModel.setHusbandPhone(StringUtils.isEmpty(patients.getHusbandPhone()) ? "" : patients.getHusbandPhone().substring(0, 3) + "****" + patients.getHusbandPhone().substring(7)); | |
1068 | + childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); | |
1069 | + childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone())); | |
1070 | 1070 | // 查询分娩方式 |
1071 | 1071 | String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); |
1072 | 1072 | Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson); |
1073 | 1073 | |
1074 | 1074 | |
1075 | 1075 | |
... | ... | @@ -1100,16 +1100,13 @@ |
1100 | 1100 | BabyModelQuery babyModelQuery = new BabyModelQuery(); |
1101 | 1101 | babyModelQuery.setYn(YnEnums.YES.getId()); |
1102 | 1102 | babyModelQuery.setParentId(patients.getId()); |
1103 | + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); | |
1103 | 1104 | List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); |
1104 | - int i = 0; | |
1105 | 1105 | if (CollectionUtils.isNotEmpty(babyModelList)) { |
1106 | - for (BabyModel babyModel : babyModelList) { | |
1107 | - if (RenShenJieJuEnums.O.getId().equals(babyModel.getPregnancyOut())) { | |
1108 | - i++; | |
1109 | - } | |
1110 | - } | |
1106 | + childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); | |
1107 | + }else{ | |
1108 | + childbirthManagerQueryModel.setLivingNumber(0); | |
1111 | 1109 | } |
1112 | - childbirthManagerQueryModel.setLivingNumber(i); | |
1113 | 1110 | |
1114 | 1111 | // 开始拼装自定义查询结果 |
1115 | 1112 | // 胎方位,胎心率,胎先露 |
1116 | 1113 | |
... | ... | @@ -1325,10 +1322,11 @@ |
1325 | 1322 | if (maternalDeliverModel.getParentId().equals(babyModel.getParentId())) { |
1326 | 1323 | NewBabyManagerQueryModel newBabyManagerQueryModel = new NewBabyManagerQueryModel(); |
1327 | 1324 | BeanUtils.copy(babyModel, newBabyManagerQueryModel); |
1325 | + newBabyManagerQueryModel.setMcertNo(DefenceUtils.getId(babyModel.getMcertNo())); | |
1328 | 1326 | newBabyManagerQueryModel.setAge(DateUtil.getAge(babyModel.getMbirth())); |
1329 | 1327 | newBabyManagerQueryModel.setBirthYMD(DateUtil.getyyyy_MM_dd(babyModel.getBirth())); |
1330 | 1328 | newBabyManagerQueryModel.setBirthHM(new SimpleDateFormat("HH:mm").format(babyModel.getBirth())); |
1331 | - newBabyManagerQueryModel.setMphone(StringUtils.isEmpty(babyModel.getMphone()) ? "" : babyModel.getMphone().substring(0, 3) + "****" + babyModel.getMphone().substring(7)); | |
1329 | + newBabyManagerQueryModel.setMphone(DefenceUtils.getPhone(babyModel.getMphone())); | |
1332 | 1330 | newBabyManagerQueryModel.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date())); |
1333 | 1331 | newBabyManagerQueryModel.setBabyId(babyModel.getId()); |
1334 | 1332 | newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyGrowthCountResult.java
View file @
14e6efa
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | -import java.util.ArrayList; | |
4 | -import java.util.HashMap; | |
5 | -import java.util.List; | |
6 | -import java.util.Map; | |
7 | 3 | |
4 | + | |
8 | 5 | /** |
9 | 6 | * Created by lqy on 2016-12-21. |
10 | 7 | */ |
11 | 8 | public class BabyGrowthCountResult { |
12 | 9 | |
10 | + //类型名称 | |
11 | + private String typeName; | |
12 | + | |
13 | 13 | //标准差 |
14 | 14 | private String bzc; |
15 | 15 | |
16 | 16 | |
... | ... | @@ -43,6 +43,12 @@ |
43 | 43 | this.count = count; |
44 | 44 | } |
45 | 45 | |
46 | + public String getTypeName() { | |
47 | + return typeName; | |
48 | + } | |
46 | 49 | |
50 | + public void setTypeName(String typeName) { | |
51 | + this.typeName = typeName; | |
52 | + } | |
47 | 53 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/GrowthCountTask.java
View file @
14e6efa