Commit 4e3950d3ecbe52ff4385da9a605097f1792432e6

Authored by zhangchao
1 parent 2c51c59ca9
Exists in luanping and in 1 other branch dev

#优化听课率建档人数查询

Showing 1 changed file with 14 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java View file @ 4e3950d
... ... @@ -649,19 +649,28 @@
649 649 patientsQuery.setBookbuildingDateEnd(DateUtil.parseYMDHMS(endTime + " 23:59:59"));
650 650 }
651 651 }
652   -
  652 + //时间范围的建档人数
  653 + List <Patients> patientsList = patientsService.queryPatient(patientsQuery);
  654 + //签到数
653 655 int signsNum=0;
654 656 List<PatientCourseModel> singsList= patientCourseService.queryPatientCourseList(patientCourseQuery);
655   - if (singsList!=null&&singsList.size()>0){
  657 + if (singsList!=null&&singsList.size()>0&&patientsList!=null&&patientsList.size()>0){
656 658 Iterator<PatientCourseModel> patientCourseIterator = singsList.iterator();
657 659 HashMap<String,PatientCourseModel> params=new HashMap<>();
658 660 while (patientCourseIterator.hasNext()) {
659 661 PatientCourseModel patientCourse = patientCourseIterator.next();
660   - params.put(patientCourse.getCardNo(),patientCourse);
  662 + params.put(patientCourse.getPatientId(),patientCourse);
661 663 }
662   - signsNum=params.size();
  664 + for (int i = 0,j=patientsList.size(); i < j; i++) {
  665 + Patients patients= patientsList.get(i);
  666 + PatientCourseModel patientCourseModel= params.get(patients.getId());
  667 + if (patientCourseModel!=null){
  668 + signsNum+=1;
  669 + }
  670 + }
  671 +
663 672 }
664   - List <Patients> patientsList = patientsService.queryPatient(patientsQuery);
  673 +
665 674  
666 675 totalData.put("lessonsRate",patientsList!=null ? signsNum+","+patientsList.size(): "0");//听课率
667 676 }