|
@ -4158,34 +4158,65 @@ public class StatisticsService extends BaseService {
|
|
|
return results;
|
|
|
}
|
|
|
|
|
|
public JSONObject getRenewPercentAndChangePercent(String renewIndex, String level, String code, String year) {
|
|
|
public JSONObject getRenewPercentAndChangePercent(String renewIndex, String level, String code, String year, String lowCode) {
|
|
|
String switchIndex = "";
|
|
|
if ("2".equals(level)) {
|
|
|
//团队的转签
|
|
|
switchIndex = "35";
|
|
|
if(StringUtils.isNoneBlank(lowCode)){
|
|
|
//服务类型维度
|
|
|
switchIndex = "55";
|
|
|
}else{
|
|
|
switchIndex = "35";
|
|
|
}
|
|
|
} else if ("3".equals(level)) {
|
|
|
//社区的转签
|
|
|
switchIndex = "35";
|
|
|
if(StringUtils.isNoneBlank(lowCode)){
|
|
|
//服务类型维度
|
|
|
switchIndex = "56";
|
|
|
}else{
|
|
|
switchIndex = "35";
|
|
|
}
|
|
|
} else {
|
|
|
//区和市的转签
|
|
|
switchIndex = "35";
|
|
|
if(StringUtils.isNoneBlank(lowCode)){
|
|
|
//服务类型维度
|
|
|
switchIndex = "57";
|
|
|
}else{
|
|
|
switchIndex = "35";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
|
|
|
String rediscode = code;
|
|
|
|
|
|
//如果服务类型维度code(老年人3,高血压4,糖尿病5)不为空,则rediscode默认带上lowcode
|
|
|
if(StringUtils.isNoneBlank(lowCode)){
|
|
|
rediscode = rediscode + ":"+lowCode;
|
|
|
}
|
|
|
|
|
|
//获取时间戳
|
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
|
|
|
|
int renewNum = getLevel1NumForRedis(renewIndex, level, code, timeKey);
|
|
|
int renewNum = getLevel1NumForRedis(renewIndex, level, rediscode, timeKey);
|
|
|
//根据年度获取去年的签约数 签约指标是1
|
|
|
String date = year + "-06-30";
|
|
|
String index = "1";
|
|
|
WlyyQuotaResult wlyyQuotaResult = findOneQuotaResult(date, Integer.valueOf(level), index, code);
|
|
|
|
|
|
int signNum = 0;
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
|
|
|
if(StringUtils.isNoneBlank(lowCode)){
|
|
|
wlyyQuotaResult = findOneQuotaResultWithLevelType2(date, Integer.valueOf(level), index, code,lowCode);
|
|
|
}else{
|
|
|
wlyyQuotaResult = findOneQuotaResult(date, Integer.valueOf(level), index, code);
|
|
|
}
|
|
|
|
|
|
if (wlyyQuotaResult != null) {
|
|
|
signNum = Integer.valueOf(wlyyQuotaResult.getResult());
|
|
|
}
|
|
|
//从redis中获取最新的转签数据 指标是37
|
|
|
int switchNum = getLevel1NumForRedis(switchIndex, level, code, timeKey);
|
|
|
int switchNum = getLevel1NumForRedis(switchIndex, level, rediscode, timeKey);
|
|
|
jo.put("yesterYearSign", signNum);//去年的签约量
|
|
|
jo.put("thisYearRenew", renewNum);//今年的续签量
|
|
|
jo.put("thisYearSwithch", switchNum);//今年的转签量
|
|
@ -4195,7 +4226,8 @@ public class StatisticsService extends BaseService {
|
|
|
return jo;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject getRenewAnalysis(String switchIndex, String switchIndexReson, String signIn, String signOut, String level, String code) {
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
@ -4790,5 +4822,37 @@ public class StatisticsService extends BaseService {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取单个数据(二级维度)
|
|
|
*
|
|
|
* @param date
|
|
|
* @param level
|
|
|
* @param index
|
|
|
* @param area
|
|
|
* @param lowCode
|
|
|
* @return
|
|
|
*/
|
|
|
private WlyyQuotaResult findOneQuotaResultWithLevelType2(String date, int level, String index, String area,String lowCode) {
|
|
|
String sql = " select * from wlyy_quota_result w where w.quota_date ='" + date + "' and w.quato_code='" + index + "' and w.level1_type= '" + level + "' and w.level2_type = "+lowCode;
|
|
|
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));
|
|
|
if (results.size() > 0) {
|
|
|
return results.get(0);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|