فهرست منبع

1.4.8i健康银行活动统计bug修复

liuwenbin 7 سال پیش
والد
کامیت
9a16f24a32

+ 4 - 2
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -267,9 +267,11 @@ public class ArticleApi {
					array.add(jsonObj);
				}
				rv.put("Result", array);
				return rv.toString();
			}else{
				return ApiUtil.getRespJSON(-10000, "找不到文章").toString();
			}
			rv.put("Result", array);
			return rv.toString();
		} catch (SQLException e) {
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();

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

@ -1041,7 +1041,7 @@ public class StatisticsESService {
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
        temp.add(Calendar.DAY_OF_MONTH, -1);
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        // 起始日期为周几
        int week = start.get(Calendar.DAY_OF_WEEK);
@ -1090,6 +1090,8 @@ public class StatisticsESService {
        // 结果集
        Map<String, JSONObject> countResult = new HashMap<>();
//        Date dd = df.parse();
        // 算出每个查询周期
        for (int j = 0; j < days.size() - 1; j++) {
            String startStr = "";
@ -1109,6 +1111,14 @@ public class StatisticsESService {
            range.put("range", endStr);
            range.put("amount", 0);
            countResult.put(endStr, range);
//            if(!DateUtil.getSundayOfThisDate(new Date()).equals(df.format(new Date()))){
//                JSONObject range2 = new JSONObject();
//                range2.put("range", endDate);
//                range2.put("amount", 0);
//                countResult.put(df.format(new Date()), range2);
//            };
        }
        if (startDate.equals(df.format(new Date()))) {
@ -1135,10 +1145,10 @@ public class StatisticsESService {
                    range = df.format(saveModel.getQuotaDate());
                }
                JSONObject json = countResult.get(range);
                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
                if (range.equals(df.format(temp.getTime()))) {
                    json.put("range", endDate);
                }
//                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
//                if (range.equals(df.format(temp.getTime()))) {
//                    json.put("range", endDate);
//                }
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    json.put("amount", amount);
@ -5429,7 +5439,7 @@ public class StatisticsESService {
            areaCondition = " and d.area like '" + area.substring(0, 4) + "%' ";
//            areaCondition2 = " and t.org_code like '" + area.substring(0, 2) + "%' ";
        }
        String activitySql = "select count(1) from wlyy_health_bank.wlyy_health_bank_activity d where d.status=1  " + areaCondition;
        String activitySql = "select count(1) from wlyy_health_bank.wlyy_health_bank_activity d where 1=1  " + areaCondition;
        Integer activityCount = jdbcTemplate.queryForObject(activitySql, Integer.class);//发布活动数
@ -5500,7 +5510,7 @@ public class StatisticsESService {
        if (StringUtils.isNotEmpty(id)) {
            condition += " and a.id='" + id+"'";
        }
        String sql = " select * from wlyy_health_bank.wlyy_health_bank_activity a where a.status=1 " + condition;
        String sql = " select * from wlyy_health_bank.wlyy_health_bank_activity a where 1=1 " + condition;
        return jdbcTemplate.queryForList(sql);
    }
@ -5515,11 +5525,11 @@ public class StatisticsESService {
//        Map<String, Object> resultMap = new HashedMap();//返回的结果
        List<SaveModel> allAmountList = null;//签约已缴费人数列表
        List<SaveModel> applyAmountList = null;//报名人数列表
        allAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, "", low_level);
        if (StringUtils.isNotEmpty(slaveKey1)) {
            allAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, slaveKey1, "", low_level);
//            allAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, null, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, slaveKey1, "", low_level);
        } else {
            allAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, "", low_level);
        }
        Map<String, Integer> allMap = new HashMap<>(); //签约人数的的列表转map

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

@ -2204,7 +2204,7 @@ public class EsStatisticsController extends BaseController {
    @RequestMapping("/lowlevel_activity")
    @ApiOperation("健康银行活动统计")
    @ResponseBody
    public String lowlevel_activity(@ApiParam(name = "id", value = "活动id") @RequestParam(required = false) String activityCode,
    public String lowlevel_activity(@ApiParam(name = "activityCode", value = "活动id") @RequestParam(required = false) String activityCode,
                                    @ApiParam(name = "area", value = "地区code") @RequestParam(required = true) String area,
                                    @ApiParam(name = "level", value = "地区级别,1 团队,2 机构,3 区,4 市") @RequestParam(required = true) int level,
                                    @ApiParam(name = "sort", value = "排序 1倒叙 2是 正序")@RequestParam(required = true) int sort,
@ -2354,11 +2354,11 @@ public class EsStatisticsController extends BaseController {
//            result.put("index_89", json);
            String index = "";
            if(interval==1){
                index="91,95";
                index="89,95";
            }else if(interval==2){
                index="91,90";
                index="89,90";
            }else if(interval==2){
                index="91,94";
                index="89,94";
            }
            if (index != null) {
                if (org.springframework.util.StringUtils.isEmpty(year)) {
@ -2369,10 +2369,10 @@ public class EsStatisticsController extends BaseController {
                for (String idx : indexes) {
                    if("91".equals(idx)){
                    if("89".equals(idx)){
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_DDL);
                        result.put("index_"+idx, json);
                        result.put("index_91", json);
                    }else{
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_ZL);
                        result.put("index_90", json);