diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java index a716bc3..74f2c58 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java @@ -1,19 +1,24 @@ package com.lyms.platform.operate.web.matnRehabPC.service.impl; import com.lyms.platform.biz.service.MatDeliverService; +import com.lyms.platform.biz.service.PatientWeightService2; import com.lyms.platform.biz.service.PatientsService; import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.operate.web.facade.ViewFacade; import com.lyms.platform.operate.web.matnRehabPC.service.MatnRehabService; import com.lyms.platform.pojo.MaternalDeliverModel; +import com.lyms.platform.pojo.PatientWeight; import com.lyms.platform.pojo.Patients; import com.lyms.platform.query.MatDeliverQuery; import com.lyms.platform.query.PatientsQuery; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.query.Criteria; +import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; @Service public class MatnRehabServiceImpl implements MatnRehabService { @@ -27,11 +32,14 @@ public class MatnRehabServiceImpl implements MatnRehabService { @Autowired private MatDeliverService matDeliverService; + @Autowired + private PatientWeightService2 patientWeightService2; + @Override public BaseObjectResponse queryInfo(String phone) { BaseObjectResponse baseObjectResponse = new BaseObjectResponse(); PatientsQuery patientsQuery = new PatientsQuery(); - // + // 查建档 patientsQuery.setPhone(phone); patientsQuery.setType(3); patientsQuery.setYn(1); @@ -40,6 +48,7 @@ public class MatnRehabServiceImpl implements MatnRehabService { List patientsList = patientsService.queryPatient(patientsQuery); if (CollectionUtils.isNotEmpty(patientsList)) { Patients patients = patientsList.get(0); + // 查分娩和复查表 给产后报告用 MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); matDeliverQuery.setYn(1); matDeliverQuery.setParentId(patients.getId()); @@ -48,6 +57,17 @@ public class MatnRehabServiceImpl implements MatnRehabService { if (CollectionUtils.isNotEmpty(queryList)){ MaternalDeliverModel model = queryList.get(0); baseObjectResponse =viewFacade.findMatDeliverData(model.getId()); + if(baseObjectResponse.getData() !=null){ + // 查体重表 给营养报告用 + List patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("patientId").is(patients.getId()))); + if(CollectionUtils.isNotEmpty(patientWeights)){ + PatientWeight patientWeight= patientWeights.get(0); + Map data = (Map) baseObjectResponse.getData(); + data.put("patientWeight",patientWeight); + baseObjectResponse.setData(data); + } + } + return baseObjectResponse; } }