|
@ -4,6 +4,7 @@ import com.yihu.wlyy.service.app.statistics.StatisticsAllService;
|
|
import com.yihu.wlyy.service.app.statistics.StatisticsService;
|
|
import com.yihu.wlyy.service.app.statistics.StatisticsService;
|
|
import com.yihu.wlyy.service.app.statisticsES.StatisticsESService;
|
|
import com.yihu.wlyy.service.app.statisticsES.StatisticsESService;
|
|
import com.yihu.wlyy.util.Constant;
|
|
import com.yihu.wlyy.util.Constant;
|
|
|
|
import com.yihu.wlyy.util.ElasticsearchUtil;
|
|
import com.yihu.wlyy.util.ValueComparator;
|
|
import com.yihu.wlyy.util.ValueComparator;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import com.yihu.wlyy.web.quota.vo.SaveModel;
|
|
import com.yihu.wlyy.web.quota.vo.SaveModel;
|
|
@ -29,7 +30,7 @@ import java.util.TreeMap;
|
|
* Created by chenweida on 2017/10/13.
|
|
* Created by chenweida on 2017/10/13.
|
|
*/
|
|
*/
|
|
@Controller
|
|
@Controller
|
|
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
|
|
|
|
|
|
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
|
|
@Api(description = "ES统计查询")
|
|
@Api(description = "ES统计查询")
|
|
public class EsStatisticsController extends BaseController {
|
|
public class EsStatisticsController extends BaseController {
|
|
|
|
|
|
@ -39,6 +40,8 @@ public class EsStatisticsController extends BaseController {
|
|
StatisticsService statisticsService;
|
|
StatisticsService statisticsService;
|
|
@Autowired
|
|
@Autowired
|
|
StatisticsAllService statisticsAllService;
|
|
StatisticsAllService statisticsAllService;
|
|
|
|
@Autowired
|
|
|
|
ElasticsearchUtil elasticsearchUtil;
|
|
/**
|
|
/**
|
|
* 获取统计时间
|
|
* 获取统计时间
|
|
*
|
|
*
|
|
@ -54,6 +57,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 指标按间隔统计 增量
|
|
* 指标按间隔统计 增量
|
|
* 按年度统计是根据前端传的 startDate
|
|
* 按年度统计是根据前端传的 startDate
|
|
@ -77,6 +81,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String level2_type) {
|
|
@RequestParam(required = false) String level2_type) {
|
|
String tag = "";
|
|
String tag = "";
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
if (index != null) {
|
|
if (index != null) {
|
|
@ -112,6 +118,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
@ -148,6 +156,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = false) String level2_type) {
|
|
@RequestParam(required = false) String level2_type) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
@ -187,6 +197,11 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String level2_type,
|
|
@RequestParam(required = false) String level2_type,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
|
|
if(StringUtils.isNotEmpty(lowLevel)){
|
|
|
|
lowLevel = elasticsearchUtil.changeLevel(Integer.parseInt(lowLevel))+"";
|
|
|
|
}
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
@ -222,6 +237,11 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String lowLevel,
|
|
@RequestParam(required = false) String lowLevel,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
|
|
if(StringUtils.isNotEmpty(lowLevel)){
|
|
|
|
lowLevel = elasticsearchUtil.changeLevel(Integer.parseInt(lowLevel))+"";
|
|
|
|
}
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
JSONArray returnJa = new JSONArray();
|
|
JSONArray returnJa = new JSONArray();
|
|
@ -237,8 +257,8 @@ public class EsStatisticsController extends BaseController {
|
|
JSONArray jsonArray2 = null;
|
|
JSONArray jsonArray2 = null;
|
|
if (Constant.getNowYearByDate(endDate).equals(year)) {
|
|
if (Constant.getNowYearByDate(endDate).equals(year)) {
|
|
jsonArray2 = statisticsESService.getLowLevelIncrementDetail(endDate, endDate, area, level, indexes[1], sort, lowLevel);
|
|
jsonArray2 = statisticsESService.getLowLevelIncrementDetail(endDate, endDate, area, level, indexes[1], sort, lowLevel);
|
|
}else{
|
|
|
|
String date=Integer.valueOf(year)+1+"-06-30";
|
|
|
|
|
|
} else {
|
|
|
|
String date = Integer.valueOf(year) + 1 + "-06-30";
|
|
jsonArray2 = statisticsESService.getLowLevelIncrementDetail(date, date, area, level, indexes[1], sort, lowLevel);
|
|
jsonArray2 = statisticsESService.getLowLevelIncrementDetail(date, date, area, level, indexes[1], sort, lowLevel);
|
|
}
|
|
}
|
|
jsonArrays.add(jsonArray2);
|
|
jsonArrays.add(jsonArray2);
|
|
@ -274,13 +294,13 @@ public class EsStatisticsController extends BaseController {
|
|
for (Map.Entry<String, JSONObject> one : index1.entrySet()) {
|
|
for (Map.Entry<String, JSONObject> one : index1.entrySet()) {
|
|
JSONObject map1 = one.getValue();
|
|
JSONObject map1 = one.getValue();
|
|
JSONObject map2 = index2.get(one.getKey());
|
|
JSONObject map2 = index2.get(one.getKey());
|
|
String amount1="0";
|
|
|
|
if(map1!=null&&map1.has("amount")){
|
|
|
|
amount1=map1.get("amount").toString();
|
|
|
|
|
|
String amount1 = "0";
|
|
|
|
if (map1 != null && map1.has("amount")) {
|
|
|
|
amount1 = map1.get("amount").toString();
|
|
}
|
|
}
|
|
String amount2="0";
|
|
|
|
if(map2!=null&&map2.has("amount")){
|
|
|
|
amount2=map2.get("amount").toString();
|
|
|
|
|
|
String amount2 = "0";
|
|
|
|
if (map2 != null && map2.has("amount")) {
|
|
|
|
amount2 = map2.get("amount").toString();
|
|
}
|
|
}
|
|
|
|
|
|
String amount = amount1 + "," + amount2;
|
|
String amount = amount1 + "," + amount2;
|
|
@ -321,6 +341,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) int level,
|
|
@RequestParam(required = true) int level,
|
|
@RequestParam(required = true) String index) {
|
|
@RequestParam(required = true) String index) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
for (String idx : indexes) {
|
|
for (String idx : indexes) {
|
|
@ -352,10 +374,12 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String year
|
|
@RequestParam(required = false) String year
|
|
) {
|
|
) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
//year没传默认是今年
|
|
//year没传默认是今年
|
|
if(org.springframework.util.StringUtils.isEmpty(year)){
|
|
|
|
year= Constant.getNowYear();
|
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(year)) {
|
|
|
|
year = Constant.getNowYear();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -366,11 +390,11 @@ public class EsStatisticsController extends BaseController {
|
|
// JSONObject signRate = statisticsAllService.getSignRate(endDate, area, level,year);
|
|
// JSONObject signRate = statisticsAllService.getSignRate(endDate, area, level,year);
|
|
// JSONObject signTaskRate = statisticsAllService.getSignTaskRate(endDate, area, level,year);
|
|
// JSONObject signTaskRate = statisticsAllService.getSignTaskRate(endDate, area, level,year);
|
|
|
|
|
|
long sign = statisticsESService.getIndexTotal(endDate, area, level, "13","2");
|
|
|
|
|
|
long sign = statisticsESService.getIndexTotal(endDate, area, level, "13", "2");
|
|
long weiJf = statisticsESService.getWeiJiaoFei(endDate, area, level);
|
|
long weiJf = statisticsESService.getWeiJiaoFei(endDate, area, level);
|
|
JSONObject jo = statisticsESService.getRenewPercent(level + "", area, Constant.getNowYear());
|
|
JSONObject jo = statisticsESService.getRenewPercent(level + "", area, Constant.getNowYear());
|
|
JSONObject signRate = statisticsESService.getSignRate(endDate, area, level,year);
|
|
|
|
JSONObject signTaskRate = statisticsESService.getSignTaskRate(endDate, area, level,year);
|
|
|
|
|
|
JSONObject signRate = statisticsESService.getSignRate(endDate, area, level, year);
|
|
|
|
JSONObject signTaskRate = statisticsESService.getSignTaskRate(endDate, area, level, year);
|
|
|
|
|
|
result.put("sign", sign);
|
|
result.put("sign", sign);
|
|
result.put("expenses", weiJf);
|
|
result.put("expenses", weiJf);
|
|
@ -380,11 +404,11 @@ public class EsStatisticsController extends BaseController {
|
|
result.put("renewRange", jo.get("renewRange"));//续签率 50.00%
|
|
result.put("renewRange", jo.get("renewRange"));//续签率 50.00%
|
|
} else {
|
|
} else {
|
|
//如果年度不是当前年度 就根据endDate 找到那个年度的最后一天的数据
|
|
//如果年度不是当前年度 就根据endDate 找到那个年度的最后一天的数据
|
|
if(!Constant.getNowYear().equals(year)){
|
|
|
|
endDate=(Integer.valueOf(year)+1)+"-06-30";
|
|
|
|
|
|
if (!Constant.getNowYear().equals(year)) {
|
|
|
|
endDate = (Integer.valueOf(year) + 1) + "-06-30";
|
|
}
|
|
}
|
|
// result = statisticsAllService.getGroupInfo(endDate, lowCode, area, level,year);
|
|
// result = statisticsAllService.getGroupInfo(endDate, lowCode, area, level,year);
|
|
result = statisticsESService.getGroupInfo(endDate, lowCode, area, level,year);
|
|
|
|
|
|
result = statisticsESService.getGroupInfo(endDate, lowCode, area, level, year);
|
|
}
|
|
}
|
|
|
|
|
|
return write(200, "查询成功", "data", result);
|
|
return write(200, "查询成功", "data", result);
|
|
@ -411,6 +435,9 @@ public class EsStatisticsController extends BaseController {
|
|
int level,
|
|
int level,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
JSONArray result = statisticsESService.getSixFiveStatistics(endDate, area, level);
|
|
JSONArray result = statisticsESService.getSixFiveStatistics(endDate, area, level);
|
|
|
|
|
|
return write(200, "查询成功", "data", result);
|
|
return write(200, "查询成功", "data", result);
|
|
@ -445,16 +472,18 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String lowCode,
|
|
@RequestParam(required = false) String lowCode,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
if (index != null) {
|
|
if (index != null) {
|
|
for (String idx : indexes) {
|
|
for (String idx : indexes) {
|
|
if(org.springframework.util.StringUtils.isEmpty(year)){
|
|
|
|
year=Constant.getNowYear();
|
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(year)) {
|
|
|
|
year = Constant.getNowYear();
|
|
}
|
|
}
|
|
// JSONObject json = statisticsAllService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode,year);
|
|
// JSONObject json = statisticsAllService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode,year);
|
|
JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode,year);
|
|
|
|
|
|
JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, lowCode, year);
|
|
result.put("index_" + idx, json);
|
|
result.put("index_" + idx, json);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -488,32 +517,39 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String lowLevel,
|
|
@RequestParam(required = false) String lowLevel,
|
|
@RequestParam(required = false) String lowCode) {
|
|
@RequestParam(required = false) String lowCode) {
|
|
try {
|
|
try {
|
|
|
|
int levelTemp = level;
|
|
|
|
String lowLevelTemp = lowLevel;
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
|
|
if(StringUtils.isNotEmpty(lowLevel)){
|
|
|
|
lowLevel = elasticsearchUtil.changeLevel(Integer.parseInt(lowLevel))+"";
|
|
|
|
}
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
String year=Constant.getNowYearByDate(date);
|
|
|
|
|
|
String year = Constant.getNowYearByDate(date);
|
|
if (StringUtils.isNotEmpty(lowCode)) {
|
|
if (StringUtils.isNotEmpty(lowCode)) {
|
|
// 指定level下特定查询级别
|
|
// 指定level下特定查询级别
|
|
if (index.equals("17")) {
|
|
if (index.equals("17")) {
|
|
//sort=1&date=2017-07-13&level=4&index=17&area=350200&lowLevel=1&lowCode=3
|
|
//sort=1&date=2017-07-13&level=4&index=17&area=350200&lowLevel=1&lowCode=3
|
|
result.put("index_" + index, statisticsESService.getLevelTwoLowLevelTotalTeamLeader(date, area, level, index, sort, lowLevel, lowCode,year));
|
|
|
|
|
|
result.put("index_" + index, statisticsESService.getLevelTwoLowLevelTotalTeamLeader(date, area, level, index, sort, lowLevel, lowCode, year));
|
|
} else {
|
|
} else {
|
|
result.put("index_" + index, statisticsESService.getLevelTwoLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode,year));
|
|
|
|
|
|
result.put("index_" + index, statisticsESService.getLevelTwoLowLevelTotal(date, area, level, index, sort, lowLevel, lowCode, year));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 未指定level下特定查询级别
|
|
// 未指定level下特定查询级别
|
|
for (String idx : indexes) {
|
|
for (String idx : indexes) {
|
|
if (idx.equals("18") || index.equals("19")) {
|
|
if (idx.equals("18") || index.equals("19")) {
|
|
result.put("index_" + idx, statisticsAllService.getLowLevelTotalSpecial(date, area, level, idx, sort, lowLevel));
|
|
|
|
} else if ( index.equals("21")) {
|
|
|
|
|
|
result.put("index_" + idx, statisticsAllService.getLowLevelTotalSpecial(date, area, levelTemp, idx, sort, lowLevelTemp));
|
|
|
|
} else if (index.equals("21")) {
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotal2(date, area, level, idx, sort, lowLevel));
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotal2(date, area, level, idx, sort, lowLevel));
|
|
} else if (idx.equals("28")) {
|
|
} else if (idx.equals("28")) {
|
|
//level=4&area=350200&sort=1&index=28&date=undefined&lowLevel=2
|
|
//level=4&area=350200&sort=1&index=28&date=undefined&lowLevel=2
|
|
result.put("index_" + idx, statisticsESService.getAvgAllInfo(level, area, lowLevel));
|
|
result.put("index_" + idx, statisticsESService.getAvgAllInfo(level, area, lowLevel));
|
|
} else if (idx.equals("13")) {
|
|
} else if (idx.equals("13")) {
|
|
// sort=1&date=2017-07-13&level=4&index=13&area=350200&lowCode=
|
|
// sort=1&date=2017-07-13&level=4&index=13&area=350200&lowCode=
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel,year));
|
|
|
|
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel, year));
|
|
} else {
|
|
} else {
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel,year));
|
|
|
|
|
|
result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@ -541,8 +577,8 @@ public class EsStatisticsController extends BaseController {
|
|
try {
|
|
try {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
JSONObject sszq = statisticsESService.getSszqAndGwrq(endDate, area, level, "18");
|
|
|
|
JSONObject gwrq = statisticsESService.getSszqAndGwrq(endDate, area, level, "19");
|
|
|
|
|
|
JSONObject sszq = statisticsAllService.getSszqAndGwrq(endDate, area, level, "18");
|
|
|
|
JSONObject gwrq = statisticsAllService.getSszqAndGwrq(endDate, area, level, "19");
|
|
|
|
|
|
result.put("sszq", sszq);
|
|
result.put("sszq", sszq);
|
|
result.put("gwrq", gwrq);
|
|
result.put("gwrq", gwrq);
|
|
@ -571,11 +607,13 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = true) String index,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
String[] indexes = index.split(",");
|
|
String[] indexes = index.split(",");
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
for (String idx : indexes) {
|
|
for (String idx : indexes) {
|
|
Long total = statisticsESService.getIndexTotal(endDate, area, level, idx,"2");
|
|
|
|
|
|
Long total = statisticsESService.getIndexTotal(endDate, area, level, idx, "2");
|
|
result.put("index_" + idx, total);
|
|
result.put("index_" + idx, total);
|
|
}
|
|
}
|
|
|
|
|
|
@ -626,12 +664,16 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = false) String lowlevel,
|
|
@RequestParam(required = false) String lowlevel,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
//新 版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
|
|
if(StringUtils.isNotEmpty(lowlevel)){
|
|
|
|
lowlevel = elasticsearchUtil.changeLevel(Integer.parseInt(lowlevel))+"";
|
|
|
|
}
|
|
JSONObject data = null;
|
|
JSONObject data = null;
|
|
if (Constant.getNowYear().equals(year)) {
|
|
if (Constant.getNowYear().equals(year)) {
|
|
data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel,null);
|
|
|
|
|
|
data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, null);
|
|
} else if (org.springframework.util.StringUtils.isEmpty(year)) {
|
|
} else if (org.springframework.util.StringUtils.isEmpty(year)) {
|
|
data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel,null);
|
|
|
|
|
|
data = statisticsESService.getConsultingStatisticsList(level, area, lowlevel, null);
|
|
// data = statisticsService.getConsultingStatisticsListAll(level, area, lowlevel, year);
|
|
// data = statisticsService.getConsultingStatisticsListAll(level, area, lowlevel, year);
|
|
} else {
|
|
} else {
|
|
|
|
|
|
@ -647,6 +689,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 咨询统计
|
|
* 咨询统计
|
|
* 咨询分析页面具体交互与业务分析内一致,即按市、区、社区、机构有不同展示,可一级级进入查看
|
|
* 咨询分析页面具体交互与业务分析内一致,即按市、区、社区、机构有不同展示,可一级级进入查看
|
|
@ -663,6 +706,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) String area,
|
|
@RequestParam(required = true) String area,
|
|
@RequestParam(required = false) String year) {
|
|
@RequestParam(required = false) String year) {
|
|
try {
|
|
try {
|
|
|
|
//版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
JSONObject data = null;
|
|
JSONObject data = null;
|
|
// if (Constant.getNowYear().equals(year)) {
|
|
// if (Constant.getNowYear().equals(year)) {
|
|
// //查今年的查找redis即可
|
|
// //查今年的查找redis即可
|
|
@ -675,7 +720,7 @@ public class EsStatisticsController extends BaseController {
|
|
// //去数据库查找年份
|
|
// //去数据库查找年份
|
|
// data = statisticsService.getConsultingTitleWithYear(level, area, year);
|
|
// data = statisticsService.getConsultingTitleWithYear(level, area, year);
|
|
// }
|
|
// }
|
|
data = statisticsESService.getConsultingTitle(level, area,year);
|
|
|
|
|
|
data = statisticsESService.getConsultingTitle(level, area, year);
|
|
if (data != null) {
|
|
if (data != null) {
|
|
return write(200, "查询成功", "data", data);
|
|
return write(200, "查询成功", "data", data);
|
|
} else {
|
|
} else {
|
|
@ -708,7 +753,9 @@ public class EsStatisticsController extends BaseController {
|
|
// } else {
|
|
// } else {
|
|
// return write(200, "查询成功", "data", statisticsService.getCoutListByTimeYear(level, area, year));
|
|
// return write(200, "查询成功", "data", statisticsService.getCoutListByTimeYear(level, area, year));
|
|
// }
|
|
// }
|
|
return write(200, "查询成功", "data", statisticsESService.getCoutListByTime(level,area,year));
|
|
|
|
|
|
//版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(Integer.parseInt(level))+"";
|
|
|
|
return write(200, "查询成功", "data", statisticsESService.getCoutListByTime(level, area, year));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
@ -732,6 +779,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取得分平均数
|
|
* 获取得分平均数
|
|
*
|
|
*
|
|
@ -768,6 +816,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 统计当前团队,签约人数,服务次数,平均满意度
|
|
* 统计当前团队,签约人数,服务次数,平均满意度
|
|
*
|
|
*
|
|
@ -817,6 +866,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取咨询数和未回复数
|
|
* 获取咨询数和未回复数
|
|
*
|
|
*
|
|
@ -838,6 +888,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取机构内服务排行
|
|
* 获取机构内服务排行
|
|
*
|
|
*
|
|
@ -879,6 +930,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 判断团队是否是团队长
|
|
* 判断团队是否是团队长
|
|
*
|
|
*
|
|
@ -917,6 +969,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 计算团队医生月或周咨询未回复和总数折线图
|
|
* 计算团队医生月或周咨询未回复和总数折线图
|
|
*
|
|
*
|
|
@ -941,6 +994,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队内这成员,未回复数,总数,结束咨询数
|
|
* 获取团队内这成员,未回复数,总数,结束咨询数
|
|
*
|
|
*
|
|
@ -964,6 +1018,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取Doctor咨询结果
|
|
* 获取Doctor咨询结果
|
|
*
|
|
*
|
|
@ -986,6 +1041,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队随访量折线统计图
|
|
* 获取团队随访量折线统计图
|
|
*
|
|
*
|
|
@ -1008,6 +1064,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getTeamDoctorFollowupLine")
|
|
@RequestMapping("/getTeamDoctorFollowupLine")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getTeamDoctorFollowupLine(@RequestParam(required = true) String type,
|
|
public String getTeamDoctorFollowupLine(@RequestParam(required = true) String type,
|
|
@ -1022,6 +1079,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据团队获取团队底下用户列表
|
|
* 根据团队获取团队底下用户列表
|
|
*
|
|
*
|
|
@ -1046,6 +1104,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取医生随访头信息
|
|
* 获取医生随访头信息
|
|
*
|
|
*
|
|
@ -1068,6 +1127,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取待预约量团队统计则线图
|
|
* 获取待预约量团队统计则线图
|
|
*
|
|
*
|
|
@ -1090,6 +1150,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队医生预约量团队统计则线图
|
|
* 获取团队医生预约量团队统计则线图
|
|
*
|
|
*
|
|
@ -1114,6 +1175,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队待预约量医生列表信息
|
|
* 获取团队待预约量医生列表信息
|
|
*
|
|
*
|
|
@ -1138,6 +1200,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队医生待预信息
|
|
* 获取团队医生待预信息
|
|
*
|
|
*
|
|
@ -1160,6 +1223,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队健康指导折线图
|
|
* 获取团队健康指导折线图
|
|
*
|
|
*
|
|
@ -1182,6 +1246,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队医生则线图
|
|
* 获取团队医生则线图
|
|
*
|
|
*
|
|
@ -1206,6 +1271,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队指导总数List
|
|
* 获取团队指导总数List
|
|
*
|
|
*
|
|
@ -1230,6 +1296,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取医生健康指导头部信息
|
|
* 获取医生健康指导头部信息
|
|
*
|
|
*
|
|
@ -1252,6 +1319,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队健康教育折线统计
|
|
* 获取团队健康教育折线统计
|
|
*
|
|
*
|
|
@ -1274,6 +1342,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队健康
|
|
* 获取团队健康
|
|
*
|
|
*
|
|
@ -1297,6 +1366,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队成员健康教育列表
|
|
* 获取团队成员健康教育列表
|
|
*
|
|
*
|
|
@ -1321,6 +1391,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getTeamDoctorEduTitle")
|
|
@RequestMapping("/getTeamDoctorEduTitle")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getTeamDoctorEduTitle(@RequestParam(required = true) String teamCode,
|
|
public String getTeamDoctorEduTitle(@RequestParam(required = true) String teamCode,
|
|
@ -1334,6 +1405,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getDotorInfo")
|
|
@RequestMapping("/getDotorInfo")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getDotorInfo(String code) {
|
|
public String getDotorInfo(String code) {
|
|
@ -1344,6 +1416,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getTeamRenewChangeLine")
|
|
@RequestMapping("/getTeamRenewChangeLine")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
|
|
public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
|
|
@ -1357,23 +1430,25 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/cleanDoctorScore")
|
|
@RequestMapping("/cleanDoctorScore")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String cleanDoctorScore(){
|
|
|
|
try{
|
|
|
|
|
|
public String cleanDoctorScore() {
|
|
|
|
try {
|
|
return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());
|
|
return write(200, "清洗完成", "data", statisticsAllService.cleanDoctorScore());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取转签率和续签率
|
|
* 获取转签率和续签率
|
|
* 前端:续签进展
|
|
* 前端:续签进展
|
|
*
|
|
|
|
|
|
* <p>
|
|
* //@param index 42,43,44 (52,53,54 服务类型维度)
|
|
* //@param index 42,43,44 (52,53,54 服务类型维度)
|
|
* @param level 等级 4 市 3区 2社区 1团队
|
|
* @param level 等级 4 市 3区 2社区 1团队
|
|
* @param area 市 默认是厦门市 350200 区 就是区的code 社区就是社区的code 团队就是团队的code
|
|
|
|
|
|
* @param area 市 默认是厦门市 350200 区 就是区的code 社区就是社区的code 团队就是团队的code.
|
|
* @param year 年份 非比传
|
|
* @param year 年份 非比传
|
|
* @param lowCode 服务类型维度code(老年人3,高血压4,糖尿病5)
|
|
* @param lowCode 服务类型维度code(老年人3,高血压4,糖尿病5)
|
|
* @return
|
|
* @return
|
|
@ -1389,12 +1464,13 @@ public class EsStatisticsController extends BaseController {
|
|
try {
|
|
try {
|
|
|
|
|
|
//return write(200, "查询成功", "data", statisticsService.getRenewPercentAndChangePercent(index,level, code, year,lowCode));
|
|
//return write(200, "查询成功", "data", statisticsService.getRenewPercentAndChangePercent(index,level, code, year,lowCode));
|
|
return write(200,"查询成功!","data",statisticsESService.getRenewPercentAndChangePercent(changeLevel(level),area,year,lowCode));
|
|
|
|
|
|
return write(200,"查询成功!","data",statisticsESService.getRenewPercentAndChangePercent(elasticsearchUtil.changeLevel(level),area,year,lowCode));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取转签人数,转签原因分析,转签分布
|
|
* 获取转签人数,转签原因分析,转签分布
|
|
* 前端:签约数据分析,团队转签详情
|
|
* 前端:签约数据分析,团队转签详情
|
|
@ -1409,6 +1485,8 @@ public class EsStatisticsController extends BaseController {
|
|
@RequestParam(required = true) String level,
|
|
@RequestParam(required = true) String level,
|
|
@RequestParam(required = true) String code) {
|
|
@RequestParam(required = true) String code) {
|
|
try {
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(Integer.parseInt(level))+"";
|
|
String switchIndex = "";
|
|
String switchIndex = "";
|
|
String switchIndexReson = "";
|
|
String switchIndexReson = "";
|
|
String signIn = "";
|
|
String signIn = "";
|
|
@ -1448,6 +1526,7 @@ public class EsStatisticsController extends BaseController {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 去年的签约量,续签量和续签率 列表
|
|
* 去年的签约量,续签量和续签率 列表
|
|
*
|
|
*
|
|
@ -1483,7 +1562,7 @@ public class EsStatisticsController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("index_"+index, statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew(area, level, index, sort, lowLevel, year,lowCode));
|
|
|
|
|
|
// result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew(area, changeLevel(level), index, sort, String.valueOf(changeLevel(Integer.valueOf(lowLevel))), year, lowCode));
|
|
|
|
|
|
return write(200, "查询成功", "data", result);
|
|
return write(200, "查询成功", "data", result);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@ -1494,42 +1573,16 @@ public class EsStatisticsController extends BaseController {
|
|
|
|
|
|
@RequestMapping("/getLevelTotalSingle")
|
|
@RequestMapping("/getLevelTotalSingle")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getLevelTotalSingle(@ApiParam(name="date", value="日期标识") @RequestParam(required = true)String date,
|
|
|
|
@ApiParam(name="area", value="区域code") @RequestParam(required = true)String area,
|
|
|
|
@ApiParam(name="level", value="级别") @RequestParam(required = true)int level){
|
|
|
|
try{
|
|
|
|
return write(200, "查询成功", "data", statisticsESService.getLowLevelTotalSingle2(date,area,level));
|
|
|
|
|
|
public String getLevelTotalSingle(@ApiParam(name = "date", value = "日期标识") @RequestParam(required = true) String date,
|
|
|
|
@ApiParam(name = "area", value = "区域code") @RequestParam(required = true) String area,
|
|
|
|
@ApiParam(name = "level", value = "级别") @RequestParam(required = true) int level) {
|
|
|
|
try {
|
|
|
|
//新版与旧版统计适配
|
|
|
|
level = elasticsearchUtil.changeLevel(level);
|
|
|
|
return write(200, "查询成功", "data", statisticsESService.getLowLevelTotalSingle2(date, area, level));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
|
|
* 将参数转换成需要的SaveModel里的标识
|
|
|
|
* @param level 等级 4 市 3区 2社区 1团队
|
|
|
|
* @return
|
|
|
|
* @author zhangdan
|
|
|
|
* @time 2017-10-18
|
|
|
|
*/
|
|
|
|
public int changeLevel(int level){
|
|
|
|
int resultLevel =0;
|
|
|
|
if (level==1){
|
|
|
|
//团队转成SaveModel里的标识
|
|
|
|
resultLevel = Integer.valueOf(SaveModel.teamLevel);
|
|
|
|
}else if(level==2){
|
|
|
|
//社区转成SaveModel里的标识
|
|
|
|
resultLevel = Integer.valueOf(SaveModel.OrgLevel);
|
|
|
|
}else if (level ==3){
|
|
|
|
//区转成SaveModel里的标识
|
|
|
|
resultLevel = Integer.valueOf(SaveModel.townLevel);
|
|
|
|
}else if (level==4){
|
|
|
|
//市转成SaveModel里的标识
|
|
|
|
resultLevel = Integer.valueOf(SaveModel.cityLevel);
|
|
|
|
}
|
|
|
|
if(resultLevel==0){
|
|
|
|
resultLevel = level;
|
|
|
|
}
|
|
|
|
return resultLevel;
|
|
|
|
}
|
|
|
|
}
|
|
}
|