Commit 924e6a363320ed1a144b498867e37426c5d31671
1 parent
a6b0ebddc6
Exists in
luanping
and in
1 other branch
#新增南河孕妇学校统计模块增加孕妇听课率
Showing 2 changed files with 50 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java
View file @
924e6a3
| ... | ... | @@ -79,6 +79,8 @@ |
| 79 | 79 | } |
| 80 | 80 | /** |
| 81 | 81 | * 1000000115 南河医院 紫色高危因素里增加 丙肝阳性、乙肝大三阳、乙肝小三阳 特殊处理 |
| 82 | + * db.getCollection('lyms_basicconfig') | |
| 83 | + * .find({"parentId":"224b2329-cb82-4da3-a071-8527f8283aab","enable":1,"typeId":"fb43fd5a-b153-4cb9-9180-c46f5612ba43"}) | |
| 82 | 84 | */ |
| 83 | 85 | if (StringUtils.isEmpty(orgId) || !orgId.equalsIgnoreCase("1000000115")){ |
| 84 | 86 | Iterator<BasicConfig> basicConfigIterator = basicConfigList.iterator(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CourseFacade.java
View file @
924e6a3
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.google.common.base.Strings; | |
| 4 | 5 | import com.lyms.platform.beans.MsgRequest; |
| 5 | 6 | import com.lyms.platform.biz.service.*; |
| 6 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| ... | ... | @@ -8,7 +9,9 @@ |
| 8 | 9 | import com.lyms.platform.common.result.BaseListResponse; |
| 9 | 10 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 10 | 11 | import com.lyms.platform.common.result.BaseResponse; |
| 11 | -import com.lyms.platform.common.utils.*; | |
| 12 | +import com.lyms.platform.common.utils.DateUtil; | |
| 13 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 14 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
| 12 | 15 | import com.lyms.platform.operate.web.request.CourseRequest; |
| 13 | 16 | import com.lyms.platform.operate.web.result.CourseResult; |
| 14 | 17 | import com.lyms.platform.operate.web.worker.CourseCountWorker; |
| 15 | 18 | |
| ... | ... | @@ -18,14 +21,13 @@ |
| 18 | 21 | import com.lyms.platform.pojo.*; |
| 19 | 22 | import com.lyms.platform.query.*; |
| 20 | 23 | import org.apache.commons.collections.CollectionUtils; |
| 21 | -import org.apache.commons.lang.StringUtils; | |
| 24 | +import org.apache.commons.lang3.StringUtils; | |
| 22 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | 26 | import org.springframework.beans.factory.annotation.Qualifier; |
| 24 | 27 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| 25 | 28 | import org.springframework.stereotype.Component; |
| 26 | 29 | |
| 27 | 30 | import java.text.DecimalFormat; |
| 28 | -import java.text.SimpleDateFormat; | |
| 29 | 31 | import java.util.*; |
| 30 | 32 | import java.util.concurrent.Callable; |
| 31 | 33 | import java.util.concurrent.Future; |
| 32 | 34 | |
| 33 | 35 | |
| ... | ... | @@ -605,10 +607,11 @@ |
| 605 | 607 | |
| 606 | 608 | |
| 607 | 609 | PatientCourseQuery patientCourseQuery = new PatientCourseQuery(); |
| 608 | - patientCourseQuery.setYn(YnEnums.YES.getId()); | |
| 609 | 610 | patientCourseQuery.setHospitalId(hospitalId); |
| 611 | + patientCourseQuery.setYn(YnEnums.YES.getId()); | |
| 610 | 612 | |
| 611 | 613 | |
| 614 | + | |
| 612 | 615 | //int allPatientCourses = patientCourseService.queryPatientCourseCount(patientCourseQuery); |
| 613 | 616 | |
| 614 | 617 | //状态 1预约,2签到 |
| 615 | 618 | |
| 616 | 619 | |
| 617 | 620 | |
| ... | ... | @@ -628,20 +631,53 @@ |
| 628 | 631 | totalData.put("allOrderRate", allSends == 0 ? 0 : df.format((double) allOrders / allSends * 100) + "%"); //总预约率 |
| 629 | 632 | totalData.put("allSigns", allSigns);//总签到数 |
| 630 | 633 | totalData.put("allSignRate", allOrders == 0 ? 0 : df.format((double) allSigns / allOrders * 100) + "%");//总签到率 |
| 631 | - //TODO 孕妇听课率 | |
| 634 | + String startTime = null; | |
| 635 | + String endTime = null; | |
| 636 | + //孕妇听课率=总签到人数/建档人数*100 | |
| 637 | + if(!Strings.isNullOrEmpty(hospitalId)&&"1000000115".equals(hospitalId)){ | |
| 638 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 639 | + patientsQuery.setHospitalId(hospitalId); | |
| 640 | + patientsQuery.setExtEnable(false); | |
| 641 | + patientsQuery.setBuildTypeNot(1); | |
| 642 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 643 | + if (!Strings.isNullOrEmpty(time)) { | |
| 644 | + String[] dates = time.split(" - "); | |
| 645 | + startTime = dates[0]; | |
| 646 | + patientsQuery.setBookbuildingDateStart(DateUtil.parseYMD(startTime)); | |
| 647 | + if (dates.length == 2) { | |
| 648 | + endTime = dates[1]; | |
| 649 | + patientsQuery.setBookbuildingDateEnd(DateUtil.parseYMDHMS(endTime + " 23:59:59")); | |
| 650 | + } | |
| 651 | + } | |
| 652 | + | |
| 653 | + int signsNum=0; | |
| 654 | + List<PatientCourseModel> singsList= patientCourseService.queryPatientCourseList(patientCourseQuery); | |
| 655 | + if (singsList!=null&&singsList.size()>0){ | |
| 656 | + Iterator<PatientCourseModel> patientCourseIterator = singsList.iterator(); | |
| 657 | + HashMap<String,PatientCourseModel> params=new HashMap<>(); | |
| 658 | + while (patientCourseIterator.hasNext()) { | |
| 659 | + PatientCourseModel patientCourse = patientCourseIterator.next(); | |
| 660 | + params.put(patientCourse.getCardNo(),patientCourse); | |
| 661 | + } | |
| 662 | + signsNum=params.size(); | |
| 663 | + } | |
| 664 | + List <Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 665 | + | |
| 666 | + totalData.put("lessonsRate",patientsList!=null ? df.format((double) signsNum / patientsList.size() * 100) + "%":0);//听课率 | |
| 667 | + } | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 632 | 672 | CourseTypeQuery courseTypeQuery = new CourseTypeQuery(); |
| 633 | 673 | courseTypeQuery.setHospitalId(hospitalId); |
| 634 | 674 | courseTypeQuery.setYn(YnEnums.YES.getId()); |
| 635 | 675 | |
| 636 | - String startTime = null; | |
| 637 | - String endTime = null; | |
| 638 | 676 | |
| 639 | - if (StringUtils.isNotEmpty(time)) { | |
| 640 | - String[] dates = time.split(" - "); | |
| 641 | - startTime = dates[0]; | |
| 677 | + | |
| 678 | + if (!Strings.isNullOrEmpty(time)) { | |
| 642 | 679 | query.setPublishTimeStart(DateUtil.parseYMD(startTime)); |
| 643 | - if (dates.length == 2) { | |
| 644 | - endTime = dates[1]; | |
| 680 | + if (endTime!=null) { | |
| 645 | 681 | query.setPublishTimeEnd(DateUtil.parseYMDHMS(endTime + " 23:59:59")); |
| 646 | 682 | } |
| 647 | 683 |