Commit ed4368427760be3940499f38c2375f5e1322e388
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
ed43684
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
ed43684
| ... | ... | @@ -28,10 +28,7 @@ |
| 28 | 28 | import org.springframework.stereotype.Component; |
| 29 | 29 | |
| 30 | 30 | import javax.annotation.PostConstruct; |
| 31 | -import java.util.ArrayList; | |
| 32 | -import java.util.HashMap; | |
| 33 | -import java.util.List; | |
| 34 | -import java.util.Map; | |
| 31 | +import java.util.*; | |
| 35 | 32 | |
| 36 | 33 | |
| 37 | 34 | /** |
| ... | ... | @@ -72,6 +69,7 @@ |
| 72 | 69 | private void init() { |
| 73 | 70 | trackDownTypeHandlerMap = new HashMap<>(); |
| 74 | 71 | trackDownTypeHandlerMap.put(TrackDownDateEnums.A.getId(), new FQTrackDownTypeHandler()); |
| 72 | + trackDownTypeHandlerMap.put(TrackDownDateEnums.B.getId(), new FQTrackDownTypeHandler()); | |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | /** |
| ... | ... | @@ -80,7 +78,7 @@ |
| 80 | 78 | * @param downQueryRequest |
| 81 | 79 | * @return |
| 82 | 80 | */ |
| 83 | - private TrackDownRecordQuery convertNaviteQuery(TrackDownQueryRequest downQueryRequest,Integer userId) { | |
| 81 | + private TrackDownRecordQuery convertNaviteQuery(TrackDownQueryRequest downQueryRequest, Integer userId) { | |
| 84 | 82 | TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); |
| 85 | 83 | downRecordQuery.setAreaId(downQueryRequest.getAreaId()); |
| 86 | 84 | downRecordQuery.setProvinceId(downQueryRequest.getProvinceId()); |
| 87 | 85 | |
| ... | ... | @@ -95,9 +93,9 @@ |
| 95 | 93 | return downRecordQuery; |
| 96 | 94 | } |
| 97 | 95 | |
| 98 | - public BaseObjectResponse list(TrackDownQueryRequest downQueryRequest,Integer userId) { | |
| 96 | + public BaseObjectResponse list(TrackDownQueryRequest downQueryRequest, Integer userId) { | |
| 99 | 97 | //转换为本地的查询条件 |
| 100 | - TrackDownRecordQuery downRecordQuery = convertNaviteQuery(downQueryRequest,userId); | |
| 98 | + TrackDownRecordQuery downRecordQuery = convertNaviteQuery(downQueryRequest, userId); | |
| 101 | 99 | |
| 102 | 100 | List<TrackDownRecord> downRecordList = trackDownRecordService.queryTrackDown(downRecordQuery); |
| 103 | 101 | |
| ... | ... | @@ -130,6 +128,38 @@ |
| 130 | 128 | * @return 返回的内容 |
| 131 | 129 | */ |
| 132 | 130 | Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate); |
| 131 | + } | |
| 132 | + | |
| 133 | + | |
| 134 | + class HYTrackDownTypeHandler implements TrackDownTypeHandler { | |
| 135 | + | |
| 136 | + @Override | |
| 137 | + public Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate) { | |
| 138 | + Map<String, Object> temp = new HashMap<>(); | |
| 139 | + temp.put("username", downRecord.getUsername()); | |
| 140 | + temp.put("age", DateUtil.getAge(downRecord.getBirth())); | |
| 141 | + temp.put("cardNo", StringUtils.encryCardNo(downRecord.getCardNo())); | |
| 142 | + temp.put("residenceAddress",CommonsHelper.getFullAddress(downRecord.getProvinceRegisterId(), downRecord.getCityRegisterId(), downRecord.getAreaRegisterId(), downRecord.getAddressRegister(), basicConfigService)); /** 居住地 */ | |
| 143 | + temp.put("phone", StringUtils.encryPhone(downRecord.getPhone())); | |
| 144 | + temp.put("id", downRecord.getId()); | |
| 145 | +// temp.put("dueDate", DateUtil.getyyyy_MM_dd(DateUtil.addDay(downRecord.getLastMenses(),281))); | |
| 146 | +// temp.put("week", DateUtil.getWeekDesc(downRecord.getLastMenses(), new Date())); /** 孕周 */ | |
| 147 | + temp.put("cjDate", ""); /** 产检日期 */ | |
| 148 | + temp.put("yycjDate", ""); /** 预约产检日期 */ | |
| 149 | + temp.put("cjzfDate", ""); /** 产检追访时间 */ | |
| 150 | + TrackDown trackDown = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); | |
| 151 | + if (trackDown != null) { | |
| 152 | + temp.put("result", StringUtils.isEmpty(trackDown.getResult()) ? "--" : trackDown.getResult()); // 婚检追访结果 | |
| 153 | +// temp.put("result", getResultByType(trackType, patient.getId(), new Sort(Sort.Direction.DESC, "created"))); // 婚检追访结果 | |
| 154 | + temp.put("trackDownTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getTrackDownDate())); // 追访时间 | |
| 155 | + temp.put("yyTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); // 预约时间 | |
| 156 | + } else { | |
| 157 | + temp.put("result", "--"); // 婚检追访结果 | |
| 158 | + temp.put("trackDownTime", "--"); // 追访时间 | |
| 159 | + temp.put("yyTime", "--"); // 预约时间 | |
| 160 | + } | |
| 161 | + return temp; | |
| 162 | + } | |
| 133 | 163 | } |
| 134 | 164 | |
| 135 | 165 | /** |