Commit a5a4da596d76cb4fa529d41a736bcc44e66e93d1
1 parent
5e950be29a
Exists in
master
and in
1 other branch
威海产后观察
Showing 6 changed files with 487 additions and 41 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/PostpartumRecords.java
- platform-dal/src/main/java/com/lyms/platform/query/PostpartumRecordsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostpartumRecordsFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PostpartumRecordsAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostpartumRecordsResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/PostpartumRecordsWorker.java
platform-dal/src/main/java/com/lyms/platform/pojo/PostpartumRecords.java
View file @
a5a4da5
| ... | ... | @@ -20,12 +20,13 @@ |
| 20 | 20 | private String maternalDeliverId;//分娩ID |
| 21 | 21 | private String created;//创建时间 |
| 22 | 22 | private String modified;//修改时间 |
| 23 | - //private List<Records> records;//记录列表 | |
| 23 | + private List<Records> records;//记录列表 | |
| 24 | 24 | private String hospitalId;//医院ID |
| 25 | 25 | private String doctor;//操作医生 |
| 26 | 26 | private String oneCxl;//产后一小时出血量 |
| 27 | 27 | private String twoCxl;//产后两小时出血量 |
| 28 | 28 | private String gcStatus;//观察状态(0:正在观察;1:观察结束) |
| 29 | + private String isDelete;//是否有效(0:无效;1:有效) | |
| 29 | 30 | |
| 30 | 31 | /*public static class Records implements Serializable { |
| 31 | 32 | private static final long serialVersionUID = SerialIdEnum.Records.getCid(); |
| 32 | 33 | |
| ... | ... | @@ -193,13 +194,13 @@ |
| 193 | 194 | this.modified = modified; |
| 194 | 195 | } |
| 195 | 196 | |
| 196 | - /*public List<Records> getRecords() { | |
| 197 | + public List<Records> getRecords() { | |
| 197 | 198 | return records; |
| 198 | 199 | } |
| 199 | 200 | |
| 200 | 201 | public void setRecords(List<Records> records) { |
| 201 | 202 | this.records = records; |
| 202 | - }*/ | |
| 203 | + } | |
| 203 | 204 | |
| 204 | 205 | public String getHospitalId() { |
| 205 | 206 | return hospitalId; |
| ... | ... | @@ -231,6 +232,22 @@ |
| 231 | 232 | |
| 232 | 233 | public void setTwoCxl(String twoCxl) { |
| 233 | 234 | this.twoCxl = twoCxl; |
| 235 | + } | |
| 236 | + | |
| 237 | + public String getGcStatus() { | |
| 238 | + return gcStatus; | |
| 239 | + } | |
| 240 | + | |
| 241 | + public void setGcStatus(String gcStatus) { | |
| 242 | + this.gcStatus = gcStatus; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public String getIsDelete() { | |
| 246 | + return isDelete; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public void setIsDelete(String isDelete) { | |
| 250 | + this.isDelete = isDelete; | |
| 234 | 251 | } |
| 235 | 252 | } |
platform-dal/src/main/java/com/lyms/platform/query/PostpartumRecordsQuery.java
View file @
a5a4da5
| ... | ... | @@ -6,6 +6,8 @@ |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | 8 | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 9 | 11 | /** |
| 10 | 12 | * 产后观察查询模型 |
| 11 | 13 | * Created by Administrator on 2019/1/9. |
| ... | ... | @@ -14,6 +16,9 @@ |
| 14 | 16 | |
| 15 | 17 | private String parentId;//孕妇ID |
| 16 | 18 | private String hospitalId;//医院ID |
| 19 | + private List<String> idList;//孕妇ID集合 | |
| 20 | + private String gcStatus;//观察状态 | |
| 21 | + private String isDelete;//是否有效 | |
| 17 | 22 | |
| 18 | 23 | public MongoQuery convertToQuery() { |
| 19 | 24 | MongoCondition condition = MongoCondition.newInstance(); |
| ... | ... | @@ -23,6 +28,15 @@ |
| 23 | 28 | if(null !=hospitalId){ |
| 24 | 29 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
| 25 | 30 | } |
| 31 | + if(null != idList){ | |
| 32 | + condition = condition.and("parentId", idList, MongoOper.IN); | |
| 33 | + } | |
| 34 | + if(null != gcStatus){ | |
| 35 | + condition = condition.and("gcStatus", gcStatus, MongoOper.IS); | |
| 36 | + } | |
| 37 | + if(null != isDelete){ | |
| 38 | + condition = condition.and("isDelete", isDelete, MongoOper.IS); | |
| 39 | + } | |
| 26 | 40 | return condition.toMongoQuery(); |
| 27 | 41 | } |
| 28 | 42 | |
| ... | ... | @@ -40,6 +54,30 @@ |
| 40 | 54 | |
| 41 | 55 | public void setHospitalId(String hospitalId) { |
| 42 | 56 | this.hospitalId = hospitalId; |
| 57 | + } | |
| 58 | + | |
| 59 | + public List<String> getIdList() { | |
| 60 | + return idList; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setIdList(List<String> idList) { | |
| 64 | + this.idList = idList; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getGcStatus() { | |
| 68 | + return gcStatus; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setGcStatus(String gcStatus) { | |
| 72 | + this.gcStatus = gcStatus; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public String getIsDelete() { | |
| 76 | + return isDelete; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setIsDelete(String isDelete) { | |
| 80 | + this.isDelete = isDelete; | |
| 43 | 81 | } |
| 44 | 82 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostpartumRecordsFacade.java
View file @
a5a4da5
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.*; |
| 4 | +import com.lyms.platform.common.base.PageInfo; | |
| 4 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| 7 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 6 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 7 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | 10 | import com.lyms.platform.common.utils.DateUtil; |
| 11 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 12 | +import com.lyms.platform.operate.web.request.PostpartumRecordsAddRequest; | |
| 9 | 13 | import com.lyms.platform.operate.web.request.PostpartumRecordsQueryRequest; |
| 10 | 14 | import com.lyms.platform.operate.web.result.HighScoreResult; |
| 11 | 15 | import com.lyms.platform.operate.web.result.PostpartumRecordsResult; |
| 16 | +import com.lyms.platform.operate.web.worker.PostpartumRecordsWorker; | |
| 12 | 17 | import com.lyms.platform.permission.model.Organization; |
| 13 | 18 | import com.lyms.platform.permission.model.Users; |
| 14 | 19 | import com.lyms.platform.permission.service.OrganizationService; |
| ... | ... | @@ -25,6 +30,8 @@ |
| 25 | 30 | import java.util.ArrayList; |
| 26 | 31 | import java.util.Date; |
| 27 | 32 | import java.util.List; |
| 33 | +import java.util.concurrent.Callable; | |
| 34 | +import java.util.concurrent.Future; | |
| 28 | 35 | |
| 29 | 36 | /** |
| 30 | 37 | * Created by Administrator on 2019/1/9. |
| ... | ... | @@ -82,7 +89,7 @@ |
| 82 | 89 | parentId = list.get(0).getId(); |
| 83 | 90 | Patients patients = list.get(0); |
| 84 | 91 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| 85 | - matDeliverQuery.setPid(list.get(0).getPid()); | |
| 92 | + matDeliverQuery.setParentId(parentId); | |
| 86 | 93 | matDeliverQuery.setYn(YnEnums.YES.getId()); |
| 87 | 94 | //查询分娩 |
| 88 | 95 | List<MaternalDeliverModel> mdList = matDeliverService.query(matDeliverQuery); |
| ... | ... | @@ -143,7 +150,7 @@ |
| 143 | 150 | List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); |
| 144 | 151 | |
| 145 | 152 | HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), false); |
| 146 | - String tTireNumber = ""; | |
| 153 | + /*String tTireNumber = ""; | |
| 147 | 154 | if (CollectionUtils.isNotEmpty(examinationModel)) { |
| 148 | 155 | if (null != examinationModel && StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())) { |
| 149 | 156 | tTireNumber = examinationModel.get(0).getTireNumber(); |
| 150 | 157 | |
| ... | ... | @@ -152,12 +159,14 @@ |
| 152 | 159 | if (CollectionUtils.isNotEmpty(antExChuModels)) { |
| 153 | 160 | tTireNumber = antExChuModels.get(0).getTireNumber(); |
| 154 | 161 | } |
| 155 | - } | |
| 162 | + }*/ | |
| 156 | 163 | postpartumRecordsResult.setGwys(highScoreResult.getHighRisk()); |
| 157 | 164 | postpartumRecordsResult.setGwpf(highScoreResult.getScoreStr()); |
| 158 | 165 | postpartumRecordsResult.setBz(patients.getMremark()); |
| 159 | 166 | postpartumRecordsResult.setBirth(DateUtil.getyyyy_MM_dd(patients.getBirth())); |
| 160 | 167 | postpartumRecordsResult.setAge(String.valueOf(DateUtil.getAge(patients.getBirth()))); |
| 168 | + postpartumRecordsResult.setFmDate(maternalDeliverModel.getDueDate()); | |
| 169 | + postpartumRecordsResult.setFmyz(maternalDeliverModel.getDueWeek()); | |
| 161 | 170 | if(null != maternalDeliverModel.getParity()){ |
| 162 | 171 | postpartumRecordsResult.setTc(String.valueOf(maternalDeliverModel.getParity())); |
| 163 | 172 | } |
| ... | ... | @@ -209,6 +218,109 @@ |
| 209 | 218 | return new BaseObjectResponse().setErrormsg("请输入查询条件!").setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
| 210 | 219 | } |
| 211 | 220 | return new BaseObjectResponse().setErrormsg("成功!").setErrorcode(ErrorCodeConstants.SUCCESS).setData(postpartumRecordsResult); |
| 221 | + } | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + /** | |
| 226 | + * 产后观察管理 | |
| 227 | + * @param prAddRequest | |
| 228 | + * @param userId | |
| 229 | + * @return | |
| 230 | + */ | |
| 231 | + public BaseListResponse getRecordsList(PostpartumRecordsAddRequest prAddRequest,Integer userId){ | |
| 232 | + BaseListResponse baseListResponse = new BaseListResponse(); | |
| 233 | + List<PostpartumRecordsResult> resultList = null; | |
| 234 | + List<Patients> patientsList = null; | |
| 235 | + List<String> parentIdList = null; | |
| 236 | + List<MaternalDeliverModel> maternalDeliverModelList = null; | |
| 237 | + List<String> mList = null; | |
| 238 | + PostpartumRecordsQuery prQuery = new PostpartumRecordsQuery(); | |
| 239 | + if(StringUtils.isNotEmpty(prAddRequest.getQueryNo()) || StringUtils.isNotEmpty(prAddRequest.getFmDate())){ | |
| 240 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 241 | + patientsQuery.setQueryNo(prAddRequest.getQueryNo()); | |
| 242 | + patientsQuery.setType(3); | |
| 243 | + if(StringUtils.isNotEmpty(prAddRequest.getFmDate())){ | |
| 244 | + try{ | |
| 245 | + patientsQuery.setFmDateStart(DateUtil.getSNDate(prAddRequest.getFmDate())[0]); | |
| 246 | + patientsQuery.setFmDateEnd(DateUtil.getSNDate(prAddRequest.getFmDate())[1]); | |
| 247 | + }catch (Exception e){ | |
| 248 | + e.printStackTrace(); | |
| 249 | + } | |
| 250 | + } | |
| 251 | + patientsList = patientsService.queryPatient(patientsQuery); | |
| 252 | + for(Patients p : patientsList){ | |
| 253 | + parentIdList.add(p.getId()); | |
| 254 | + } | |
| 255 | + } | |
| 256 | + if(StringUtils.isNotEmpty(prAddRequest.getFmfs())){ | |
| 257 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 258 | + String deliveryModeQueryJson = "fmfs\\\":\\\"" + prAddRequest.getFmfs(); | |
| 259 | + matDeliverQuery.setParentIdList(parentIdList); | |
| 260 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 261 | + matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(prAddRequest.getFmfs()) ? null : deliveryModeQueryJson); | |
| 262 | + maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); | |
| 263 | + for(MaternalDeliverModel m : maternalDeliverModelList){ | |
| 264 | + mList.add(m.getParentId()); | |
| 265 | + } | |
| 266 | + } | |
| 267 | + if(CollectionUtils.isNotEmpty(parentIdList)){ | |
| 268 | + parentIdList.retainAll(mList); | |
| 269 | + prQuery.setIdList(parentIdList); | |
| 270 | + }else if(CollectionUtils.isNotEmpty(mList)){ | |
| 271 | + mList.retainAll(parentIdList); | |
| 272 | + prQuery.setIdList(mList); | |
| 273 | + } | |
| 274 | + if(StringUtils.isNotEmpty(prAddRequest.getGcStatus())){ | |
| 275 | + prQuery.setGcStatus(prAddRequest.getGcStatus()); | |
| 276 | + } | |
| 277 | + prQuery.setLimit(prAddRequest.getLimit()); | |
| 278 | + prQuery.setPage(prAddRequest.getPage()); | |
| 279 | + prQuery.setIsDelete("1"); | |
| 280 | + prQuery.setNeed("need"); | |
| 281 | + List<PostpartumRecords> postList = postpartumRecordsService.getBabySieveQuery(prQuery); | |
| 282 | + if(CollectionUtils.isNotEmpty(postList)){ | |
| 283 | + int batchSize = 3; | |
| 284 | + int end = 0; | |
| 285 | + List<Future> futures = new ArrayList<>(); | |
| 286 | + for(int i = 0; i < postList.size(); i += batchSize){ | |
| 287 | + end += end + batchSize; | |
| 288 | + if(end > postList.size()){ | |
| 289 | + end = postList.size(); | |
| 290 | + } | |
| 291 | + List<PostpartumRecords> mlist = postList.subList(i, end); | |
| 292 | + Callable c = new PostpartumRecordsWorker(organizationService,usersService,patientsService, | |
| 293 | + mlist,matDeliverService,recordsService); | |
| 294 | + Future f = commonThreadPool.submit(c); | |
| 295 | + if (f != null) | |
| 296 | + { | |
| 297 | + futures.add(f); | |
| 298 | + } | |
| 299 | + } | |
| 300 | + if (CollectionUtils.isNotEmpty(futures)) { | |
| 301 | + for (Future f : futures) { | |
| 302 | + try { | |
| 303 | + | |
| 304 | + resultList.addAll((List<PostpartumRecordsResult>) f.get()); | |
| 305 | + } catch (Exception e) { | |
| 306 | + ExceptionUtils.catchException(e, "chgc list error."); | |
| 307 | + } | |
| 308 | + } | |
| 309 | + } | |
| 310 | + /*for(PostpartumRecords pRecord : postList){ | |
| 311 | + RecordsQuery recordsQuery = new RecordsQuery(); | |
| 312 | + recordsQuery.setIsDelete("1"); | |
| 313 | + recordsQuery.setPostId(pRecord.getId()); | |
| 314 | + List<Records> rList = recordsService.getRecordsListQuery(recordsQuery); | |
| 315 | + }*/ | |
| 316 | + baseListResponse.setPageInfo(prQuery.getPageInfo()); | |
| 317 | + baseListResponse.setData(resultList); | |
| 318 | + baseListResponse.setErrormsg("成功"); | |
| 319 | + baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 320 | + }else{ | |
| 321 | + return baseListResponse.setData(resultList).setPageInfo(new PageInfo()).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 322 | + } | |
| 323 | + return baseListResponse; | |
| 212 | 324 | } |
| 213 | 325 | |
| 214 | 326 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PostpartumRecordsAddRequest.java
View file @
a5a4da5
| 1 | 1 | package com.lyms.platform.operate.web.request; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.base.IBasicRequestConvert; |
| 4 | +import com.lyms.platform.pojo.BabySieveModel; | |
| 4 | 5 | import com.lyms.platform.pojo.PostpartumRecords; |
| 6 | +import com.lyms.platform.pojo.Records; | |
| 5 | 7 | |
| 6 | 8 | import java.io.Serializable; |
| 7 | 9 | import java.util.List; |
| 8 | 10 | |
| 9 | 11 | |
| 10 | 12 | |
| 11 | 13 | |
| ... | ... | @@ -10,13 +12,142 @@ |
| 10 | 12 | * Created by Administrator on 2019/1/11. |
| 11 | 13 | * 产后观察增加或修改模型 |
| 12 | 14 | */ |
| 13 | -public class PostpartumRecordsAddRequest { | |
| 15 | +public class PostpartumRecordsAddRequest implements IBasicRequestConvert<PostpartumRecords>{ | |
| 14 | 16 | |
| 17 | + | |
| 18 | + | |
| 19 | + // 是否分页 | |
| 20 | + private String need; | |
| 21 | + // 当前页起始行数 | |
| 22 | + private Integer offset = 0; | |
| 23 | + // 页面行数 | |
| 24 | + private Integer limit = 15; | |
| 25 | + // 当前页 | |
| 26 | + private int page = 1; | |
| 27 | + | |
| 28 | + public String getNeed() { | |
| 29 | + return need; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public void setNeed(String need) { | |
| 33 | + this.need = need; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public Integer getOffset() { | |
| 37 | + return offset; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public void setOffset(Integer offset) { | |
| 41 | + this.offset = offset; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public Integer getLimit() { | |
| 45 | + return limit; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void setLimit(Integer limit) { | |
| 49 | + this.limit = limit; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public int getPage() { | |
| 53 | + return page; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setPage(int page) { | |
| 57 | + this.page = page; | |
| 58 | + } | |
| 59 | + | |
| 15 | 60 | private String id; |
| 61 | + private String parentId;//孕妇ID | |
| 16 | 62 | private String oneCxl; |
| 17 | 63 | private String twoCxl; |
| 18 | - //private List<Records> records; | |
| 64 | + private List<Records> records; | |
| 19 | 65 | |
| 66 | + private String gcStatus;//观察状态 | |
| 67 | + private String fmDate;//分娩时间 | |
| 68 | + private String fmfs;//分娩方式 | |
| 69 | + private String queryNo;//查询号 | |
| 70 | + | |
| 71 | + public String getGcStatus() { | |
| 72 | + return gcStatus; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setGcStatus(String gcStatus) { | |
| 76 | + this.gcStatus = gcStatus; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getParentId() { | |
| 80 | + return parentId; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setParentId(String parentId) { | |
| 84 | + this.parentId = parentId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getFmDate() { | |
| 88 | + return fmDate; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setFmDate(String fmDate) { | |
| 92 | + this.fmDate = fmDate; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public String getFmfs() { | |
| 96 | + return fmfs; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setFmfs(String fmfs) { | |
| 100 | + this.fmfs = fmfs; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getQueryNo() { | |
| 104 | + return queryNo; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setQueryNo(String queryNo) { | |
| 108 | + this.queryNo = queryNo; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String getId() { | |
| 112 | + return id; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setId(String id) { | |
| 116 | + this.id = id; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getOneCxl() { | |
| 120 | + return oneCxl; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setOneCxl(String oneCxl) { | |
| 124 | + this.oneCxl = oneCxl; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public String getTwoCxl() { | |
| 128 | + return twoCxl; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setTwoCxl(String twoCxl) { | |
| 132 | + this.twoCxl = twoCxl; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public List<Records> getRecords() { | |
| 136 | + return records; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setRecords(List<Records> records) { | |
| 140 | + this.records = records; | |
| 141 | + } | |
| 142 | + @Override | |
| 143 | + public PostpartumRecords convertToDataModel(){ | |
| 144 | + PostpartumRecords postpartumRecords = new PostpartumRecords(); | |
| 145 | + | |
| 146 | + return postpartumRecords; | |
| 147 | + } | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 20 | 151 | /*public class Records implements IBasicRequestConvert<PostpartumRecords.Records> { |
| 21 | 152 | |
| 22 | 153 | private String id; |
| ... | ... | @@ -160,38 +291,6 @@ |
| 160 | 291 | public void setQm(String qm) { |
| 161 | 292 | this.qm = qm; |
| 162 | 293 | } |
| 163 | - }*/ | |
| 164 | - | |
| 165 | - public String getId() { | |
| 166 | - return id; | |
| 167 | - } | |
| 168 | - | |
| 169 | - public void setId(String id) { | |
| 170 | - this.id = id; | |
| 171 | - } | |
| 172 | - | |
| 173 | - public String getOneCxl() { | |
| 174 | - return oneCxl; | |
| 175 | - } | |
| 176 | - | |
| 177 | - public void setOneCxl(String oneCxl) { | |
| 178 | - this.oneCxl = oneCxl; | |
| 179 | - } | |
| 180 | - | |
| 181 | - public String getTwoCxl() { | |
| 182 | - return twoCxl; | |
| 183 | - } | |
| 184 | - | |
| 185 | - public void setTwoCxl(String twoCxl) { | |
| 186 | - this.twoCxl = twoCxl; | |
| 187 | - } | |
| 188 | - | |
| 189 | - /*public List<Records> getRecords() { | |
| 190 | - return records; | |
| 191 | - } | |
| 192 | - | |
| 193 | - public void setRecords(List<Records> records) { | |
| 194 | - this.records = records; | |
| 195 | 294 | }*/ |
| 196 | 295 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostpartumRecordsResult.java
View file @
a5a4da5
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | */ |
| 14 | 14 | public class PostpartumRecordsResult { |
| 15 | 15 | |
| 16 | - private String id; | |
| 16 | + private String id;//产后观察主键ID | |
| 17 | 17 | private String parentId;//孕妇ID |
| 18 | 18 | private String maternalDeliverId;//分娩ID |
| 19 | 19 | private String created;//创建时间 |
| 20 | 20 | |
| ... | ... | @@ -43,7 +43,14 @@ |
| 43 | 43 | private String fmHospital;//分娩医院 |
| 44 | 44 | private String jsys;//接生医生 |
| 45 | 45 | |
| 46 | + private String recordsNum;//记录条数 | |
| 47 | + private String gcStatus;//观察状态(0:正在观察;1:观察结束) | |
| 48 | + private String zjh;//证件号 | |
| 49 | + private String fmfs;//分娩方式 | |
| 50 | + private String ts;//胎数 | |
| 51 | + private String livingNumber;//活产数 | |
| 46 | 52 | |
| 53 | + | |
| 47 | 54 | public String getId() { |
| 48 | 55 | return id; |
| 49 | 56 | } |
| ... | ... | @@ -266,6 +273,54 @@ |
| 266 | 273 | |
| 267 | 274 | public void setJsys(String jsys) { |
| 268 | 275 | this.jsys = jsys; |
| 276 | + } | |
| 277 | + | |
| 278 | + public String getRecordsNum() { | |
| 279 | + return recordsNum; | |
| 280 | + } | |
| 281 | + | |
| 282 | + public void setRecordsNum(String recordsNum) { | |
| 283 | + this.recordsNum = recordsNum; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public String getGcStatus() { | |
| 287 | + return gcStatus; | |
| 288 | + } | |
| 289 | + | |
| 290 | + public void setGcStatus(String gcStatus) { | |
| 291 | + this.gcStatus = gcStatus; | |
| 292 | + } | |
| 293 | + | |
| 294 | + public String getZjh() { | |
| 295 | + return zjh; | |
| 296 | + } | |
| 297 | + | |
| 298 | + public void setZjh(String zjh) { | |
| 299 | + this.zjh = zjh; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public String getFmfs() { | |
| 303 | + return fmfs; | |
| 304 | + } | |
| 305 | + | |
| 306 | + public void setFmfs(String fmfs) { | |
| 307 | + this.fmfs = fmfs; | |
| 308 | + } | |
| 309 | + | |
| 310 | + public String getTs() { | |
| 311 | + return ts; | |
| 312 | + } | |
| 313 | + | |
| 314 | + public void setTs(String ts) { | |
| 315 | + this.ts = ts; | |
| 316 | + } | |
| 317 | + | |
| 318 | + public String getLivingNumber() { | |
| 319 | + return livingNumber; | |
| 320 | + } | |
| 321 | + | |
| 322 | + public void setLivingNumber(String livingNumber) { | |
| 323 | + this.livingNumber = livingNumber; | |
| 269 | 324 | } |
| 270 | 325 | |
| 271 | 326 | public PostpartumRecordsResult convertToResult(PostpartumRecords postpartumRecords){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/PostpartumRecordsWorker.java
View file @
a5a4da5
| 1 | +package com.lyms.platform.operate.web.worker; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.MatDeliverService; | |
| 4 | +import com.lyms.platform.biz.service.PatientsService; | |
| 5 | +import com.lyms.platform.biz.service.RecordsService; | |
| 6 | +import com.lyms.platform.common.enums.FmTypeEnums; | |
| 7 | +import com.lyms.platform.common.enums.YnEnums; | |
| 8 | +import com.lyms.platform.common.utils.DateUtil; | |
| 9 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 10 | +import com.lyms.platform.operate.web.result.ChildbirthManagerQueryModel; | |
| 11 | +import com.lyms.platform.operate.web.result.PostpartumRecordsResult; | |
| 12 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
| 13 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 14 | +import com.lyms.platform.permission.service.UsersService; | |
| 15 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
| 16 | +import com.lyms.platform.pojo.Patients; | |
| 17 | +import com.lyms.platform.pojo.PostpartumRecords; | |
| 18 | +import com.lyms.platform.pojo.Records; | |
| 19 | +import com.lyms.platform.query.MatDeliverQuery; | |
| 20 | +import com.lyms.platform.query.PatientsQuery; | |
| 21 | +import com.lyms.platform.query.RecordsQuery; | |
| 22 | +import org.apache.commons.collections.MapUtils; | |
| 23 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 24 | + | |
| 25 | +import java.util.ArrayList; | |
| 26 | +import java.util.Map; | |
| 27 | +import java.util.concurrent.Callable; | |
| 28 | + | |
| 29 | + | |
| 30 | +import java.util.List; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * Created by Administrator on 2019/1/11. | |
| 34 | + */ | |
| 35 | +public class PostpartumRecordsWorker implements Callable<List<PostpartumRecordsResult>> { | |
| 36 | + | |
| 37 | + private OrganizationService organizationService; | |
| 38 | + private UsersService usersService; | |
| 39 | + private PatientsService patientsService; | |
| 40 | + private List<PostpartumRecords> prList; | |
| 41 | + private MatDeliverService matDeliverService; | |
| 42 | + private RecordsService recordsService; | |
| 43 | + | |
| 44 | + public PostpartumRecordsWorker(OrganizationService organizationService,UsersService usersService,PatientsService patientsService, | |
| 45 | + List<PostpartumRecords> prList,MatDeliverService matDeliverService,RecordsService recordsService){ | |
| 46 | + this.organizationService = organizationService; | |
| 47 | + this.usersService = usersService; | |
| 48 | + this.patientsService = patientsService; | |
| 49 | + this.prList = prList; | |
| 50 | + this.matDeliverService = matDeliverService; | |
| 51 | + this.recordsService = recordsService; | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public List<PostpartumRecordsResult> call() { | |
| 56 | + List<PostpartumRecordsResult> rList = new ArrayList<PostpartumRecordsResult>(); | |
| 57 | + if(CollectionUtils.isNotEmpty(prList)){ | |
| 58 | + for(PostpartumRecords r : prList){ | |
| 59 | + //封装返回的数据类 | |
| 60 | + PostpartumRecordsResult psResult = new PostpartumRecordsResult(); | |
| 61 | + //查询孕妇 | |
| 62 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 63 | + patientsQuery.setType(3); | |
| 64 | + patientsQuery.setId(r.getParentId()); | |
| 65 | + Patients patient = patientsService.queryPatient(patientsQuery).get(0); | |
| 66 | + //查询分娩 | |
| 67 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 68 | + matDeliverQuery.setParentId(r.getParentId()); | |
| 69 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 70 | + MaternalDeliverModel maternalDeliverModel = matDeliverService.query(matDeliverQuery).get(0); | |
| 71 | + //开始封装 | |
| 72 | + psResult.setFmDate(maternalDeliverModel.getDueDate());//分娩时间 | |
| 73 | + psResult.setName(patient.getUsername());//姓名 | |
| 74 | + psResult.setAge(String.valueOf(DateUtil.getAge(patient.getBirth())));//年龄 | |
| 75 | + psResult.setZjh(patient.getCardNo());//证件号 | |
| 76 | + psResult.setFmyz(maternalDeliverModel.getDueWeek()); | |
| 77 | + | |
| 78 | + String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); | |
| 79 | + Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson); | |
| 80 | + if (MapUtils.isNotEmpty(deliveryModeMap) && org.apache.commons.lang.StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) { | |
| 81 | + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) { | |
| 82 | + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) { | |
| 83 | + psResult.setFmfs(fmTypeEnums.getName()); | |
| 84 | + break; | |
| 85 | + } | |
| 86 | + } | |
| 87 | + if(deliveryModeMap.get("scfs") != null){ | |
| 88 | + String scfs = deliveryModeMap.get("scfs").toString(); | |
| 89 | + psResult.setFmfs(FmTypeEnums.getFmScNameById(scfs)); | |
| 90 | + } | |
| 91 | + } else { | |
| 92 | + psResult.setFmfs(""); | |
| 93 | + }//分娩方式 | |
| 94 | + if(null != maternalDeliverModel.getTireNumber()){ | |
| 95 | + psResult.setTs(String.valueOf(maternalDeliverModel.getTireNumber()));//胎数 | |
| 96 | + } | |
| 97 | + psResult.setLivingNumber(String.valueOf(maternalDeliverModel.getBaby().size()));//活产数 | |
| 98 | + psResult.setPhone(patient.getPhone()); | |
| 99 | + //查询记录详情 | |
| 100 | + RecordsQuery recordsQuery = new RecordsQuery(); | |
| 101 | + recordsQuery.setIsDelete("1"); | |
| 102 | + recordsQuery.setPostId(r.getId()); | |
| 103 | + List<Records> recordsList = recordsService.getRecordsListQuery(recordsQuery); | |
| 104 | + if(CollectionUtils.isNotEmpty(recordsList)){ | |
| 105 | + psResult.setRecordsNum(String.valueOf(recordsList.size()));//记录条数 | |
| 106 | + }else{ | |
| 107 | + psResult.setRecordsNum("0"); | |
| 108 | + } | |
| 109 | + psResult.setGcStatus(r.getGcStatus());//观察状态(0:正在观察;1:观察结束) | |
| 110 | + | |
| 111 | + //各种ID | |
| 112 | + psResult.setId(r.getId());//产后查看主键ID | |
| 113 | + psResult.setParentId(patient.getId());//孕妇ID | |
| 114 | + psResult.setMaternalDeliverId(maternalDeliverModel.getId());//分娩ID | |
| 115 | + | |
| 116 | + rList.add(psResult); | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + return rList; | |
| 123 | + } | |
| 124 | + | |
| 125 | +} |