Commit cffa6d524ea93a5976e1472c71ec60bc3a5ff490

Authored by [wangbo]
1 parent a7618f2203

修改复诊随访本bug

Showing 2 changed files with 16 additions and 23 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ cffa6d5
... ... @@ -201,7 +201,7 @@
201 201 @RequestMapping(value = "/printExFuData", method = RequestMethod.GET)
202 202 @ResponseBody
203 203 @TokenRequired
204   - public BaseResponse printExFuData(@RequestParam("id") String id, HttpServletRequest request, Integer state, String gravida) {
  204 + public BaseResponse printE0xFuData(@RequestParam("id") String id, HttpServletRequest request, Integer state, String gravida) {
205 205 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
206 206 if (loginState == null) {
207 207 System.out.println("用户未登录!");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ cffa6d5
... ... @@ -528,18 +528,18 @@
528 528 String riskName = null;
529 529 boolean flag = false;
530 530 List<String> parentIdList = new ArrayList<>();
531   - if ("0".equals(gravida)) {//表示全部孕妇处打印
  531 + if (null == antenatalExaminationModel) {//表示全部孕妇处打印
532 532 patients = patientsService.findOnePatientById(id);
533 533 if (patients != null) {
534   - Calendar instance = Calendar.getInstance();
  534 + /* Calendar instance = Calendar.getInstance();
535 535 instance.setTime(new Date());
536 536 instance.add(Calendar.DATE, -294);//只差未分娩的孕妇
537 537 instance.set(Calendar.HOUR_OF_DAY, 00);
538 538 instance.set(Calendar.MINUTE, 00);
539 539 instance.set(Calendar.SECOND, 00);
540 540 instance.set(Calendar.MILLISECOND, 000);
541   - Date start = instance.getTime();
542   - List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid()).and("lastMenses").gte(start)), Patients.class);
  541 + Date start = instance.getTime();*/
  542 + List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid()).and("lastMenses").is(patients.getLastMenses())), Patients.class);
543 543 if (CollectionUtils.isNotEmpty(patientsList)) {
544 544 for (Patients patients1 : patientsList) {
545 545 parentIdList.add(patients1.getId());
546 546  
547 547  
... ... @@ -549,9 +549,19 @@
549 549 AntenatalExaminationModel antenatalExaminationModels = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patients.getPid())), AntenatalExaminationModel.class);
550 550 riskName = getRisk(antenatalExaminationModels.getRiskFactor(), antenatalExaminationModels.getOtherRisk());
551 551 }
552   - } else {
  552 + } else if (null != antenatalExaminationModel && state != 0) { //产检处打印全部的
553 553 patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId());
  554 + List<Patients> patientsList = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid()).and("lastMenses").is(patients.getLastMenses())), Patients.class);
  555 + if (CollectionUtils.isNotEmpty(patientsList)) {
  556 + for (Patients patients1 : patientsList) {
  557 + parentIdList.add(patients1.getId());
  558 + }
  559 + flag = true;
  560 + }
554 561 riskName = getRisk(antenatalExaminationModel.getRiskFactor(), antenatalExaminationModel.getOtherRisk());
  562 + } else {//产检检查打印2-5次的
  563 + patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId());
  564 + riskName = getRisk(antenatalExaminationModel.getRiskFactor(), antenatalExaminationModel.getOtherRisk());
555 565 }
556 566 String name = patients.getUsername();
557 567  
558 568  
... ... @@ -591,13 +601,7 @@
591 601 } else {
592 602 return mList;
593 603 }
594   - /*exData[0] = list.get(0);
595   - exData[1] = list.get(1);
596   - exData[2] = list.get(2);
597   - exData[3] = list.get(3);*/
598 604 }
599   -
600   - // Map<String, Object> map = new HashMap<>();
601 605 for (int i = 0; i < exData.length; i++) {
602 606 Map<String, Object> map = new HashedMap();
603 607 map.put("name", name);
... ... @@ -605,17 +609,6 @@
605 609 if (data == null) {
606 610 continue;
607 611 }
608   - /*String numStr = "";
609   - if (i == 0) {
610   - numStr = "one";
611   - } else if (i == 1) {
612   - numStr = "two";
613   - } else if (i == 2) {
614   - numStr = "thre";
615   - } else if (i == 3) {
616   - numStr = "four";
617   - }*/
618   -
619 612 if (data.getCheckDate() != null) {
620 613 map.put("checkDate", DateUtil.getyyyy_MM_dd(data.getCheckDate()));
621 614 }