Explorar el Código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionExpressageLogDO.java
wangzhinan hace 4 años
padre
commit
2a4c0cd09c

+ 40 - 19
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -446,7 +446,7 @@ public class StatisticsEsService {
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,level2_type);
            JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = dateTotalStatistics3(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,null);
            object.put("specialistData",array1);
@ -4556,7 +4556,7 @@ public class StatisticsEsService {
    }
    public JSONObject appCenterCircular(String startDate, String endDate, String area, int level, String index) throws Exception {
    public JSONObject appCenterCircular(String startDate, String endDate, String area, int level, String index,String flag) throws Exception {
        JSONObject object = new JSONObject();
        if (index.equalsIgnoreCase("3")||index.equalsIgnoreCase("3,21")||index.equalsIgnoreCase("21")){
@ -4600,23 +4600,44 @@ public class StatisticsEsService {
            object.put("total",decimalFormat.format(total));
        }else if (index.equalsIgnoreCase("20")){
            //图文复诊
            SaveModel saveModel2 = null;
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
            //视频复诊
            SaveModel saveModel3 = null;
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "2");
            //总数
            SaveModel saveModel1 = null;
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL);
            Double topicCount = saveModel2.getResult1();//图文复诊数量
            Double videoCount = saveModel3.getResult1();//视频复诊数量
            Double total = saveModel1.getResult1();//总量
            object.put("topicCount",topicCount);//图文复诊数量
            object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
            object.put("videoCount",videoCount);//视频复诊数量
            object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
            object.put("total",total);
            if (flag.equalsIgnoreCase("1")){
                //图文复诊
                SaveModel saveModel2 = null;
                saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
                //视频复诊
                SaveModel saveModel3 = null;
                saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2NoSlaveKey1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "2");
                //总数
                SaveModel saveModel1 = null;
                saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
                Double topicCount = saveModel2.getResult1();//图文复诊数量
                Double videoCount = saveModel3.getResult1();//视频复诊数量
                Double total = saveModel1.getResult1();//总量
                object.put("topicCount",topicCount);//图文复诊数量
                object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
                object.put("videoCount",videoCount);//视频复诊数量
                object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
                object.put("total",total);
            }else if (flag.equalsIgnoreCase("1")){
                //快递
                SaveModel saveModel2 = null;
                saveModel2 = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "0");
                //自取
                SaveModel saveModel3 = null;
                saveModel3 = elasticsearchUtil.findOneDateQuotaLevel3NoSlaveKey2(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, "1");
                //总数
                SaveModel saveModel1 = null;
                saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
                Double topicCount = saveModel2.getResult1();//图文复诊数量
                Double videoCount = saveModel3.getResult1();//视频复诊数量
                Double total = saveModel1.getResult1();//总量
                object.put("express",topicCount);//快递数量
                object.put("expressRate",getRange(topicCount.intValue(),total.intValue(),0));
                object.put("invite",videoCount);//自取数量
                object.put("inviteRate",getRange(videoCount.intValue(),total.intValue(),0));
                object.put("total",total);
            }
        }
        return object;

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

@ -1208,6 +1208,25 @@ public class ElasticsearchUtil {
        return (SaveModel) list.get(0);
    }
    /**
     * 根据2级维度的1级指标去聚合 没有2级维度
     * 查询某一天某一个2级维度的某个1级维度和2级维度下的指标  例如查询65岁以上的高血压患者
     *
     * @param endDate 时间 yyyy-mm-dd
     * @param area      code  厦门市 350200
     * @param level     等级 1 省 2 市 3 区县 4 机构 5团队
     * @param index     指标code
     * @param timelevel // 1日 2年
     * @param slaveKey1 二级维度的key
     * @return
     */
    public SaveModel findOneDateQuotaLevel3NoSlaveKey2(String startDate,String endDate, String area, int level, String index, String timelevel, String slaveKey1) throws Exception {
        if (org.springframework.util.StringUtils.isEmpty(slaveKey1)) {
            slaveKey1 = commonParams;
        }
        List list = findDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, slaveKey1, null, null, null);
        return (SaveModel) list.get(0);
    }
    /**
     * 2级维度
     * 查询某个时间区间某一个2级维度的某个1级维度和2级维度下的指标  例如查询65岁以上的高血压患者

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

@ -958,10 +958,11 @@ 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 flag) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.appCenterCircular(startDate, endDate, area, level, index);
            result= statisticsEsService.appCenterCircular(startDate, endDate, area, level, index,flag);
        } catch (Exception e) {
            e.printStackTrace();
        }