Commit 7ca2c75d19363a7799120cab14c61a670db6ebff
1 parent
32c3ece8d7
Exists in
master
and in
6 other branches
孕妇学校统计
Showing 2 changed files with 30 additions and 29 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientCourseQuery.java
View file @
7ca2c75
... | ... | @@ -138,21 +138,21 @@ |
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | -// if (null != createdStart) { | |
142 | -// if (null != c1) { | |
143 | -// c1 = c1.and("created").gte(createdStart); | |
144 | -// } else { | |
145 | -// c1 = Criteria.where("created").gte(createdStart); | |
146 | -// } | |
147 | -// } | |
148 | -// | |
149 | -// if (null != createdEnd) { | |
150 | -// if (null != c1) { | |
151 | -// c1 = c1.lte(createdEnd); | |
152 | -// } else { | |
153 | -// c1 = Criteria.where("created").lte(createdEnd); | |
154 | -// } | |
155 | -// } | |
141 | + if (null != createdStart) { | |
142 | + if (null != c1) { | |
143 | + c1 = c1.and("created").gte(createdStart); | |
144 | + } else { | |
145 | + c1 = Criteria.where("created").gte(createdStart); | |
146 | + } | |
147 | + } | |
148 | + | |
149 | + if (null != createdEnd) { | |
150 | + if (null != c1) { | |
151 | + c1 = c1.lte(createdEnd); | |
152 | + } else { | |
153 | + c1 = Criteria.where("created").lte(createdEnd); | |
154 | + } | |
155 | + } | |
156 | 156 | |
157 | 157 | |
158 | 158 | if (null != c1) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
View file @
7ca2c75
... | ... | @@ -366,13 +366,16 @@ |
366 | 366 | query.setYn(YnEnums.YES.getId()); |
367 | 367 | query.setHospitalId(hospitalId); |
368 | 368 | |
369 | - int allCourses = courseService.queryCourseCount(query); | |
370 | 369 | int allSends = 0; //TODO |
371 | 370 | |
372 | - | |
373 | 371 | PatientCourseQuery patientCourseQuery = new PatientCourseQuery(); |
374 | 372 | patientCourseQuery.setYn(YnEnums.YES.getId()); |
375 | 373 | patientCourseQuery.setHospitalId(hospitalId); |
374 | + | |
375 | + int allCourses = courseService.queryCourseCount(query); | |
376 | + | |
377 | + int allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); | |
378 | + | |
376 | 379 | //状态 1预约,2签到 |
377 | 380 | patientCourseQuery.setStatus(1); |
378 | 381 | |
379 | 382 | |
380 | 383 | |
381 | 384 | |
382 | 385 | |
383 | 386 | |
384 | 387 | |
... | ... | @@ -388,26 +391,24 @@ |
388 | 391 | resultData.put("allCourses",allCourses); //课程数 |
389 | 392 | resultData.put("allSends",allSends); //总推送数 |
390 | 393 | resultData.put("allOrders",allOrders); //总预约数 |
391 | - resultData.put("allOrderRate",allCourses == 0 ? 0 : df.format((double) allOrders / allCourses * 100) + "%"); //总预约率 | |
394 | + resultData.put("allOrderRate",allCourses == 0 ? 0 : df.format((double) allOrders / allPatientCourses * 100) + "%"); //总预约率 | |
392 | 395 | resultData.put("allSigns",allSigns);//总签到数 |
393 | - resultData.put("allSignRate",allCourses == 0 ? 0 : df.format((double) allSigns / allCourses * 100) + "%");//总签到率 | |
396 | + resultData.put("allSignRate",allCourses == 0 ? 0 : df.format((double) allSigns / allPatientCourses * 100) + "%");//总签到率 | |
394 | 397 | |
398 | + CourseTypeQuery courseTypeQuery = new CourseTypeQuery(); | |
399 | + courseTypeQuery.setHospitalId(hospitalId); | |
400 | + courseTypeQuery.setYn(YnEnums.YES.getId()); | |
395 | 401 | |
396 | 402 | if (StringUtils.isNotEmpty(time)) { |
397 | 403 | String[] dates = time.split(" - "); |
398 | - query.setCreatedStart(DateUtil.parseYMD(dates[0])); | |
404 | + patientCourseQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); | |
399 | 405 | if (dates.length == 2) { |
400 | - query.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
406 | + patientCourseQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
401 | 407 | } |
402 | 408 | } |
403 | 409 | |
404 | - allCourses = courseService.queryCourseCount(query); | |
410 | + allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); | |
405 | 411 | |
406 | - | |
407 | - CourseTypeQuery courseTypeQuery = new CourseTypeQuery(); | |
408 | - courseTypeQuery.setHospitalId(hospitalId); | |
409 | - courseTypeQuery.setYn(YnEnums.YES.getId()); | |
410 | - | |
411 | 412 | List<Map> tableData = new ArrayList<>(); |
412 | 413 | |
413 | 414 | Map chartData = new HashMap(); |
414 | 415 | |
... | ... | @@ -445,9 +446,9 @@ |
445 | 446 | |
446 | 447 | tableMap.put("sends",0);//TODO |
447 | 448 | tableMap.put("orders",courseOrders); |
448 | - tableMap.put("ordersRate",allCourses == 0 ? "0" : df.format((double) courseOrders / allCourses * 100) + "%"); | |
449 | + tableMap.put("ordersRate",allCourses == 0 ? "0" : df.format((double) courseOrders / allPatientCourses * 100) + "%"); | |
449 | 450 | tableMap.put("signs",courseSigns); |
450 | - tableMap.put("signsRate",allCourses == 0 ? "0" : df.format((double) courseSigns / allCourses * 100) + "%"); | |
451 | + tableMap.put("signsRate",allCourses == 0 ? "0" : df.format((double) courseSigns / allPatientCourses * 100) + "%"); | |
451 | 452 | tableData.add(tableMap); |
452 | 453 | } |
453 | 454 |