Commit d20655e3a284a419e1ea488f995edf3f463243c9
1 parent
f207d9dd84
Exists in
master
and in
6 other branches
乐陵住院统计导出及bug解决
Showing 4 changed files with 382 additions and 23 deletions
- platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientMarkHospitalController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml
View file @
d20655e
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientMarkHospitalController.java
View file @
d20655e
| ... | ... | @@ -10,9 +10,13 @@ |
| 10 | 10 | import com.lyms.platform.permission.model.PatientMarkHospital; |
| 11 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 12 | import org.springframework.stereotype.Controller; |
| 13 | -import org.springframework.web.bind.annotation.*; | |
| 13 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 15 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 16 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 14 | 17 | |
| 15 | 18 | import javax.servlet.http.HttpServletRequest; |
| 19 | +import javax.servlet.http.HttpServletResponse; | |
| 16 | 20 | |
| 17 | 21 | /** |
| 18 | 22 | * <p> |
| ... | ... | @@ -56,6 +60,20 @@ |
| 56 | 60 | } |
| 57 | 61 | |
| 58 | 62 | /** |
| 63 | + * 导出预约住院提统计 | |
| 64 | + * | |
| 65 | + * @param request | |
| 66 | + * @return | |
| 67 | + */ | |
| 68 | + @RequestMapping(value = "/extHospit", method = {RequestMethod.POST, RequestMethod.GET}) | |
| 69 | + @TokenRequired | |
| 70 | + public void extHospit(PatientMarkRequest patientMarkRequest | |
| 71 | + , HttpServletRequest request, HttpServletResponse resp) { | |
| 72 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 73 | + patientMarkHospFacade.extHospit(patientMarkRequest, loginState.getId(),resp); | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 59 | 77 | * 回院提醒统计 |
| 60 | 78 | * @param request |
| 61 | 79 | * @return |
| 62 | 80 | |
| ... | ... | @@ -68,7 +86,21 @@ |
| 68 | 86 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 69 | 87 | return patientMarkHospFacade.reportBackHospit(patientMarkRequest, loginState.getId()); |
| 70 | 88 | } |
| 89 | + | |
| 71 | 90 | /** |
| 91 | + * 导出回院提醒统计 | |
| 92 | + * @param request | |
| 93 | + * @return | |
| 94 | + */ | |
| 95 | + @RequestMapping(value = "/extBackHospit", method = {RequestMethod.POST, RequestMethod.GET}) | |
| 96 | + @TokenRequired | |
| 97 | + public void extBackHospit(PatientMarkRequest patientMarkRequest | |
| 98 | + , HttpServletRequest request, HttpServletResponse resp) { | |
| 99 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 100 | + patientMarkHospFacade.extBackHospit(patientMarkRequest, loginState.getId(),resp); | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 72 | 104 | * 住院提统计 |
| 73 | 105 | * @param request |
| 74 | 106 | * @return |
| 75 | 107 | |
| ... | ... | @@ -81,7 +113,20 @@ |
| 81 | 113 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 82 | 114 | return patientMarkHospFacade.reportInHospit(patientMarkRequest, loginState.getId()); |
| 83 | 115 | } |
| 116 | + | |
| 84 | 117 | /** |
| 118 | + * 导出住院提统计 | |
| 119 | + * @param request | |
| 120 | + * @return | |
| 121 | + */ | |
| 122 | + @RequestMapping(value = "/extInHospit", method = {RequestMethod.POST, RequestMethod.GET}) | |
| 123 | + @TokenRequired | |
| 124 | + public void extInHospit(PatientMarkRequest patientMarkRequest | |
| 125 | + , HttpServletRequest request, HttpServletResponse resp) { | |
| 126 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 127 | + patientMarkHospFacade.extInHospit(patientMarkRequest, loginState.getId(),resp); | |
| 128 | + } | |
| 129 | + /** | |
| 85 | 130 | * 实际住院提统计 |
| 86 | 131 | * @param request |
| 87 | 132 | * @return |
| ... | ... | @@ -95,6 +140,18 @@ |
| 95 | 140 | return patientMarkHospFacade.reportRealityHospit(patientMarkRequest, loginState.getId()); |
| 96 | 141 | } |
| 97 | 142 | /** |
| 143 | + * 导出实际住院提统计 | |
| 144 | + * @param request | |
| 145 | + * @return | |
| 146 | + */ | |
| 147 | + @RequestMapping(value = "/extRealityHospit", method = {RequestMethod.POST, RequestMethod.GET}) | |
| 148 | + @TokenRequired | |
| 149 | + public void extRealityHospit(PatientMarkRequest patientMarkRequest | |
| 150 | + , HttpServletRequest request, HttpServletResponse resp) { | |
| 151 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 152 | + patientMarkHospFacade.extRealityHospit(patientMarkRequest, loginState.getId(),resp); | |
| 153 | + } | |
| 154 | + /** | |
| 98 | 155 | * 预约失败住院提统计 |
| 99 | 156 | * @param request |
| 100 | 157 | * @return |
| ... | ... | @@ -106,6 +163,19 @@ |
| 106 | 163 | , HttpServletRequest request) { |
| 107 | 164 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 108 | 165 | return patientMarkHospFacade.reportFailureHospit(patientMarkRequest, loginState.getId()); |
| 166 | + } | |
| 167 | + | |
| 168 | + /** | |
| 169 | + * 导出预约失败住院提统计 | |
| 170 | + * @param request | |
| 171 | + * @return | |
| 172 | + */ | |
| 173 | + @RequestMapping(value = "/extFailureHospit", method = {RequestMethod.POST, RequestMethod.GET}) | |
| 174 | + @TokenRequired | |
| 175 | + public void extFailureHospit(PatientMarkRequest patientMarkRequest | |
| 176 | + , HttpServletRequest request, HttpServletResponse resp) { | |
| 177 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 178 | + patientMarkHospFacade.extFailureHospit(patientMarkRequest, loginState.getId(),resp); | |
| 109 | 179 | } |
| 110 | 180 | |
| 111 | 181 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java
View file @
d20655e
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | import com.lyms.platform.common.utils.DefenceUtils; |
| 13 | 13 | import com.lyms.platform.operate.web.request.PatientMarkRequest; |
| 14 | 14 | import com.lyms.platform.operate.web.result.PatienMarkHospResult; |
| 15 | +import com.lyms.platform.operate.web.utils.ResponseUtil; | |
| 15 | 16 | import com.lyms.platform.permission.model.*; |
| 16 | 17 | import com.lyms.platform.permission.service.PatientMarkHospitalLogService; |
| 17 | 18 | import com.lyms.platform.permission.service.PatientMarkHospitalService; |
| ... | ... | @@ -25,6 +26,7 @@ |
| 25 | 26 | import org.springframework.stereotype.Component; |
| 26 | 27 | |
| 27 | 28 | import javax.annotation.Resource; |
| 29 | +import javax.servlet.http.HttpServletResponse; | |
| 28 | 30 | import java.util.*; |
| 29 | 31 | |
| 30 | 32 | /** |
| ... | ... | @@ -111,6 +113,63 @@ |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | 115 | /** |
| 116 | + * 导出住院预约统计 | |
| 117 | + * | |
| 118 | + * @param patientMarkRequest | |
| 119 | + * @param id | |
| 120 | + * @return | |
| 121 | + */ | |
| 122 | + public void extHospit(PatientMarkRequest patientMarkRequest, Integer id, HttpServletResponse resp) { | |
| 123 | + PatientMarkHospitalQuery query = new PatientMarkHospitalQuery(); | |
| 124 | + query.setMakeStartDate(patientMarkRequest.getMakeStartDate()); | |
| 125 | + query.setMakeEndDate(patientMarkRequest.getMakeEndDate()); | |
| 126 | + //根据用户id获取医院ID | |
| 127 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 128 | + query.setHospitalId(hospitalId); | |
| 129 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 130 | + List<Patients> patientses = setPatientIds(patientMarkRequest, patientsQuery, hospitalId); | |
| 131 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 132 | + List<String> parentIds = new LinkedList<>(); | |
| 133 | + for (Patients pa : patientses) { | |
| 134 | + parentIds.add(pa.getId()); | |
| 135 | + } | |
| 136 | + query.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
| 137 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
| 138 | + return; | |
| 139 | + } | |
| 140 | + | |
| 141 | + //统计数据 | |
| 142 | + List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportPatMarkHospByMakeDoctor(query); | |
| 143 | + | |
| 144 | + //列数据 | |
| 145 | + List<String> legendData = new ArrayList<>(); | |
| 146 | + List<Map<String, Object>> serData = new ArrayList<>(); | |
| 147 | + | |
| 148 | + int i = 1; | |
| 149 | + for (ReportMakeHosptail rm : reportMakeHosptails) { | |
| 150 | + Map<String, Object> map = new HashedMap(); | |
| 151 | + Users users = usersService.getUsers(Integer.parseInt(rm.getDoctorId())); | |
| 152 | + if (users != null) { | |
| 153 | + rm.setDoctorName(users.getName()); | |
| 154 | + } else { | |
| 155 | + rm.setDoctorName("产检医生"); | |
| 156 | + } | |
| 157 | + legendData.add(rm.getDoctorName()); | |
| 158 | + map.put("value", rm.getNum()); | |
| 159 | + map.put("name", rm.getDoctorName()); | |
| 160 | + map.put("id", i++); | |
| 161 | + serData.add(map); | |
| 162 | + } | |
| 163 | + | |
| 164 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 165 | + cnames.put("id", "#"); | |
| 166 | + cnames.put("name", "操作员"); | |
| 167 | + cnames.put("value", "住院预约数"); | |
| 168 | + | |
| 169 | + ResponseUtil.responseExcel(cnames, serData, resp); | |
| 170 | + } | |
| 171 | + | |
| 172 | + /** | |
| 114 | 173 | * 回院预约统计 |
| 115 | 174 | * |
| 116 | 175 | * @param patientMarkRequest |
| ... | ... | @@ -143,6 +202,9 @@ |
| 143 | 202 | return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 144 | 203 | } |
| 145 | 204 | |
| 205 | + //回院住院提醒状态必须是已提醒状态 | |
| 206 | + patientMarkHospQuery.setBackStatus(2); | |
| 207 | + | |
| 146 | 208 | //统计数据 |
| 147 | 209 | List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportPatMarkHospByBackDoctor(patientMarkHospQuery); |
| 148 | 210 | |
| 149 | 211 | |
| ... | ... | @@ -190,7 +252,70 @@ |
| 190 | 252 | return result; |
| 191 | 253 | } |
| 192 | 254 | |
| 255 | + /** | |
| 256 | + * 导出回院预约统计 | |
| 257 | + * | |
| 258 | + * @param patientMarkRequest | |
| 259 | + * @param id | |
| 260 | + * @return | |
| 261 | + */ | |
| 262 | + public void extBackHospit(PatientMarkRequest patientMarkRequest, Integer id, HttpServletResponse resp) { | |
| 263 | + //根据用户id获取医院ID | |
| 264 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 265 | + PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); | |
| 193 | 266 | |
| 267 | + | |
| 268 | + patientMarkHospQuery.setHospitalId(hospitalId); | |
| 269 | + patientMarkHospQuery.setBackStartDate(patientMarkRequest.getMakeStartDate()); | |
| 270 | + patientMarkHospQuery.setBackEndDate(patientMarkRequest.getMakeEndDate()); | |
| 271 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 272 | + List<Patients> patientses = setPatientIds(patientMarkRequest, patientsQuery, hospitalId); | |
| 273 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 274 | + List<String> parentIds = new LinkedList<>(); | |
| 275 | + for (Patients pa : patientses) { | |
| 276 | + parentIds.add(pa.getId()); | |
| 277 | + } | |
| 278 | + patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
| 279 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
| 280 | + return; | |
| 281 | + } | |
| 282 | + | |
| 283 | + //回院住院提醒状态必须是已提醒状态 | |
| 284 | + patientMarkHospQuery.setBackStatus(2); | |
| 285 | + | |
| 286 | + //统计数据 | |
| 287 | + List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportPatMarkHospByBackDoctor(patientMarkHospQuery); | |
| 288 | + | |
| 289 | + //列数据 | |
| 290 | + List<String> legendData = new ArrayList<>(); | |
| 291 | + List<Map<String, Object>> serData = new ArrayList<>(); | |
| 292 | + | |
| 293 | + int i = 1; | |
| 294 | + for (ReportMakeHosptail rm : reportMakeHosptails) { | |
| 295 | + legendData.add(rm.getDoctorName()); | |
| 296 | + Users users = usersService.getUsers(Integer.parseInt(rm.getDoctorId())); | |
| 297 | + if (users != null) { | |
| 298 | + rm.setDoctorName(users.getName()); | |
| 299 | + } else { | |
| 300 | + rm.setDoctorName("产检医生"); | |
| 301 | + } | |
| 302 | + Map<String, Object> map = new HashedMap(); | |
| 303 | + map.put("doctorName", rm.getDoctorName()); | |
| 304 | + map.put("succNum", rm.getSuccNum()); | |
| 305 | + map.put("errNum", rm.getErrNum()); | |
| 306 | + map.put("id", i++); | |
| 307 | + serData.add(map); | |
| 308 | + } | |
| 309 | + | |
| 310 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 311 | + cnames.put("id", "#"); | |
| 312 | + cnames.put("doctorName", "操作员"); | |
| 313 | + cnames.put("succNum", "回院预约成功数"); | |
| 314 | + cnames.put("errNum", "回院预约成功数"); | |
| 315 | + ResponseUtil.responseExcel(cnames, serData, resp); | |
| 316 | + } | |
| 317 | + | |
| 318 | + | |
| 194 | 319 | /** |
| 195 | 320 | * 住院提醒统计 |
| 196 | 321 | * |
| 197 | 322 | |
| 198 | 323 | |
| ... | ... | @@ -245,15 +370,15 @@ |
| 245 | 370 | succNum += rm.getSuccNum(); |
| 246 | 371 | errNum += rm.getErrNum(); |
| 247 | 372 | } |
| 248 | - legendData.add("成功住院预约数量"); | |
| 249 | - legendData.add("失败预约住院数量"); | |
| 373 | + legendData.add("住院提醒成功总数"); | |
| 374 | + legendData.add("住院提醒失败总数"); | |
| 250 | 375 | Map<String, Object> map = new HashedMap(); |
| 251 | 376 | map.put("value", succNum); |
| 252 | - map.put("name", "回院提醒成功总数"); | |
| 377 | + map.put("name", "住院提醒成功总数"); | |
| 253 | 378 | serData.add(map); |
| 254 | 379 | map = new HashedMap(); |
| 255 | 380 | map.put("value", errNum); |
| 256 | - map.put("name", "回院提醒失败总数"); | |
| 381 | + map.put("name", "住院提醒失败总数"); | |
| 257 | 382 | serData.add(map); |
| 258 | 383 | |
| 259 | 384 | |
| 260 | 385 | |
| ... | ... | @@ -268,7 +393,64 @@ |
| 268 | 393 | return result; |
| 269 | 394 | } |
| 270 | 395 | |
| 396 | + | |
| 271 | 397 | /** |
| 398 | + * 导出住院提醒统计 | |
| 399 | + * | |
| 400 | + * @param patientMarkRequest | |
| 401 | + * @param id | |
| 402 | + * @return | |
| 403 | + */ | |
| 404 | + public void extInHospit(PatientMarkRequest patientMarkRequest, Integer id, HttpServletResponse resp) { | |
| 405 | + //根据用户id获取医院ID | |
| 406 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 407 | + PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); | |
| 408 | + patientMarkHospQuery.setHospitalId(hospitalId); | |
| 409 | + patientMarkHospQuery.setInHospitStartDate(patientMarkRequest.getMakeStartDate()); | |
| 410 | + patientMarkHospQuery.setInHospitEndDate(patientMarkRequest.getMakeEndDate()); | |
| 411 | + | |
| 412 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 413 | + List<Patients> patientses = setPatientIds(patientMarkRequest, patientsQuery, hospitalId); | |
| 414 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 415 | + List<String> parentIds = new LinkedList<>(); | |
| 416 | + for (Patients pa : patientses) { | |
| 417 | + parentIds.add(pa.getId()); | |
| 418 | + } | |
| 419 | + patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
| 420 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
| 421 | + return; | |
| 422 | + } | |
| 423 | + | |
| 424 | + //统计数据 | |
| 425 | + List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportPatMarkHospByInDoctor(patientMarkHospQuery); | |
| 426 | + patientMarkHospQuery.setBackResult(1); | |
| 427 | + patientMarkHospQuery.setInHospitStatus(1); | |
| 428 | + List<Map<String, Object>> serData = new ArrayList<>(); | |
| 429 | + | |
| 430 | + int i = 1; | |
| 431 | + for (ReportMakeHosptail rm : reportMakeHosptails) { | |
| 432 | + Users users = usersService.getUsers(Integer.parseInt(rm.getDoctorId())); | |
| 433 | + if (users != null) { | |
| 434 | + rm.setDoctorName(users.getName()); | |
| 435 | + } else { | |
| 436 | + rm.setDoctorName("产检医生"); | |
| 437 | + } | |
| 438 | + Map<String, Object> map = new HashedMap(); | |
| 439 | + map.put("doctorName", rm.getDoctorName()); | |
| 440 | + map.put("succNum", rm.getSuccNum()); | |
| 441 | + map.put("errNum", rm.getErrNum()); | |
| 442 | + map.put("id", i++); | |
| 443 | + serData.add(map); | |
| 444 | + } | |
| 445 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 446 | + cnames.put("id", "#"); | |
| 447 | + cnames.put("doctorName", "操作员"); | |
| 448 | + cnames.put("succNum", "住院提醒成功总数"); | |
| 449 | + cnames.put("errNum", "住院提醒失败总数"); | |
| 450 | + ResponseUtil.responseExcel(cnames, serData, resp); | |
| 451 | + } | |
| 452 | + | |
| 453 | + /** | |
| 272 | 454 | * 实际住院统计 |
| 273 | 455 | * |
| 274 | 456 | * @param patientMarkRequest |
| ... | ... | @@ -279,8 +461,8 @@ |
| 279 | 461 | //根据用户id获取医院ID |
| 280 | 462 | String hospitalId = autoMatchFacade.getHospitalId(id); |
| 281 | 463 | PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); |
| 282 | - patientMarkHospQuery.setHospitStartDate(patientMarkRequest.getMakeStartDate()); | |
| 283 | - patientMarkHospQuery.setHospitEndDate(patientMarkRequest.getMakeEndDate()); | |
| 464 | + patientMarkHospQuery.setInHospitStartDate(patientMarkRequest.getMakeStartDate()); | |
| 465 | + patientMarkHospQuery.setInHospitEndDate(patientMarkRequest.getMakeEndDate()); | |
| 284 | 466 | |
| 285 | 467 | patientMarkHospQuery.setHospitalId(hospitalId); |
| 286 | 468 | PatientsQuery patientsQuery = new PatientsQuery(); |
| ... | ... | @@ -311,8 +493,8 @@ |
| 311 | 493 | succNum += rm.getSuccNum(); |
| 312 | 494 | num += rm.getNum(); |
| 313 | 495 | } |
| 314 | - legendData.add("住院提醒成功总数"); | |
| 315 | - legendData.add("实际住院总数"); | |
| 496 | + legendData.add("住院提醒成功人数"); | |
| 497 | + legendData.add("实际住院人数"); | |
| 316 | 498 | Map<String, Object> map = new HashedMap(); |
| 317 | 499 | map.put("value", succNum); |
| 318 | 500 | map.put("name", "实际住院总数"); |
| ... | ... | @@ -333,6 +515,111 @@ |
| 333 | 515 | } |
| 334 | 516 | |
| 335 | 517 | /** |
| 518 | + * 导出实际住院统计 | |
| 519 | + * | |
| 520 | + * @param patientMarkRequest | |
| 521 | + * @param id | |
| 522 | + * @return | |
| 523 | + */ | |
| 524 | + public void extRealityHospit(PatientMarkRequest patientMarkRequest, Integer id, HttpServletResponse resp) { | |
| 525 | + //根据用户id获取医院ID | |
| 526 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 527 | + PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); | |
| 528 | + patientMarkHospQuery.setHospitStartDate(patientMarkRequest.getMakeStartDate()); | |
| 529 | + patientMarkHospQuery.setHospitEndDate(patientMarkRequest.getMakeEndDate()); | |
| 530 | + | |
| 531 | + patientMarkHospQuery.setHospitalId(hospitalId); | |
| 532 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 533 | + List<Patients> patientses = setPatientIds(patientMarkRequest, patientsQuery, hospitalId); | |
| 534 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 535 | + List<String> parentIds = new LinkedList<>(); | |
| 536 | + for (Patients pa : patientses) { | |
| 537 | + parentIds.add(pa.getId()); | |
| 538 | + } | |
| 539 | + patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
| 540 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
| 541 | + return; | |
| 542 | + } | |
| 543 | + List<Map<String, Object>> serData = new ArrayList<>(); | |
| 544 | + //实际住院统计数据 | |
| 545 | + List<ReportMakeHosptail> reportMakeHosptails = patientMarkHospitalService.reportRealityByInDoctor(patientMarkHospQuery); | |
| 546 | + int i = 1; | |
| 547 | + for (ReportMakeHosptail rm : reportMakeHosptails) { | |
| 548 | + Users users = usersService.getUsers(Integer.parseInt(rm.getDoctorId())); | |
| 549 | + if (users != null) { | |
| 550 | + rm.setDoctorName(users.getName()); | |
| 551 | + } else { | |
| 552 | + rm.setDoctorName("产检医生"); | |
| 553 | + } | |
| 554 | + Map<String, Object> map = new HashedMap(); | |
| 555 | + map.put("doctorName", rm.getDoctorName()); | |
| 556 | + map.put("num", rm.getNum()); | |
| 557 | + map.put("succNum", rm.getSuccNum()); | |
| 558 | + map.put("id", i++); | |
| 559 | + serData.add(map); | |
| 560 | + } | |
| 561 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 562 | + cnames.put("id", "#"); | |
| 563 | + cnames.put("doctorName", "操作员"); | |
| 564 | + cnames.put("num", "住院提醒成功人数"); | |
| 565 | + cnames.put("succNum", "实际住院人数"); | |
| 566 | + ResponseUtil.responseExcel(cnames, serData, resp); | |
| 567 | + } | |
| 568 | + | |
| 569 | + /** | |
| 570 | + * 导出预约失败统计 | |
| 571 | + * | |
| 572 | + * @param patientMarkRequest | |
| 573 | + * @param id | |
| 574 | + * @return | |
| 575 | + */ | |
| 576 | + public void extFailureHospit(PatientMarkRequest patientMarkRequest, Integer id, HttpServletResponse resp) { | |
| 577 | + //根据用户id获取医院ID | |
| 578 | + String hospitalId = autoMatchFacade.getHospitalId(id); | |
| 579 | + PatientMarkHospitalQuery patientMarkHospQuery = new PatientMarkHospitalQuery(); | |
| 580 | + patientMarkHospQuery.setHospitalId(hospitalId); | |
| 581 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 582 | + List<Patients> patientses = setPatientIds(patientMarkRequest, patientsQuery, hospitalId); | |
| 583 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 584 | + List<String> parentIds = new LinkedList<>(); | |
| 585 | + for (Patients pa : patientses) { | |
| 586 | + parentIds.add(pa.getId()); | |
| 587 | + } | |
| 588 | + patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); | |
| 589 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()) { | |
| 590 | + return; | |
| 591 | + } | |
| 592 | + patientMarkHospQuery.setMakeStartDate(patientMarkRequest.getMakeStartDate()); | |
| 593 | + patientMarkHospQuery.setMakeEndDate(patientMarkRequest.getMakeEndDate()); | |
| 594 | + | |
| 595 | + List<Map<String, Object>> serData = new ArrayList<>(); | |
| 596 | + //提醒失败统计数据 | |
| 597 | + List<ReportFailureHosptail> reportMakeHosptails = patientMarkHospitalService.reportFailure(patientMarkHospQuery); | |
| 598 | + int i = 1; | |
| 599 | + for (ReportFailureHosptail rf : reportMakeHosptails) { | |
| 600 | + Map<String, Object> map = new HashedMap(); | |
| 601 | + map.put("type", rf.getType()); | |
| 602 | + map.put("num", rf.getNum()); | |
| 603 | + map.put("noPhoneNum", rf.getNoPhoneNum()); | |
| 604 | + map.put("indeterNum", rf.getIndeterNum()); | |
| 605 | + map.put("otherHospNum", rf.getOtherHospNum()); | |
| 606 | + map.put("otherNum", rf.getOtherNum()); | |
| 607 | + map.put("id", i++); | |
| 608 | + serData.add(map); | |
| 609 | + } | |
| 610 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 611 | + cnames.put("id", "#"); | |
| 612 | + cnames.put("type", "类型"); | |
| 613 | + cnames.put("num", "预约提醒总量"); | |
| 614 | + cnames.put("noPhoneNum", "电话无人接听"); | |
| 615 | + cnames.put("indeterNum", "暂时不确定"); | |
| 616 | + cnames.put("otherHospNum", "他院已办理"); | |
| 617 | + cnames.put("otherNum", "其他"); | |
| 618 | + ResponseUtil.responseExcel(cnames, serData, resp); | |
| 619 | + } | |
| 620 | + | |
| 621 | + | |
| 622 | + /** | |
| 336 | 623 | * 预约失败统计 |
| 337 | 624 | * |
| 338 | 625 | * @param patientMarkRequest |
| 339 | 626 | |
| ... | ... | @@ -404,9 +691,10 @@ |
| 404 | 691 | return result; |
| 405 | 692 | } |
| 406 | 693 | |
| 694 | + | |
| 407 | 695 | public List<Patients> setPatientIds(PatientMarkRequest patientMarkRequest, PatientsQuery patientsQuery, String hospitalId) { |
| 408 | 696 | //根据查询号、当前孕周进行查询 |
| 409 | - if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()|| StringUtils.isNotEmpty(patientMarkRequest.getQueryNo())) { | |
| 697 | + if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd() || StringUtils.isNotEmpty(patientMarkRequest.getQueryNo())) { | |
| 410 | 698 | if (null != patientMarkRequest.getcDueWeekStart()) { |
| 411 | 699 | patientsQuery.setLastMensesEnd(DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(patientMarkRequest.getcDueWeekStart() * 7))); |
| 412 | 700 | } |
| ... | ... | @@ -485,7 +773,7 @@ |
| 485 | 773 | patientMarkHospitalService.addPatientMarkHospital(ps); |
| 486 | 774 | |
| 487 | 775 | //添加日志 |
| 488 | - addPatientMarkHospLog(ps,1); | |
| 776 | + addPatientMarkHospLog(ps, 1); | |
| 489 | 777 | |
| 490 | 778 | BaseResponse baseResponse = new BaseResponse(); |
| 491 | 779 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| ... | ... | @@ -523,7 +811,7 @@ |
| 523 | 811 | ps.setInHospitStatus(2); |
| 524 | 812 | } |
| 525 | 813 | //添加日志 |
| 526 | - addPatientMarkHospLog(ps,type); | |
| 814 | + addPatientMarkHospLog(ps, type); | |
| 527 | 815 | |
| 528 | 816 | //根据用户id获取医院ID |
| 529 | 817 | patientMarkHospitalService.updatePatientMarkHospital(ps); |
| 530 | 818 | |
| ... | ... | @@ -536,10 +824,11 @@ |
| 536 | 824 | |
| 537 | 825 | /** |
| 538 | 826 | * 添加住院预约日志 |
| 827 | + * | |
| 539 | 828 | * @param ps |
| 540 | 829 | * @param type (1-住院预约修改,2-回院提醒修改、3-住院提醒修改) |
| 541 | 830 | */ |
| 542 | - public void addPatientMarkHospLog(PatientMarkHospital ps,int type){ | |
| 831 | + public void addPatientMarkHospLog(PatientMarkHospital ps, int type) { | |
| 543 | 832 | PatientMarkHospitalLog markHospitalLog = new PatientMarkHospitalLog(); |
| 544 | 833 | markHospitalLog.setId(UUID.randomUUID().toString().replace("-", "")); |
| 545 | 834 | markHospitalLog.setHospitalId(ps.getHospitalId()); |
| ... | ... | @@ -608,7 +897,7 @@ |
| 608 | 897 | if (ps.getBackResult() != null) { |
| 609 | 898 | result.setBackResultStr(ps.getBackResult() == 1 ? "成功" : "失败"); |
| 610 | 899 | //提醒结果为失败 |
| 611 | - if (ps.getBackResult() == 2&&ps.getBackFailure() != null) { | |
| 900 | + if (ps.getBackResult() == 2 && ps.getBackFailure() != null) { | |
| 612 | 901 | result.setBackFailure(ps.getBackFailure()); |
| 613 | 902 | result.setBackFailureStr(MakeHospitalEnums.getTitle(ps.getBackFailure())); |
| 614 | 903 | } |
| 615 | 904 | |
| ... | ... | @@ -708,14 +997,14 @@ |
| 708 | 997 | parentIds.add(pa.getId()); |
| 709 | 998 | } |
| 710 | 999 | patientMarkHospQuery.setPatientIds((String[]) parentIds.toArray(new String[parentIds.size()])); |
| 711 | - } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd()||StringUtils.isNotEmpty(patientMarkRequest.getQueryNo())) { | |
| 1000 | + } else if (null != patientMarkRequest.getcDueWeekStart() || null != patientMarkRequest.getcDueWeekEnd() || StringUtils.isNotEmpty(patientMarkRequest.getQueryNo())) { | |
| 712 | 1001 | return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(new ArrayList()); |
| 713 | 1002 | } |
| 714 | 1003 | |
| 715 | 1004 | if (patientMarkRequest.getType() == 2) {//2-回院提醒 |
| 716 | 1005 | patientMarkHospQuery.setBackStatus(patientMarkRequest.getStatus()); |
| 717 | 1006 | patientMarkHospQuery.setBackResult(patientMarkRequest.getResult()); |
| 718 | - if(patientMarkRequest.getFailure()!=null){ | |
| 1007 | + if (patientMarkRequest.getFailure() != null) { | |
| 719 | 1008 | //失败原因,则前提是提醒状态是失败 |
| 720 | 1009 | patientMarkHospQuery.setBackFailure(patientMarkRequest.getFailure()); |
| 721 | 1010 | patientMarkHospQuery.setBackResult(2); |
| ... | ... | @@ -729,7 +1018,7 @@ |
| 729 | 1018 | patientMarkHospQuery.setBackStatus(2); |
| 730 | 1019 | patientMarkHospQuery.setBackResult(1); |
| 731 | 1020 | patientMarkHospQuery.setInHospitResult(patientMarkRequest.getResult()); |
| 732 | - if(patientMarkRequest.getFailure()!=null){ | |
| 1021 | + if (patientMarkRequest.getFailure() != null) { | |
| 733 | 1022 | //失败原因,则前提是提醒状态是失败 |
| 734 | 1023 | patientMarkHospQuery.setInHospitFailure(patientMarkRequest.getFailure()); |
| 735 | 1024 | patientMarkHospQuery.setInHospitResult(2); |
| 736 | 1025 | |
| 737 | 1026 | |
| ... | ... | @@ -794,11 +1083,11 @@ |
| 794 | 1083 | if (null != patients) { |
| 795 | 1084 | //住院结束时间 |
| 796 | 1085 | Date hospitEndDate = null; |
| 797 | - if(ps.getInHospitMakeDate()!=null){ | |
| 1086 | + if (ps.getInHospitMakeDate() != null) { | |
| 798 | 1087 | hospitEndDate = ps.getInHospitMakeDate(); |
| 799 | - }else if(ps.getBackMakeDate()!=null){ | |
| 1088 | + } else if (ps.getBackMakeDate() != null) { | |
| 800 | 1089 | hospitEndDate = ps.getBackMakeDate(); |
| 801 | - }else{ | |
| 1090 | + } else { | |
| 802 | 1091 | hospitEndDate = ps.getMakeInHospitDate(); |
| 803 | 1092 | } |
| 804 | 1093 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
d20655e
| ... | ... | @@ -159,7 +159,7 @@ |
| 159 | 159 | patientServiceList.add(ps); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - synPatientService(patientServiceList.toArray(new PatientService[patientServiceList.size()])); | |
| 162 | + // synPatientService(patientServiceList.toArray(new PatientService[patientServiceList.size()])); | |
| 163 | 163 | |
| 164 | 164 | BaseResponse baseResponse = new BaseResponse(); |
| 165 | 165 | baseResponse.setObject(ps.getId()); |
| ... | ... | @@ -181,7 +181,7 @@ |
| 181 | 181 | ps.setUpdateDate(new Date()); |
| 182 | 182 | ps.setUpdateUser(String.valueOf(id)); |
| 183 | 183 | patientServiceService.updatePatientService(ps); |
| 184 | - synPatientService(ps); | |
| 184 | + // synPatientService(ps); | |
| 185 | 185 | BaseResponse baseResponse = new BaseResponse(); |
| 186 | 186 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 187 | 187 | baseResponse.setErrormsg("成功"); |