Commit 6c0dcc1f58676c1ba1c3b25b8467b1aa2600a15b
1 parent
e3a2415723
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 84 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
6c0dcc1
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | import com.lyms.platform.common.utils.*; |
| 16 | 16 | import com.lyms.platform.operate.web.request.*; |
| 17 | 17 | import com.lyms.platform.operate.web.result.*; |
| 18 | +import com.lyms.platform.operate.web.service.ITrackDownService; | |
| 18 | 19 | import com.lyms.platform.operate.web.service.PatientWeightService; |
| 19 | 20 | import com.lyms.platform.operate.web.service.RareBloodGroupService; |
| 20 | 21 | import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; |
| 21 | 22 | |
| ... | ... | @@ -98,8 +99,9 @@ |
| 98 | 99 | private OrganizationService organizationService; |
| 99 | 100 | @Autowired |
| 100 | 101 | private OrganizationGroupsFacade groupsFacade; |
| 101 | - | |
| 102 | 102 | @Autowired |
| 103 | + private ITrackDownService trackDownService; | |
| 104 | + @Autowired | |
| 103 | 105 | @Qualifier("commonThreadPool") |
| 104 | 106 | private ThreadPoolTaskExecutor commonThreadPool; |
| 105 | 107 | |
| ... | ... | @@ -1657,7 +1659,8 @@ |
| 1657 | 1659 | if (end > patientWeightList.size()) { |
| 1658 | 1660 | end = patientWeightList.size(); |
| 1659 | 1661 | } |
| 1660 | - listFuture.add(commonThreadPool.submit(new QuanWeightWorker(patientWeightList.subList(i, end), mongoTemplate, commonService, basicConfigService, trackDownRecordService))); | |
| 1662 | + listFuture.add(commonThreadPool.submit(new QuanWeightWorker(patientWeightList.subList(i, end), mongoTemplate, | |
| 1663 | + commonService, basicConfigService, trackDownRecordService,trackDownService,matDeliverService))); | |
| 1661 | 1664 | } |
| 1662 | 1665 | for (Future f : listFuture) { |
| 1663 | 1666 | try { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanWeightWorker.java
View file @
6c0dcc1
| ... | ... | @@ -2,21 +2,28 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
| 4 | 4 | import com.lyms.platform.biz.service.CommonService; |
| 5 | +import com.lyms.platform.biz.service.MatDeliverService; | |
| 5 | 6 | import com.lyms.platform.biz.service.TrackDownRecordService; |
| 7 | +import com.lyms.platform.common.enums.FmTypeEnums; | |
| 6 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | 10 | import com.lyms.platform.common.utils.DateUtil; |
| 11 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 8 | 12 | import com.lyms.platform.common.utils.StringUtils; |
| 9 | 13 | import com.lyms.platform.operate.web.facade.PatientFacade; |
| 14 | +import com.lyms.platform.operate.web.service.ITrackDownService; | |
| 10 | 15 | import com.lyms.platform.pojo.MaternalDeliverModel; |
| 11 | 16 | import com.lyms.platform.pojo.PatientWeight; |
| 12 | 17 | import com.lyms.platform.pojo.Patients; |
| 13 | 18 | import com.lyms.platform.pojo.TrackDownRecord; |
| 14 | 19 | import com.lyms.platform.query.AntExChuQuery; |
| 15 | 20 | import com.lyms.platform.query.AntExQuery; |
| 21 | +import com.lyms.platform.query.MatDeliverQuery; | |
| 16 | 22 | import com.lyms.platform.query.TrackDownRecordQuery; |
| 17 | 23 | import org.apache.commons.collections.CollectionUtils; |
| 18 | 24 | import org.slf4j.Logger; |
| 19 | 25 | import org.slf4j.LoggerFactory; |
| 26 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | 27 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 21 | 28 | import org.springframework.data.mongodb.core.query.Criteria; |
| 22 | 29 | import org.springframework.data.mongodb.core.query.Query; |
| 23 | 30 | |
| 24 | 31 | |
| 25 | 32 | |
| ... | ... | @@ -33,23 +40,29 @@ |
| 33 | 40 | public class QuanWeightWorker implements Callable<List<Map>> { |
| 34 | 41 | |
| 35 | 42 | private static final Logger logger = LoggerFactory.getLogger(PatientFacade.class); |
| 36 | - | |
| 43 | + private ITrackDownService trackDownService; | |
| 37 | 44 | private List<PatientWeight> patientWeightList; |
| 38 | 45 | private MongoTemplate mongoTemplate; |
| 39 | 46 | private CommonService commonService; |
| 40 | 47 | private BasicConfigService basicConfigService; |
| 41 | 48 | private TrackDownRecordService trackDownRecordService; |
| 49 | + private MatDeliverService matDeliverService; | |
| 42 | 50 | public QuanWeightWorker(List<PatientWeight> patientWeightList, |
| 43 | 51 | MongoTemplate mongoTemplate, |
| 44 | 52 | CommonService commonService, |
| 45 | 53 | BasicConfigService basicConfigService, |
| 46 | - TrackDownRecordService trackDownRecordService | |
| 54 | + TrackDownRecordService trackDownRecordService, | |
| 55 | + ITrackDownService trackDownService, | |
| 56 | + MatDeliverService matDeliverService | |
| 47 | 57 | ) { |
| 48 | 58 | this.patientWeightList = patientWeightList; |
| 49 | 59 | this.mongoTemplate = mongoTemplate; |
| 50 | 60 | this.commonService = commonService; |
| 51 | 61 | this.basicConfigService = basicConfigService; |
| 52 | 62 | this.trackDownRecordService = trackDownRecordService; |
| 63 | + this.trackDownService = trackDownService; | |
| 64 | + this.matDeliverService = matDeliverService; | |
| 65 | + | |
| 53 | 66 | } |
| 54 | 67 | |
| 55 | 68 | @Override |
| ... | ... | @@ -61,6 +74,70 @@ |
| 61 | 74 | Patients patients = patientsList.get(0); |
| 62 | 75 | Map map = new HashMap(); |
| 63 | 76 | puliMap(patients, patientWeight, map); |
| 77 | + | |
| 78 | + BaseObjectResponse response = trackDownService.info(patients.getId(),3,0); | |
| 79 | + if (response != null && response.getErrorcode() == 0) | |
| 80 | + { | |
| 81 | + Map<String, Object> down = (Map<String, Object>)response.getData(); | |
| 82 | + if (down != null) | |
| 83 | + { | |
| 84 | + map.put("result",down.get("result")); | |
| 85 | + map.put("trackDownDate",down.get("trackDownDate")); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + if (patients.getType() == 3) | |
| 90 | + { | |
| 91 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 92 | + matDeliverQuery.setPid(patients.getPid()); | |
| 93 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 94 | + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | |
| 95 | + if (CollectionUtils.isNotEmpty(list2)) | |
| 96 | + { | |
| 97 | + MaternalDeliverModel maternalDeliverModel = list2.get(0); | |
| 98 | + String deliveryMode = ""; | |
| 99 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(maternalDeliverModel.getDeliveryMode())) { | |
| 100 | + StringBuilder sb = new StringBuilder(); | |
| 101 | + Map m = JsonUtil.str2Obj(maternalDeliverModel.getDeliveryMode(), Map.class); | |
| 102 | + String fmfs = null; | |
| 103 | + if (m != null) { | |
| 104 | + Object b = m.get("fmfs"); | |
| 105 | + if (b != null) { | |
| 106 | + fmfs = b.toString(); | |
| 107 | + if (fmfs != null) { | |
| 108 | + if (fmfs.equals("1")) { | |
| 109 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 110 | + sb.append(fmName); | |
| 111 | + if (null != m.get("scfs") && !"null".equals(m.get("scfs").toString())) { | |
| 112 | + sb.append(","); | |
| 113 | + String scfs = m.get("scfs").toString(); | |
| 114 | + sb.append(FmTypeEnums.getFmScNameById(scfs)); | |
| 115 | + } | |
| 116 | + deliveryMode = sb.toString(); | |
| 117 | + } else if (fmfs.equals("2")) { | |
| 118 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 119 | + deliveryMode = fmName; | |
| 120 | + } | |
| 121 | + } | |
| 122 | + } | |
| 123 | + } | |
| 124 | + } | |
| 125 | + map.put("deliveryMode", deliveryMode);//分娩方式 | |
| 126 | + map.put("deliveryDate", maternalDeliverModel.getDueDate()); | |
| 127 | + | |
| 128 | + String babyWight = ""; | |
| 129 | + List<MaternalDeliverModel.Baby> babys = maternalDeliverModel.getBaby(); | |
| 130 | + if (CollectionUtils.isNotEmpty(babys)) | |
| 131 | + { | |
| 132 | + for (MaternalDeliverModel.Baby baby : babys) | |
| 133 | + { | |
| 134 | + babyWight+=baby.getBabyWeight()+" "; | |
| 135 | + } | |
| 136 | + } | |
| 137 | + map.put("babyWight", babyWight); | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 64 | 141 | //列表中冗余上追访管理--孕期检查列表id |
| 65 | 142 | TrackDownRecordQuery query = new TrackDownRecordQuery(); |
| 66 | 143 | query.setParentId(patients.getId()); |