Commit 18bcc7d2e8ad563a049b8314606a58a72dc7cccd
1 parent
87f6738276
Exists in
master
and in
1 other branch
update
Showing 6 changed files with 145 additions and 32 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
18bcc7d
| ... | ... | @@ -227,8 +227,10 @@ |
| 227 | 227 | if (null != patients) { |
| 228 | 228 | if (patients.getType() == 1) { |
| 229 | 229 | antExRecordModel.setStatus(2); |
| 230 | + antExRecordModel.setDueStatus(2); | |
| 230 | 231 | } else { |
| 231 | 232 | antExRecordModel.setStatus(1); |
| 233 | + antExRecordModel.setDueStatus(1); | |
| 232 | 234 | } |
| 233 | 235 | antExRecordModel.setcDay(DateUtil.daysBetween(patients.getLastMenses(),antEx.getCheckDate())); |
| 234 | 236 | antExRecordModel.setCardNo(patients.getCardNo()); |
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
View file @
18bcc7d
| ... | ... | @@ -50,8 +50,12 @@ |
| 50 | 50 | private String hospitalId; |
| 51 | 51 | //手机号 |
| 52 | 52 | private String phone; |
| 53 | - //状态 1 已分娩 2未分娩 | |
| 53 | + //在添加产检时候的状态 1 已分娩 2未分娩 | |
| 54 | 54 | private int status; |
| 55 | + | |
| 56 | + //当前孕妇状态 1 已分娩 2未分娩 | |
| 57 | + private int dueStatus; | |
| 58 | + | |
| 55 | 59 | //类型 1 复诊 2 初诊 |
| 56 | 60 | private Integer type; |
| 57 | 61 | //产检医生 |
| ... | ... | @@ -111,6 +115,14 @@ |
| 111 | 115 | |
| 112 | 116 | //处理意见 |
| 113 | 117 | private String treatOpinion; |
| 118 | + | |
| 119 | + public int getDueStatus() { | |
| 120 | + return dueStatus; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setDueStatus(int dueStatus) { | |
| 124 | + this.dueStatus = dueStatus; | |
| 125 | + } | |
| 114 | 126 | |
| 115 | 127 | public String getZyzlState() { |
| 116 | 128 | return zyzlState; |
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
18bcc7d
| ... | ... | @@ -343,6 +343,7 @@ |
| 343 | 343 | private List hospitalList; |
| 344 | 344 | //孕妇状态 |
| 345 | 345 | private Integer status; |
| 346 | + private Integer dueStatus; | |
| 346 | 347 | private String levelId; |
| 347 | 348 | //无标记高危因素查询 |
| 348 | 349 | private List<String> noLeveId; |
| ... | ... | @@ -356,6 +357,14 @@ |
| 356 | 357 | private List<String> rFactorList; |
| 357 | 358 | |
| 358 | 359 | |
| 360 | + public Integer getDueStatus() { | |
| 361 | + return dueStatus; | |
| 362 | + } | |
| 363 | + | |
| 364 | + public void setDueStatus(Integer dueStatus) { | |
| 365 | + this.dueStatus = dueStatus; | |
| 366 | + } | |
| 367 | + | |
| 359 | 368 | public List<String> getNoLeveId() { |
| 360 | 369 | return noLeveId; |
| 361 | 370 | } |
| ... | ... | @@ -642,6 +651,9 @@ |
| 642 | 651 | } |
| 643 | 652 | if (null != status) { |
| 644 | 653 | condition = condition.and("status", status, MongoOper.IS); |
| 654 | + } | |
| 655 | + if (null != dueStatus) { | |
| 656 | + condition = condition.and("dueStatus", dueStatus, MongoOper.IS); | |
| 645 | 657 | } |
| 646 | 658 | if (StringUtils.isNotEmpty(cId)) { |
| 647 | 659 | condition = condition.and("checkDoctor", cId, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
18bcc7d
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 17 | 17 | import com.lyms.platform.common.enums.SieveStatusEnums; |
| 18 | 18 | import com.lyms.platform.common.enums.YnEnums; |
| 19 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 19 | 20 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 20 | 21 | import com.lyms.platform.common.result.BaseResponse; |
| 21 | 22 | import com.lyms.platform.common.utils.*; |
| ... | ... | @@ -864,6 +865,9 @@ |
| 864 | 865 | } |
| 865 | 866 | |
| 866 | 867 | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 867 | 871 | @RequestMapping(value = "/rebuildDefaultRoles", method = RequestMethod.GET) |
| 868 | 872 | @ResponseBody |
| 869 | 873 | public String rebuildDefaultRoles() { |
| ... | ... | @@ -4309,5 +4313,64 @@ |
| 4309 | 4313 | return checkup.getNumCode()+""; |
| 4310 | 4314 | } |
| 4311 | 4315 | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + @RequestMapping(value = "/updateAntExRecordModelDueStatus", method = RequestMethod.GET) | |
| 4319 | + @ResponseBody | |
| 4320 | + public String updateAntExRecordModelDueStatus(@RequestParam(required = false) String hospitalId) { | |
| 4321 | + | |
| 4322 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 4323 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 4324 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 4325 | + organizationQuery.setId(Integer.parseInt(hospitalId)); | |
| 4326 | + } | |
| 4327 | + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
| 4328 | + | |
| 4329 | + for (Organization org : organizationList) | |
| 4330 | + { | |
| 4331 | + System.out.println(org.getId()+org.getName()); | |
| 4332 | + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 4333 | + antExRecordQuery.setHospitalId(org.getId()+""); | |
| 4334 | + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); | |
| 4335 | + if (CollectionUtils.isNotEmpty(antExRecordModelList)) { | |
| 4336 | + int batchSize = 5000; | |
| 4337 | + int end = 0; | |
| 4338 | + for (int i = 0; i < antExRecordModelList.size(); i += batchSize) { | |
| 4339 | + end = (end + batchSize); | |
| 4340 | + if (end > antExRecordModelList.size()) { | |
| 4341 | + end = antExRecordModelList.size(); | |
| 4342 | + } | |
| 4343 | + System.out.println("start:" + i + ",end:" + end); | |
| 4344 | + final List<AntExRecordModel> tempList = antExRecordModelList.subList(i, end); | |
| 4345 | + | |
| 4346 | + new Thread(new Runnable() { | |
| 4347 | + @Override | |
| 4348 | + public void run() { | |
| 4349 | + if (CollectionUtils.isNotEmpty(tempList)) { | |
| 4350 | + for (AntExRecordModel antExRecordModel : tempList) { | |
| 4351 | + if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) { | |
| 4352 | + Patients pats = patientsService.findOnePatientById(antExRecordModel.getParentId()); | |
| 4353 | + if (pats != null) | |
| 4354 | + { | |
| 4355 | + if (pats.getType() != null && pats.getType() == 3) | |
| 4356 | + { | |
| 4357 | + AntExRecordModel dbmodel = new AntExRecordModel(); | |
| 4358 | + dbmodel.setDueStatus(1); | |
| 4359 | + dbmodel.setId(antExRecordModel.getId()); | |
| 4360 | + recordService.updateOne(dbmodel, antExRecordModel.getId()); | |
| 4361 | + System.out.println(antExRecordModel.getId()); | |
| 4362 | + } | |
| 4363 | + } | |
| 4364 | + } | |
| 4365 | + } | |
| 4366 | + } | |
| 4367 | + | |
| 4368 | + } | |
| 4369 | + }).start(); | |
| 4370 | + } | |
| 4371 | + } | |
| 4372 | + } | |
| 4373 | + return "updateAntExRecordModelDueStatus finish"; | |
| 4374 | + } | |
| 4312 | 4375 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
18bcc7d
| ... | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | |
| 123 | 123 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 124 | 124 | |
| 125 | - antExRecordQuery.setStatus(antExManagerQueryRequest.getDeuStatus()); | |
| 125 | + antExRecordQuery.setDueStatus(antExManagerQueryRequest.getDeuStatus()); | |
| 126 | 126 | |
| 127 | 127 | antExRecordQuery.setZyzlState(antExManagerQueryRequest.getZyzlState()); |
| 128 | 128 | antExRecordQuery.setZywzzlState(antExManagerQueryRequest.getZywzzlState()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
18bcc7d
| ... | ... | @@ -697,45 +697,69 @@ |
| 697 | 697 | }).start(); |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | - | |
| 700 | + @Autowired | |
| 701 | + private AntExRecordService recordService; | |
| 701 | 702 | /** |
| 702 | 703 | * 分娩添加或更新追访信息 |
| 703 | 704 | * |
| 704 | 705 | * @param userId |
| 705 | 706 | */ |
| 706 | - public void addTrackDownInfo(Integer userId, Patients patients) { | |
| 707 | - //添加产后追访信息 | |
| 708 | - int day = DateUtil.daysBetween(patients.getFmDate(), new Date()); | |
| 709 | - if (day <= 60) {//产后60天内,可做产后访视或产后复查环节 | |
| 710 | - if (null != patients) { | |
| 711 | - TrackDownRecord trackDownRecord = patients.build(); | |
| 712 | - trackDownRecord.setTrackType(TrackDownDateEnums.F.getId()); | |
| 713 | - if (patients.getDueStatus() == 1) {//终止妊娠 | |
| 714 | - //当前孕妇是孕28周后,进入产后复查追访,否则结束流程 | |
| 715 | - int dueWeek = DateUtil.getWeek2(patients.getLastMenses(), patients.getFmDate()); | |
| 707 | + public void addTrackDownInfo(Integer userId,final Patients patients) { | |
| 708 | + commonThreadPool.execute(new Runnable() { | |
| 709 | + @Override | |
| 710 | + public void run() { | |
| 716 | 711 | |
| 717 | - if (dueWeek >= 28) {//进入产后复查 | |
| 718 | - trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 719 | - } else {//结束流程 | |
| 720 | - trackDownRecord.setStatus(0); | |
| 712 | + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 713 | + antExRecordQuery.setPid(patients.getPid()); | |
| 714 | + antExRecordQuery.setDueStatus(2); | |
| 715 | + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); | |
| 716 | + | |
| 717 | + if (antExRecordModelList != null) | |
| 718 | + { | |
| 719 | + for (AntExRecordModel model : antExRecordModelList) | |
| 720 | + { | |
| 721 | + AntExRecordModel dbmodel = new AntExRecordModel(); | |
| 722 | + dbmodel.setDueStatus(1); | |
| 723 | + dbmodel.setId(model.getId()); | |
| 724 | + recordService.updateOne(dbmodel, model.getId()); | |
| 721 | 725 | } |
| 726 | + | |
| 722 | 727 | } |
| 723 | - //查询是否存在追访记录,如果有则修改,没有则新增 | |
| 724 | - TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 725 | - downRecordQuery.setParentId(patients.getId()); | |
| 726 | - downRecordQuery.setStatus(3); | |
| 727 | - List <TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 728 | - logger.info("CHTrackDownDataLoader addTrackDown by id :" + patients.getId()); | |
| 729 | - if (CollectionUtils.isNotEmpty(records)) { | |
| 730 | - TrackDownRecord track = records.get(0); | |
| 731 | - trackDownRecord.setId(track.getId()); | |
| 728 | + //添加产后追访信息 | |
| 729 | + int day = DateUtil.daysBetween(patients.getFmDate(), new Date()); | |
| 730 | + if (day <= 60) {//产后60天内,可做产后访视或产后复查环节 | |
| 731 | + if (null != patients) { | |
| 732 | + TrackDownRecord trackDownRecord = patients.build(); | |
| 733 | + trackDownRecord.setTrackType(TrackDownDateEnums.F.getId()); | |
| 734 | + if (patients.getDueStatus() == 1) {//终止妊娠 | |
| 735 | + //当前孕妇是孕28周后,进入产后复查追访,否则结束流程 | |
| 736 | + int dueWeek = DateUtil.getWeek2(patients.getLastMenses(), patients.getFmDate()); | |
| 737 | + | |
| 738 | + if (dueWeek >= 28) {//进入产后复查 | |
| 739 | + trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 740 | + } else {//结束流程 | |
| 741 | + trackDownRecord.setStatus(0); | |
| 742 | + } | |
| 743 | + } | |
| 744 | + //查询是否存在追访记录,如果有则修改,没有则新增 | |
| 745 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 746 | + downRecordQuery.setParentId(patients.getId()); | |
| 747 | + downRecordQuery.setStatus(3); | |
| 748 | + List <TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 749 | + logger.info("CHTrackDownDataLoader addTrackDown by id :" + patients.getId()); | |
| 750 | + if (CollectionUtils.isNotEmpty(records)) { | |
| 751 | + TrackDownRecord track = records.get(0); | |
| 752 | + trackDownRecord.setId(track.getId()); | |
| 753 | + } | |
| 754 | + if (day > 42) {//不需要做产后访视追访记录,只做产后复查追访 | |
| 755 | + trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 756 | + } | |
| 757 | + trackDownService.addOrupdateTrackDownRecord(patients.getOperator(), trackDownRecord); | |
| 758 | + } | |
| 732 | 759 | } |
| 733 | - if (day > 42) {//不需要做产后访视追访记录,只做产后复查追访 | |
| 734 | - trackDownRecord.setTrackType(TrackDownDateEnums.J.getId()); | |
| 735 | - } | |
| 736 | - trackDownService.addOrupdateTrackDownRecord(patients.getOperator(), trackDownRecord); | |
| 737 | 760 | } |
| 738 | - } | |
| 761 | + }); | |
| 762 | + | |
| 739 | 763 | } |
| 740 | 764 | |
| 741 | 765 | /** |