Commit c569151f2558b3eee8d2143f35c4d21d8a3bfc59
1 parent
56c739ceb1
Exists in
master
and in
1 other branch
commit
Showing 1 changed file with 178 additions and 271 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
c569151
Diff suppressed. Click to show
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | @Component |
36 | 36 | public class BabyBookbuildingFacade { |
37 | 37 | |
38 | - public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); | |
38 | + public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); | |
39 | 39 | |
40 | 40 | @Autowired |
41 | 41 | private HisService hisServiceV2; |
42 | 42 | |
43 | 43 | |
... | ... | @@ -84,18 +84,18 @@ |
84 | 84 | private UsersService usersService; |
85 | 85 | |
86 | 86 | |
87 | - | |
88 | 87 | @Autowired |
89 | 88 | private SmsConfigFacade smsConfigFacade; |
90 | 89 | |
91 | 90 | |
92 | - public BaseResponse getBabyBase(String babyId){ | |
91 | + public BaseResponse getBabyBase(String babyId) { | |
93 | 92 | //查询儿童的基本信息 |
94 | 93 | BabyBasicResult base = new BabyBasicResult(); |
95 | 94 | babyCheckFacade.getBabyModel(babyId, base); |
96 | 95 | |
97 | 96 | return new BaseObjectResponse().setData(base).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
98 | 97 | } |
98 | + | |
99 | 99 | /** |
100 | 100 | * 儿童电子病历 |
101 | 101 | * |
... | ... | @@ -112,8 +112,7 @@ |
112 | 112 | |
113 | 113 | //查询建档记录 得到pid 通过pid查询所有的儿童建档记录 |
114 | 114 | List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
115 | - if (CollectionUtils.isNotEmpty(builds)) | |
116 | - { | |
115 | + if (CollectionUtils.isNotEmpty(builds)) { | |
117 | 116 | babyQuery.setId(null); |
118 | 117 | babyQuery.setPid(builds.get(0).getPid()); |
119 | 118 | } |
120 | 119 | |
121 | 120 | |
122 | 121 | |
123 | 122 | |
... | ... | @@ -122,23 +121,23 @@ |
122 | 121 | List<Map<String, String>> list = new ArrayList<>(); |
123 | 122 | //查询建档记录 |
124 | 123 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
125 | - if(CollectionUtils.isNotEmpty(models)){ | |
124 | + if (CollectionUtils.isNotEmpty(models)) { | |
126 | 125 | int len = models.size(); |
127 | 126 | buildIds = new String[len]; |
128 | 127 | |
129 | - for(int i = 0 ;i < len ;i++){ | |
128 | + for (int i = 0; i < len; i++) { | |
130 | 129 | |
131 | - BabyModel babyModel =models.get(i); | |
130 | + BabyModel babyModel = models.get(i); | |
132 | 131 | buildIds[i] = babyModel.getId(); |
133 | 132 | Map<String, String> checkRecord = new HashMap<>(); |
134 | 133 | checkRecord.put("id", babyModel.getId()); |
135 | - checkRecord.put("pid",babyModel.getPid()); | |
134 | + checkRecord.put("pid", babyModel.getPid()); | |
136 | 135 | checkRecord.put("checkDate", DateUtil.getyyyy_MM_dd(babyModel.getBuildDate())); |
137 | 136 | String monthAge = DateUtil.getBabyMonthAge(babyModel.getBirth(), babyModel.getBuildDate()); |
138 | 137 | checkRecord.put("monthAge", monthAge); |
139 | 138 | checkRecord.put("buildId", babyModel.getId()); |
140 | - checkRecord.put("type","1"); | |
141 | - checkRecord.put("hospitalId",babyModel.getHospitalId()); | |
139 | + checkRecord.put("type", "1"); | |
140 | + checkRecord.put("hospitalId", babyModel.getHospitalId()); | |
142 | 141 | //查询建档医院 |
143 | 142 | Organization org = organizationService.getOrganization(Integer.valueOf(babyModel.getHospitalId())); |
144 | 143 | if (org != null) { |
... | ... | @@ -154,7 +153,7 @@ |
154 | 153 | personModelQuery.setYn(YnEnums.YES.getId()); |
155 | 154 | personModelQuery.setId(builds.get(0).getPid()); |
156 | 155 | Collections.reverse(list); |
157 | - List<PersonModel> personModels = personService.queryPersons(personModelQuery); | |
156 | + List<PersonModel> personModels = personService.queryPersons(personModelQuery); | |
158 | 157 | |
159 | 158 | List<Map<String, String>> tempList = new ArrayList<>(); |
160 | 159 | babyCheckFacade.getBabyCheckList(buildIds, personModels.get(0), tempList); |
... | ... | @@ -186,8 +185,7 @@ |
186 | 185 | DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())); |
187 | 186 | model.setCardId(cardId + request.getBabyName()); |
188 | 187 | } |
189 | - if (StringUtils.isNotEmpty(request.getMommyPhone())) | |
190 | - { | |
188 | + if (StringUtils.isNotEmpty(request.getMommyPhone())) { | |
191 | 189 | String phoneId = request.getMommyPhone() + |
192 | 190 | DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())); |
193 | 191 | model.setPhoneId(phoneId + request.getBabyName()); |
... | ... | @@ -210,13 +208,10 @@ |
210 | 208 | patientsQuery.setYn(YnEnums.YES.getId()); |
211 | 209 | patientsQuery.setCardNo(request.getMommyCertificateNum()); |
212 | 210 | patientsQuery.setDueStatus(0); |
213 | - List<Patients> pats = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
214 | - if (CollectionUtils.isNotEmpty(pats)) | |
215 | - { | |
216 | - for(Patients pat : pats) | |
217 | - { | |
218 | - if (pat == null) | |
219 | - { | |
211 | + List<Patients> pats = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
212 | + if (CollectionUtils.isNotEmpty(pats)) { | |
213 | + for (Patients pat : pats) { | |
214 | + if (pat == null) { | |
220 | 215 | continue; |
221 | 216 | } |
222 | 217 | if (pat.getType() != null && pat.getType() == 3) { |
223 | 218 | |
224 | 219 | |
225 | 220 | |
... | ... | @@ -242,18 +237,13 @@ |
242 | 237 | babyQuery.setYn(YnEnums.YES.getId()); |
243 | 238 | babyQuery.setId(request.getId()); |
244 | 239 | List<BabyModel> list = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
245 | - if (CollectionUtils.isNotEmpty(list)) | |
246 | - { | |
240 | + if (CollectionUtils.isNotEmpty(list)) { | |
247 | 241 | BabyModel babyModel = list.get(0); |
248 | - if (!(babyModel.getServiceStatus() == ServiceStatusEnums.STANDARD_OPEN.getId() || babyModel.getServiceStatus() == ServiceStatusEnums.ADD_OPEN.getId())) | |
249 | - { | |
242 | + if (!(babyModel.getServiceStatus() == ServiceStatusEnums.STANDARD_OPEN.getId() || babyModel.getServiceStatus() == ServiceStatusEnums.ADD_OPEN.getId())) { | |
250 | 243 | |
251 | - if (babyModel.getServiceType() == ServiceTypeEnums.STANDARD_SERVICE.getId()) | |
252 | - { | |
244 | + if (babyModel.getServiceType() == ServiceTypeEnums.STANDARD_SERVICE.getId()) { | |
253 | 245 | babyModel.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); |
254 | - } | |
255 | - else if (babyModel.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId()) | |
256 | - { | |
246 | + } else if (babyModel.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId()) { | |
257 | 247 | babyModel.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); |
258 | 248 | } |
259 | 249 | |
260 | 250 | |
261 | 251 | |
262 | 252 | |
... | ... | @@ -277,21 +267,19 @@ |
277 | 267 | BaseObjectResponse br = new BaseObjectResponse(); |
278 | 268 | |
279 | 269 | //判断儿童是否建档在该医院 |
280 | - if (StringUtils.isNotEmpty(request.getMommyPhone()) || StringUtils.isNotEmpty(request.getMommyCertificateNum())) | |
281 | - { | |
270 | + if (StringUtils.isNotEmpty(request.getMommyPhone()) || StringUtils.isNotEmpty(request.getMommyCertificateNum())) { | |
282 | 271 | BabyModelQuery babyQuery = new BabyModelQuery(); |
283 | 272 | babyQuery.setYn(YnEnums.YES.getId()); |
284 | 273 | String phoneId = request.getMommyPhone() + |
285 | - DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())) +request.getBabyName(); | |
274 | + DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())) + request.getBabyName(); | |
286 | 275 | |
287 | 276 | String cardId = request.getMommyCertificateNum() + |
288 | - DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())) +request.getBabyName(); | |
277 | + DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())) + request.getBabyName(); | |
289 | 278 | babyQuery.setPhoneId(phoneId); |
290 | 279 | babyQuery.setCardId(cardId); |
291 | 280 | babyQuery.setHospitalId(request.getHospitalId()); |
292 | 281 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
293 | - if (CollectionUtils.isNotEmpty(models)) | |
294 | - { | |
282 | + if (CollectionUtils.isNotEmpty(models)) { | |
295 | 283 | br.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
296 | 284 | br.setErrormsg("儿童在医院已经建档"); |
297 | 285 | return br; |
298 | 286 | |
... | ... | @@ -299,15 +287,13 @@ |
299 | 287 | } |
300 | 288 | |
301 | 289 | //判断就诊卡号是否已经建档 |
302 | - if (StringUtils.isNotEmpty(request.getVcCardNo()) ) | |
303 | - { | |
290 | + if (StringUtils.isNotEmpty(request.getVcCardNo())) { | |
304 | 291 | BabyModelQuery babyQuery = new BabyModelQuery(); |
305 | 292 | babyQuery.setYn(YnEnums.YES.getId()); |
306 | 293 | babyQuery.setVcCardNo(request.getVcCardNo()); |
307 | 294 | babyQuery.setHospitalId(request.getHospitalId()); |
308 | 295 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
309 | - if (CollectionUtils.isNotEmpty(models)) | |
310 | - { | |
296 | + if (CollectionUtils.isNotEmpty(models)) { | |
311 | 297 | br.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
312 | 298 | br.setErrormsg("儿童就诊卡号在该医院已经建档"); |
313 | 299 | return br; |
... | ... | @@ -316,9 +302,8 @@ |
316 | 302 | PatientsQuery patientsQuery = new PatientsQuery(); |
317 | 303 | patientsQuery.setVcCardNo(request.getVcCardNo()); |
318 | 304 | patientsQuery.setHospitalId(request.getHospitalId()); |
319 | - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
320 | - if (CollectionUtils.isNotEmpty(patients)) | |
321 | - { | |
305 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
306 | + if (CollectionUtils.isNotEmpty(patients)) { | |
322 | 307 | br.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
323 | 308 | br.setErrormsg("该就诊卡号在该医院已经建档"); |
324 | 309 | return br; |
... | ... | @@ -339,10 +324,8 @@ |
339 | 324 | babyPerson.setModified(new Date()); |
340 | 325 | if (StringUtils.isNotEmpty(request.getPid())) { |
341 | 326 | babyPersonId = request.getPid(); |
342 | - personService.updatePerson(babyPerson,request.getPid()); | |
343 | - } | |
344 | - else | |
345 | - { | |
327 | + personService.updatePerson(babyPerson, request.getPid()); | |
328 | + } else { | |
346 | 329 | babyPerson.setYn(YnEnums.YES.getId()); |
347 | 330 | babyPerson.setCreated(new Date()); |
348 | 331 | resperson = personService.addPerson(babyPerson); |
349 | 332 | |
350 | 333 | |
351 | 334 | |
352 | 335 | |
... | ... | @@ -357,33 +340,26 @@ |
357 | 340 | personYunModelQuery.setTypes(new Integer[]{1, 3}); |
358 | 341 | personYunModelQuery.setCardNo(request.getMommyCertificateNum()); |
359 | 342 | List<PersonModel> personYunModels = personService.queryPersons(personYunModelQuery); |
360 | - if (CollectionUtils.isNotEmpty(personYunModels)) | |
361 | - { | |
362 | - PersonModel pm = personYunModels.get(0); | |
363 | - if (pm != null) | |
364 | - { | |
343 | + if (CollectionUtils.isNotEmpty(personYunModels)) { | |
344 | + PersonModel pm = personYunModels.get(0); | |
345 | + if (pm != null) { | |
365 | 346 | //查询最后一次建档记录 |
366 | 347 | PatientsQuery patientsQuery = new PatientsQuery(); |
367 | 348 | patientsQuery.setYn(YnEnums.YES.getId()); |
368 | 349 | patientsQuery.setPid(pm.getId()); |
369 | - List<Patients> pats = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
370 | - if (CollectionUtils.isNotEmpty(pats)) | |
371 | - { | |
350 | + List<Patients> pats = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
351 | + if (CollectionUtils.isNotEmpty(pats)) { | |
372 | 352 | |
373 | 353 | //当前状态为 孕妇状态 |
374 | - if (pm.getType() != null && pm.getType() == 1) | |
375 | - { | |
354 | + if (pm.getType() != null && pm.getType() == 1) { | |
376 | 355 | boolean isUpdatePatStatus = false; |
377 | - for(Patients pat : pats) | |
378 | - { | |
379 | - if (pat == null) | |
380 | - { | |
356 | + for (Patients pat : pats) { | |
357 | + if (pat == null) { | |
381 | 358 | continue; |
382 | 359 | } |
383 | 360 | |
384 | 361 | //找到当前医院的孕妇建档 |
385 | - if (pat.getHospitalId() != null && pat.getHospitalId().equals(request.getHospitalId())) | |
386 | - { | |
362 | + if (pat.getHospitalId() != null && pat.getHospitalId().equals(request.getHospitalId())) { | |
387 | 363 | patients = pat; |
388 | 364 | } |
389 | 365 | |
... | ... | @@ -402,8 +378,7 @@ |
402 | 378 | patientUpdate.setType(3); |
403 | 379 | patientUpdate.setFmDate(StringUtils.isEmpty(request.getDueDate()) ? DateUtil.parseYMD(request.getBabyBirthday()) : DateUtil.parseYMD(request.getDueDate())); |
404 | 380 | patientsService.updatePatientByPid(patientUpdate, pm.getId()); |
405 | - if (!isUpdatePatStatus) | |
406 | - { | |
381 | + if (!isUpdatePatStatus) { | |
407 | 382 | isUpdatePatStatus = true; |
408 | 383 | } |
409 | 384 | |
410 | 385 | |
411 | 386 | |
412 | 387 | |
... | ... | @@ -412,15 +387,32 @@ |
412 | 387 | } |
413 | 388 | } |
414 | 389 | |
415 | - if (isUpdatePatStatus) | |
416 | - { | |
390 | + if (isUpdatePatStatus) { | |
417 | 391 | pm.setType(3);//基本信息更新成产妇 |
418 | - personService.updatePerson(pm,pm.getId()); | |
392 | + personService.updatePerson(pm, pm.getId()); | |
419 | 393 | } |
394 | + } else if (pm.getType() != null && pm.getType() == 3) { | |
395 | + //儿童建档时 需要修改自动分娩的产妇 | |
396 | + for (Patients patients1 : pats) { | |
397 | + //自动分娩类型 | |
398 | + if (null != patients1.getBuildType() && 2 == patients1.getBuildType()) { | |
399 | + Date lastMenses = patients1.getLastMenses(); | |
400 | + if (lastMenses != null && request.getBabyBirthday() != null) { | |
401 | + Date brith = DateUtil.parseYMD(request.getBabyBirthday()); | |
402 | + Date tempDate = DateUtil.addWeek(lastMenses, 24); | |
403 | + if (brith.getTime() >= tempDate.getTime()) { | |
404 | + Patients patients2 = new Patients(); | |
405 | + patients2.setId(patients1.getId()); | |
406 | + patients2.setFmDate(StringUtils.isEmpty(request.getDueDate()) ? DateUtil.parseYMD(request.getBabyBirthday()) : DateUtil.parseYMD(request.getDueDate())); | |
407 | + patients2.setBuildType(1); | |
408 | + patientsService.updatePatient(patients2); | |
409 | + } | |
410 | + } | |
411 | + } | |
412 | + } | |
420 | 413 | } |
421 | 414 | |
422 | - if (patients == null) | |
423 | - { | |
415 | + if (patients == null) { | |
424 | 416 | //添加产妇建档 |
425 | 417 | Patients patient = getPatientsData(request); |
426 | 418 | patient.setPid(pm.getId()); |
... | ... | @@ -432,8 +424,7 @@ |
432 | 424 | } |
433 | 425 | } |
434 | 426 | //没有孕妇基本信息就新建产妇建档 和基本信息 |
435 | - else | |
436 | - { | |
427 | + else { | |
437 | 428 | //添加产妇基本信息 |
438 | 429 | PersonModel pmodel = new PersonModel(); |
439 | 430 | pmodel.setName(request.getMommyName()); |
... | ... | @@ -445,7 +436,7 @@ |
445 | 436 | pmodel.setModified(new Date()); |
446 | 437 | pmodel.setCreated(new Date()); |
447 | 438 | |
448 | - PersonModel yunModel = personService.addPerson(pmodel); | |
439 | + PersonModel yunModel = personService.addPerson(pmodel); | |
449 | 440 | |
450 | 441 | //添加产妇建档 |
451 | 442 | Patients patient = getPatientsData(request); |
... | ... | @@ -455,8 +446,7 @@ |
455 | 446 | } |
456 | 447 | |
457 | 448 | |
458 | - if (patients == null) | |
459 | - { | |
449 | + if (patients == null) { | |
460 | 450 | br.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
461 | 451 | br.setErrormsg("失败"); |
462 | 452 | return br; |
463 | 453 | |
... | ... | @@ -471,15 +461,13 @@ |
471 | 461 | DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())); |
472 | 462 | model.setCardId(cardId + request.getBabyName()); |
473 | 463 | } |
474 | - if (StringUtils.isNotEmpty(request.getMommyPhone())) | |
475 | - { | |
464 | + if (StringUtils.isNotEmpty(request.getMommyPhone())) { | |
476 | 465 | String phoneId = request.getMommyPhone() + |
477 | 466 | DateUtil.getYmd(DateUtil.parseYMD(request.getBabyBirthday())); |
478 | 467 | model.setPhoneId(phoneId + request.getBabyName()); |
479 | 468 | } |
480 | 469 | |
481 | - if (patients.getId() != null) | |
482 | - { | |
470 | + if (patients.getId() != null) { | |
483 | 471 | model.setParentId(patients.getId()); |
484 | 472 | } |
485 | 473 | model.setCreated(new Date()); |
486 | 474 | |
... | ... | @@ -507,14 +495,12 @@ |
507 | 495 | /** |
508 | 496 | * 创建建档短信 |
509 | 497 | */ |
510 | - public void createBuildSms(BabyModel babyModel) | |
511 | - { | |
498 | + public void createBuildSms(BabyModel babyModel) { | |
512 | 499 | |
513 | 500 | //判断医院是否启动和对应的服务项是否启用 |
514 | - SmsConfigModel configModel = new SmsConfigModel(); | |
515 | - BaseResponse response = smsConfigFacade.hospitalIsStart(babyModel.getHospitalId(),configModel,SmsServiceEnums.FWKT.getId()); | |
516 | - if (response != null) | |
517 | - { | |
501 | + SmsConfigModel configModel = new SmsConfigModel(); | |
502 | + BaseResponse response = smsConfigFacade.hospitalIsStart(babyModel.getHospitalId(), configModel, SmsServiceEnums.FWKT.getId()); | |
503 | + if (response != null) { | |
518 | 504 | return; |
519 | 505 | } |
520 | 506 | |
521 | 507 | |
522 | 508 | |
523 | 509 | |
524 | 510 | |
... | ... | @@ -529,37 +515,28 @@ |
529 | 515 | Integer serviceStatus = babyModel.getServiceStatus(); |
530 | 516 | List<SmsTemplateModel> sendList = new ArrayList<>(); |
531 | 517 | List<SmsTemplateModel> temps = smsTemplateService.querySmsTemplates(query); |
532 | - if (CollectionUtils.isNotEmpty(temps)) | |
533 | - { | |
518 | + if (CollectionUtils.isNotEmpty(temps)) { | |
534 | 519 | |
535 | - for (SmsTemplateModel temp : temps) | |
536 | - { | |
537 | - if (temp.getServiceType() == serviceType && temp.getServiceStatus() == serviceStatus) | |
538 | - { | |
520 | + for (SmsTemplateModel temp : temps) { | |
521 | + if (temp.getServiceType() == serviceType && temp.getServiceStatus() == serviceStatus) { | |
539 | 522 | sendList.add(temp); |
540 | 523 | break; |
541 | 524 | } |
542 | 525 | } |
543 | 526 | |
544 | - for (SmsTemplateModel temp : temps) | |
545 | - { | |
546 | - if (temp.getServiceStatus() == ServiceStatusEnums.STANDARD_ALL.getId()) | |
547 | - { | |
548 | - if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() ) | |
549 | - { | |
527 | + for (SmsTemplateModel temp : temps) { | |
528 | + if (temp.getServiceStatus() == ServiceStatusEnums.STANDARD_ALL.getId()) { | |
529 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId()) { | |
550 | 530 | sendList.add(temp); |
551 | 531 | break; |
552 | 532 | } |
553 | 533 | } |
554 | 534 | } |
555 | 535 | |
556 | - for (SmsTemplateModel temp : temps) | |
557 | - { | |
558 | - if (temp.getServiceStatus() == ServiceStatusEnums.ADD_ALL.getId()) | |
559 | - { | |
536 | + for (SmsTemplateModel temp : temps) { | |
537 | + if (temp.getServiceStatus() == ServiceStatusEnums.ADD_ALL.getId()) { | |
560 | 538 | if (serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() |
561 | - || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId()|| serviceStatus == ServiceStatusEnums.SUSPEND.getId()) | |
562 | - { | |
539 | + || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.SUSPEND.getId()) { | |
563 | 540 | sendList.add(temp); |
564 | 541 | break; |
565 | 542 | } |
... | ... | @@ -567,12 +544,9 @@ |
567 | 544 | } |
568 | 545 | |
569 | 546 | |
570 | - for (SmsTemplateModel temp : temps) | |
571 | - { | |
572 | - if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OPEN.getId()) | |
573 | - { | |
574 | - if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() ) | |
575 | - { | |
547 | + for (SmsTemplateModel temp : temps) { | |
548 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OPEN.getId()) { | |
549 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.ADD_OPEN.getId()) { | |
576 | 550 | sendList.add(temp); |
577 | 551 | break; |
578 | 552 | } |
... | ... | @@ -580,13 +554,9 @@ |
580 | 554 | } |
581 | 555 | |
582 | 556 | |
583 | - | |
584 | - for (SmsTemplateModel temp : temps) | |
585 | - { | |
586 | - if (temp.getServiceStatus() == ServiceStatusEnums.ALL_NO_OPEN.getId()) | |
587 | - { | |
588 | - if (serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() ) | |
589 | - { | |
557 | + for (SmsTemplateModel temp : temps) { | |
558 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_NO_OPEN.getId()) { | |
559 | + if (serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId()) { | |
590 | 560 | sendList.add(temp); |
591 | 561 | break; |
592 | 562 | } |
... | ... | @@ -594,13 +564,9 @@ |
594 | 564 | } |
595 | 565 | |
596 | 566 | |
597 | - | |
598 | - for (SmsTemplateModel temp : temps) | |
599 | - { | |
600 | - if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OVERDUE.getId()) | |
601 | - { | |
602 | - if (serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId() ) | |
603 | - { | |
567 | + for (SmsTemplateModel temp : temps) { | |
568 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OVERDUE.getId()) { | |
569 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId()) { | |
604 | 570 | sendList.add(temp); |
605 | 571 | break; |
606 | 572 | } |
607 | 573 | |
608 | 574 | |
609 | 575 | |
... | ... | @@ -608,29 +574,24 @@ |
608 | 574 | } |
609 | 575 | |
610 | 576 | |
611 | - | |
612 | - for (SmsTemplateModel temp : temps) | |
613 | - { | |
614 | - if (temp.getServiceType() == ServiceTypeEnums.ALL_SERVICE.getId() && temp.getServiceStatus() == ServiceStatusEnums.ALL.getId()) | |
615 | - { | |
577 | + for (SmsTemplateModel temp : temps) { | |
578 | + if (temp.getServiceType() == ServiceTypeEnums.ALL_SERVICE.getId() && temp.getServiceStatus() == ServiceStatusEnums.ALL.getId()) { | |
616 | 579 | sendList.add(temp); |
617 | 580 | break; |
618 | 581 | } |
619 | 582 | } |
620 | 583 | |
621 | - if (CollectionUtils.isNotEmpty(sendList)) | |
622 | - { | |
584 | + if (CollectionUtils.isNotEmpty(sendList)) { | |
623 | 585 | |
624 | 586 | //短信前缀 |
625 | - String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, babyModel.getBuildDoctor()); | |
626 | - for (SmsTemplateModel templateModel : sendList) | |
627 | - { | |
587 | + String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, babyModel.getBuildDoctor()); | |
588 | + for (SmsTemplateModel templateModel : sendList) { | |
628 | 589 | if (templateModel != null && templateModel.getStatus() == 1) { |
629 | 590 | MessageListRequest smsList = new MessageListRequest(); |
630 | 591 | List<MessageRequest> messages = new ArrayList<>(); |
631 | 592 | MessageRequest mr = new MessageRequest(); |
632 | 593 | String content = "【" + messagePrefix + "】" + templateModel.getContent(); |
633 | - mr.setContent(StringUtils.replaceBaby(babyModel.getName(),babyModel.getBirth(),content)); | |
594 | + mr.setContent(StringUtils.replaceBaby(babyModel.getName(), babyModel.getBirth(), content)); | |
634 | 595 | mr.setObjType(ServiceObjEnums.BABYOBJ.getId()); |
635 | 596 | mr.setPhone(babyModel.getMphone()); |
636 | 597 | //短信商 |
637 | 598 | |
... | ... | @@ -656,13 +617,11 @@ |
656 | 617 | } |
657 | 618 | |
658 | 619 | |
659 | - | |
660 | 620 | } |
661 | 621 | } |
662 | 622 | |
663 | 623 | |
664 | - public static void main(String[] args) | |
665 | - { | |
624 | + public static void main(String[] args) { | |
666 | 625 | |
667 | 626 | Integer serviceType = 1; |
668 | 627 | Integer serviceStatus = 3; |
... | ... | @@ -745,8 +704,6 @@ |
745 | 704 | } |
746 | 705 | |
747 | 706 | |
748 | - | |
749 | - | |
750 | 707 | /** |
751 | 708 | * 准备修改和添加的孕妇建档数据 |
752 | 709 | * |
... | ... | @@ -842,8 +799,7 @@ |
842 | 799 | bm.setMremark(b.getMremark()); |
843 | 800 | bm.setDiagnose(JsonUtil.array2JsonString(b.getDiagnose())); |
844 | 801 | |
845 | - if (b.getDiagnose() != null && b.getDiagnose().size() > 0) | |
846 | - { | |
802 | + if (b.getDiagnose() != null && b.getDiagnose().size() > 0) { | |
847 | 803 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
848 | 804 | basicConfigQuery.setYn(YnEnums.YES.getId()); |
849 | 805 | basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); |
... | ... | @@ -859,7 +815,6 @@ |
859 | 815 | } |
860 | 816 | |
861 | 817 | |
862 | - | |
863 | 818 | if (b.getExpType() != null) { |
864 | 819 | if (b.getExpType() == ExpEnums.SGY.getId()) { |
865 | 820 | Date vipEndTime = DateUtil.addMonth(DateUtil.parseYMD(b.getBuildDate()), 3); |
... | ... | @@ -888,9 +843,7 @@ |
888 | 843 | if (b.getHighRisk() == null) { |
889 | 844 | bm.setLastHighRisk(0); |
890 | 845 | bm.setHighRisk(0); |
891 | - } | |
892 | - else | |
893 | - { | |
846 | + } else { | |
894 | 847 | bm.setLastHighRisk(b.getHighRisk()); |
895 | 848 | bm.setHighRisk(b.getHighRisk()); |
896 | 849 | } |
... | ... | @@ -911,8 +864,7 @@ |
911 | 864 | query.setYn(YnEnums.YES.getId()); |
912 | 865 | query.setBuildId(id); |
913 | 866 | List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query); |
914 | - if (CollectionUtils.isNotEmpty(checkModels)) | |
915 | - { | |
867 | + if (CollectionUtils.isNotEmpty(checkModels)) { | |
916 | 868 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("存在儿童检查记录,不能删除建档"); |
917 | 869 | } |
918 | 870 | |
919 | 871 | |
920 | 872 | |
... | ... | @@ -920,18 +872,15 @@ |
920 | 872 | babyQuery.setId(id); |
921 | 873 | babyQuery.setYn(YnEnums.YES.getId()); |
922 | 874 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
923 | - if (CollectionUtils.isNotEmpty(models)) | |
924 | - { | |
875 | + if (CollectionUtils.isNotEmpty(models)) { | |
925 | 876 | babyQuery.setId(null); |
926 | 877 | babyQuery.setPid(models.get(0).getPid()); |
927 | 878 | List<BabyModel> allModels = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
928 | - if (CollectionUtils.isNotEmpty(allModels)) | |
929 | - { | |
930 | - if (allModels.get(0) != null && allModels.size() == 1 && allModels.get(0).getId().equals(id)) | |
931 | - { | |
879 | + if (CollectionUtils.isNotEmpty(allModels)) { | |
880 | + if (allModels.get(0) != null && allModels.size() == 1 && allModels.get(0).getId().equals(id)) { | |
932 | 881 | PersonModel personModel = new PersonModel(); |
933 | 882 | personModel.setYn(YnEnums.NO.getId()); |
934 | - personService.updatePerson(personModel,allModels.get(0).getPid()); | |
883 | + personService.updatePerson(personModel, allModels.get(0).getPid()); | |
935 | 884 | } |
936 | 885 | } |
937 | 886 | |
938 | 887 | |
... | ... | @@ -1048,16 +997,12 @@ |
1048 | 997 | |
1049 | 998 | result.setServiceStatus(String.valueOf(model.getServiceStatus())); |
1050 | 999 | |
1051 | - if (StringUtils.isNotEmpty(model.getBuildDoctor())) | |
1052 | - { | |
1053 | - Map<String,String> doctorObj = new HashMap<>(); | |
1054 | - doctorObj.put("id",model.getBuildDoctor()); | |
1055 | - if ("a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29".equals(model.getBuildDoctor())) | |
1056 | - { | |
1000 | + if (StringUtils.isNotEmpty(model.getBuildDoctor())) { | |
1001 | + Map<String, String> doctorObj = new HashMap<>(); | |
1002 | + doctorObj.put("id", model.getBuildDoctor()); | |
1003 | + if ("a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29".equals(model.getBuildDoctor())) { | |
1057 | 1004 | doctorObj.put("name", "产科病房"); |
1058 | - } | |
1059 | - else | |
1060 | - { | |
1005 | + } else { | |
1061 | 1006 | Users users = usersService.getUsers(Integer.parseInt(model.getBuildDoctor())); |
1062 | 1007 | doctorObj.put("name", users.getName()); |
1063 | 1008 | } |
1064 | 1009 | |
1065 | 1010 | |
... | ... | @@ -1166,16 +1111,15 @@ |
1166 | 1111 | * @param param |
1167 | 1112 | * @return |
1168 | 1113 | */ |
1169 | - public BaseObjectResponse queryBabyBuildRecord(BookbuildingQueryRequest param,Integer userId) { | |
1114 | + public BaseObjectResponse queryBabyBuildRecord(BookbuildingQueryRequest param, Integer userId) { | |
1170 | 1115 | |
1171 | 1116 | |
1172 | - Map<String,Object> map = new HashMap<>(); | |
1117 | + Map<String, Object> map = new HashMap<>(); | |
1173 | 1118 | |
1174 | 1119 | List<BabyInfoResult> results = new ArrayList<>(); |
1175 | 1120 | |
1176 | 1121 | //得到当前登录的医院id |
1177 | - if (userId != null) | |
1178 | - { | |
1122 | + if (userId != null) { | |
1179 | 1123 | Users dbuser = usersService.getUsers(userId); |
1180 | 1124 | if (dbuser != null) { |
1181 | 1125 | Integer hospitalId = dbuser.getOrgId(); |
1182 | 1126 | |
1183 | 1127 | |
... | ... | @@ -1197,20 +1141,15 @@ |
1197 | 1141 | personModelQuery.setType(2); |
1198 | 1142 | personModelQuery.setCardNo(param.getCardNo()); |
1199 | 1143 | List<PersonModel> personModels = personService.queryPersons(personModelQuery); |
1200 | - if (CollectionUtils.isNotEmpty(personModels)) | |
1201 | - { | |
1202 | - for(PersonModel babayPerson : personModels) | |
1203 | - { | |
1144 | + if (CollectionUtils.isNotEmpty(personModels)) { | |
1145 | + for (PersonModel babayPerson : personModels) { | |
1204 | 1146 | BabyInfoResult result = new BabyInfoResult(); |
1205 | 1147 | result.setPid(babayPerson.getId()); |
1206 | 1148 | result.setCardNo(babayPerson.getCardNo());//母亲的身份证号码 |
1207 | 1149 | result.setName(babayPerson.getName()); |
1208 | - if (babayPerson.getBirth() != null) | |
1209 | - { | |
1150 | + if (babayPerson.getBirth() != null) { | |
1210 | 1151 | result.setMonthAge(DateUtil.getBabyMonthAge(babayPerson.getBirth(), new Date())); |
1211 | - } | |
1212 | - else | |
1213 | - { | |
1152 | + } else { | |
1214 | 1153 | result.setMonthAge(""); |
1215 | 1154 | } |
1216 | 1155 | |
1217 | 1156 | |
1218 | 1157 | |
... | ... | @@ -1218,19 +1157,15 @@ |
1218 | 1157 | BabyModelQuery babyQuery = new BabyModelQuery(); |
1219 | 1158 | babyQuery.setYn(YnEnums.YES.getId()); |
1220 | 1159 | babyQuery.setPid(babayPerson.getId()); |
1221 | - List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery,"buildDate", Sort.Direction.DESC); | |
1160 | + List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "buildDate", Sort.Direction.DESC); | |
1222 | 1161 | |
1223 | 1162 | List<Map<String, String>> list = new ArrayList<>(); |
1224 | - if (CollectionUtils.isNotEmpty(builds)) | |
1225 | - { | |
1226 | - for(BabyModel build: builds) | |
1227 | - { | |
1228 | - if (build == null || StringUtils.isEmpty(build.getHospitalId())) | |
1229 | - { | |
1163 | + if (CollectionUtils.isNotEmpty(builds)) { | |
1164 | + for (BabyModel build : builds) { | |
1165 | + if (build == null || StringUtils.isEmpty(build.getHospitalId())) { | |
1230 | 1166 | continue; |
1231 | 1167 | } |
1232 | - if (build.getHospitalId().equals(param.getHospitalId())) | |
1233 | - { | |
1168 | + if (build.getHospitalId().equals(param.getHospitalId())) { | |
1234 | 1169 | isCurrentHosp = true; |
1235 | 1170 | buildInfo = build; |
1236 | 1171 | } |
... | ... | @@ -1239,7 +1174,7 @@ |
1239 | 1174 | Map<String, String> buildRecords = new HashMap<>(); |
1240 | 1175 | buildRecords.put("id", build.getId()); |
1241 | 1176 | buildRecords.put("buildDate", DateUtil.getyyyy_MM_dd(build.getBuildDate())); |
1242 | - buildRecords.put("hospitalId",build.getHospitalId()); | |
1177 | + buildRecords.put("hospitalId", build.getHospitalId()); | |
1243 | 1178 | //查询建档医院 |
1244 | 1179 | Organization org = organizationService.getOrganization(Integer.valueOf(build.getHospitalId())); |
1245 | 1180 | if (org != null) { |
... | ... | @@ -1251,8 +1186,7 @@ |
1251 | 1186 | list.add(buildRecords); |
1252 | 1187 | } |
1253 | 1188 | |
1254 | - if (!isCurrentHosp) | |
1255 | - { | |
1189 | + if (!isCurrentHosp) { | |
1256 | 1190 | buildInfo = builds.get(0); |
1257 | 1191 | } |
1258 | 1192 | result.setBuildRecords(list); |
1259 | 1193 | |
... | ... | @@ -1270,11 +1204,9 @@ |
1270 | 1204 | babyQuery.setHospitalId(param.getHospitalId()); |
1271 | 1205 | |
1272 | 1206 | List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
1273 | - if (CollectionUtils.isNotEmpty(babyModels)) | |
1274 | - { | |
1207 | + if (CollectionUtils.isNotEmpty(babyModels)) { | |
1275 | 1208 | BabyModel model = babyModels.get(0); |
1276 | - if (model != null) | |
1277 | - { | |
1209 | + if (model != null) { | |
1278 | 1210 | |
1279 | 1211 | puerperaQuery.setCardNo(model.getMcertNo()); |
1280 | 1212 | |
1281 | 1213 | |
1282 | 1214 | |
1283 | 1215 | |
1284 | 1216 | |
... | ... | @@ -1283,28 +1215,22 @@ |
1283 | 1215 | result.setPid(model.getPid()); |
1284 | 1216 | result.setCardNo(model.getMcertNo());//母亲的身份证号码 |
1285 | 1217 | result.setName(model.getName()); |
1286 | - if (model.getBirth() != null) | |
1287 | - { | |
1218 | + if (model.getBirth() != null) { | |
1288 | 1219 | result.setMonthAge(DateUtil.getBabyMonthAge(model.getBirth(), new Date())); |
1289 | - } | |
1290 | - else | |
1291 | - { | |
1220 | + } else { | |
1292 | 1221 | result.setMonthAge(""); |
1293 | 1222 | } |
1294 | 1223 | |
1295 | 1224 | BabyModelQuery babyBuildQuery = new BabyModelQuery(); |
1296 | 1225 | babyBuildQuery.setYn(YnEnums.YES.getId()); |
1297 | 1226 | babyBuildQuery.setPid(model.getPid()); |
1298 | - List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery,"buildDate", Sort.Direction.DESC); | |
1227 | + List<BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "buildDate", Sort.Direction.DESC); | |
1299 | 1228 | |
1300 | 1229 | List<Map<String, String>> list = new ArrayList<>(); |
1301 | - if (CollectionUtils.isNotEmpty(builds)) | |
1302 | - { | |
1303 | - for(BabyModel build: builds) | |
1304 | - { | |
1230 | + if (CollectionUtils.isNotEmpty(builds)) { | |
1231 | + for (BabyModel build : builds) { | |
1305 | 1232 | |
1306 | - if (build != null && StringUtils.isNotEmpty(build.getHospitalId()) && build.getHospitalId().equals(param.getHospitalId())) | |
1307 | - { | |
1233 | + if (build != null && StringUtils.isNotEmpty(build.getHospitalId()) && build.getHospitalId().equals(param.getHospitalId())) { | |
1308 | 1234 | isCurrentHosp = true; |
1309 | 1235 | buildInfo = build; |
1310 | 1236 | } |
... | ... | @@ -1313,7 +1239,7 @@ |
1313 | 1239 | buildRecords.put("id", build.getId()); |
1314 | 1240 | buildRecords.put("buildDate", DateUtil.getyyyy_MM_dd(build.getBuildDate())); |
1315 | 1241 | |
1316 | - buildRecords.put("hospitalId",build.getHospitalId()); | |
1242 | + buildRecords.put("hospitalId", build.getHospitalId()); | |
1317 | 1243 | //查询建档医院 |
1318 | 1244 | Organization org = organizationService.getOrganization(Integer.valueOf(build.getHospitalId())); |
1319 | 1245 | if (org != null) { |
... | ... | @@ -1325,8 +1251,7 @@ |
1325 | 1251 | list.add(buildRecords); |
1326 | 1252 | } |
1327 | 1253 | |
1328 | - if (!isCurrentHosp) | |
1329 | - { | |
1254 | + if (!isCurrentHosp) { | |
1330 | 1255 | buildInfo = builds.get(0); |
1331 | 1256 | } |
1332 | 1257 | |
... | ... | @@ -1348,9 +1273,9 @@ |
1348 | 1273 | |
1349 | 1274 | Patients patients = patientsService.findOnePatientByCardNo(puerperaQuery); |
1350 | 1275 | map.put("patients", patients); |
1351 | - map.put("records",results); | |
1352 | - map.put("buildInfo",buildInfo == null ? null : getBabyBuildResult(buildInfo)); | |
1353 | - map.put("isCurrentHospBuild",isCurrentHosp); | |
1276 | + map.put("records", results); | |
1277 | + map.put("buildInfo", buildInfo == null ? null : getBabyBuildResult(buildInfo)); | |
1278 | + map.put("isCurrentHospBuild", isCurrentHosp); | |
1354 | 1279 | |
1355 | 1280 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
1356 | 1281 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
1357 | 1282 | |
... | ... | @@ -1489,14 +1414,13 @@ |
1489 | 1414 | * @param request |
1490 | 1415 | * @return |
1491 | 1416 | */ |
1492 | - public BaseListResponse queryBabyList(BabyManageRequest request,Integer userId) { | |
1417 | + public BaseListResponse queryBabyList(BabyManageRequest request, Integer userId) { | |
1493 | 1418 | |
1494 | 1419 | String hospitalId = ""; |
1495 | 1420 | |
1496 | 1421 | |
1497 | 1422 | //得到当前登录的医院id |
1498 | - if (userId != null) | |
1499 | - { | |
1423 | + if (userId != null) { | |
1500 | 1424 | Users dbuser = usersService.getUsers(userId); |
1501 | 1425 | if (dbuser != null) { |
1502 | 1426 | hospitalId = String.valueOf(dbuser.getOrgId()); |
... | ... | @@ -1541,8 +1465,7 @@ |
1541 | 1465 | // } |
1542 | 1466 | // } |
1543 | 1467 | // } |
1544 | - if (StringUtils.isNotEmpty(model.getPid())) | |
1545 | - { | |
1468 | + if (StringUtils.isNotEmpty(model.getPid())) { | |
1546 | 1469 | List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid()); |
1547 | 1470 | if (CollectionUtils.isNotEmpty(diagList)) { |
1548 | 1471 | for (Object obj : diagList) { |
... | ... | @@ -1587,7 +1510,7 @@ |
1587 | 1510 | |
1588 | 1511 | Date currentDate = DateUtil.formatDate(new Date()); |
1589 | 1512 | Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); |
1590 | - Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1),1); | |
1513 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
1591 | 1514 | babyQuery.setBirthStart(end); |
1592 | 1515 | babyQuery.setBirthEnd(start); |
1593 | 1516 | } |
1594 | 1517 | |
1595 | 1518 | |
... | ... | @@ -1613,19 +1536,17 @@ |
1613 | 1536 | babyQuery.setLastDiagnose(request.getDiagnose()); |
1614 | 1537 | |
1615 | 1538 | //预约时间 |
1616 | - if (StringUtils.isNotEmpty(request.getNextDate())) | |
1617 | - { | |
1539 | + if (StringUtils.isNotEmpty(request.getNextDate())) { | |
1618 | 1540 | String nextDateStr = request.getNextDate(); |
1619 | 1541 | String[] dates = nextDateStr.split(" - "); |
1620 | 1542 | |
1621 | 1543 | babyQuery.setNextDateStart(DateUtil.parseYMD(dates[0])); |
1622 | - if(dates.length==2){ | |
1544 | + if (dates.length == 2) { | |
1623 | 1545 | babyQuery.setNextDateEnd(DateUtil.parseYMD(dates[1])); |
1624 | 1546 | } |
1625 | 1547 | } |
1626 | 1548 | |
1627 | - if (StringUtils.isNotEmpty(request.getBirth())) | |
1628 | - { | |
1549 | + if (StringUtils.isNotEmpty(request.getBirth())) { | |
1629 | 1550 | String birthStr = request.getBirth(); |
1630 | 1551 | String[] dates = birthStr.split(" - "); |
1631 | 1552 | babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); |
... | ... | @@ -1638,8 +1559,7 @@ |
1638 | 1559 | } |
1639 | 1560 | |
1640 | 1561 | if (request.getServiceStatus() != null) { |
1641 | - if (!(request.getServiceStatus() == ServiceStatusEnums.STANDARD_ALL.getId() || request.getServiceStatus() == ServiceStatusEnums.ADD_ALL.getId())) | |
1642 | - { | |
1562 | + if (!(request.getServiceStatus() == ServiceStatusEnums.STANDARD_ALL.getId() || request.getServiceStatus() == ServiceStatusEnums.ADD_ALL.getId())) { | |
1643 | 1563 | babyQuery.setServiceStatus(request.getServiceStatus()); |
1644 | 1564 | } |
1645 | 1565 | } |
1646 | 1566 | |
1647 | 1567 | |
1648 | 1568 | |
... | ... | @@ -1668,24 +1588,22 @@ |
1668 | 1588 | * @param request |
1669 | 1589 | * @return |
1670 | 1590 | */ |
1671 | - public BaseResponse sendBabyGuideSms(BabyGuideSmsequest request,Integer userId) { | |
1591 | + public BaseResponse sendBabyGuideSms(BabyGuideSmsequest request, Integer userId) { | |
1672 | 1592 | String hospitalId = ""; |
1673 | 1593 | |
1674 | 1594 | |
1675 | 1595 | //得到当前登录的医院id |
1676 | - if (userId != null) | |
1677 | - { | |
1596 | + if (userId != null) { | |
1678 | 1597 | Users dbuser = usersService.getUsers(userId); |
1679 | 1598 | if (dbuser != null) { |
1680 | - hospitalId = String.valueOf(dbuser.getOrgId()); | |
1599 | + hospitalId = String.valueOf(dbuser.getOrgId()); | |
1681 | 1600 | } |
1682 | 1601 | } |
1683 | 1602 | |
1684 | 1603 | //判断医院是否启动和对应的服务项是否启用 |
1685 | - SmsConfigModel configModel = new SmsConfigModel(); | |
1686 | - BaseResponse response = smsConfigFacade.hospitalIsStart(hospitalId,configModel,SmsServiceEnums.YSGXHZD.getId()); | |
1687 | - if (response != null) | |
1688 | - { | |
1604 | + SmsConfigModel configModel = new SmsConfigModel(); | |
1605 | + BaseResponse response = smsConfigFacade.hospitalIsStart(hospitalId, configModel, SmsServiceEnums.YSGXHZD.getId()); | |
1606 | + if (response != null) { | |
1689 | 1607 | return response; |
1690 | 1608 | } |
1691 | 1609 | |
1692 | 1610 | |
... | ... | @@ -1718,9 +1636,9 @@ |
1718 | 1636 | for (BabyModel model : sendModels) { |
1719 | 1637 | if (model != null && StringUtils.isNotEmpty(model.getMphone())) { |
1720 | 1638 | //短信前缀 |
1721 | - String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, model.getBuildDoctor()); | |
1639 | + String messagePrefix = smsConfigFacade.getSmsPrefix(configModel, model.getBuildDoctor()); | |
1722 | 1640 | MessageRequest mr = new MessageRequest(); |
1723 | - mr.setContent("【"+messagePrefix+"】"+request.getSmsContent()); | |
1641 | + mr.setContent("【" + messagePrefix + "】" + request.getSmsContent()); | |
1724 | 1642 | mr.setObjType(ServiceObjEnums.BABYOBJ.getId()); |
1725 | 1643 | mr.setPhone(model.getMphone()); |
1726 | 1644 | //短信商 |
1727 | 1645 | |
1728 | 1646 | |
1729 | 1647 | |
1730 | 1648 | |
1731 | 1649 | |
1732 | 1650 | |
... | ... | @@ -1753,35 +1671,31 @@ |
1753 | 1671 | |
1754 | 1672 | /** |
1755 | 1673 | * 通过身份证号码查询孕妇的基本信息 |
1674 | + * | |
1756 | 1675 | * @param cardNo |
1757 | 1676 | * @return |
1758 | 1677 | */ |
1759 | - public BaseResponse queryYunBaseInfo(String cardNo,String pid) { | |
1678 | + public BaseResponse queryYunBaseInfo(String cardNo, String pid) { | |
1760 | 1679 | |
1761 | 1680 | BabyBuildResult result = null; |
1762 | 1681 | |
1763 | - if (StringUtils.isNotEmpty(pid)) | |
1764 | - { | |
1682 | + if (StringUtils.isNotEmpty(pid)) { | |
1765 | 1683 | BabyModelQuery babyQuery = new BabyModelQuery(); |
1766 | 1684 | babyQuery.setYn(YnEnums.YES.getId()); |
1767 | 1685 | babyQuery.setPid(pid); |
1768 | 1686 | //获取最近一次其他医院的建档记录 |
1769 | 1687 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
1770 | - if (CollectionUtils.isNotEmpty(models)) | |
1771 | - { | |
1688 | + if (CollectionUtils.isNotEmpty(models)) { | |
1772 | 1689 | BabyModel babyModel = models.get(0); |
1773 | - if (babyModel != null) | |
1774 | - { | |
1690 | + if (babyModel != null) { | |
1775 | 1691 | result = getBabyBuildResult(babyModel); |
1776 | 1692 | } |
1777 | 1693 | } |
1778 | - } | |
1779 | - else | |
1780 | - { | |
1694 | + } else { | |
1781 | 1695 | PatientsQuery patientsQuery = new PatientsQuery(); |
1782 | 1696 | patientsQuery.setYn(YnEnums.YES.getId()); |
1783 | 1697 | |
1784 | - if (StringUtils.isNotEmpty(cardNo)); | |
1698 | + if (StringUtils.isNotEmpty(cardNo)) ; | |
1785 | 1699 | { |
1786 | 1700 | |
1787 | 1701 | |
... | ... | @@ -1790,8 +1704,7 @@ |
1790 | 1704 | babyQuery.setMcertNo(cardNo); |
1791 | 1705 | //获取最近一次的建档记录 |
1792 | 1706 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
1793 | - if (CollectionUtils.isNotEmpty(models)) | |
1794 | - { | |
1707 | + if (CollectionUtils.isNotEmpty(models)) { | |
1795 | 1708 | BabyModel babyModel = models.get(0); |
1796 | 1709 | |
1797 | 1710 | result = new BabyBuildResult(); |
1798 | 1711 | |
1799 | 1712 | |
... | ... | @@ -1812,16 +1725,12 @@ |
1812 | 1725 | |
1813 | 1726 | |
1814 | 1727 | result.setFatherProfessionTypeId(babyModel.getFproTypeId()); |
1815 | - } | |
1816 | - else | |
1817 | - { | |
1728 | + } else { | |
1818 | 1729 | patientsQuery.setCardNo(cardNo); |
1819 | - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
1820 | - if (CollectionUtils.isNotEmpty(patients)) | |
1821 | - { | |
1730 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
1731 | + if (CollectionUtils.isNotEmpty(patients)) { | |
1822 | 1732 | Patients patient = patients.get(0); |
1823 | - if (patients != null) | |
1824 | - { | |
1733 | + if (patients != null) { | |
1825 | 1734 | |
1826 | 1735 | result = new BabyBuildResult(); |
1827 | 1736 | result.setMommyName(patient.getUsername()); |
1828 | 1737 | |
1829 | 1738 | |
1830 | 1739 | |
... | ... | @@ -1857,27 +1766,26 @@ |
1857 | 1766 | try { |
1858 | 1767 | String hospitalId = ""; |
1859 | 1768 | //得到当前登录的医院id |
1860 | - if (userId != null) | |
1861 | - { | |
1769 | + if (userId != null) { | |
1862 | 1770 | Users dbuser = usersService.getUsers(userId); |
1863 | 1771 | if (dbuser != null) { |
1864 | 1772 | hospitalId = String.valueOf(dbuser.getOrgId()); |
1865 | 1773 | } |
1866 | 1774 | } |
1867 | - List<Map<String,Object>> datas = new ArrayList<>(); | |
1775 | + List<Map<String, Object>> datas = new ArrayList<>(); | |
1868 | 1776 | BabyModelQuery babyQuery = new BabyModelQuery(); |
1869 | 1777 | babyQuery.setHospitalId(String.valueOf(hospitalId)); |
1870 | 1778 | List<BabyModel> models = getBabayListByCondition(request, false, babyQuery); |
1871 | 1779 | if (CollectionUtils.isNotEmpty(models)) { |
1872 | 1780 | for (BabyModel model : models) { |
1873 | - Map<String,Object> data = new HashMap<>(); | |
1781 | + Map<String, Object> data = new HashMap<>(); | |
1874 | 1782 | if (model.getHighRisk() == null || model.getHighRisk() == 0) { |
1875 | 1783 | data.put("highRisk", "健康"); |
1876 | 1784 | } else { |
1877 | 1785 | data.put("highRisk", "高危"); |
1878 | 1786 | } |
1879 | - data.put("sex",StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); | |
1880 | - data.put("babyName",StringUtils.emptyDeal(model.getName())); | |
1787 | + data.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); | |
1788 | + data.put("babyName", StringUtils.emptyDeal(model.getName())); | |
1881 | 1789 | data.put("birthday", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth()))); |
1882 | 1790 | data.put("mommyName", StringUtils.emptyDeal(model.getMname())); |
1883 | 1791 | data.put("mommnyPhone", StringUtils.emptyDeal(model.getMphone())); |
... | ... | @@ -1886,8 +1794,7 @@ |
1886 | 1794 | data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date()))); |
1887 | 1795 | |
1888 | 1796 | String diagnose = ""; |
1889 | - if (StringUtils.isNotEmpty(model.getPid())) | |
1890 | - { | |
1797 | + if (StringUtils.isNotEmpty(model.getPid())) { | |
1891 | 1798 | List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid()); |
1892 | 1799 | if (CollectionUtils.isNotEmpty(diagList)) { |
1893 | 1800 | for (Object obj : diagList) { |
1894 | 1801 | |
1895 | 1802 | |
1896 | 1803 | |
... | ... | @@ -1899,25 +1806,25 @@ |
1899 | 1806 | } |
1900 | 1807 | } |
1901 | 1808 | data.put("diagnose", diagnose); |
1902 | - datas.add(data); | |
1809 | + datas.add(data); | |
1903 | 1810 | } |
1904 | 1811 | } |
1905 | 1812 | OutputStream out = httpServletResponse.getOutputStream(); |
1906 | - Map<String,String> cnames = new LinkedHashMap<>(); | |
1907 | - cnames.put("sex","性别"); | |
1908 | - cnames.put("babyName","儿童姓名"); | |
1813 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
1814 | + cnames.put("sex", "性别"); | |
1815 | + cnames.put("babyName", "儿童姓名"); | |
1909 | 1816 | cnames.put("birthday", "儿童生日"); |
1910 | 1817 | cnames.put("mommyName", "母亲姓名"); |
1911 | 1818 | cnames.put("mommnyPhone", "联系方式"); |
1912 | 1819 | cnames.put("serviceStatus", "服务状态"); |
1913 | - cnames.put("nextDate","下次预约时间"); | |
1914 | - cnames.put("monthAge","月龄"); | |
1915 | - cnames.put("diagnose","高危诊断"); | |
1820 | + cnames.put("nextDate", "下次预约时间"); | |
1821 | + cnames.put("monthAge", "月龄"); | |
1822 | + cnames.put("diagnose", "高危诊断"); | |
1916 | 1823 | cnames.put("highRisk", "是否健康"); |
1917 | 1824 | httpServletResponse.setContentType("application/octet-stream"); |
1918 | 1825 | httpServletResponse.setCharacterEncoding("UTF-8"); |
1919 | - httpServletResponse.setHeader("Content-Disposition", "attachment;fileName="+"childDatas.xls"); | |
1920 | - ExcelUtil.toExcel(out,datas,cnames); | |
1826 | + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "childDatas.xls"); | |
1827 | + ExcelUtil.toExcel(out, datas, cnames); | |
1921 | 1828 | } catch (IOException e) { |
1922 | 1829 | e.printStackTrace(); |
1923 | 1830 | } |