Commit 3f88f77174d75ec7bb2119dfa475cd9286de93ae
1 parent
ae3238784a
Exists in
master
and in
1 other branch
服务同步
Showing 3 changed files with 49 additions and 51 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
3f88f77
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.*; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.enums.*; |
| 7 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 7 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 10 | import com.lyms.platform.common.utils.*; |
| ... | ... | @@ -1123,7 +1124,9 @@ |
| 1123 | 1124 | * @param postpartumFollowMakeRequest |
| 1124 | 1125 | * @return |
| 1125 | 1126 | */ |
| 1126 | - public List<PostpartumFollowResult> postpartumDeliver(PostpartumFollowMakeRequest postpartumFollowMakeRequest) { | |
| 1127 | + public BaseListResponse postpartumDeliver(PostpartumFollowMakeRequest postpartumFollowMakeRequest) { | |
| 1128 | + BaseListResponse listResponse = new BaseListResponse(); | |
| 1129 | + | |
| 1127 | 1130 | List<PostpartumFollowResult> postpartumFollowResults = new ArrayList<>(); |
| 1128 | 1131 | |
| 1129 | 1132 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 1130 | 1133 | |
| ... | ... | @@ -1141,9 +1144,13 @@ |
| 1141 | 1144 | // 非区域 |
| 1142 | 1145 | hospitalList.add(postpartumFollowMakeRequest.getHospitalId()); |
| 1143 | 1146 | } else { |
| 1144 | - // 未传入查询条件 | |
| 1145 | - if (StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalProvinceId()) && StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalProvinceId()) && StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalAreaId()) && StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalId())) { | |
| 1146 | 1147 | |
| 1148 | + if(StringUtils.isNotEmpty(postpartumFollowMakeRequest.getHospitalId())){ | |
| 1149 | + hospitalList.add(postpartumFollowMakeRequest.getHospitalId()); | |
| 1150 | + } | |
| 1151 | + | |
| 1152 | + // 未传入查询条件,进行院内系统进行查询 | |
| 1153 | + if (StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalProvinceId()) && StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalCityId()) && StringUtils.isEmpty(postpartumFollowMakeRequest.getHospitalAreaId())) { | |
| 1147 | 1154 | DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); |
| 1148 | 1155 | dataPermissionsModelQuery.setUserId(postpartumFollowMakeRequest.getOperatorId()); |
| 1149 | 1156 | List<DataPermissionsModel> dataPermissionsModelList = dataPermissionService.queryPermission(dataPermissionsModelQuery); |
| 1150 | 1157 | |
| 1151 | 1158 | |
| 1152 | 1159 | |
| ... | ... | @@ -1181,22 +1188,16 @@ |
| 1181 | 1188 | List<String> parentIdList = new ArrayList<>(); |
| 1182 | 1189 | if (CollectionUtils.isEmpty(patientsList)) { |
| 1183 | 1190 | // 没有查到,直接抛出 |
| 1184 | - return postpartumFollowResults; | |
| 1191 | + return listResponse; | |
| 1185 | 1192 | } |
| 1186 | - Map<String,Patients> patientsMap = new HashMap<>(); | |
| 1193 | + Map<String,PostpartumFollowResult> patientsMap = new HashMap<>(); | |
| 1187 | 1194 | for (Patients patients : patientsList) { |
| 1188 | 1195 | parentIdList.add(patients.getId()); |
| 1189 | - patientsMap.put(patients.getId(),patients); | |
| 1190 | - } | |
| 1191 | - | |
| 1192 | - MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 1193 | - matDeliverQuery.setParentIdList(parentIdList); | |
| 1194 | - matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 1195 | - List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery); | |
| 1196 | - | |
| 1197 | - for(MaternalDeliverModel deliverModel : maternalDeliverModelList){ | |
| 1198 | 1196 | PostpartumFollowResult postpartumFollowResult = new PostpartumFollowResult(); |
| 1199 | - Patients patients = patientsMap.get(deliverModel.getParentId()); | |
| 1197 | + postpartumFollowResult.setPid(patients.getPid()); | |
| 1198 | + postpartumFollowResult.setPatientId(patients.getId()); | |
| 1199 | + postpartumFollowResult.setPostViewDay(DateUtil.daysBetween(patients.getFmDate(), new Date()) + "天"); | |
| 1200 | + | |
| 1200 | 1201 | // 居住地 |
| 1201 | 1202 | postpartumFollowResult.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); |
| 1202 | 1203 | // 电话转换 |
| ... | ... | @@ -1205,6 +1206,17 @@ |
| 1205 | 1206 | postpartumFollowResult.setName(patients.getUsername()); |
| 1206 | 1207 | // 年龄 |
| 1207 | 1208 | postpartumFollowResult.setAge(DateUtil.getAge(patients.getBirth())); |
| 1209 | + //放入map,进行下一步数据整合 | |
| 1210 | + patientsMap.put(patients.getId(),postpartumFollowResult); | |
| 1211 | + } | |
| 1212 | + | |
| 1213 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
| 1214 | + matDeliverQuery.setParentIdList(parentIdList); | |
| 1215 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
| 1216 | + List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery); | |
| 1217 | + | |
| 1218 | + for(MaternalDeliverModel deliverModel : maternalDeliverModelList){ | |
| 1219 | + PostpartumFollowResult postpartumFollowResult = patientsMap.get(deliverModel.getParentId()); | |
| 1208 | 1220 | //机构信息 |
| 1209 | 1221 | Organization organization = organizationService.getOrganization(Integer.valueOf(deliverModel.getFmHospital())); |
| 1210 | 1222 | // 市 |
| 1211 | 1223 | |
| ... | ... | @@ -1219,11 +1231,11 @@ |
| 1219 | 1231 | } |
| 1220 | 1232 | //分娩医院 |
| 1221 | 1233 | postpartumFollowResult.setFmHospital(organization.getName()); |
| 1222 | - | |
| 1223 | 1234 | postpartumFollowResults.add(postpartumFollowResult); |
| 1224 | 1235 | } |
| 1225 | - | |
| 1226 | - return postpartumFollowResults; | |
| 1236 | + listResponse.setPageInfo(patientsQuery.getPageInfo()); | |
| 1237 | + listResponse.setObject(postpartumFollowResults); | |
| 1238 | + return listResponse; | |
| 1227 | 1239 | } |
| 1228 | 1240 | |
| 1229 | 1241 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostpartumFollowMakeFacade.java
View file @
3f88f77
| ... | ... | @@ -2,16 +2,15 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.result.BaseListResponse; |
| 4 | 4 | import com.lyms.platform.common.result.BaseResponse; |
| 5 | -import com.lyms.platform.common.utils.BeanUtils; | |
| 6 | -import com.lyms.platform.operate.web.request.ChildbirthManagerRequest; | |
| 7 | 5 | import com.lyms.platform.operate.web.request.PostpartumFollowMakeRequest; |
| 8 | -import com.lyms.platform.operate.web.result.ChildbirthManagerResult; | |
| 6 | +import com.lyms.platform.operate.web.result.PostpartumFollowResult; | |
| 9 | 7 | import com.lyms.platform.permission.model.PostpartumFollowMake; |
| 10 | 8 | import com.lyms.platform.permission.service.PostpartumFollowMakeService; |
| 11 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 10 | import org.springframework.stereotype.Component; |
| 13 | 11 | |
| 14 | -import java.util.Map; | |
| 12 | +import java.util.ArrayList; | |
| 13 | +import java.util.List; | |
| 15 | 14 | |
| 16 | 15 | /** |
| 17 | 16 | * @auther yangfei |
| ... | ... | @@ -25,6 +24,9 @@ |
| 25 | 24 | @Autowired |
| 26 | 25 | private MatDeliverFacade matDeliverFacade; |
| 27 | 26 | |
| 27 | + @Autowired | |
| 28 | + private AutoMatchFacade autoMatchFacade; | |
| 29 | + | |
| 28 | 30 | public BaseResponse postpartumFollowMakeInit(Integer id) { |
| 29 | 31 | return null; |
| 30 | 32 | } |
| 31 | 33 | |
| 32 | 34 | |
| 33 | 35 | |
| 34 | 36 | |
| ... | ... | @@ -47,30 +49,26 @@ |
| 47 | 49 | |
| 48 | 50 | public BaseListResponse getPostpartumFollowMake( PostpartumFollowMakeRequest postpartumFollowMakeRequest, Integer id) { |
| 49 | 51 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 50 | - | |
| 52 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 53 | + postpartumFollowMakeRequest.setOperatorId(id); | |
| 51 | 54 | //如果有访视状态、产妇随访确认、联系结果、联系失败原因就先查询预约随访记录表,根据pid进行查分娩信息。 |
| 52 | 55 | if (postpartumFollowMakeRequest.getVisitResult()!=null||postpartumFollowMakeRequest.getContactResult()!=null |
| 53 | 56 | || postpartumFollowMakeRequest.getContactReason()!=null|| postpartumFollowMakeRequest.getVisitAffirm()!=null){ |
| 54 | 57 | |
| 55 | 58 | }else{//查询孕妇表,type=3 |
| 56 | - ChildbirthManagerRequest childbirthManagerRequest = new ChildbirthManagerRequest(); | |
| 57 | - childbirthManagerRequest.setOperatorId(id); | |
| 58 | - //查区域 | |
| 59 | - childbirthManagerRequest.setIsArea("area"); | |
| 60 | - BeanUtils.copy(postpartumFollowMakeRequest, childbirthManagerRequest); | |
| 61 | - // 区域 | |
| 62 | - Map<String, String> query = childbirthManagerRequest.getAreaQueryMap(); | |
| 63 | - | |
| 64 | - StringBuffer queryStr = new StringBuffer(); | |
| 65 | - for (String key : query.keySet()) { | |
| 66 | - queryStr.append(key + ","); | |
| 59 | + postpartumFollowMakeRequest.setIsArea("area"); | |
| 60 | + baseListResponse = matDeliverFacade.postpartumDeliver(postpartumFollowMakeRequest); | |
| 61 | + } | |
| 62 | + if(baseListResponse.getObject()!=null){ | |
| 63 | + List<PostpartumFollowResult> postpartumFollowResults = (List<PostpartumFollowResult>) baseListResponse.getObject(); | |
| 64 | + List<String> patientIds = new ArrayList<>(); | |
| 65 | + for(PostpartumFollowResult pf:postpartumFollowResults){ | |
| 66 | + patientIds.add(pf.getPatientId()); | |
| 67 | 67 | } |
| 68 | - childbirthManagerRequest.setInitQuery(queryStr.substring(0, queryStr.length() - 1)); | |
| 69 | - ChildbirthManagerResult childbirthManagerResult = matDeliverFacade.childbirthManager(childbirthManagerRequest); | |
| 70 | - baseListResponse.setObject(childbirthManagerResult); | |
| 68 | + //根据In查询,进行grunp by patientId,进行排序 | |
| 71 | 69 | |
| 70 | + //返回结果,进行前端开发 | |
| 72 | 71 | } |
| 73 | - | |
| 74 | 72 | return baseListResponse; |
| 75 | 73 | } |
| 76 | 74 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostpartumFollowResult.java
View file @
3f88f77
| ... | ... | @@ -21,10 +21,6 @@ |
| 21 | 21 | */ |
| 22 | 22 | private Integer age; |
| 23 | 23 | |
| 24 | - /** | |
| 25 | - * @discription 证件号 | |
| 26 | - */ | |
| 27 | - private String cardNo; | |
| 28 | 24 | |
| 29 | 25 | /** |
| 30 | 26 | * @discription 联系方式 |
| ... | ... | @@ -36,7 +32,7 @@ |
| 36 | 32 | */ |
| 37 | 33 | private String address; |
| 38 | 34 | /** |
| 39 | - * @discription 分娩医院市 | |
| 35 | + * @discription 分娩医院 | |
| 40 | 36 | */ |
| 41 | 37 | private String hospitalCityName; |
| 42 | 38 | |
| ... | ... | @@ -101,14 +97,6 @@ |
| 101 | 97 | |
| 102 | 98 | public void setAge(Integer age) { |
| 103 | 99 | this.age = age; |
| 104 | - } | |
| 105 | - | |
| 106 | - public String getCardNo() { | |
| 107 | - return cardNo; | |
| 108 | - } | |
| 109 | - | |
| 110 | - public void setCardNo(String cardNo) { | |
| 111 | - this.cardNo = cardNo; | |
| 112 | 100 | } |
| 113 | 101 | |
| 114 | 102 | public String getPhone() { |