Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 years ago
parent
commit
5e353a85df

File diff suppressed because it is too large
+ 60 - 61
patient-co/patient-co-statistics-es/doc/sql/统计相关表数据备份20171121.txt


+ 2 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/controller/JobController.java

@ -110,10 +110,10 @@ public class JobController extends BaseController {
    @RequestMapping(value = "productDataByDayToDayAndId", method = RequestMethod.GET)
    public String productDataByDayToDayAndId( @ApiParam(name = "start", value = "yyyy-MM-dd")@RequestParam(value = "start", required = true)String start,
                                         @ApiParam(name = "end", value = "yyyy-MM-dd")@RequestParam(value = "end", required = true)String end,
                                              @ApiParam(name = "id", value = "任务id")@RequestParam(value = "id", required = true)String id) {
                                         @ApiParam(name = "ids", value = "任务ids多个逗号分割")@RequestParam(value = "ids", required = true)String ids) {
        try {
            
            jobService.productDataByDayToDayAndId(start,end,id);
            jobService.productDataByDayToDayAndId(start,end,ids);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);

+ 5 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -307,7 +307,7 @@ public class JobService {
    }
    public void productDataByDayToDayAndId(String start, String end, String id) throws Exception {
    public void productDataByDayToDayAndId(String start, String end, String ids) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date startDate = sdf.parse(start);
        Date endDate = sdf.parse(end);
@ -315,9 +315,12 @@ public class JobService {
            throw new Exception("日期参数错误");
        }
        int day = daysBetween(startDate, endDate);
        String [] idStr=ids.split(",");
        for (int i = 0; i < day; i++) {
            Cache.cleanCache();//清空缓存
            productDataByOneDayWithId(getYesterday(i, startDate), id);
            for(String id:idStr){
                productDataByOneDayWithId(getYesterday(i, startDate), id);
            }
        }
    }

+ 21 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -210,13 +210,23 @@ public class StatisticsESService {
        SaveModel saveModel = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, "1", level2_type);
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, "1");
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL);
        }
        return saveModel.getResult2().longValue();
    }
    public long getTotalAmount3(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
        SaveModel saveModel = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index,SaveModel.timeLevel_DDL, level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL);
        }
        return saveModel.getResult2().longValue();
    }
    /**
     * 查询截止某个日期某个区域后机构各下级指标累计情况
     *
@ -1251,13 +1261,13 @@ public class StatisticsESService {
                        int num = 0;
                        int taskNum = 0;
                        if (lowCode.equals("3")) {
                        if (low_level.equals("3")) {
                            num = peopleNum.getSixFiveNum();
                            taskNum = peopleNum.getSixFiveTaskNum();
                        } else if (lowCode.equals("5")) {
                        } else if (low_level.equals("5")) {
                            num = peopleNum.getGxyNum();
                            taskNum = peopleNum.getGxyTaskNum();
                        } else if (lowCode.equals("4")) {
                        } else if (low_level.equals("4")) {
                            num = peopleNum.getTnbNum();
                            taskNum = peopleNum.getTnbTaskNum();
                        }
@ -3413,6 +3423,10 @@ public class StatisticsESService {
                }
            }
        }
        //团队翻译
        if(SaveModel.teamLevel.equals(lowlevel)){
            translateTeamLeaderName(rs);
        }
        Collections.sort(rs, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Integer map1value = Integer.valueOf(String.valueOf(o1.get("val")));
@ -4170,4 +4184,6 @@ public class StatisticsESService {
        resultJSON.put("rs", json);
        return resultJSON;
    }
}

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -164,8 +164,12 @@ public class EsStatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
//                result.put("index_" + idx, statisticsService.getTotalAmount(startDate, endDate, area, level, idx, level2_type));
                result.put("index_" + idx, statisticsESService.getTotalAmount(startDate, endDate, area, level, idx, level2_type));
                if("3".equals(idx)){
                    //为了确保之前是咨询量是准确的 所以咨询量用到达量不用增量累加
                    result.put("index_" + idx, statisticsESService.getTotalAmount3(startDate, endDate, area, level, idx, level2_type));
                }else{
                    result.put("index_" + idx, statisticsESService.getTotalAmount(startDate, endDate, area, level, idx, level2_type));
                }
            }
            return write(200, "查询成功", "data", result);