Commit 00a1ac669d5d57c677a626240dd5d260bcf145f1
1 parent
99e3609693
Exists in
master
and in
6 other branches
产检节点统计
Showing 2 changed files with 40 additions and 8 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
00a1ac6
| ... | ... | @@ -278,7 +278,7 @@ |
| 278 | 278 | } else { |
| 279 | 279 | antExRecordModel.setStatus(1); |
| 280 | 280 | } |
| 281 | - antExRecordModel.setcDay(DateUtil.daysBetween(patients.getLastMenses(),antExChuModel.getCheckTime())); | |
| 281 | + antExRecordModel.setcDay(DateUtil.daysBetween(patients.getLastMenses(), antExChuModel.getCheckTime())); | |
| 282 | 282 | |
| 283 | 283 | //户籍地和居住地2个是相反的 |
| 284 | 284 | antExRecordModel.setAddressRegister(patients.getAddress()); |
| 285 | 285 | |
| ... | ... | @@ -325,12 +325,23 @@ |
| 325 | 325 | * @return |
| 326 | 326 | */ |
| 327 | 327 | public List<AntExRecordModel> queryAntExRecords(AntExRecordQuery antExRecordQuery) { |
| 328 | +// MongoQuery query = antExRecordQuery.convertToQuery(); | |
| 329 | +// if (StringUtils.isNotEmpty(antExRecordQuery.getNeed())) { | |
| 330 | +// antExRecordQuery.mysqlBuild(antExRecordDao.count(query)); | |
| 331 | +// query.start(antExRecordQuery.getOffset()).end(antExRecordQuery.getLimit()); | |
| 332 | +// } | |
| 333 | +// return antExRecordDao.queryRecord(query.addOrder(Sort.Direction.DESC, "checkTime")); | |
| 334 | + | |
| 335 | + return queryAntExRecords(antExRecordQuery,Sort.Direction.DESC,"checkTime"); | |
| 336 | + } | |
| 337 | + | |
| 338 | + public List<AntExRecordModel> queryAntExRecords(AntExRecordQuery antExRecordQuery,Sort.Direction direction,String sortField) { | |
| 328 | 339 | MongoQuery query = antExRecordQuery.convertToQuery(); |
| 329 | 340 | if (StringUtils.isNotEmpty(antExRecordQuery.getNeed())) { |
| 330 | 341 | antExRecordQuery.mysqlBuild(antExRecordDao.count(query)); |
| 331 | 342 | query.start(antExRecordQuery.getOffset()).end(antExRecordQuery.getLimit()); |
| 332 | 343 | } |
| 333 | - return antExRecordDao.queryRecord(query.addOrder(Sort.Direction.DESC, "checkTime")); | |
| 344 | + return antExRecordDao.queryRecord(query.addOrder(direction, sortField)); | |
| 334 | 345 | } |
| 335 | 346 | |
| 336 | 347 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
00a1ac6
| ... | ... | @@ -27,6 +27,7 @@ |
| 27 | 27 | import org.apache.commons.collections.CollectionUtils; |
| 28 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 29 | 29 | import org.springframework.beans.factory.annotation.Qualifier; |
| 30 | +import org.springframework.data.domain.Sort; | |
| 30 | 31 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| 31 | 32 | import org.springframework.stereotype.Component; |
| 32 | 33 | |
| 33 | 34 | |
| 34 | 35 | |
| 35 | 36 | |
| ... | ... | @@ -579,22 +580,22 @@ |
| 579 | 580 | } |
| 580 | 581 | else if (nodeName == 1) |
| 581 | 582 | { |
| 582 | - antExRecordQuery.setcDueWeekStart(16); | |
| 583 | + antExRecordQuery.setcDueWeekStart(16*7); | |
| 583 | 584 | antExRecordQuery.setcDueWeekEnd((20 + 1) * 7 - 1); |
| 584 | 585 | } |
| 585 | 586 | else if (nodeName == 2) |
| 586 | 587 | { |
| 587 | - antExRecordQuery.setcDueWeekStart(21); | |
| 588 | + antExRecordQuery.setcDueWeekStart(21*7); | |
| 588 | 589 | antExRecordQuery.setcDueWeekEnd((24 + 1) * 7 - 1); |
| 589 | 590 | } |
| 590 | 591 | else if (nodeName == 3) |
| 591 | 592 | { |
| 592 | - antExRecordQuery.setcDueWeekStart(28); | |
| 593 | + antExRecordQuery.setcDueWeekStart(28*7); | |
| 593 | 594 | antExRecordQuery.setcDueWeekEnd((36 + 1) * 7 - 1); |
| 594 | 595 | } |
| 595 | 596 | else if (nodeName == 4) |
| 596 | 597 | { |
| 597 | - antExRecordQuery.setcDueWeekStart(37); | |
| 598 | + antExRecordQuery.setcDueWeekStart(37*7); | |
| 598 | 599 | antExRecordQuery.setcDueWeekEnd((40 + 1) * 7 - 1); |
| 599 | 600 | } |
| 600 | 601 | } |
| 601 | 602 | |
| ... | ... | @@ -609,9 +610,29 @@ |
| 609 | 610 | { |
| 610 | 611 | Map<String,Object> map = new HashMap<>(); |
| 611 | 612 | map.put("EXAMINE_DATE", DateUtil.getyyyy_MM_dd(model.getCheckTime())); //产检日期 |
| 612 | - map.put("NAME",model.getName()); //姓名 | |
| 613 | + map.put("NAME", model.getName()); //姓名 | |
| 613 | 614 | map.put("YZ_NAME", StringUtils.dueWeek(model.getcDay())); //产检孕周 |
| 614 | - map.put("EXAMINE_HISTORY_NUM",""); //产检第次 | |
| 615 | + | |
| 616 | + AntExRecordQuery query = new AntExRecordQuery(); | |
| 617 | + query.setParentId(model.getParentId()); | |
| 618 | + | |
| 619 | + String times = ""; | |
| 620 | + List<AntExRecordModel> antExRecordModels = recordService.queryAntExRecords(antExRecordQuery,Sort.Direction.ASC,"checkTime"); | |
| 621 | + if (CollectionUtils.isNotEmpty(antExRecordModels)) | |
| 622 | + { | |
| 623 | + for (int j = 0 ; j < list.size() ; j++) | |
| 624 | + { | |
| 625 | + AntExRecordModel antExRecordModel = list.get(j); | |
| 626 | + | |
| 627 | + if (model.getId().equals(antExRecordModel.getId())) | |
| 628 | + { | |
| 629 | + times = String.valueOf(j); | |
| 630 | + break; | |
| 631 | + } | |
| 632 | + } | |
| 633 | + } | |
| 634 | + | |
| 635 | + map.put("EXAMINE_HISTORY_NUM",times); //产检第次 | |
| 615 | 636 | |
| 616 | 637 | |
| 617 | 638 | String chospital = ""; |