diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java index fafcd06..de98795 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java @@ -403,7 +403,7 @@ public class CourseFacade { patientCourseQuery.setHospitalId(hospitalId); - int allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); + //int allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); //状态 1预约,2签到 patientCourseQuery.setStatus(1); @@ -419,9 +419,9 @@ public class CourseFacade { totalData.put("allCourses",allCourses); //课程数 totalData.put("allSends",allSends); //总推送数 totalData.put("allOrders",allOrders); //总预约数 - totalData.put("allOrderRate", allCourses == 0 ? 0 : df.format((double) allOrders / allPatientCourses * 100) + "%"); //总预约率 + totalData.put("allOrderRate", allSends == 0 ? 0 : df.format((double) allOrders / allSends * 100) + "%"); //总预约率 totalData.put("allSigns", allSigns);//总签到数 - totalData.put("allSignRate", allCourses == 0 ? 0 : df.format((double) allSigns / allPatientCourses * 100) + "%");//总签到率 + totalData.put("allSignRate", allOrders == 0 ? 0 : df.format((double) allSigns / allOrders * 100) + "%");//总签到率 CourseTypeQuery courseTypeQuery = new CourseTypeQuery(); courseTypeQuery.setHospitalId(hospitalId); @@ -452,8 +452,6 @@ public class CourseFacade { } patientCourseQuery.setCourseIds(courseIds); - allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); - List> list = new ArrayList<>(); int batchSize = 2; int end = 0; @@ -468,8 +466,7 @@ public class CourseFacade { startTime, endTime, patientCourseService, - courseTypeService, - allPatientCourses); + courseTypeService ); Future f = commonThreadPool.submit(c); futures.add(f); } @@ -492,6 +489,7 @@ public class CourseFacade { List signs = new ArrayList(); int orderAll = 0; int signsAll = 0; + int sendAll = 0; for (CourseModel courseModel : courseModelList) { @@ -516,6 +514,9 @@ public class CourseFacade { signsAll+=Integer.parseInt(map.get("signs")); tableItem.put("signsRate",map.get("signsRate")); + + + sendAll+=Integer.parseInt(map.get("courseSends")); } } tableData.add(tableItem); @@ -526,9 +527,9 @@ public class CourseFacade { tableItem.put("courseTypeName", "合计"); tableItem.put("courseName",courseModelList.size()); tableItem.put("orders", orderAll); - tableItem.put("ordersRate", allPatientCourses == 0 ? "0" : df.format((double) orderAll / allPatientCourses * 100) + "%"); + tableItem.put("ordersRate", sendAll == 0 ? "0" : df.format((double) orderAll / sendAll * 100) + "%"); tableItem.put("signs",signsAll); - tableItem.put("signsRate",allPatientCourses == 0 ? "0" : df.format((double) signsAll / allPatientCourses * 100) + "%"); + tableItem.put("signsRate",orderAll == 0 ? "0" : df.format((double) signsAll / orderAll * 100) + "%"); tableData.add(tableItem); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CourseCountWorker.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CourseCountWorker.java index fe9d57f..9d39f0b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CourseCountWorker.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CourseCountWorker.java @@ -29,20 +29,17 @@ public class CourseCountWorker implements Callable { private String end; private PatientCourseService patientCourseService; private CourseTypeService courseTypeService; - private int allPatientCourses; public CourseCountWorker(List courseModelList,String hospitalId, String start, String end, PatientCourseService patientCourseService, - CourseTypeService courseTypeService, - int allPatientCourses) + CourseTypeService courseTypeService) { this.hospitalId = hospitalId; this.courseModelList = courseModelList; this.patientCourseService = patientCourseService; this.courseTypeService = courseTypeService; - this.allPatientCourses = allPatientCourses; this.start = start; this.end = end; } @@ -94,9 +91,9 @@ public class CourseCountWorker implements Callable { topmap.put("sends",String.valueOf(courseSends)); topmap.put("orders",String.valueOf(courseOrders)); - topmap.put("ordersRate",allPatientCourses == 0 ? "0" : df.format((double) courseOrders / allPatientCourses * 100) + "%"); + topmap.put("ordersRate",String.valueOf(courseSends == 0 ? "0" : df.format((double) courseOrders / courseSends * 100)) + "%"); topmap.put("signs",String.valueOf(courseSigns)); - topmap.put("signsRate", allPatientCourses == 0 ? "0" : df.format((double) courseSigns / allPatientCourses * 100) + "%"); + topmap.put("signsRate", String.valueOf(courseOrders == 0 ? "0" : df.format((double) courseSigns / courseOrders * 100)) + "%"); data.add(topmap); }