Commit e68cf43e authored by alex yao's avatar alex yao

feat: API积分数据分析+导出

parent 34e2c15a
...@@ -10,6 +10,7 @@ import cn.com.yict.framemax.core.i18n.I18nMessageException; ...@@ -10,6 +10,7 @@ import cn.com.yict.framemax.core.i18n.I18nMessageException;
*/ */
public enum DataAnalyzeTimeRangeEnum { public enum DataAnalyzeTimeRangeEnum {
customize("customize"), customize("customize"),
today("today"),
week("week"), week("week"),
month("month"), month("month"),
; ;
...@@ -29,7 +30,7 @@ public enum DataAnalyzeTimeRangeEnum { ...@@ -29,7 +30,7 @@ public enum DataAnalyzeTimeRangeEnum {
} }
public static DataAnalyzeTimeRangeEnum getByType(String type) { public static DataAnalyzeTimeRangeEnum getByType(String type) {
for (DataAnalyzeTimeRangeEnum item : values()){ for (DataAnalyzeTimeRangeEnum item : values()) {
if (item.getType().equals(type)) { if (item.getType().equals(type)) {
return item; return item;
} }
......
...@@ -173,6 +173,12 @@ public class AgentDataAnalyzeServiceImpl implements AgentDataAnalyzeService { ...@@ -173,6 +173,12 @@ public class AgentDataAnalyzeServiceImpl implements AgentDataAnalyzeService {
Date endDate; Date endDate;
Date startDate; Date startDate;
switch (DataAnalyzeTimeRangeEnum.getByType(rangType)) { switch (DataAnalyzeTimeRangeEnum.getByType(rangType)) {
case today:
endDate = DateUtils.getTodayEnd();
startDate = DateUtils.getDayStartTime(endDate);
startTime = DateUtils.formatDate(startDate, DateUtils.yyyy_MM_dd);
endTime = DateUtils.formatDate(endDate, DateUtils.yyyy_MM_dd_HH_mm_ss);
break;
case week: case week:
endDate = DateUtils.getTodayEnd(); endDate = DateUtils.getTodayEnd();
startDate = DateUtils.getDayStartTime(DateUtils.addDays(endDate, -6)); startDate = DateUtils.getDayStartTime(DateUtils.addDays(endDate, -6));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment