Commit 9bece8ec25f4df045671484a9ae7329ce3d8f520
1 parent
34c945fdbb
Exists in
master
and in
6 other branches
逗号改括号
Showing 2 changed files with 112 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
9bece8e
| ... | ... | @@ -347,7 +347,8 @@ |
| 347 | 347 | BaseListResponse baseListResponse; |
| 348 | 348 | try { |
| 349 | 349 | patientManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
| 350 | - PatientManagerResult patientManagerResult = patientFacade.patientManager(patientManagerRequest); | |
| 350 | +// PatientManagerResult patientManagerResult = patientFacade.patientManager(patientManagerRequest); | |
| 351 | + PatientManagerResult patientManagerResult = patientFacade.patientManager2(patientManagerRequest); | |
| 351 | 352 | if (patientManagerResult.getErrorcode() != ErrorCodeConstants.SUCCESS) { |
| 352 | 353 | baseListResponse = new BaseListResponse().setErrorcode(patientManagerResult.getErrorcode()).setErrormsg(patientManagerResult.getErrormsg()); |
| 353 | 354 | return baseListResponse; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
9bece8e
| ... | ... | @@ -1106,6 +1106,116 @@ |
| 1106 | 1106 | return patientManagerResult; |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | + public PatientManagerResult patientManager2(PatientManagerRequest patientManagerRequest) { | |
| 1110 | + PatientManagerResult patientManagerResult = new PatientManagerResult(); | |
| 1111 | + | |
| 1112 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1113 | + | |
| 1114 | + if (patientManagerRequest.getBuildWeekStart() != null) { | |
| 1115 | + patientsQuery.setBuildDaysStart(patientManagerRequest.getBuildWeekStart() * 7); | |
| 1116 | + } | |
| 1117 | + | |
| 1118 | + if (patientManagerRequest.getBuildWeekEnd() != null) { | |
| 1119 | + patientsQuery.setBuildDaysEnd((patientManagerRequest.getBuildWeekEnd() + 1) * 7 - 1); | |
| 1120 | + } | |
| 1121 | + | |
| 1122 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 1123 | + if (!patientManagerRequest.isExcel()) { | |
| 1124 | + patientsQuery.setNeed("need"); | |
| 1125 | + patientsQuery.setLimit(patientManagerRequest.getLimit()); | |
| 1126 | + patientsQuery.setPage(patientManagerRequest.getPage()); | |
| 1127 | + } | |
| 1128 | + //排查本院隐藏建档 | |
| 1129 | + patientsQuery.setExtEnable(false); | |
| 1130 | + patientsQuery.setBuildTypeNot(1); | |
| 1131 | + patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId())); | |
| 1132 | + patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId()); | |
| 1133 | + patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId()); | |
| 1134 | + patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId()); | |
| 1135 | + patientsQuery.setStreetId(StringUtils.isEmpty(patientManagerRequest.getStreetRegisterId()) ? null : patientManagerRequest.getStreetRegisterId()); | |
| 1136 | + patientsQuery.setStreetRegisterId(StringUtils.isEmpty(patientManagerRequest.getStreetId()) ? null : patientManagerRequest.getStreetId()); | |
| 1137 | + // UsersQuery usersQuery = new UsersQuery(); | |
| 1138 | + // usersQuery.setName(patientManagerRequest.getBookbuildingDoctor()); | |
| 1139 | + // usersQuery.setYn(YnEnums.YES.getId()); | |
| 1140 | + // List<Users> usersList = usersService.queryUsers(usersQuery); | |
| 1141 | + // if (CollectionUtils.isNotEmpty(usersList)) { | |
| 1142 | + // List<String> bookbuildingDoctorList = new ArrayList<>(); | |
| 1143 | + // for (Users users : usersList) { | |
| 1144 | + // bookbuildingDoctorList.add(users.getId().toString()); | |
| 1145 | + // } | |
| 1146 | + // patientsQuery.setBookbuildingDoctorList(bookbuildingDoctorList); | |
| 1147 | + // } | |
| 1148 | + patientsQuery.setBookbuildingDoctor(StringUtils.isEmpty(patientManagerRequest.getBookbuildingDoctor()) ? null : patientManagerRequest.getBookbuildingDoctor()); | |
| 1149 | + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceId()) ? null : patientManagerRequest.getProvinceId()); | |
| 1150 | + patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityId()) ? null : patientManagerRequest.getCityId()); | |
| 1151 | + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(patientManagerRequest.getAreaId()) ? null : patientManagerRequest.getAreaId()); | |
| 1152 | + if (StringUtils.isNotEmpty(patientManagerRequest.getBookBuildingDate())) { | |
| 1153 | + try { | |
| 1154 | + patientsQuery.setBookbuildingDateStart(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[0]); | |
| 1155 | + patientsQuery.setBookbuildingDateEnd(DateUtil.getSNDate(patientManagerRequest.getBookBuildingDate())[1]); | |
| 1156 | + } catch (Exception e) { | |
| 1157 | + // 什么都不做,这里是数据传入错误了 | |
| 1158 | + } | |
| 1159 | + } | |
| 1160 | + patientsQuery.setQueryNo(StringUtils.isEmpty(patientManagerRequest.getQueryNo()) ? null : patientManagerRequest.getQueryNo()); | |
| 1161 | + | |
| 1162 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 1163 | + List<PatientManagerQueryModel> patientManagerQueryModelList = new ArrayList<>(); | |
| 1164 | + if (CollectionUtils.isNotEmpty(patientsList)) { | |
| 1165 | + for (Patients patients : patientsList) { | |
| 1166 | + PatientManagerQueryModel patientManagerQueryModel = new PatientManagerQueryModel(); | |
| 1167 | + BeanUtils.copy(patients, patientManagerQueryModel); | |
| 1168 | + patientManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth())); | |
| 1169 | + patientManagerQueryModel.setpId(patients.getPid()); | |
| 1170 | + String dueWeek = ""; | |
| 1171 | + try { | |
| 1172 | +// && patients.getBuildType() == 2 | |
| 1173 | + if (patients.getBookbuildingDate().getTime() - patients.getDueDate().getTime() > 0) { | |
| 1174 | + dueWeek = "已分娩"; | |
| 1175 | + } else { | |
| 1176 | + int days = DateUtil.daysBetween(patients.getLastMenses(), patients.getBookbuildingDate()); | |
| 1177 | + if (days > 7 * 42 - 1) { | |
| 1178 | + dueWeek = "已分娩"; | |
| 1179 | + } else { | |
| 1180 | + String week = (days / 7) + ""; | |
| 1181 | + int day = (days % 7); | |
| 1182 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 1183 | + } | |
| 1184 | + } | |
| 1185 | + } catch (Exception e) { | |
| 1186 | + // 什么都不干 | |
| 1187 | + } | |
| 1188 | + patientManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); | |
| 1189 | + patientManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo())); | |
| 1190 | + patientManagerQueryModel.setBuildWeek(dueWeek); | |
| 1191 | + | |
| 1192 | + String bookbuildingDoctor = ""; | |
| 1193 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
| 1194 | + Users user = usersService.getUsers(Integer.valueOf(patients.getBookbuildingDoctor())); | |
| 1195 | + if (user != null) { | |
| 1196 | + bookbuildingDoctor = user.getName(); | |
| 1197 | + } else { | |
| 1198 | + System.out.println(patients.getId() + ";no user bookbuildingDoctor" + patients.getBookbuildingDoctor()); | |
| 1199 | + } | |
| 1200 | + } | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + patientManagerQueryModel.setBookbuildingDoctor(bookbuildingDoctor); | |
| 1204 | + patientManagerQueryModel.setBookbuildingDate(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
| 1205 | + patientManagerQueryModel.setAddressRegister(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
| 1206 | + patientManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
| 1207 | + patientManagerQueryModel.setId(patients.getId()); | |
| 1208 | + patientManagerQueryModelList.add(patientManagerQueryModel); | |
| 1209 | + } | |
| 1210 | + } | |
| 1211 | + | |
| 1212 | + patientManagerResult.setPageInfo(patientsQuery.getPageInfo()); | |
| 1213 | + patientManagerResult.setData(patientManagerQueryModelList); | |
| 1214 | + patientManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1215 | + patientManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 1216 | + return patientManagerResult; | |
| 1217 | + } | |
| 1218 | + | |
| 1109 | 1219 | public BaseResponse findPatient2(PatientQueryRequest patientQueryRequest, Integer userId) { |
| 1110 | 1220 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 1111 | 1221 | patientsQuery.setPid(patientQueryRequest.getPid()); |