Ver Fonte

feat:乐团档案--作业情况

Joburgess há 4 anos atrás
pai
commit
f580052feb

+ 21 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java

@@ -11,10 +11,13 @@ import com.ym.mec.biz.service.StudentCourseHomeworkService;
 import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.date.DateUtil;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
@@ -125,11 +128,28 @@ public class StudentCourseHomeworkController extends BaseController {
 
     @ApiOperation(value = "乐团作业情况")
     @GetMapping("/musicGroupHomeworkStat")
-    public HttpResponseResult musicGroupHomeworkStat(String musicGroupId, String startDay, String endDay) {
+    public HttpResponseResult musicGroupHomeworkStat(String musicGroupId, String year, Integer term) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
+
+        if(StringUtils.isEmpty(year)){
+            throw new BizException("请录入年份");
+        }
+        if(term == null){
+            throw new BizException("请录入学期");
+        }
+        String startDay = "";
+        String endDay = "";
+        if(term == 0){
+            startDay = year + "-03-01";
+            endDay = year + "-08-3";
+        }else {
+            startDay = year + "-09-01";
+            endDay = (Integer.valueOf(year) + 1) + "-02-01";
+        }
+
         return succeed(studentServeService.musicGroupHomeworkStat(musicGroupId, sysUser.getId(), startDay, endDay));
     }