Commit 1492b5a0a5ad7dfd8496a38deb9a4996f63123b4
1 parent
bbb18c9ea4
Exists in
master
and in
6 other branches
增加追访
Showing 3 changed files with 111 additions and 30 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java
View file @
1492b5a
| ... | ... | @@ -24,6 +24,7 @@ | 
| 24 | 24 | |
| 25 | 25 | private String id; | 
| 26 | 26 | private String username; | 
| 27 | + private String source; | |
| 27 | 28 | private Date birth; | 
| 28 | 29 | private String phone; | 
| 29 | 30 | private String cardNo; | 
| ... | ... | @@ -47,6 +48,14 @@ | 
| 47 | 48 | private Integer status; | 
| 48 | 49 | //数据所在的列表 | 
| 49 | 50 | private Integer trackType; | 
| 51 | + | |
| 52 | + public String getSource() { | |
| 53 | + return source; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setSource(String source) { | |
| 57 | + this.source = source; | |
| 58 | + } | |
| 50 | 59 | |
| 51 | 60 | public Integer getTrackType() { | 
| 52 | 61 | return trackType; | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
1492b5a
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownJobFacade.java
View file @
1492b5a
| ... | ... | @@ -7,6 +7,7 @@ | 
| 7 | 7 | import com.lyms.platform.common.result.BaseResponse; | 
| 8 | 8 | import com.lyms.platform.common.utils.DateUtil; | 
| 9 | 9 | import com.lyms.platform.common.utils.StringUtils; | 
| 10 | +import com.lyms.platform.operate.web.utils.TrackDownConvertHelper; | |
| 10 | 11 | import com.lyms.platform.pojo.*; | 
| 11 | 12 | import com.lyms.platform.query.*; | 
| 12 | 13 | import org.apache.commons.collections.CollectionUtils; | 
| ... | ... | @@ -65,6 +66,8 @@ | 
| 65 | 66 | downJobHandlers.add(new CJTrackDownDataLoader()); | 
| 66 | 67 | //分娩数据加载 | 
| 67 | 68 | downJobHandlers.add(new FMTrackDownDataLoader()); | 
| 69 | + //产后访视和产后复查的数据加载 产后访视和产后复查的规则一样 | |
| 70 | + downJobHandlers.add(new CHTrackDownDataLoader()); | |
| 68 | 71 | } | 
| 69 | 72 | |
| 70 | 73 | /** | 
| ... | ... | @@ -73,7 +76,6 @@ | 
| 73 | 76 | @Autowired | 
| 74 | 77 | private ResidentsArchiveService residentsArchiveService; | 
| 75 | 78 | |
| 76 | - | |
| 77 | 79 | /** | 
| 78 | 80 | * 婚前检查 | 
| 79 | 81 | */ | 
| ... | ... | @@ -166,6 +168,7 @@ | 
| 166 | 168 | TrackDownRecord downRecord = new TrackDownRecord(); | 
| 167 | 169 | downRecord.setParentId(model.getId()); | 
| 168 | 170 | downRecord.setPid(model.getPid()); | 
| 171 | + downRecord.setSource(model.getId()); | |
| 169 | 172 | downRecord.setLastMenses(model.getLastMenses()); | 
| 170 | 173 | downRecord.setUsername(model.getUsername()); | 
| 171 | 174 | downRecord.setCityRegisterId(model.getCityRegisterId()); | 
| ... | ... | @@ -179,7 +182,6 @@ | 
| 179 | 182 | downRecord.setAreaRegisterId(model.getAreaRegisterId()); | 
| 180 | 183 | downRecord.setStatus(1); | 
| 181 | 184 | downRecord.setTrackType(TrackDownDateEnums.E.getId()); | 
| 182 | -// downRecord.setDone(0); | |
| 183 | 185 | return downRecord; | 
| 184 | 186 | } | 
| 185 | 187 | } | 
| ... | ... | @@ -229,24 +231,7 @@ | 
| 229 | 231 | |
| 230 | 232 | @Override | 
| 231 | 233 | public TrackDownRecord build(Patients model) { | 
| 232 | - TrackDownRecord downRecord = new TrackDownRecord(); | |
| 233 | - downRecord.setParentId(model.getId()); | |
| 234 | - downRecord.setPid(model.getPid()); | |
| 235 | - downRecord.setLastMenses(model.getLastMenses()); | |
| 236 | - downRecord.setUsername(model.getUsername()); | |
| 237 | - downRecord.setCityRegisterId(model.getCityRegisterId()); | |
| 238 | - downRecord.setBirth(model.getBirth()); | |
| 239 | - downRecord.setAreaRegisterId(model.getAreaRegisterId()); | |
| 240 | - downRecord.setCardNo(model.getCardNo()); | |
| 241 | - downRecord.setAddressRegister(model.getAddressRegister()); | |
| 242 | - downRecord.setHospitalId(model.getHospitalId()); | |
| 243 | - downRecord.setPhone(model.getPhone()); | |
| 244 | - downRecord.setStreetRegisterId(model.getStreetRegisterId()); | |
| 245 | - downRecord.setAreaRegisterId(model.getAreaRegisterId()); | |
| 246 | -// downRecord.setDone(0); | |
| 247 | - downRecord.setStatus(1); | |
| 248 | - downRecord.setTrackType(TrackDownDateEnums.C.getId()); | |
| 249 | - return downRecord; | |
| 234 | + return TrackDownConvertHelper.patientToTrackDownRecord(model); | |
| 250 | 235 | } | 
| 251 | 236 | } | 
| 252 | 237 | |
| ... | ... | @@ -283,12 +268,6 @@ | 
| 283 | 268 | int page = 0; | 
| 284 | 269 | List<PremaritalCheckup> data = null; | 
| 285 | 270 | do { | 
| 286 | - /* ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 287 | - archiveQuery.setYn(YnEnums.YES.getId()); | |
| 288 | - archiveQuery.setSort("created asc"); | |
| 289 | - archiveQuery.setNeed("1"); | |
| 290 | - archiveQuery.setPage(page); | |
| 291 | - archiveQuery.setLimit(limit);*/ | |
| 292 | 271 | |
| 293 | 272 | PremaritalCheckupQuery premaritalCheckupQuery = new PremaritalCheckupQuery(); | 
| 294 | 273 | premaritalCheckupQuery.setYn(YnEnums.YES.getId()); | 
| ... | ... | @@ -300,7 +279,6 @@ | 
| 300 | 279 | data = premaritalCheckupService.queryPremaritalCheckup(premaritalCheckupQuery); | 
| 301 | 280 | |
| 302 | 281 | //查询妇女建档 | 
| 303 | -// data = residentsArchiveService.queryResident(archiveQuery); | |
| 304 | 282 | if (CollectionUtils.isNotEmpty(data)) { | 
| 305 | 283 | for (PremaritalCheckup model : data) { | 
| 306 | 284 | handOneByOne(model); | 
| 307 | 285 | |
| ... | ... | @@ -334,8 +312,11 @@ | 
| 334 | 312 | TrackDownRecord record = new TrackDownRecord(); | 
| 335 | 313 | |
| 336 | 314 | ResidentsArchiveModel resid = residentsArchiveService.getResident(model.getParentId()); | 
| 315 | + if (null == resid) { | |
| 316 | + return null; | |
| 317 | + } | |
| 337 | 318 | record.setParentId(resid.getId()); | 
| 338 | - | |
| 319 | + record.setSource(model.getId()); | |
| 339 | 320 | record.setAddressRegister(resid.getAddressRegister()); | 
| 340 | 321 | record.setAreaRegisterId(resid.getAreaRegisterId()); | 
| 341 | 322 | record.setBirth(resid.getBirthday()); | 
| ... | ... | @@ -422,7 +403,7 @@ | 
| 422 | 403 | record.setPhone(model.getPhone()); | 
| 423 | 404 | record.setHospitalId(model.getHospitalId()); | 
| 424 | 405 | record.setStatus(1); | 
| 425 | -// record.setDone(0); | |
| 406 | + record.setSource(model.getId()); | |
| 426 | 407 | record.setCardNo(model.getCertificateNum()); | 
| 427 | 408 | record.setTrackType(TrackDownDateEnums.A.getId()); | 
| 428 | 409 | return record; | 
| ... | ... | @@ -481,7 +462,7 @@ | 
| 481 | 462 | TrackDownRecord record = new TrackDownRecord(); | 
| 482 | 463 | record.setParentId(model.getId()); | 
| 483 | 464 | |
| 484 | - Patients patients =patientsService.findOnePatientById(model.getParentId()); | |
| 465 | + Patients patients = patientsService.findOnePatientById(model.getParentId()); | |
| 485 | 466 | record.setAddressRegister(patients.getAddressRegister()); | 
| 486 | 467 | record.setAreaRegisterId(patients.getAreaRegisterId()); | 
| 487 | 468 | record.setBirth(patients.getBirth()); | 
| 488 | 469 | |
| ... | ... | @@ -491,12 +472,95 @@ | 
| 491 | 472 | record.setPhone(patients.getPhone()); | 
| 492 | 473 | record.setHospitalId(model.getHospitalId()); | 
| 493 | 474 | record.setStatus(1); | 
| 475 | + record.setSource(model.getId()); | |
| 494 | 476 | record.setCardNo(patients.getCardNo()); | 
| 495 | 477 | record.setTrackType(TrackDownDateEnums.F.getId()); | 
| 496 | 478 | return record; | 
| 497 | 479 | } | 
| 498 | 480 | } | 
| 499 | 481 | |
| 482 | + | |
| 483 | + /** | |
| 484 | + * 产后访视追访数据加载 | |
| 485 | + * 1.分娩并出院有出院小结的孕妇 | |
| 486 | + */ | |
| 487 | + class CHTrackDownDataLoader implements TrackDownDataLoader<DischargeAbstractMotherModel> { | |
| 488 | + | |
| 489 | + @Override | |
| 490 | + public void execute() { | |
| 491 | + int page = 0; | |
| 492 | + List<DischargeAbstractMotherModel> data = null; | |
| 493 | + do { | |
| 494 | + | |
| 495 | + logger.info("CHTrackDownDataLoader execute "); | |
| 496 | + | |
| 497 | + DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery(); | |
| 498 | + dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId()); | |
| 499 | + dischargeAbstractMotherQuery.setSort("createDate asc"); | |
| 500 | + dischargeAbstractMotherQuery.setNeed("1"); | |
| 501 | + dischargeAbstractMotherQuery.setPage(page); | |
| 502 | + dischargeAbstractMotherQuery.setLimit(limit); | |
| 503 | + | |
| 504 | + dischargeAbstractMotherService.query(dischargeAbstractMotherQuery); | |
| 505 | + //查询妇女建档 | |
| 506 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 507 | + for (DischargeAbstractMotherModel model : data) { | |
| 508 | + handOneByOne(model); | |
| 509 | + } | |
| 510 | + } | |
| 511 | + page++; | |
| 512 | + } while (CollectionUtils.isNotEmpty(data) && data.size() == limit); | |
| 513 | + } | |
| 514 | + | |
| 515 | + @Override | |
| 516 | + public void handOneByOne(DischargeAbstractMotherModel model) { | |
| 517 | + | |
| 518 | + | |
| 519 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 520 | + downRecordQuery.setParentId(model.getId()); | |
| 521 | + List<TrackDownRecord> records = downRecordService.queryTrackDown(downRecordQuery); | |
| 522 | + if (CollectionUtils.isEmpty(records)) { | |
| 523 | + logger.info("FMTrackDownDataLoader addTrackDown by id :" + model.getId()); | |
| 524 | + TrackDownRecord trackDownRecord = build(model); | |
| 525 | + if (null != trackDownRecord) { | |
| 526 | + downRecordService.addTrackDown(trackDownRecord); | |
| 527 | + trackDownRecord.setId(null); | |
| 528 | + trackDownRecord.setTrackType(TrackDownDateEnums.G.getId()); | |
| 529 | + downRecordService.addTrackDown(trackDownRecord); | |
| 530 | + } | |
| 531 | + } | |
| 532 | + } | |
| 533 | + | |
| 534 | + @Override | |
| 535 | + public TrackDownRecord build(DischargeAbstractMotherModel model) { | |
| 536 | + | |
| 537 | + Patients patients = patientsService.findOnePatientById(model.getPatientId()); | |
| 538 | + if (null == patients) { | |
| 539 | + return null; | |
| 540 | + } | |
| 541 | + TrackDownRecord downRecord = new TrackDownRecord(); | |
| 542 | + downRecord.setParentId(model.getPatientId()); | |
| 543 | + downRecord.setSource(model.getId()); | |
| 544 | + downRecord.setPid(model.getPid()); | |
| 545 | + downRecord.setLastMenses(patients.getLastMenses()); | |
| 546 | + downRecord.setUsername(patients.getUsername()); | |
| 547 | + downRecord.setCityRegisterId(patients.getCityRegisterId()); | |
| 548 | + downRecord.setBirth(patients.getBirth()); | |
| 549 | + downRecord.setAreaRegisterId(patients.getAreaRegisterId()); | |
| 550 | + downRecord.setCardNo(patients.getCardNo()); | |
| 551 | + downRecord.setAddressRegister(patients.getAddressRegister()); | |
| 552 | + downRecord.setHospitalId(model.getHospitalId()); | |
| 553 | + downRecord.setPhone(patients.getPhone()); | |
| 554 | + downRecord.setStreetRegisterId(patients.getStreetRegisterId()); | |
| 555 | + downRecord.setAreaRegisterId(patients.getAreaRegisterId()); | |
| 556 | + downRecord.setStatus(1); | |
| 557 | + downRecord.setTrackType(TrackDownDateEnums.F.getId()); | |
| 558 | + return downRecord; | |
| 559 | + } | |
| 560 | + } | |
| 561 | + | |
| 562 | + @Autowired | |
| 563 | + private DischargeAbstractMotherService dischargeAbstractMotherService; | |
| 500 | 564 | @Autowired | 
| 501 | 565 | private MatDeliverService matDeliverService; | 
| 502 | 566 | } |