|
@ -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;
|