Commit 18ca94d80a3b1cb38cef7c08566a2d18c5cf02ea
1 parent
dff86c41af
Exists in
dev
#fix:优化数据统计
Showing 3 changed files with 20 additions and 92 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
18ca94d
| ... | ... | @@ -180,7 +180,8 @@ |
| 180 | 180 | ps.setSerStatus(1); |
| 181 | 181 | ps.setServiceWeek(yxzhVO.getWeeks()); |
| 182 | 182 | ps.setSerType(1); |
| 183 | - | |
| 183 | + ps.setSerEndTime(patientService.getSerEndTime()); | |
| 184 | + ps.setSerStartTime(patientService.getSerStartTime()); | |
| 184 | 185 | patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); |
| 185 | 186 | |
| 186 | 187 | } |
| ... | ... | @@ -194,6 +195,8 @@ |
| 194 | 195 | ps.setSerStatus(1); |
| 195 | 196 | ps.setServiceWeek(yxzhVO.getWeeks()); |
| 196 | 197 | ps.setSerType(6); |
| 198 | + ps.setSerEndTime(patientService.getSerEndTime()); | |
| 199 | + ps.setSerStartTime(patientService.getSerStartTime()); | |
| 197 | 200 | baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); |
| 198 | 201 | |
| 199 | 202 | } |
| ... | ... | @@ -207,6 +210,8 @@ |
| 207 | 210 | ps.setSerStatus(1); |
| 208 | 211 | ps.setServiceWeek(yxzhVO.getWeeks()); |
| 209 | 212 | ps.setSerType(2); |
| 213 | + ps.setSerEndTime(patientService.getSerEndTime()); | |
| 214 | + ps.setSerStartTime(patientService.getSerStartTime()); | |
| 210 | 215 | baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); |
| 211 | 216 | |
| 212 | 217 | } |
| ... | ... | @@ -222,6 +227,8 @@ |
| 222 | 227 | ps.setSerStatus(1); |
| 223 | 228 | ps.setServiceWeek(yxzhVO.getWeeks()); |
| 224 | 229 | ps.setSerType(20); |
| 230 | + ps.setSerEndTime(patientService.getSerEndTime()); | |
| 231 | + ps.setSerStartTime(patientService.getSerStartTime()); | |
| 225 | 232 | baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); |
| 226 | 233 | } |
| 227 | 234 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
View file @
18ca94d
| ... | ... | @@ -1211,13 +1211,14 @@ |
| 1211 | 1211 | if (StringUtils.isEmpty(parentIds)){ |
| 1212 | 1212 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 1213 | 1213 | } |
| 1214 | - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 1215 | - antExRecordQuery.setNeed("1"); | |
| 1216 | - antExRecordQuery.setParentIds(com.lyms.platform.common.utils.StringUtils.covertToList(parentIds, String.class)); | |
| 1217 | - antExRecordQuery.setNeed("true"); | |
| 1218 | - antExRecordQuery.setLimit(limit); | |
| 1219 | - antExRecordQuery.setPage(page); | |
| 1220 | - return antenatalExaminationFacade.antenatalExaminationStatisticsList(antExRecordQuery); | |
| 1214 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1215 | + patientsQuery.setNeed("1"); | |
| 1216 | + patientsQuery.setYn(1); | |
| 1217 | + patientsQuery.setIds(com.lyms.platform.common.utils.StringUtils.covertToList(parentIds, String.class)); | |
| 1218 | + patientsQuery.setNeed("true"); | |
| 1219 | + patientsQuery.setLimit(limit); | |
| 1220 | + patientsQuery.setPage(page); | |
| 1221 | + return antenatalExaminationFacade.antenatalExaminationStatisticsList(patientsQuery); | |
| 1221 | 1222 | } |
| 1222 | 1223 | |
| 1223 | 1224 | @RequestMapping(value = "/cjStatistics/enums", method = RequestMethod.GET) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
18ca94d
| ... | ... | @@ -223,92 +223,12 @@ |
| 223 | 223 | return null; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - public BaseResponse antenatalExaminationStatisticsList(AntExRecordQuery antExRecordQuery){ | |
| 226 | + public BaseResponse antenatalExaminationStatisticsList(PatientsQuery patientsQuery){ | |
| 227 | 227 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 228 | - List data = new ArrayList<>(); | |
| 229 | - | |
| 230 | - List<AntExRecordModel> list2 = recordService.queryAntExRecords(antExRecordQuery); | |
| 231 | - if (CollectionUtils.isNotEmpty(list2)) { | |
| 232 | - for (AntExRecordModel record : list2) { | |
| 233 | - CjStatisticsListResult cjStatisticsListResult = new CjStatisticsListResult(); | |
| 234 | - cjStatisticsListResult.convertToResult(record); | |
| 235 | - Patients patients = patientsService.findOnePatientById(record.getParentId()); | |
| 236 | - String dueWeek = ""; | |
| 237 | - if (null != patients) { | |
| 238 | - //2017-03-15 高帆说的改成这样 | |
| 239 | - if (patients.getType()==1 &&patients.getLastMenses() != null && record.getCheckTime() != null) { | |
| 240 | - int days = DateUtil.daysBetween(patients.getLastMenses(), record.getCheckTime()); | |
| 241 | - String week = (days / 7) + ""; | |
| 242 | - int day = (days % 7); | |
| 243 | - dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 244 | - cjStatisticsListResult.setDueWeek(dueWeek); | |
| 245 | - }else if(patients.getType()==3 &&patients.getLastMenses() != null && patients.getDueDate() != null){ | |
| 246 | - int days = DateUtil.daysBetween(patients.getLastMenses(), patients.getDueDate()); | |
| 247 | - String week = (days / 7) + ""; | |
| 248 | - int day = (days % 7); | |
| 249 | - dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 250 | - cjStatisticsListResult.setDueWeek(dueWeek); | |
| 251 | - } | |
| 252 | - } | |
| 253 | - | |
| 254 | - | |
| 255 | - Users users = usersService.getUsers(NumberUtils.toInt(record.getCheckDoctor())); | |
| 256 | - if (null != users) { | |
| 257 | - cjStatisticsListResult.setCheckDoctor(users.getName()); | |
| 258 | - } | |
| 259 | - | |
| 260 | - //处理高危 | |
| 261 | - handleRisk(record, cjStatisticsListResult); | |
| 262 | - | |
| 263 | - data.add(cjStatisticsListResult); | |
| 264 | - } | |
| 265 | - } | |
| 266 | - | |
| 267 | - return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(antExRecordQuery.getPageInfo()); | |
| 268 | - | |
| 228 | + List<Patients> list= patientsService.queryPatient(patientsQuery); | |
| 229 | + return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(list).setPageInfo(patientsQuery.getPageInfo()); | |
| 269 | 230 | } |
| 270 | - private void handleRisk(AntExRecordModel e, CjStatisticsListResult antExManagerResult) { | |
| 271 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(e.getfId())) { | |
| 272 | - String risk = null; | |
| 273 | - if (e.getType() == 2) { | |
| 274 | - AntExChuModel model = antExService.findOne(e.getfId()); | |
| 275 | - if (null != model) { | |
| 276 | - risk = model.getOtherHighRisk(); | |
| 277 | - } | |
| 278 | - } else if (e.getType() == 1) { | |
| 279 | - AntenatalExaminationModel model = antExService.findOneById(e.getfId()); | |
| 280 | - if (null != model) { | |
| 281 | - risk = model.getOtherRisk(); | |
| 282 | - } | |
| 283 | - } | |
| 284 | - StringBuffer name = new StringBuffer(); | |
| 285 | - Integer score = 0; | |
| 286 | - List<Map<String, Object>> results = commonService.resolveOtherRisk(risk); | |
| 287 | - if (CollectionUtils.isNotEmpty(results)) { | |
| 288 | - for (Map result : results) { | |
| 289 | - //高危因素名字 | |
| 290 | - name.append(result.get("name").toString() + ","); | |
| 291 | - String level = result.get("levelId").toString(); | |
| 292 | - score += NumberUtils.toInt(result.get("score").toString(), 0); | |
| 293 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(level) && !"null".equals(level)) { | |
| 294 | - e.gethLevel().add(level); | |
| 295 | - } | |
| 296 | - } | |
| 297 | - } | |
| 298 | - //高危因素 | |
| 299 | - antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); | |
| 300 | - String ri = commonService.resloveFactor(e.gethRisk()); | |
| 301 | - if (ri.isEmpty()) { | |
| 302 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(name.toString())) { | |
| 303 | - ri = name.substring(0, name.length() - 1); | |
| 304 | - } | |
| 305 | - } else if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(name.toString())) { | |
| 306 | - ri += "," + name.substring(0, name.length() - 1); | |
| 307 | - } | |
| 308 | - antExManagerResult.setrRisk(ri); | |
| 309 | - antExManagerResult.setScore((e.gethScore() + score)); | |
| 310 | - } | |
| 311 | - } | |
| 231 | + | |
| 312 | 232 | public BaseResponse antenatalExaminationStatistics(Integer userId){ |
| 313 | 233 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 314 | 234 | AntExChuQuery antExChuQuery=new AntExChuQuery(); |