Преглед на файлове

Merge branch 'dev' of wujunjie/patient-co-management into dev

lyr преди 8 години
родител
ревизия
092484ed88

+ 26 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -453,8 +453,10 @@ public class StatisticsAllService extends BaseService {
        List<Map<String, Object>> resultList = new ArrayList<>();
        if (date.compareTo(dateFormat.format(new Date())) >= 0) {
//            查询当天及以后的数据
            resultList = getLevelTwoTodayLowLevelTotal(area, level, index, sort, lowLevel, lowCode);
        } else {
//           查询当天以前的数据
            resultList = getLevelTwoTodayBeforeLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode);
        }
@ -647,6 +649,23 @@ public class StatisticsAllService extends BaseService {
        String lowLevelField = "";
        String lowLevelName = "";
//      查询日期参数是否存在于数据库
        String sql1 = "SELECT" +
                "   count(quota_date)" +
                "  FROM" +
                "   wlyy_quota_result" +
                "  where quota_date = ? and quato_code = ?";
        int rows = jdbcTemplate.queryForObject(sql1,Integer.class,date,index);
        if (rows==0){
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                Date tdate=sdf.parse(date);
                Calendar day = Calendar.getInstance();
                day.setTime(tdate);
                day.add(Calendar.DATE, -1);
                date = new SimpleDateFormat("yyyy-MM-dd").format(day.getTime());
        }
        if (level == 4) {
            // 市级别
            areaField = "city";
@ -684,7 +703,9 @@ public class StatisticsAllService extends BaseService {
                "     quato_code = '" + index + "' " +
                "   and level1_type = ? and del = '1'" +
                "   and quota_date = ? " +
                "   and " + areaField + " = ? ";
                "   and " + areaField + " = ? " +
                "   order by quota_date DESC " +
                "   limit 0,1";
        resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, date, area});
@ -863,13 +884,13 @@ public class StatisticsAllService extends BaseService {
    /**
     * 获取今天某个区域一级指标的下级统计
     * 获取今天及以后某个区域一级指标的下级统计
     *
     * @param area
     * @param level
     * @param index
     * @param lowLevel
     * @return
     * @return 只返回当天的数据
     */
    public List<Map<String, Object>> getLevelTwoTodayLowLevelTotal(String area, int level, String index, int sort, String lowLevel, String lowCode) throws Exception {
        List<Map<String, Object>> resultList = new ArrayList<>();
@ -886,9 +907,11 @@ public class StatisticsAllService extends BaseService {
                redisData = "";
            }
            if (!StringUtils.isEmpty(redisData)) {
//                redisData不为空(从缓存中取出当天数据)
                JSONObject json = new JSONObject(redisData);
                map.put("amount", Long.valueOf(String.valueOf(json.get("num"))));
            } else {
//                redis中没有当天数据
                flag = true;
                resultList = new ArrayList<>();
                break;

+ 5 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -344,8 +344,9 @@ public class StatisticsController extends BaseController {
     *
     * @param date
     * @param area
     * @param level
     * @param index
     * @param level  level1_type等级 1:团队 2社区机构 3区级 4市级
     * @param index quotoCode 18/19两率
     * @param sort 1降序排列-1升序排列
     * @return
     */
    @RequestMapping("/lowlevel_all")
@ -362,8 +363,10 @@ public class StatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            if (StringUtils.isNotEmpty(lowCode)) {
//                指定level下特定查询级别
                result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode));
            } else {
//                未指定level下特定查询级别
                for (String idx : indexes) {
                    if (idx.equals("18") || index.equals("19")) {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotalSpecial(date, area, level, idx, sort, lowLevel));