Commit 421772bf4682fe2605eeb335533e25b4639bf4bf
1 parent
e3669ff507
Exists in
master
and in
8 other branches
add statistics(map) common index
Showing 1 changed file with 10 additions and 0 deletions
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java
View file @
421772b
... | ... | @@ -471,6 +471,7 @@ |
471 | 471 | patients.setPhone(map.get("P_MOBILEPHONE").toString()); |
472 | 472 | patients.setBirth(map.get("P_BIRTHDAY") == null ? null : (Date) map.get("P_BIRTHDAY")); |
473 | 473 | patients.setLastMenses(map.get("P_LASTMENSTRUALPERIOD") == null ? null : (Date) map.get("P_LASTMENSTRUALPERIOD")); |
474 | + patients.setDueDate(buildDueDate(patients.getLastMenses())); | |
474 | 475 | |
475 | 476 | patients.setAddress(map.get("P_ADDRESSSTREET") == null ? null : map.get("P_ADDRESSSTREET").toString()); |
476 | 477 | patients.setProvinceId(map.get("P_ADDRESSPROVINCE") == null ? null : map.get("P_ADDRESSPROVINCE").toString()); |
... | ... | @@ -512,6 +513,15 @@ |
512 | 513 | e.printStackTrace(); |
513 | 514 | LogUtil.taskError(e.getMessage(), e); |
514 | 515 | } |
516 | + } | |
517 | + | |
518 | + private Date buildDueDate(Date lastMenses) { | |
519 | + if (lastMenses == null) { | |
520 | + return null; | |
521 | + } | |
522 | + DateTime dt = new DateTime(lastMenses); | |
523 | + dt = dt.plusMonths(9).plusDays(7); | |
524 | + return dt.toDate(); | |
515 | 525 | } |
516 | 526 | |
517 | 527 | private Map<String, List<SimpleCommunity>> convertToMap(List<CommunityConfig> configs) { |