|
@ -583,7 +583,7 @@ public class StatisticsESService {
|
|
|
*/
|
|
|
public JSONObject getSignRate(String endDate, String area, int level, String year) throws Exception {
|
|
|
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"1","2");
|
|
|
long signAmount = saveModel.getResult2().longValue();
|
|
|
PopulationBase peopleNum = getPopulationBase(area, year);
|
|
|
JSONObject json = new JSONObject();
|
|
@ -614,7 +614,7 @@ public class StatisticsESService {
|
|
|
if (endDate.compareTo(dateFormat.format(new Date())) >= 0) {
|
|
|
endDate = elasticsearchUtil.getQuotaTime();
|
|
|
}
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"1","2");
|
|
|
long signAmount = saveModel.getResult2().longValue();
|
|
|
PopulationBase peopleNum = getPopulationBase(area, year);
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
@ -839,7 +839,7 @@ public class StatisticsESService {
|
|
|
resultList.add(obj);
|
|
|
}
|
|
|
}
|
|
|
} else if (SaveModel.townLevel.equals(lowLevel)) {
|
|
|
} else if (lowLevel.equals("4")) {
|
|
|
List<Town> towns = new ArrayList<>();
|
|
|
if (SaveModel.cityLevel.equals(level+"")) {
|
|
|
towns = townDao.findByCityCode(area);
|
|
@ -868,7 +868,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
} else if (SaveModel.teamLevel.equals(lowLevel)) {
|
|
|
List<Hospital> hospitals = new ArrayList<>();
|
|
|
if (SaveModel.cityLevel.equals(level+"")) {
|
|
|
if (level == 2) {
|
|
|
hospitals = hospitalDao.findByCity(area);
|
|
|
} else if (SaveModel.townLevel.equals(level+"")) {
|
|
|
hospitals = hospitalDao.findByTownCode(area);
|
|
@ -902,22 +902,23 @@ public class StatisticsESService {
|
|
|
|
|
|
public JSONArray getLevelTwoLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel, String lowCode, String year) throws Exception {
|
|
|
|
|
|
// String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel1(date, area, level, index, SaveModel.timeLevel_DDL, lowLevel, lowCode);
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel1(date, area, level, index, SaveModel.timeLevel_DDL, low_level, lowCode);
|
|
|
|
|
|
if (esModelList != null && esModelList.size() > 0) {
|
|
|
for (SaveModel one : esModelList) {
|
|
|
Map<String, Object> maps = new HashMap<String, Object>();
|
|
|
maps.put("amount", one.getResult1());
|
|
|
if (SaveModel.townLevel.equals(lowLevel)) {
|
|
|
maps.put("amount", one.getResult1().intValue());
|
|
|
if (low_level.equals("3")) {
|
|
|
maps.put("code", one.getTown());
|
|
|
maps.put("name", one.getTownName());
|
|
|
} else if (SaveModel.OrgLevel.equals(lowLevel)) {
|
|
|
} else if (low_level.equals("4")) {
|
|
|
maps.put("code", one.getHospital());
|
|
|
maps.put("name", one.getHospitalName());
|
|
|
} else if (SaveModel.teamLevel.equals(lowLevel)) {
|
|
|
} else if (low_level.equals("5")) {
|
|
|
maps.put("code", one.getTeam());
|
|
|
maps.put("name", one.getTeamName());
|
|
|
}
|
|
@ -926,7 +927,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
// 结果为空时,自建结果集
|
|
|
if (resultList == null || resultList.size() < 1) {
|
|
|
resultList = getLowLevelMapKey(level, lowCode, area);
|
|
|
resultList = getLowLevelMapKey(level, low_level, area);
|
|
|
}
|
|
|
|
|
|
if (resultList != null) {
|
|
@ -937,7 +938,7 @@ public class StatisticsESService {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
map.put("signTaskNum", signTaskNum);//目标量
|
|
|
map.put("signRegulationNum", signRegulationNum);//调控量
|
|
|
if (!SaveModel.teamLevel.equals(lowLevel)) {
|
|
|
if (!low_level.equals("5")) {
|
|
|
PopulationBase peopleNum = getPopulationBase(map.get("code").toString(), year);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
@ -946,10 +947,10 @@ public class StatisticsESService {
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
} else if (lowCode.equals("5")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
} else if (lowCode.equals("4")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
@ -964,7 +965,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
|
|
@ -1100,7 +1101,7 @@ public class StatisticsESService {
|
|
|
*/
|
|
|
public JSONArray getLevelTwoLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String lowCode, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel1(date, area, level, index, SaveModel.timeLevel_DDL, lowLevel, lowCode);
|
|
@ -1112,10 +1113,10 @@ public class StatisticsESService {
|
|
|
if (low_level.equals("3")) {
|
|
|
maps.put("code", one.getTown());
|
|
|
maps.put("name", one.getTownName());
|
|
|
} else if (low_level.equals("2")) {
|
|
|
} else if (low_level.equals("4")) {
|
|
|
maps.put("code", one.getHospital());
|
|
|
maps.put("name", one.getHospitalName());
|
|
|
} else if (low_level.equals("1")) {
|
|
|
} else if (low_level.equals("5")) {
|
|
|
maps.put("code", one.getTeam());
|
|
|
maps.put("name", one.getTeamName());
|
|
|
}
|
|
@ -1133,7 +1134,7 @@ public class StatisticsESService {
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
if (!low_level.equals("5")) {
|
|
|
PopulationBase peopleNum = getPopulationBase(area, year);
|
|
|
if (peopleNum != null) {
|
|
|
int num = 0;
|
|
@ -1142,10 +1143,10 @@ public class StatisticsESService {
|
|
|
if (lowCode.equals("3")) {
|
|
|
num = peopleNum.getSixFiveNum();
|
|
|
taskNum = peopleNum.getSixFiveTaskNum();
|
|
|
} else if (lowCode.equals("1")) {
|
|
|
} else if (lowCode.equals("5")) {
|
|
|
num = peopleNum.getGxyNum();
|
|
|
taskNum = peopleNum.getGxyTaskNum();
|
|
|
} else if (lowCode.equals("2")) {
|
|
|
} else if (lowCode.equals("4")) {
|
|
|
num = peopleNum.getTnbNum();
|
|
|
taskNum = peopleNum.getTnbTaskNum();
|
|
|
}
|
|
@ -1161,7 +1162,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
|
|
@ -1200,7 +1201,7 @@ public class StatisticsESService {
|
|
|
*/
|
|
|
public JSONArray getLowLevelTotal2(String date, String area, int level, String index, int sort, String lowLevel) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
//获取微信关注的未交费
|
|
|
Map<String, Integer> expenseStatus0 = getByIndex(date, area, level, "49", sort, lowLevel, dateFormat);
|
|
@ -1241,7 +1242,7 @@ public class StatisticsESService {
|
|
|
map.put("bindRate", getRangeDouuble(expenseStatus1amountNum, expenseStatus1SigjnNum, 2));//微信关注率
|
|
|
}
|
|
|
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2)) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4)) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
// 排序 按绑定率来排序
|
|
@ -1308,11 +1309,11 @@ public class StatisticsESService {
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
|
|
|
if (esModelList != null && esModelList.size() > 0) {
|
|
|
esModelList.stream().forEach(one -> {
|
|
|
if (SaveModel.townLevel.equals(lowLevel)) {
|
|
|
if (lowLevel.equals("3")) {
|
|
|
returnMap.put(one.getTown(), one.getResult1().intValue());
|
|
|
} else if (SaveModel.OrgLevel.equals(lowLevel)) {
|
|
|
} else if (lowLevel.equals("4")) {
|
|
|
returnMap.put(one.getHospital(), one.getResult1().intValue());
|
|
|
} else if (SaveModel.teamLevel.equals(lowLevel)) {
|
|
|
} else if (lowLevel.equals("5")) {
|
|
|
returnMap.put(one.getTeam(),one.getResult1().intValue());
|
|
|
}
|
|
|
});
|
|
@ -1325,7 +1326,7 @@ public class StatisticsESService {
|
|
|
JSONObject returnJo = new JSONObject();
|
|
|
JSONArray ja = new JSONArray();
|
|
|
//市级
|
|
|
if (level == 4) {
|
|
|
if (level == 2) {
|
|
|
if (StringUtils.isBlank(lowLevel)) {
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "3");
|
|
|
esModelList.forEach(one -> {
|
|
@ -1354,7 +1355,7 @@ public class StatisticsESService {
|
|
|
jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
|
|
|
ja.put(jo);
|
|
|
});
|
|
|
} else if (level == 2) {
|
|
|
} else if (level == 4) {
|
|
|
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "1");
|
|
|
esModelList.forEach(one -> {
|
|
@ -1385,22 +1386,22 @@ public class StatisticsESService {
|
|
|
*/
|
|
|
public JSONArray getLowLevelTotalTeamLeader(String date, String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);
|
|
|
|
|
|
if (esModelList != null && esModelList.size() > 0) {
|
|
|
for (SaveModel one : esModelList) {
|
|
|
Map<String, Object> maps = new HashMap<String, Object>();
|
|
|
maps.put("amount", one.getResult2().intValue());
|
|
|
if (SaveModel.townLevel.equals(low_level)) {
|
|
|
if (low_level.equals("3") && one.getTown()!=null) {
|
|
|
maps.put("code", one.getTown());
|
|
|
maps.put("name", one.getTownName());
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("4") && one.getHospital()!=null) {
|
|
|
maps.put("code", one.getHospital());
|
|
|
maps.put("name", one.getHospitalName());
|
|
|
} else if (SaveModel.teamLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("5") && one.getTeam()!=null) {
|
|
|
maps.put("code", one.getTeam());
|
|
|
maps.put("name", one.getTeamName());
|
|
|
}
|
|
@ -1423,7 +1424,7 @@ public class StatisticsESService {
|
|
|
map.put("signTaskNum", signTaskNum);//目标量
|
|
|
map.put("signRegulationNum", signRegulationNum);//调控量
|
|
|
|
|
|
if (!SaveModel.teamLevel.equals(low_level)) {
|
|
|
if (!low_level.equals("5")) {
|
|
|
String code = map.get("code").toString();
|
|
|
PopulationBase peopleNum = getPopulationBase(code, year);
|
|
|
if (peopleNum != null) {
|
|
@ -1439,7 +1440,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
|
|
@ -1479,10 +1480,10 @@ public class StatisticsESService {
|
|
|
*/
|
|
|
public JSONArray getLowLevelTotal(String date, String area, int level, String index, int sort, String lowLevel, String year) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
String low_level = String.valueOf(org.springframework.util.StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, lowLevel);
|
|
|
List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);
|
|
|
|
|
|
if (esModelList != null && esModelList.size() > 0) {
|
|
|
for (SaveModel one : esModelList) {
|
|
@ -1491,10 +1492,10 @@ public class StatisticsESService {
|
|
|
if (low_level.equals("3")) {
|
|
|
maps.put("code", one.getTown());
|
|
|
maps.put("name", one.getTownName());
|
|
|
} else if (low_level.equals("2")) {
|
|
|
} else if (low_level.equals("4")) {
|
|
|
maps.put("code", one.getHospital());
|
|
|
maps.put("name", one.getHospitalName());
|
|
|
} else if (low_level.equals("1")) {
|
|
|
} else if (low_level.equals("5")) {
|
|
|
maps.put("code", one.getTeam());
|
|
|
maps.put("name", one.getTeamName());
|
|
|
}
|
|
@ -1512,7 +1513,7 @@ public class StatisticsESService {
|
|
|
for (Map<String, Object> map : resultList) {
|
|
|
map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
|
|
|
|
|
|
if (!low_level.equals("1")) {
|
|
|
if (!low_level.equals("5")) {
|
|
|
PopulationBase peopleNum = getPopulationBase(area, year);
|
|
|
if (peopleNum != null) {
|
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
@ -1527,7 +1528,7 @@ public class StatisticsESService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
|
|
@ -1573,10 +1574,10 @@ public class StatisticsESService {
|
|
|
if (SaveModel.townLevel.equals(low_level)) {
|
|
|
maps.put("code", one.getTown());
|
|
|
maps.put("name", one.getTownName());
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("4")) {
|
|
|
maps.put("code", one.getHospital());
|
|
|
maps.put("name", one.getHospitalName());
|
|
|
} else if (SaveModel.teamLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("5")) {
|
|
|
maps.put("code", one.getTeam());
|
|
|
maps.put("name", one.getTeamName());
|
|
|
}
|
|
@ -1599,11 +1600,11 @@ public class StatisticsESService {
|
|
|
resultList.add(obj);
|
|
|
}
|
|
|
}
|
|
|
} else if (SaveModel.OrgLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("4")) {
|
|
|
List<Town> towns = new ArrayList<>();
|
|
|
if (SaveModel.cityLevel.equals(level+"")) {
|
|
|
if (level == 2) {
|
|
|
towns = townDao.findByCityCode(area);
|
|
|
} else if (SaveModel.townLevel.equals(level+"")) {
|
|
|
} else if (level == 3) {
|
|
|
Town town = townDao.findByCode(area);
|
|
|
towns.add(town);
|
|
|
}
|
|
@ -1621,11 +1622,11 @@ public class StatisticsESService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else if (SaveModel.teamLevel.equals(low_level)) {
|
|
|
} else if (low_level.equals("5")) {
|
|
|
List<Hospital> hospitals = new ArrayList<>();
|
|
|
if (SaveModel.cityLevel.equals(level+"")) {
|
|
|
if (level == 2) {
|
|
|
hospitals = hospitalDao.findByCity(area);
|
|
|
} else if (SaveModel.OrgLevel.equals(level+"")) {
|
|
|
} else if (level == 3) {
|
|
|
hospitals = hospitalDao.findByTownCode(area);
|
|
|
} else {
|
|
|
Hospital hos = hospitalDao.findByCode(area);
|
|
@ -2009,7 +2010,7 @@ public class StatisticsESService {
|
|
|
JSONObject jo = new JSONObject();
|
|
|
String switchIndex = "";//转签index
|
|
|
String signIndex ="1";//签约index
|
|
|
String renewIndex =index;//续签index..
|
|
|
String renewIndex =index;//续签index.
|
|
|
String date = year + "-06-30";
|
|
|
try{
|
|
|
if (level == 4) {
|
|
@ -2278,28 +2279,29 @@ public class StatisticsESService {
|
|
|
public JSONArray getLevelTwoLowLevelTotalSignAndRenew(String area, int level, String index, int sort, String lowLevel, String year, String lowCode) throws Exception {
|
|
|
|
|
|
String lastDate = year + "-06-30";
|
|
|
//String timeKey = elasticsearchUtil.getQuotaTime();
|
|
|
String timeKey = elasticsearchUtil.getQuotaTime();
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level + 1) : lowLevel);
|
|
|
|
|
|
String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();//续签量
|
|
|
Map<String, Integer> renewMap = new HashMap<>(); //续签的的列表转map
|
|
|
List<SaveModel> renewSaveModels = new ArrayList<SaveModel>();
|
|
|
List<SaveModel> signSaveModels = new ArrayList<SaveModel>();
|
|
|
|
|
|
if (StringUtils.isEmpty(lowCode)) {
|
|
|
//续签量
|
|
|
renewSaveModels = elasticsearchUtil.findListDateQuotaLevel0(lastDate, area, level, index, "2", lowLevel);
|
|
|
renewSaveModels = elasticsearchUtil.findDateQuotaLevel0(timeKey,timeKey, area, level, index, "2", "",lowLevel);
|
|
|
} else {
|
|
|
//续签量
|
|
|
renewSaveModels = elasticsearchUtil.findListDateQuotaLevel1(lastDate, area, level, index, "2", lowLevel, lowCode);
|
|
|
renewSaveModels = elasticsearchUtil.findDateQuotaLevel1(timeKey,timeKey, area, level, index,"2",lowCode,"",low_level);
|
|
|
}
|
|
|
|
|
|
if (renewSaveModels != null && renewSaveModels.size() > 0) {
|
|
|
for (SaveModel saveModel : renewSaveModels) {
|
|
|
if ("3".equals(low_level)) {
|
|
|
if ("3".equals(low_level) && saveModel.getTown()!=null) {
|
|
|
renewMap.put(saveModel.getTown(), saveModel.getResult2().intValue());
|
|
|
} else if ("4".equals(low_level)) {
|
|
|
} else if ("4".equals(low_level) && saveModel.getHospital()!=null) {
|
|
|
renewMap.put(saveModel.getHospital(), saveModel.getResult2().intValue());
|
|
|
} else if ("5".equals(low_level)) {
|
|
|
} else if ("5".equals(low_level) && saveModel.getTeam()!=null) {
|
|
|
renewMap.put(saveModel.getTeam(), saveModel.getResult2().intValue());
|
|
|
} else {
|
|
|
continue;
|
|
@ -2310,7 +2312,7 @@ public class StatisticsESService {
|
|
|
//自建结果集
|
|
|
resultList = getLowLevelMapKey(level, low_level, area);
|
|
|
|
|
|
if (resultList != null) {
|
|
|
if (resultList != null && resultList.size()>0) {
|
|
|
DecimalFormat df = new DecimalFormat("0.0000");
|
|
|
//查询去年的签约转map
|
|
|
List<SaveModel> yearsList = new ArrayList();
|
|
@ -2343,21 +2345,27 @@ public class StatisticsESService {
|
|
|
|
|
|
for (Map<String, Object> reMap : resultList) {
|
|
|
reMap.put("amount", reMap.get("amount") != null ? Long.valueOf(reMap.get("amount").toString()) : 0L);
|
|
|
int signNum = 0;
|
|
|
int renewNum = 0;
|
|
|
//获取去年签约的人数 默认是上个年度的最后一天
|
|
|
if((resultMap!=null && resultMap.size()>0)&&(renewMap!=null && renewMap.size()>0)){
|
|
|
if(resultMap!=null && resultMap.size()>0){
|
|
|
SaveModel one = resultMap.get(reMap.get("code").toString());
|
|
|
int signNum = 0;
|
|
|
int renewNum = renewMap.get(reMap.get("code").toString());
|
|
|
if (one != null) {
|
|
|
signNum = one.getResult2().intValue();
|
|
|
}
|
|
|
reMap.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
|
|
|
reMap.put("signNum", signNum);
|
|
|
reMap.put("renewNum", renewNum);
|
|
|
}else{
|
|
|
}
|
|
|
if (renewMap!=null && renewMap.size()>0){
|
|
|
renewNum = renewMap.get(reMap.get("code").toString());
|
|
|
}else{
|
|
|
}
|
|
|
reMap.put("renewNum", renewNum);
|
|
|
reMap.put("signNum", signNum);
|
|
|
reMap.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
|
|
|
|
|
|
}
|
|
|
|
|
|
if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
|
|
|
if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
|
|
|
translateTeamLeaderName(resultList);
|
|
|
}
|
|
|
//对结果进行排序
|