Commit 519221e840041def7ad5d5d963e9ac30a2ea9a73
1 parent
d1edd0b46a
Exists in
master
and in
6 other branches
1
Showing 1 changed file with 76 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
519221e
| ... | ... | @@ -2,8 +2,10 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.*; |
| 4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | +import com.lyms.platform.common.enums.FmTypeEnums; | |
| 5 | 6 | import com.lyms.platform.common.enums.TrackDownDateEnums; |
| 6 | 7 | import com.lyms.platform.common.enums.TrackDownTransferEnums; |
| 8 | +import com.lyms.platform.common.enums.YnEnums; | |
| 7 | 9 | import com.lyms.platform.common.result.BaseListResponse; |
| 8 | 10 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | 11 | import com.lyms.platform.common.result.PageResult; |
| ... | ... | @@ -13,6 +15,7 @@ |
| 13 | 15 | import com.lyms.platform.operate.web.request.TrackDownQueryRequest; |
| 14 | 16 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 15 | 17 | import com.lyms.platform.pojo.*; |
| 18 | +import com.lyms.platform.query.PostReviewQuery; | |
| 16 | 19 | import com.lyms.platform.query.TrackDownRecordQuery; |
| 17 | 20 | import org.apache.commons.collections.CollectionUtils; |
| 18 | 21 | import org.slf4j.Logger; |
| 19 | 22 | |
| 20 | 23 | |
| 21 | 24 | |
| 22 | 25 | |
| ... | ... | @@ -74,10 +77,18 @@ |
| 74 | 77 | private void init() { |
| 75 | 78 | trackDownTypeHandlerMap = new HashMap<>(); |
| 76 | 79 | trackDownTypeHandlerMap.put(TrackDownDateEnums.A.getId(), new FQTrackDownTypeHandler()); |
| 80 | + //怀孕建档 | |
| 77 | 81 | trackDownTypeHandlerMap.put(TrackDownDateEnums.B.getId(), new FQTrackDownTypeHandler()); |
| 82 | + //产前检查 | |
| 78 | 83 | trackDownTypeHandlerMap.put(TrackDownDateEnums.C.getId(), new CJTrackDownTypeHandler()); |
| 84 | + //产前筛查 | |
| 79 | 85 | trackDownTypeHandlerMap.put(TrackDownDateEnums.D.getId(), new CJTrackDownTypeHandler()); |
| 86 | + //分娩住院 | |
| 80 | 87 | trackDownTypeHandlerMap.put(TrackDownDateEnums.E.getId(), new CJTrackDownTypeHandler()); |
| 88 | + //产后访视 | |
| 89 | + trackDownTypeHandlerMap.put(TrackDownDateEnums.F.getId(), new CHTrackDownTypeHandler()); | |
| 90 | + //产后复查 | |
| 91 | + trackDownTypeHandlerMap.put(TrackDownDateEnums.G.getId(), new CHFCTrackDownTypeHandler()); | |
| 81 | 92 | } |
| 82 | 93 | |
| 83 | 94 | /** |
| ... | ... | @@ -210,6 +221,71 @@ |
| 210 | 221 | */ |
| 211 | 222 | Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate); |
| 212 | 223 | } |
| 224 | + @Autowired | |
| 225 | + private PostReviewService postReviewService; | |
| 226 | + class CHFCTrackDownTypeHandler implements TrackDownTypeHandler{ | |
| 227 | + | |
| 228 | + @Override | |
| 229 | + public Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate) { | |
| 230 | + Map<String, Object> temp = new HashMap<>(); | |
| 231 | + temp.put("id", downRecord.getId()); | |
| 232 | + temp.put("pid", downRecord.getPid()); | |
| 233 | + temp.put("parentId", downRecord.getParentId()); | |
| 234 | + temp.put("username", downRecord.getUsername()); | |
| 235 | + temp.put("cardNo", downRecord.getCardNo()); | |
| 236 | + temp.put("residenceAddress", CommonsHelper.getFullAddress(downRecord.getProvinceRegisterId(), downRecord.getCityRegisterId(), downRecord.getAreaRegisterId(), downRecord.getAddressRegister(), basicConfigService)); /** 居住地 */ | |
| 237 | + temp.put("phone", StringUtils.encryPhone(downRecord.getPhone())); | |
| 238 | + 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); | |
| 239 | + temp.put("age", DateUtil.getAge(downRecord.getBirth())); | |
| 240 | + // 婚检追访结果 | |
| 241 | + temp.put("result", trackDown == null ? "--" : TrackDownTransferEnums.getName(trackDown.getTrackDownType())); | |
| 242 | + // 婚检追访时间 | |
| 243 | + temp.put("trackDownTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getTrackDownDate())); | |
| 244 | + // 预约时间 | |
| 245 | + temp.put("yyTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); | |
| 246 | + PostReviewQuery postReviewQuery =new PostReviewQuery(); | |
| 247 | + postReviewQuery.setYn(YnEnums.YES.getId()); | |
| 248 | + postReviewQuery.setParentId(downRecord.getParentId()); | |
| 249 | + List<PostReviewModel> list = postReviewService.findWithList(postReviewQuery); | |
| 250 | + Patients patients = patientsService.findOnePatientById(downRecord.getParentId()); | |
| 251 | + /** 复查次数 */ | |
| 252 | + temp.put("fcNum", list.size()); | |
| 253 | + temp.put("fmDate", DateUtil.getyyyy_MM_dd(patients.getFmDate())); | |
| 254 | + /** 初次复查日期 */ | |
| 255 | + temp.put("ccfcDate", list.get(list.size()-1).getCheckTime() == null ? "--" : DateUtil.getyyyy_MM_dd(list.get(list.size()-1).getCheckTime())); | |
| 256 | + /** 预约复查日期 */ | |
| 257 | + temp.put("yyfcDate ",list.get(0).getNextCheckTime() == null ? "--" : DateUtil.getyyyy_MM_dd(list.get(0).getNextCheckTime())); | |
| 258 | + /** 生产方式 */ | |
| 259 | + temp.put("scType", FmTypeEnums.getFmNameById2("1")); | |
| 260 | + return temp; | |
| 261 | + } | |
| 262 | + } | |
| 263 | + /** | |
| 264 | + * 产后访视 | |
| 265 | + */ | |
| 266 | + class CHTrackDownTypeHandler implements TrackDownTypeHandler{ | |
| 267 | + @Override | |
| 268 | + public Map build(TrackDownRecord downRecord, MongoTemplate mongoTemplate) { | |
| 269 | + Map<String, Object> temp = new HashMap<>(); | |
| 270 | + temp.put("id", downRecord.getId()); | |
| 271 | + temp.put("pid", downRecord.getPid()); | |
| 272 | + temp.put("parentId", downRecord.getParentId()); | |
| 273 | + temp.put("username", downRecord.getUsername()); | |
| 274 | + temp.put("cardNo", downRecord.getCardNo()); | |
| 275 | + temp.put("residenceAddress", CommonsHelper.getFullAddress(downRecord.getProvinceRegisterId(), downRecord.getCityRegisterId(), downRecord.getAreaRegisterId(), downRecord.getAddressRegister(), basicConfigService)); /** 居住地 */ | |
| 276 | + temp.put("phone", StringUtils.encryPhone(downRecord.getPhone())); | |
| 277 | + 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); | |
| 278 | + temp.put("age", DateUtil.getAge(downRecord.getBirth())); | |
| 279 | + // 婚检追访结果 | |
| 280 | + temp.put("result", trackDown == null ? "--" : TrackDownTransferEnums.getName(trackDown.getTrackDownType())); | |
| 281 | + // 婚检追访时间 | |
| 282 | + temp.put("trackDownTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getTrackDownDate())); | |
| 283 | + // 预约时间 | |
| 284 | + temp.put("yyTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate())); | |
| 285 | + return temp; | |
| 286 | + } | |
| 287 | + } | |
| 288 | + | |
| 213 | 289 | |
| 214 | 290 | /** |
| 215 | 291 | * 怀孕建档返回的字段 |