|
@@ -3,9 +3,14 @@ package com.yonge.cooleshow.student.controller;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.LocalTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -67,6 +72,14 @@ public class SysMusicCompareRecordController extends BaseController {
|
|
|
return failed("获取用户信息失败");
|
|
|
}
|
|
|
queryInfo.setUserId(sysUser.getId());
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getStartTime())) {
|
|
|
+ return failed("时间不能为空");
|
|
|
+ }
|
|
|
+ LocalDate localDate = LocalDate.parse(queryInfo.getStartTime() + "-01",
|
|
|
+ DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+ queryInfo.setStartTime(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
+ LocalDate endDate = localDate.plusDays(localDate.getMonth().length(localDate.isLeapYear()) -1);
|
|
|
+ queryInfo.setEndTime(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
return succeed(sysMusicCompareRecordService.studentTrainData(queryInfo));
|
|
|
}
|
|
|
|