Browse Source

统计修改

wangjun 4 năm trước cách đây
mục cha
commit
72d427e537

+ 14 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -3594,7 +3594,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("popularity",doctorDO.getPopularity());
            rs.put("qrcode",doctorDO.getQrcode());
            //号别
            String deptTyepCode = "";
            /*String deptTyepCode = "";
            if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                deptTyepCode = "6";
                List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(doctor);
@ -3610,7 +3610,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                }
            }
            }*/
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            /*String chargeType = doctorDO.getChargeType();
            if (StringUtils.isNotBlank(chargeType)){
@ -3701,11 +3701,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
//            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
//            rs.put("coordinationCout",coordinationCout);
            //医生关注
            List<BaseDoctorPatientFollowDO> doctorPatientFollowDOS = baseOrgPatientDao.findByDoctorAndPatient(doctor,patient);
            if (doctorPatientFollowDOS != null && doctorPatientFollowDOS.size() > 0) {
                rs.put("attention", "1");
            } else {
                rs.put("attention", "0");
            if(StringUtils.isNotBlank(patient)){
                List<BaseDoctorPatientFollowDO> doctorPatientFollowDOS = baseOrgPatientDao.findByDoctorAndPatient(doctor,patient);
                if (doctorPatientFollowDOS != null && doctorPatientFollowDOS.size() > 0) {
                    rs.put("attention", "1");
                } else {
                    rs.put("attention", "0");
                }
            }
@ -5303,9 +5305,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " d.outpatient_type AS \"outpatientType\"," +
                " a.total AS \"consultTotal\"," +
                " h.org_name AS \"orgName\"," +
                " h.org_code AS \"orgCode\"," +
                " follow.id AS \"followid\" " +
                " FROM " +
                " h.org_code AS \"orgCode\" " ;
        if(StringUtils.isNoneBlank(patientid)){
            sql+=" , follow.id AS \"followid\" " ;
        }
        sql+=" FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " Left join ( select count(id) as total,doctor from wlyy_outpatient where status = 3 GROUP BY doctor ) a on a.doctor = d.id ";

+ 17 - 6
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -3696,7 +3696,7 @@ public class StatisticsEsService {
     * @return
     * @throws Exception
     */
    public JSONObject getConsultHead(String startDate, String endDate, String area, int level, String index) throws Exception {
    public JSONObject getConsultHead(String startDate, String endDate, String area, int level, String index,String lowCode) throws Exception {
        JSONObject object = new JSONObject();
        if (index.equalsIgnoreCase("6")){
            //总量
@ -3739,14 +3739,25 @@ public class StatisticsEsService {
         /*   //进行中
            SaveModel saveModel5 = null;*/
            String index1= (Integer.parseInt(index)+1)+"";
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"1");
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"2");
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"-1");
            //居民取消
            List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"-1");
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel1(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null,lowCode);
            //已结束
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"3");
            logger.info("total"+total==null?"0":String.valueOf(total.size())+";"+total.get(0).getResult1());
            //已接诊
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL, null,lowCode,"1");
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null,lowCode,"0");
            saveModel = total.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL,lowCode,"");
            saveModel1 = haveReceiveTotal.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,lowCode,"1");
            saveModel3 = endTotal.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,lowCode,"3");
            saveModel4 = concleTotal.get(0);//elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,lowCode,"-1");
/*
            saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
*/
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
            saveModel2 = noReceiveTotal.get(0);elasticsearchUtil.bfindOneDateQuotaLevel12(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,lowCode,"0");
            object.put("consultTotal",saveModel.getResult1());//咨询总量
            object.put("haveReceiveTotal",saveModel1.getResult1());//已接诊
            object.put("noReceiveTotal",saveModel2.getResult1());//未接诊

+ 10 - 0
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -1091,6 +1091,16 @@ public class ElasticsearchUtil {
        List list = findDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, slaveKey1, null, null);
        return (SaveModel) list.get(0);
    }
    public SaveModel bfindOneDateQuotaLevel12(String startDate, String endDate, String area, int level, String index, String timelevel, String slaveKey1, String slaveKey2) throws Exception {
        if (org.springframework.util.StringUtils.isEmpty(slaveKey1)) {
            slaveKey1 = commonParams;
        }
        if (org.springframework.util.StringUtils.isEmpty(slaveKey2)) {
            slaveKey2 = commonParams;
        }
        List list = findDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, slaveKey1, slaveKey2, null, null);
        return (SaveModel) list.get(0);
    }
    /**
     * 1级维度

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -566,11 +566,12 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String lowCode) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultHead(startDate, endDate, area, level, index);
            result = statisticsEsService.getConsultHead(startDate, endDate, area, level, index,lowCode);
        } catch (Exception e) {
            e.printStackTrace();