|
@ -178,7 +178,9 @@ public class StatisticsService {
|
|
|
JSONObject res = new JSONObject();
|
|
|
StringBuffer sqlbuff = new StringBuffer();
|
|
|
List<Map<String,Object>> listMaps = null;
|
|
|
|
|
|
if ("".equals(day)){
|
|
|
day = "30";
|
|
|
}
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
cal.setTime(new Date());
|
|
|
cal.add(Calendar.DATE, -Integer.parseInt(day));
|
|
@ -227,6 +229,13 @@ public class StatisticsService {
|
|
|
// 28 新生儿-在线咨询总数
|
|
|
// 32 新生儿-在线咨询总数
|
|
|
// 35 新生儿-上门辅导-服务工单数
|
|
|
// 54 新生儿-上门辅导-工单数发起数
|
|
|
if ("".equals(interval)){
|
|
|
interval ="1";
|
|
|
}
|
|
|
if ("".equals(timeLevel)){
|
|
|
timeLevel ="1";
|
|
|
}
|
|
|
if (!"3".equals(type)&&!"41".equals(type)&&!"43".equals(type)&&!"1".equals(type)&&!"2".equals(type)){
|
|
|
JSONArray esResoult = addLine(String.valueOf(date),LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")), area, level, type, timeLevel, interval, lowLevel);
|
|
|
List<Map> maps = JSONObject.parseArray(esResoult.toJSONString(), Map.class);
|
|
@ -237,7 +246,7 @@ public class StatisticsService {
|
|
|
}
|
|
|
|
|
|
/*综合总数*/
|
|
|
public JSONObject combinedTotal(String type,String startDate,String endDate) throws Exception {
|
|
|
public JSONObject combinedTotal(String type,String endDate) throws Exception {
|
|
|
JSONObject res = new JSONObject();
|
|
|
String index = "";
|
|
|
//es
|
|
@ -245,7 +254,8 @@ public class StatisticsService {
|
|
|
// 44 老人-生活照料-代预约
|
|
|
// 28 新生儿-在线咨询总数
|
|
|
// 35 新生儿-上门辅导-服务工单数
|
|
|
|
|
|
// 29 新生儿-在线咨询未回复数
|
|
|
// 54 新生儿-上门辅导-工单数发起数
|
|
|
//sql
|
|
|
// activity-3 幼儿活动
|
|
|
// activity-1 活动浏览次数
|
|
@ -253,13 +263,13 @@ public class StatisticsService {
|
|
|
//41 老人-紧急呼叫
|
|
|
//43 老人 安放监护
|
|
|
|
|
|
//type 42 老人 37 幼儿
|
|
|
if ("42".equals(type)){
|
|
|
index = "39,44";
|
|
|
//type 幼儿42 37老人
|
|
|
if ("37".equals(type)){
|
|
|
index = "39,44";
|
|
|
String[] indexes = index.split(",");
|
|
|
for(String ind:indexes){
|
|
|
//总量
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
|
|
|
res.put("index_"+ind,saveModel.getResult2().longValue());
|
|
|
}
|
|
|
String emergencyCallSql = "SELECT COUNT(1) FROM base_emergency_assistance_order WHERE status >= 0 ";
|
|
@ -269,11 +279,11 @@ public class StatisticsService {
|
|
|
res.put("index_41",emergencyCallNum);
|
|
|
res.put("index_43",securityMonitoringNum);
|
|
|
}else {
|
|
|
index = "28,35";
|
|
|
index = "28,35,54,29";
|
|
|
String[] indexes = index.split(",");
|
|
|
for(String ind:indexes){
|
|
|
//总量
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
|
|
|
SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
|
|
|
res.put("index_"+ind,saveModel.getResult2().longValue());
|
|
|
}
|
|
|
|