Browse Source

bug修改

chenweida 8 năm trước cách đây
mục cha
commit
5e7982b908

+ 29 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -4011,6 +4011,24 @@ public class StatisticsService extends BaseService {
        }
        return null;
    }
    public List<WlyyQuotaResult> findQuotaResults(String date, int level, String index, String area) {
        String sql = " select * from wlyy_quota_result w where w.quota_date ='" + date + "' and w.quato_code='" + index + "' and w.level1_type= " + level;
        if (level == 4) {
            // 市级别
            sql += " and city='" + area + "' ";
        } else if (level == 3) {
            // 区、城镇级别
            sql += " and town='" + area + "' ";
        } else if (level == 2) {
            // 机构级别
            sql += " and org_code='" + area + "' ";
        } else if (level == 1) {
            // 机构级别
            sql += " and qkdoctor_code ='" + area + "'";
        }
        List<WlyyQuotaResult> results = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyQuotaResult.class));
        return results;
    }
    public JSONObject getRenewPercentAndChangePercent(String level, String code, String year) {
        String renewIndex="";
@ -4260,12 +4278,18 @@ public class StatisticsService extends BaseService {
    public JSONObject getCoutListByTimeYear(String level, String area, String year) {
        JSONObject result = new JSONObject();
        WlyyQuotaResult wlyyQuotaResult = findOneQuotaResult((Integer.valueOf(year) + 1) + "-06-30", Integer.valueOf(level), "24", area);
        if (wlyyQuotaResult != null) {
            result.put("name", getNameByLevel(wlyyQuotaResult, Integer.valueOf(level)));
            result.put("code", getCodeByLevel(wlyyQuotaResult, Integer.valueOf(level)));
            result.put("num", Integer.valueOf(wlyyQuotaResult.getResult()));
        List<WlyyQuotaResult> wlyyQuotaResult = findQuotaResults((Integer.valueOf(year) + 1) + "-06-30", Integer.valueOf(level), "24", area);
        JSONArray jo=new JSONArray();
        if (wlyyQuotaResult != null&&wlyyQuotaResult.size()>0) {
            wlyyQuotaResult.stream().forEach(one->{
                JSONObject temp1 = new JSONObject();
                temp1.put("name", getNameByLevel(one, Integer.valueOf(level)));
                temp1.put("code", getCodeByLevel(one, Integer.valueOf(level)));
                temp1.put("num", Integer.valueOf(one.getResult()));
                jo.put(temp1);
            });
        }
        result.put("resultList", jo);
        return result;
    }

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

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.statistics.WlyyQuotaResult;
import com.yihu.wlyy.job.Constant;
import com.yihu.wlyy.service.app.statistics.StatisticsAllService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -506,6 +507,10 @@ public class StatisticsController extends BaseController {
            } else {
//                未指定level下特定查询级别
                for (String idx : indexes) {
                    if((idx.equals("21"))||(idx.equals("20"))){
                        //如果是21或者20的指标 默认找最新的日期
                        date= DateUtil.getStringDate("yyyy-MM-dd");
                    }
                    if (idx.equals("18") || index.equals("19")) {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotalSpecial(date, area, level, idx, sort, lowLevel));
                    } else if (idx.equals("1") || index.equals("21")) {
@ -576,10 +581,14 @@ public class StatisticsController extends BaseController {
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                if((idx.equals("21"))||(idx.equals("20"))){
                    //如果是21或者20的指标 默认找最新的日期
                    endDate= DateUtil.getStringDate("yyyy-MM-dd");
                }
                Long total = statisticsAllService.getIndexTotal(endDate, area, level, idx);
                super.infoMessage("原来的总数:" + total);
                //如果year不为空  那么因为是到达量 所以要加上一年的数据
                if (!org.springframework.util.StringUtils.isEmpty(year) && !"2016".equals(year)) {
                //如果year不为空  那么因为是到达量 所以要加上一年的数据 21和20的指标不安年度统计 所以不用累加
                if (!org.springframework.util.StringUtils.isEmpty(year) && !"2016".equals(year)&&!(idx.equals("21")||(idx.equals("20")))) {
                    //得到上一个年份的的最后一天的统计数据
                    String date = year + "-06-30";//固定是 6月三十号 为一个年份的最后一天,如果是2017年份 那么就是2017-7-1 到 2018-6-30
                    WlyyQuotaResult wlyyQuotaResult = statisticsService.findOneQuotaResult(date, level, idx, area);