ソースを参照

update 添加乐器开始时间,结束时间修正

周箭河 4 年 前
コミット
f9a1f16e42

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.service.StudentInstrumentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -79,6 +80,13 @@ public class StudentInstrumentController extends BaseController {
         if (studentInstrument.getStudentId() == null) {
             return failed("学生id不能为空");
         }
+        if(studentInstrument.getStartTime() != null){
+            studentInstrument.setStartTime(DateUtil.trunc(studentInstrument.getStartTime()));
+        }
+
+        if(studentInstrument.getEndTime() != null){
+            studentInstrument.setEndTime(DateUtil.getLastTimeWithDay(studentInstrument.getEndTime()));
+        }
         SysUser student = sysUserFeignService.queryUserById(studentInstrument.getStudentId());
         studentInstrument.setOrganId(student.getOrganId());
         return succeed(studentInstrumentService.addStudentInstrument(studentInstrument));