Commit c60d3495 by 黄明步

.

parent ec76952a
...@@ -34,13 +34,15 @@ public class StatController { ...@@ -34,13 +34,15 @@ public class StatController {
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "startDate",value = "开始日期范围,非必填,为空则默认当日",dataType = "String"), @ApiImplicitParam(name = "startDate",value = "开始日期范围,非必填,为空则默认当日",dataType = "String"),
@ApiImplicitParam(name = "endDate",value = "结束日期范围,非必填",dataType = "String"), @ApiImplicitParam(name = "endDate",value = "结束日期范围,非必填",dataType = "String"),
@ApiImplicitParam(name = "displayType",value = "展示类型,总体量或各法院使用量可选值[detailed|full]",dataType = "String",required = false), @ApiImplicitParam(name = "interval",value = "时间间隔,按日查询时可用,可选值[hour|minute|second]",dataType = "String"),
@ApiImplicitParam(name = "displayType",value = "展示类型,总体量或各法院使用量可选值[detailed|full]",dataType = "String"),
}) })
@GetMapping("/getBrokenLineData") @GetMapping("/getBrokenLineData")
public Result getBrokenLineData(@RequestParam(value = "startDate", required = false) String startDate, public Result getBrokenLineData(@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "interval", required = false) String interval,
@RequestParam(value = "displayType", defaultValue = "full") String displayType) { @RequestParam(value = "displayType", defaultValue = "full") String displayType) {
return statService.getBrokenLineData(startDate, endDate, "interval", displayType); return statService.getBrokenLineData(startDate, endDate, interval, displayType);
} }
......
...@@ -128,7 +128,20 @@ public class StatService { ...@@ -128,7 +128,20 @@ public class StatService {
DateTime yearMonthDayDateTime = DateUtil.parse(startDate, "yyyy-MM-dd"); DateTime yearMonthDayDateTime = DateUtil.parse(startDate, "yyyy-MM-dd");
startDate = DateUtil.beginOfDay(yearMonthDayDateTime).toString(); startDate = DateUtil.beginOfDay(yearMonthDayDateTime).toString();
newEndDate = DateUtil.endOfDay(yearMonthDayDateTime).toString(); newEndDate = DateUtil.endOfDay(yearMonthDayDateTime).toString();
defaultInterval = CalendarInterval.Hour; switch (interval) {
case "hour":
defaultInterval = CalendarInterval.Hour;
break;
case "minute":
defaultInterval = CalendarInterval.Minute;
break;
case "second":
defaultInterval = CalendarInterval.Second;
break;
default:
defaultInterval = CalendarInterval.Hour;
break;
}
break; break;
} }
...@@ -137,7 +150,6 @@ public class StatService { ...@@ -137,7 +150,6 @@ public class StatService {
// newEndDate = DateUtil.beginOfDay(DateUtil.date()).toString("yyyy-MM-dd HH:mm:ss"); // newEndDate = DateUtil.beginOfDay(DateUtil.date()).toString("yyyy-MM-dd HH:mm:ss");
startDate = DateUtil.beginOfDay(DateUtil.parseDate("2024-01-23")).toString("yyyy-MM-dd HH:mm:ss"); startDate = DateUtil.beginOfDay(DateUtil.parseDate("2024-01-23")).toString("yyyy-MM-dd HH:mm:ss");
newEndDate = DateUtil.endOfDay(DateUtil.parseDate("2024-01-23")).toString("yyyy-MM-dd HH:mm:ss"); newEndDate = DateUtil.endOfDay(DateUtil.parseDate("2024-01-23")).toString("yyyy-MM-dd HH:mm:ss");
defaultInterval = CalendarInterval.Minute;
} }
endDate = StrUtil.isBlank(endDate) ? newEndDate : endDate; endDate = StrUtil.isBlank(endDate) ? newEndDate : endDate;
......
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