Commit acc6e2f5e114c5bba61397b0c87749c1e643cbbb

Authored by zhangchao
1 parent 8bc671cd5e
Exists in dev

#fix:优化大同门诊数据搜索逻辑

Showing 1 changed file with 38 additions and 7 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java View file @ acc6e2f
... ... @@ -507,9 +507,11 @@
507 507 @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment")
508 508 @ResponseBody
509 509 public BaseResponse getAppointment(@RequestHeader("Authorization")String authorization,
510   - @RequestParam String doctor,
511   - @RequestParam String startTime,
512   - @RequestParam String endTime,
  510 + @RequestParam String doctor,
  511 + @RequestParam String startTime,
  512 + @RequestParam String endTime,
  513 + @RequestParam(required = false) Integer isBuild,
  514 + @RequestParam(required = false) Integer expire,
513 515 @RequestParam(required = false) String name,
514 516 @RequestParam(required = false) String doctorName
515 517  
... ... @@ -523,6 +525,9 @@
523 525 List<AppointmentModel> modelList= appointmentService.queryAppointment(doctor,startTime,endTime,name,doctorName);
524 526 Date date=new Date();
525 527 if (CollectionUtils.isNotEmpty(modelList)){
  528 + boolean b=true;
  529 + List<AppointmentModel> checkList=new ArrayList<>();
  530 +
526 531 PatientsQuery patientsQuery =new PatientsQuery();
527 532 patientsQuery.setYn(1);
528 533 patientsQuery.setHospitalId(hospitalId);
... ... @@ -539,6 +544,7 @@
539 544 patientsQuery.setPhone(phone);
540 545 }else {
541 546 appointmentModel.setIsBuild(0);
  547 + appointmentModel.setExpire(1);
542 548 }
543 549 }
544 550 if (appointmentModel.getIsBuild()==null){
... ... @@ -561,7 +567,6 @@
561 567 }
562 568 }
563 569  
564   -
565 570 if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getRiskLevelId()) && !"[]".equals(patients.getRiskLevelId())) {
566 571 List level = new ArrayList();
567 572 try {
568 573  
569 574  
570 575  
571 576  
572 577  
... ... @@ -571,21 +576,47 @@
571 576 if (null != basicConfig) {
572 577 Map map = new HashMap();
573 578 basicConfig.replenRisk(map);
574   - level.add(map);
  579 + if (!level.contains(map)){
  580 + level.add(map);
  581 + }
575 582 }
576 583 }
577 584 } catch (Exception e) {
578 585 ExceptionUtils.catchException(e, "patients.getRiskLevelId error.");
579 586 }
580   - appointmentModel.setrlevel(HighScoreResult.filter(level));
  587 + appointmentModel.setrlevel(level);
581 588 }
582 589 }else {
583 590 appointmentModel.setIsBuild(0);
  591 + appointmentModel.setExpire(1);
584 592 }
585 593 }
  594 + if (isBuild!=null){
  595 + b=false;
  596 + if (expire!=null){
  597 + if (appointmentModel.getIsBuild()==isBuild&&appointmentModel.getExpire()==expire){
  598 + checkList.add(appointmentModel);
  599 + }
  600 + }else {
  601 + if (appointmentModel.getIsBuild()==isBuild){
  602 + checkList.add(appointmentModel);
  603 + }
  604 + }
  605 + }else {
  606 + if (expire!=null){
  607 + b=false;
  608 + if (appointmentModel.getExpire()==expire){
  609 + checkList.add(appointmentModel);
  610 + }
  611 + }
  612 + }
586 613 }
  614 + if (b){
  615 + baseResponse.setObject(modelList);
  616 + }else {
  617 + baseResponse.setObject(checkList);
  618 + }
587 619 }
588   - baseResponse.setObject(modelList);
589 620 baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
590 621 return baseResponse;
591 622 }