Commit 1afb35c0481c109bb849463ec52d6facff73eefb

Authored by yangfei

Merge remote-tracking branch 'origin/master'

Showing 4 changed files

platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java View file @ 1afb35c
... ... @@ -21,6 +21,8 @@
21 21 private String barCode;
22 22 private String pid;
23 23 private String parentId;
  24 + //末次月经
  25 + private Date lastMenses;
24 26 /* //名字
25 27 private String name;
26 28 //年龄
... ... @@ -445,6 +447,13 @@
445 447 return tireData;
446 448 }
447 449  
  450 + public Date getLastMenses() {
  451 + return lastMenses;
  452 + }
  453 +
  454 + public void setLastMenses(Date lastMenses) {
  455 + this.lastMenses = lastMenses;
  456 + }
448 457  
449 458 public void setTireData(List tireData) {
450 459 this.tireData = tireData;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 1afb35c
... ... @@ -63,9 +63,6 @@
63 63  
64 64  
65 65 @Autowired
66   - private AntenatalExaminationService antenatalExaminationService;
67   -
68   - @Autowired
69 66 private AutoMatchFacade autoMatchFacade;
70 67  
71 68 @Autowired
... ... @@ -81,6 +78,9 @@
81 78 private AntenatalExaminationFacade antenatalExaminationFacade;
82 79  
83 80 @Autowired
  81 + private AntenatalExaminationService antenatalExaminationService;
  82 +
  83 + @Autowired
84 84 private SmsConfigFacade smsConfigFacade;
85 85  
86 86 @Autowired
87 87  
88 88  
... ... @@ -746,13 +746,33 @@
746 746 patient.setOperator(userId);
747 747  
748 748 yunBookbuildingService.updatePregnant(patient, id);
  749 +
749 750 //如果当前是建档医院,那么需要修改其他非建档医院的数据
750 751 if (autoMatchFacade.checkBStatus(userId)) {
751 752 patientsService.updateBaseData(patient);
752 753 }
  754 + Patients patients = patientsService.findOnePatientById(id);
  755 + updateAntExLastMenses(patients.getLastMenses(), patients.getPid(), patients.getBookbuildingDate());
753 756 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
754 757 }
755 758  
  759 + /**
  760 + * 修改初诊 复诊的末次月经字段
  761 + * @param lastMenses
  762 + */
  763 + private void updateAntExLastMenses(Date lastMenses,String pid,Date bookBuildDate){
  764 + AntExQuery antExQuery=new AntExQuery();
  765 + antExQuery.setStart(bookBuildDate);
  766 + antExQuery.setPid(pid);
  767 + antExQuery.setYn(YnEnums.YES.getId());
  768 + List<AntenatalExaminationModel> antexList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  769 + if(CollectionUtils.isNotEmpty(antexList)){
  770 + for(AntenatalExaminationModel antex:antexList){
  771 + antex.setLastMenses(lastMenses);
  772 + antenatalExaminationService.updateOneAnt(antex,antex.getId());
  773 + }
  774 + }
  775 + }
756 776 /**
757 777 * 查询孕妇建档记录
758 778 *
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java View file @ 1afb35c
... ... @@ -55,7 +55,7 @@
55 55  
56 56 if(StringUtils.isNotEmpty(key)) {
57 57 Criteria criteria = new Criteria();
58   - criteria.orOperator(Criteria.where("username").is(key), Criteria.where("vcCardNo").is(key), Criteria.where("phone").is(key));
  58 + criteria.orOperator(Criteria.where("username").regex(key), Criteria.where("cardNo").is(key), Criteria.where("phone").is(key));
59 59 List<Patients> patients = mongoUtil.findField(Patients.class, criteria, "id");
60 60 if(CollectionUtils.isEmpty(patients)) {
61 61 return RespBuilder.buildSuccess(new PageResult(0, page, limit, null));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 1afb35c
... ... @@ -1217,16 +1217,36 @@
1217 1217 }
1218 1218 }
1219 1219 System.out.println("===========");
1220   - for (Map.Entry<String, List<Map<String, Object>>> map : userCheckInfo.entrySet()) {
1221   - System.out.println(map.getKey() + " : " + map.getValue());
1222   - }
1223   -
1224 1220 Map<Integer, Integer> countMap = new HashMap<>();
1225 1221 for (int i = 1; i < 14; i++) {
1226 1222 countMap.put(i, 0);
1227 1223 }
1228   - for (Map<String,Object> map : datas) {
1229   -
  1224 + Set<Map.Entry<String, List<Map<String, Object>>>> entries = userCheckInfo.entrySet();
  1225 + for (Map.Entry<String, List<Map<String, Object>>> entry : entries) {
  1226 + List<Map<String, Object>> value = entry.getValue();
  1227 + if(value.size() == 1) {
  1228 + countMap.put(1, countMap.get(1) + 1);
  1229 + } else {
  1230 + /** 按照分娩时间分组 */
  1231 + /** key=pid value=count */
  1232 + Map<Date, Integer> tempMap = new HashMap<>();
  1233 + Integer other = 0;
  1234 + Date otherDate = new Date();
  1235 + for (Map<String, Object> map : value) {
  1236 + Date fmDate = (Date) map.get("fmDate");
  1237 + if(fmDate == null) {
  1238 + ++other;
  1239 + continue;
  1240 + }
  1241 + if(tempMap.containsKey(fmDate)) {
  1242 + tempMap.put(fmDate, tempMap.get(fmDate) + 1);
  1243 + } else {
  1244 + tempMap.put(fmDate, 1);
  1245 + }
  1246 + }
  1247 + tempMap.put(otherDate, other);
  1248 + System.out.println(">>> " + tempMap);
  1249 + }
1230 1250 }
1231 1251  
1232 1252 List<Map<String,Object>> restList = new ArrayList<>();