Commit 06848e148cf085d020ee486d530846fcddad99bc

Authored by liquanyu
1 parent 5db8c64c27

高危检查列表

Showing 1 changed file with 44 additions and 23 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ 06848e1
... ... @@ -592,28 +592,25 @@
592 592 }
593 593 }
594 594  
595   - Map<String,List<AntExRecordModel>> map = new HashMap<>();
596   -
597 595 antExRecordQuery.setHospitalId(hospitalId);
598 596 List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC,"created");
599   - if (CollectionUtils.isNotEmpty(antExRecordModelList))
600   - {
601   - for (AntExRecordModel recordModel : antExRecordModelList)
602   - {
603   - List<AntExRecordModel> list = map.get(recordModel.getParentId());
604   - if (!CollectionUtils.isNotEmpty(list))
605   - {
606   - list = new ArrayList<>();
607   - }
608   - list.add(recordModel);
609   - map.put(recordModel.getParentId(),list);
610   - }
611   - }
  597 + Map<String,List<AntExRecordModel>> map = handleAntexRecord(antExRecordModelList);
  598 + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery();
612 599  
613   - List<String> riskListIds = new ArrayList<>();
  600 + //查询产检新增的高危分页记录
  601 + List<AntExRecordModel> pageAntExRecords = getIncrRiskAntexRecard(map,pageAntExRecordsQuery, antExManagerQueryRequest.getPage(),antExManagerQueryRequest.getLimit());
614 602  
615   - Map<String,List<String>> incriskMap = new HashMap<>();
  603 + //查询产检详情
  604 + List<AntExManagerResult> data = getAntExRecords(pageAntExRecords, hospitalId, false, antExManagerQueryRequest.getShowDetail());
616 605  
  606 + return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(pageAntExRecordsQuery.getPageInfo());
  607 + }
  608 +
  609 +
  610 + private List<AntExRecordModel> getIncrRiskAntexRecard(Map<String,List<AntExRecordModel>> map,AntExRecordQuery pageAntExRecordsQuery,Integer page,Integer limit)
  611 + {
  612 + List<String> riskListIds = new ArrayList<>();
  613 + Map<String,List<String>> incriskMap = new HashMap<>();
617 614 AntExRecordQuery beforeRecordQuery = new AntExRecordQuery();
618 615  
619 616 if (map.size() > 0)
620 617  
... ... @@ -708,11 +705,9 @@
708 705 }
709 706 }
710 707 }
711   -
712   - AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery();
713 708 pageAntExRecordsQuery.setNeed("true");
714   - pageAntExRecordsQuery.setPage(antExManagerQueryRequest.getPage());
715   - pageAntExRecordsQuery.setLimit(antExManagerQueryRequest.getLimit());
  709 + pageAntExRecordsQuery.setPage(page);
  710 + pageAntExRecordsQuery.setLimit(limit);
716 711 pageAntExRecordsQuery.setIds(riskListIds);
717 712 List<AntExRecordModel> pageAntExRecords = recordService.queryAntExRecords(pageAntExRecordsQuery);
718 713 if (CollectionUtils.isNotEmpty(pageAntExRecords))
719 714  
... ... @@ -723,9 +718,35 @@
723 718 }
724 719 }
725 720  
726   - List<AntExManagerResult> data = getAntExRecords(pageAntExRecords, hospitalId, false, antExManagerQueryRequest.getShowDetail());
  721 + return pageAntExRecords;
  722 + }
727 723  
728   - return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(pageAntExRecordsQuery.getPageInfo());
  724 +
  725 + /**
  726 + * 把同一个人的产检记录放入集合
  727 + * @param antExRecordModelList
  728 + * @return
  729 + */
  730 + private Map<String,List<AntExRecordModel>> handleAntexRecord(List<AntExRecordModel> antExRecordModelList)
  731 + {
  732 + Map<String,List<AntExRecordModel>> map = new HashMap<>();
  733 + if (CollectionUtils.isNotEmpty(antExRecordModelList))
  734 + {
  735 + for (AntExRecordModel recordModel : antExRecordModelList)
  736 + {
  737 + List<AntExRecordModel> list = map.get(recordModel.getParentId());
  738 + if (CollectionUtils.isEmpty(list))
  739 + {
  740 + list = new ArrayList<>();
  741 + }
  742 + if (list.size() < 2)
  743 + {
  744 + list.add(recordModel);
  745 + map.put(recordModel.getParentId(),list);
  746 + }
  747 + }
  748 + }
  749 + return map;
729 750 }
730 751 }