|
@ -144,7 +144,7 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " and level2_type = '" + level2_type + "'";
|
|
|
}
|
|
|
|
|
|
Map<String, Object> result = jdbcTemplate.queryForMap(sql, new Object[]{level, endDate, area});
|
|
|
Map<String, Object> result = jdbcTemplate.queryForMap(sql, level, endDate, area);
|
|
|
|
|
|
// 截止日期包含当天,则从redis查询当天统计数据
|
|
|
if (endDate.compareTo(new SimpleDateFormat("yyyy-MM-dd").format(new Date())) >= 0) {
|
|
@ -206,7 +206,7 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " and qkdoctor_code = ?";
|
|
|
}
|
|
|
|
|
|
Map<String, Object> result = jdbcTemplate.queryForMap(sql, new Object[]{level, startDate, endDate, area});
|
|
|
Map<String, Object> result = jdbcTemplate.queryForMap(sql, level, startDate, endDate, area);
|
|
|
|
|
|
// 截止日期包含当天,则从redis查询当天统计数据
|
|
|
if (endDate.compareTo(new SimpleDateFormat("yyyy-MM-dd").format(new Date())) >= 0) {
|
|
@ -310,7 +310,7 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " order by amount asc ";
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, endDate, area});
|
|
|
List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, low_level, endDate, area);
|
|
|
|
|
|
// 结果为空时,自建结果集
|
|
|
if (resultList == null || resultList.size() < 1) {
|
|
@ -525,7 +525,7 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " order by amount asc ";
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, new Object[]{low_level, startDate, endDate, area});
|
|
|
List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql, low_level, startDate, endDate, area);
|
|
|
|
|
|
// 结果为空时,自建结果集
|
|
|
if (resultList == null || resultList.size() < 1) {
|
|
@ -771,7 +771,7 @@ public class StatisticsService extends BaseService {
|
|
|
if (resultList != null) {
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
if (countResult.containsKey(map.get("range").toString())) {
|
|
|
JSONObject range = (JSONObject) countResult.get(map.get("range").toString());
|
|
|
JSONObject range = countResult.get(map.get("range").toString());
|
|
|
long amount = range.getLong("amount");
|
|
|
long resultAmount = map.get("amount") != null ? Math.round(Double.valueOf(map.get("amount").toString())) : 0;
|
|
|
range.put("amount", amount + resultAmount);
|
|
@ -1647,7 +1647,7 @@ public class StatisticsService extends BaseService {
|
|
|
sql += " AND d.hospital = ? ";
|
|
|
}
|
|
|
|
|
|
Map<String, Object> rs = jdbcTemplate.queryForMap(sql, new Object[]{area});
|
|
|
Map<String, Object> rs = jdbcTemplate.queryForMap(sql, area);
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
@ -1681,7 +1681,7 @@ public class StatisticsService extends BaseService {
|
|
|
|
|
|
sql += " GROUP BY mt order by mt DESC ";
|
|
|
|
|
|
List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql, new Object[]{statDate, endDate, area});
|
|
|
List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql, statDate, endDate, area);
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
if (rs != null && rs.size() > 0) {
|
|
|
//降低循环层级
|
|
@ -2866,14 +2866,14 @@ public class StatisticsService extends BaseService {
|
|
|
List<Map<String, Object>> couTotal = jdbcTemplate.queryForList(couTotalSQL);
|
|
|
if (couTotal != null && couTotal.size() > 0) {
|
|
|
Map<String, Object> couTotalMap = couTotal.get(0);
|
|
|
total = (Long) couTotalMap.get("total") == null ? 0L : (Long) couTotalMap.get("total");
|
|
|
total = couTotalMap.get("total") == null ? 0L : (Long) couTotalMap.get("total");
|
|
|
}
|
|
|
rs.put("total", total);
|
|
|
|
|
|
List<Map<String, Object>> reyTotal = jdbcTemplate.queryForList(reyTotalSql);
|
|
|
if (reyTotal != null && reyTotal.size() > 0) {
|
|
|
Map<String, Object> reyTotalMap = reyTotal.get(0);
|
|
|
relyOnTime = (Long) reyTotalMap.get("total") == null ? 0L : (Long) reyTotalMap.get("total");
|
|
|
relyOnTime = reyTotalMap.get("total") == null ? 0L : (Long) reyTotalMap.get("total");
|
|
|
}
|
|
|
if (total != 0L && relyOnTime != 0L) {
|
|
|
double rr = (double) relyOnTime / total * 100;
|
|
@ -2887,7 +2887,7 @@ public class StatisticsService extends BaseService {
|
|
|
List<Map<String, Object>> addTotal = jdbcTemplate.queryForList(addTotalSql);
|
|
|
if (addTotal != null && addTotal.size() > 0) {
|
|
|
Map<String, Object> addTotalMap = addTotal.get(0);
|
|
|
addNumber = (Long) addTotalMap.get("total") == null ? 0L : (Long) addTotalMap.get("total");
|
|
|
addNumber = addTotalMap.get("total") == null ? 0L : (Long) addTotalMap.get("total");
|
|
|
}
|
|
|
//本周或月增量
|
|
|
rs.put("addNumber", addNumber);
|
|
@ -2895,7 +2895,7 @@ public class StatisticsService extends BaseService {
|
|
|
List<Map<String, Object>> noRelyTotal = jdbcTemplate.queryForList(noRelySql);
|
|
|
if (noRelyTotal != null && noRelyTotal.size() > 0) {
|
|
|
Map<String, Object> noRelyTotalMap = noRelyTotal.get(0);
|
|
|
noRelyNumber = (Long) noRelyTotalMap.get("total") == null ? 0L : (Long) noRelyTotalMap.get("total");
|
|
|
noRelyNumber = noRelyTotalMap.get("total") == null ? 0L : (Long) noRelyTotalMap.get("total");
|
|
|
}
|
|
|
rs.put("noRelyNumber", noRelyNumber);
|
|
|
return rs;
|
|
@ -4027,12 +4027,30 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public JSONObject getRenewPercentAndChangePercent(String level, String code, String year) {
|
|
|
String renewIndex="";
|
|
|
String switchIndex="";
|
|
|
if("2".equals(level)){
|
|
|
//团队的续签量
|
|
|
renewIndex="42";
|
|
|
//团队的转签
|
|
|
switchIndex="37";
|
|
|
}else if("2".equals(level)){
|
|
|
//社区的续签量
|
|
|
renewIndex="43";
|
|
|
//社区的转签
|
|
|
switchIndex="45";
|
|
|
}else{
|
|
|
//区和市的续签量
|
|
|
renewIndex="44";
|
|
|
//区和市的转签
|
|
|
switchIndex="46";
|
|
|
}
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
//获取时间戳
|
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
|
//从redis中获取最新的续签数据 续签指标是29
|
|
|
int renewNum = getLevel1NumForRedis("29", level, code, timeKey);
|
|
|
;
|
|
|
|
|
|
int renewNum = getLevel1NumForRedis(renewIndex, level, code, timeKey);
|
|
|
//根据年度获取去年的签约数 签约指标是1
|
|
|
String date = year + "-06-30";
|
|
|
String index = "1";
|
|
@ -4042,7 +4060,7 @@ public class StatisticsService extends BaseService {
|
|
|
signNum = Integer.valueOf(wlyyQuotaResult.getResult());
|
|
|
}
|
|
|
//从redis中获取最新的转签数据 指标是37
|
|
|
int switchNum = getLevel1NumForRedis("37", level, code, timeKey);
|
|
|
int switchNum = getLevel1NumForRedis(switchIndex, level, code, timeKey);
|
|
|
jo.put("yesterYearSign", signNum);//去年的签约量
|
|
|
jo.put("thisYearRenew", renewNum);//今年的续签量
|
|
|
jo.put("thisYearSwithch", switchNum);//今年的转签量
|
|
@ -4053,18 +4071,19 @@ public class StatisticsService extends BaseService {
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getRenewAnalysis(String level, String code) {
|
|
|
public JSONObject getRenewAnalysis(String switchIndex,String switchIndexReson,String signIn,String signOut,String level, String code) {
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
|
//获取签入人数
|
|
|
int switchNum = getLevel1NumForRedis("37", level, code, timeKey);
|
|
|
int switchNum = getLevel1NumForRedis(switchIndex, level, code, timeKey);
|
|
|
|
|
|
//获取转签分布
|
|
|
JSONArray switchJO = getLevel2JsonObjectForRedis("30", level, code, timeKey);
|
|
|
JSONArray switchJO = getLevel2JsonObjectForRedis(switchIndexReson, level, code, timeKey);
|
|
|
//获取签入人数
|
|
|
int inNum = getLevel1NumForRedis("34", level, code, timeKey);
|
|
|
int inNum = getLevel1NumForRedis(signIn, level, code, timeKey);
|
|
|
//获取签出人数
|
|
|
int outNum = getLevel1NumForRedis("35", level, code, timeKey);
|
|
|
int outNum = getLevel1NumForRedis(signOut, level, code, timeKey);
|
|
|
|
|
|
int changeTeam = getLevel1NumForRedis("31", level, code, timeKey);//夸团队的数目
|
|
|
int changeHospital = getLevel1NumForRedis("32", level, code, timeKey);//夸社区的数目
|