|
@ -1891,6 +1891,7 @@ public class BaseStatistsService {
|
|
|
|
|
|
public String filtersExchangeHandle(String filters, EsConfig esConfig) {
|
|
public String filtersExchangeHandle(String filters, EsConfig esConfig) {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
String otherFilter = "";
|
|
Calendar lastDate = Calendar.getInstance();
|
|
Calendar lastDate = Calendar.getInstance();
|
|
lastDate.set(Calendar.DAY_OF_MONTH, 1); // 设置为1号,当前日期既为本月第一天
|
|
lastDate.set(Calendar.DAY_OF_MONTH, 1); // 设置为1号,当前日期既为本月第一天
|
|
String firstDay = sdf.format(lastDate.getTime());
|
|
String firstDay = sdf.format(lastDate.getTime());
|
|
@ -1901,7 +1902,17 @@ public class BaseStatistsService {
|
|
String preMonthFirstDay = sdf.format(lastDate.getTime());
|
|
String preMonthFirstDay = sdf.format(lastDate.getTime());
|
|
lastDate.set(Calendar.DAY_OF_MONTH, lastDate.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
lastDate.set(Calendar.DAY_OF_MONTH, lastDate.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
String preMonthLastDay = sdf.format(lastDate.getTime());
|
|
String preMonthLastDay = sdf.format(lastDate.getTime());
|
|
// 如果有时间过滤条件,则按时间条件计算
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(filters)) {
|
|
|
|
String[] split = filters.split(";");
|
|
|
|
for (String s : split) {
|
|
|
|
// 拼接非quotaDate的过滤条件
|
|
|
|
if (!s.contains(quotaDateField)) {
|
|
|
|
otherFilter += s + " and ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 如果有时间过滤条件,则计算时间条件计算
|
|
if (StringUtils.isNotEmpty(filters) && filters.contains(quotaDateField)) {
|
|
if (StringUtils.isNotEmpty(filters) && filters.contains(quotaDateField)) {
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
boolean b = filters.indexOf("'") > -1;
|
|
boolean b = filters.indexOf("'") > -1;
|
|
@ -1932,6 +1943,10 @@ public class BaseStatistsService {
|
|
if (StringUtils.isNotEmpty(esConfig.getFilter())) {
|
|
if (StringUtils.isNotEmpty(esConfig.getFilter())) {
|
|
filters += " and " + esConfig.getFilter();
|
|
filters += " and " + esConfig.getFilter();
|
|
}
|
|
}
|
|
|
|
if (StringUtils.isNotEmpty(otherFilter)) {
|
|
|
|
filters = otherFilter + filters;
|
|
|
|
}
|
|
return filters;
|
|
return filters;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|