Commit 7d635364 by baochunxin

#G:新增app 选课课程查看接口

parent 73c89d06
...@@ -3,15 +3,12 @@ package yangtz.cs.liu.wechat.controller.courseSelection; ...@@ -3,15 +3,12 @@ package yangtz.cs.liu.wechat.controller.courseSelection;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import java.util.Calendar; import java.util.Calendar;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,11 +16,9 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,11 +16,9 @@ import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.domain.curricula.CurriclaStudentVo; import yangtz.cs.liu.campus.domain.curricula.CurriclaStudentVo;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable; import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService; import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.service.curricula.ICurriculaVariableService; import yangtz.cs.liu.campus.service.curricula.ICurriculaVariableService;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService; import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo; import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
/** /**
...@@ -45,12 +40,13 @@ public class WxCouresSelection { ...@@ -45,12 +40,13 @@ public class WxCouresSelection {
/** /**
* 学生选号信息查询 * 学生选号信息查询
*/ */
@GetMapping("/getCourseInfo/{studentId}") @GetMapping("/getCourseInfo/{studentId}/{id}")
private AjaxResult getCourseInfo(@PathVariable("studentId") Long studentId) { private AjaxResult getCourseInfo(@PathVariable("studentId") Long studentId,@PathVariable("id") Long id) {
//查询学生个人选课信息 //查询学生个人选课信息
LambdaQueryWrapper<CurriculaStudent> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CurriculaStudent> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CurriculaStudent::getStudentId, studentId); wrapper.eq(CurriculaStudent::getStudentId, studentId);
wrapper.eq(CurriculaStudent::getDelFlag, "0"); wrapper.eq(CurriculaStudent::getDelFlag, "0");
wrapper.eq(CurriculaStudent::getCurriculaId, id);
//查询出学生任务信息 //查询出学生任务信息
CurriculaStudent one = iCurriculaStudentService.getOne(wrapper); CurriculaStudent one = iCurriculaStudentService.getOne(wrapper);
//判断当前学生是否可以选课 //判断当前学生是否可以选课
...@@ -104,6 +100,13 @@ public class WxCouresSelection { ...@@ -104,6 +100,13 @@ public class WxCouresSelection {
} }
/**
* 学生选课课程展示
*/
@GetMapping("/getCurriculaSub/{id}")
public AjaxResult getCurriculaSub(@PathVariable("id") Long id){
return AjaxResult.success(iCurriculaVariableService.selectCurriculaVariableById(id));
}
/** /**
* 学生成绩查询 * 学生成绩查询
...@@ -133,12 +136,11 @@ public class WxCouresSelection { ...@@ -133,12 +136,11 @@ public class WxCouresSelection {
private AjaxResult saveStudentcourse(@RequestBody CurriculaStudent curriculaStudent){ private AjaxResult saveStudentcourse(@RequestBody CurriculaStudent curriculaStudent){
//保存专业信息 //保存专业信息
try { try {
boolean b = iCurriculaStudentService.updateById(curriculaStudent); boolean b = iCurriculaStudentService.saveOrUpdate(curriculaStudent);
return AjaxResult.success("选课成功"); return AjaxResult.success("选课成功");
}catch (Exception e){ }catch (Exception e){
return AjaxResult.error("选课失败"); return AjaxResult.error("选课失败");
} }
} }
} }
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