Commit 811b18e9 by baochunxin

#G:公众号选课后端接口上传

parent 8db017d6
......@@ -88,20 +88,20 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
# host: 43.143.63.140
# host: localhost
host: 43.143.63.140
# host: 47.105.176.202
# host: 127.0.0.1
# 端口,默认为6379
# port: 8134
port: 6379
# port: 16379
# port: 6379
port: 16379
# port: 9121
# 数据库索引
database: 11
# 密码
password:
# password: lbt18062367596
# password:
password: lbt18062367596
# 连接超时时间
timeout: 10s
lettuce:
......
package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
......@@ -15,6 +16,9 @@ public interface IStudentScoreService extends IService<SchoolStudentScore> {
*/
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
//根据学生ID查询成绩
List<SchoolStudentScoreVo> selectStudentScoreList(Long studentId);
/**
* 查询学生成绩详细信息
* @param id
......@@ -62,4 +66,9 @@ public interface IStudentScoreService extends IService<SchoolStudentScore> {
* @return
*/
int deleteStudentScore(Long[] ids);
/**
* 根据类型查询三类成绩
*/
List<SchoolStudentScoreVo> getStudentTypeViwe(CurriculaStudent curriculaStudent);
}
......@@ -30,12 +30,14 @@ public class SchoolStudentScoreVo extends OurBaseEntity {
/** 班级 */
@Excel(name = "班级")
private String className;
/**年级值*/
private Integer gradeValue;
/** 考试类型 */
@Excel(name = "考试类型",combo = {"一次","二次","三次","期末"},readConverterExp = "1=一次,2=二次,3=三次,4=期末")
private String examType;
/** 总成绩 */
private double totalScore;
/** 年级排名 */
/** 总成绩年级排名 */
private Integer ranking;
/** 班级排名 */
private Integer classRanking;
......
package yangtz.cs.liu.wechat.controller.courseSelection;
import com.ruoyi.common.core.domain.AjaxResult;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
/**
* 公众号,选课
*/
@RestController
@RequestMapping("/wx/course")
public class WxCouresSelection {
@Autowired
IStudentScoreService iStudentScoreService;
@Autowired
ICurriculaStudentService iCurriculaStudentService;
/**
* 学生成绩查询
*/
@GetMapping("/achievement/{studentId}")
private AjaxResult getStudentAchievements(@PathVariable("studentId") Long studentId){
List<SchoolStudentScoreVo> schoolStudentScoreVos = iStudentScoreService
.selectStudentScoreList(studentId);
return AjaxResult.success(schoolStudentScoreVos);
}
/**
* 据物理化类型查看
*/
@GetMapping("/studenttypeview")
private AjaxResult getStudentTypeview( CurriculaStudent curriculaStudent){
List<SchoolStudentScoreVo> studentTypeViwe = iStudentScoreService
.getStudentTypeViwe(curriculaStudent);
return AjaxResult.success(studentTypeViwe);
}
/**
* 保存选课信息
*/
@PostMapping("/savestudentcourse")
private AjaxResult saveStudentcourse(@RequestBody CurriculaStudent curriculaStudent){
//保存专业信息
try {
iCurriculaStudentService.save(curriculaStudent);
return AjaxResult.success("选课成功");
}catch (Exception e){
return AjaxResult.error("选课失败");
}
}
}
......@@ -59,8 +59,10 @@
LEFT JOIN school_student xs ON cj.student_id = xs.id
LEFT JOIN school_class bj ON cj.class_id = bj.id
WHERE
cj.curricula_id = #{curriculaId}
AND cj.del_flag = '0'
cj.del_flag = '0'
<if test="curriculaId != null and curriculaId != ''">and cj.curricula_id = #{curriculaId} </if>
<if test="gradeValue != null and gradeValue != ''">and bj.grade_value = #{gradeValue} </if>
<if test="studentId != null and studentId != ''">and cj.student_id = #{studentId} </if>
<if test="examType != null and examType != ''">and cj.exam_type = #{examType}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
<if test="classId != null">and cj.class_id = #{classId}</if>
......
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