Commit c7994ca1 by baochunxin

#G:公众号选课学生选课信息上传

parent f93abba3
package yangtz.cs.liu.campus.domain.curricula;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import lombok.Data;
/**
* 公众号选课返回信息
*/
@Data
public class CurriclaStudentVo {
/** 主键id */
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课任务主键id */
private Long curriculaId;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
private String curriculaState;
/** 已选课程 */
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 所选科目 */
private String selectedSubject;
/** 任务名称 */
private String taskName;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
}
...@@ -31,5 +31,5 @@ public class CurriculaStudent { ...@@ -31,5 +31,5 @@ public class CurriculaStudent {
/** 所选科目 */ /** 所选科目 */
private String selectedSubject; private String selectedSubject;
/** 是否删除 */ /** 是否删除 */
private String delFalg; private String delFlag;
} }
...@@ -241,15 +241,17 @@ public class SchoolClassEducational extends BaseEntity ...@@ -241,15 +241,17 @@ public class SchoolClassEducational extends BaseEntity
{ {
return teacherWord; return teacherWord;
} }
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag() @Override
{ public String getDelFlag() {
return delFlag; return delFlag;
} }
@Override
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public void setGradeId(Long gradeId) public void setGradeId(Long gradeId)
{ {
this.gradeId = gradeId; this.gradeId = gradeId;
......
package yangtz.cs.liu.wechat.controller.courseSelection; package yangtz.cs.liu.wechat.controller.courseSelection;
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.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
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;
...@@ -9,9 +13,14 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -9,9 +13,14 @@ import org.springframework.web.bind.annotation.PostMapping;
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;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
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.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.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;
/** /**
...@@ -27,6 +36,30 @@ public class WxCouresSelection { ...@@ -27,6 +36,30 @@ public class WxCouresSelection {
@Autowired @Autowired
ICurriculaStudentService iCurriculaStudentService; ICurriculaStudentService iCurriculaStudentService;
@Autowired
ICurriculaVariableService iCurriculaVariableService;
/**
* 学生选号信息查询
*/
@GetMapping("/getCourseInfo/{studentId}")
private AjaxResult getCourseInfo(@PathVariable("studentId") Long studentId){
//查询学生个人选课信息
LambdaQueryWrapper<CurriculaStudent> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CurriculaStudent::getStudentId,studentId);
wrapper.eq(CurriculaStudent::getDelFlag,"0");
//查询出学生任务信息
CurriculaStudent one = iCurriculaStudentService.getOne(wrapper);
//查询选课信息
CurriculaVariable byId = iCurriculaVariableService.getById(one.getCurriculaId());
CurriclaStudentVo data = new CurriclaStudentVo();
//拼接返回对象
BeanUtils.copyProperties(one,data);
BeanUtils.copyProperties(byId,data);
return AjaxResult.success(data);
}
/** /**
* 学生成绩查询 * 学生成绩查询
*/ */
...@@ -55,7 +88,7 @@ public class WxCouresSelection { ...@@ -55,7 +88,7 @@ public class WxCouresSelection {
private AjaxResult saveStudentcourse(@RequestBody CurriculaStudent curriculaStudent){ private AjaxResult saveStudentcourse(@RequestBody CurriculaStudent curriculaStudent){
//保存专业信息 //保存专业信息
try { try {
iCurriculaStudentService.save(curriculaStudent); iCurriculaStudentService.updateById(curriculaStudent);
return AjaxResult.success("选课成功"); return AjaxResult.success("选课成功");
}catch (Exception e){ }catch (Exception e){
return AjaxResult.error("选课失败"); return AjaxResult.error("选课失败");
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<result property="selectedMajor" column="selected_major" /> <result property="selectedMajor" column="selected_major" />
<result property="selectedSubject" column="selected_subject" /> <result property="selectedSubject" column="selected_subject" />
<result property="divisionClassesName" column="division_classes_name" /> <result property="divisionClassesName" column="division_classes_name" />
<result property="delFlag" column="del_flag" /> <result property="delFalg" column="del_flag" />
</resultMap> </resultMap>
<select id="countNum" parameterType="Long" resultType="Map"> <select id="countNum" parameterType="Long" resultType="Map">
......
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