Commit 5ae57e55 by zhaopanyu

Merge branch 'master' of 49.232.152.146:xhxy/smart_school

parents 252c0441 d011f37f
......@@ -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:
......
......@@ -20,6 +20,7 @@
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" icon="el-icon-download" size="mini" @click="upload.open = true">导入</el-button>
<el-button type="warning" icon="el-icon-upload2" size="mini" @click="exportRecord">导出</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
......@@ -493,6 +494,23 @@ export default {
})
},
//导出列表数据
exportRecord(){
let data = {
curriculaId:this.queryParams.curriculaId,
studentName:this.queryParams.studentName,
examType:this.queryParams.examType,
classId:this.queryParams.classId,
}
this.download(
"curricula/studentScore/export",
{
...data,
},
`学生成绩管理_${new Date().getTime()}.xlsx`
);
},
//下载模板
downloadTemplate() {
this.download(
......
......@@ -77,4 +77,13 @@ public class CurriCulaVariableController extends BaseController {
public AjaxResult selectClass(@RequestParam("grade") String grade){
return AjaxResult.success(curriculaVariableService.selectClass(grade));
}
/**
* 获取选课任务下拉框
* @return
*/
@GetMapping("/getGrade")
public AjaxResult getGrade(){
return AjaxResult.success(curriculaVariableService.getGrade());
}
}
\ No newline at end of file
......@@ -65,6 +65,17 @@ public class CurriculaStudentController extends BaseController {
}
/**
* 查看夏季二次分班列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listXjEc")
public TableDataInfo listXjEc(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListXjQm(curriculaStudentVo));
}
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
......@@ -83,22 +94,6 @@ public class CurriculaStudentController extends BaseController {
public void export(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo);
// list.forEach(curriculaStudentVo1 -> {
// if(null == curriculaStudentVo1.getSelectedMajor() || "".equals(curriculaStudentVo1.getSelectedMajor())){
//
// }else {
// String[] split = curriculaStudentVo1.getSelectedMajor().split(",");
// String selectedMajorName = "";
// for (int i=0;i<split.length;i++) {
// if (i == split.length - 1){
// selectedMajorName += sysDictDataService.selectDictLabel(split[i],"specialty") + ",";
// }else {
// selectedMajorName += sysDictDataService.selectDictLabel(split[i],"specialty");
// }
// }
// curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
// }
// });
for (CurriculaStudentVo studentVo : list) {
if (null != studentVo.getSelectedMajor()){
if (studentVo.getSelectedMajor().length() > 0){
......@@ -167,6 +162,24 @@ public class CurriculaStudentController extends BaseController {
}
/**
* 导出夏季二次分班情况列表
*/
@Log(title = "夏季选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportXjEc")
public void exportXjEc(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListXjQm(curriculaStudentVo);
List<CurriculaStudentXjVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentXjVo curriculaStudentXjVo = new CurriculaStudentXjVo();
BeanUtils.copyProperties(curriculaStudentVo1,curriculaStudentXjVo);
list.add(curriculaStudentXjVo);
});
ExcelUtil<CurriculaStudentXjVo> util = new ExcelUtil<CurriculaStudentXjVo>(CurriculaStudentXjVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 导出艺体选课情况列表
*/
@Log(title = "艺体选课情况", businessType = BusinessType.EXPORT)
......@@ -183,4 +196,43 @@ public class CurriculaStudentController extends BaseController {
ExcelUtil<CurriculaStudentYtVo> util = new ExcelUtil<CurriculaStudentYtVo>(CurriculaStudentYtVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 查看选课情况列表(班主任)
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listBzr")
public TableDataInfo listBzr(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListBzr(curriculaStudentVo));
}
/**
* 导出选课情况列表(班主任)
*/
@Log(title = "选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportBzr")
public void exportBzr(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentListBzr(curriculaStudentVo);
for (CurriculaStudentVo studentVo : list) {
if (null != studentVo.getSelectedMajor()){
if (studentVo.getSelectedMajor().length() > 0){
String[] split = studentVo.getSelectedMajor().split(",");
String selectedMajorName = "";
for (int i=0;i<split.length;i++) {
if (i == split.length - 1){
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]);
}else {
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i])+ ",";
}
}
studentVo.setSelectedMajorName(selectedMajorName);
}
}
}
ExcelUtil<CurriculaStudentVo> util = new ExcelUtil<CurriculaStudentVo>(CurriculaStudentVo.class);
util.exportExcel(response, list, "选课情况数据");
}
}
package yangtz.cs.liu.campus.controller.curricula;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.service.curricula.IDivisionClassesService;
import yangtz.cs.liu.campus.vo.curricula.SchoolDivisionClassesVo;
import java.util.List;
@RestController
@RequestMapping("/schoolDivision")
public class SchoolDivisionClassController extends BaseController {
@Autowired
private IDivisionClassesService divisionClassesService;
/**
* 首次分班规则
* @param list
* @return
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody List<SchoolDivisionClassesVo> list){
return toAjax(divisionClassesService.insertDivisionClasses(list));
}
/**
* 获取每种课程选择人数
* @param
* @return
*/
@GetMapping("/getNumber")
public AjaxResult getNumber(@RequestParam("curriculaId") Long curriculaId){
return AjaxResult.success(divisionClassesService.getNumber(curriculaId));
}
/**
* 二次分班规则
* @param list
* @return
*/
@PostMapping("/addEc")
public AjaxResult addEc(@RequestBody List<SchoolDivisionClassesVo> list){
return toAjax(divisionClassesService.insertDivisionClassesEc(list));
}
}
package yangtz.cs.liu.campus.controller.curricula;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentYtVo;
import yangtz.cs.liu.campus.vo.curricula.StudentScoreVo;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -36,6 +43,24 @@ public class StudentScoreController extends BaseController {
}
/**
* 导出成绩管理列表
*/
@Log(title = "成绩管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void exportYt(HttpServletResponse response, SchoolStudentScoreVo schoolStudentScoreVo)
{
List<SchoolStudentScoreVo> schoolStudentScoreVoList = studentScoreService.selectStudentScoreList(schoolStudentScoreVo);
List<StudentScoreVo> list = new ArrayList<>();
schoolStudentScoreVoList.forEach(schoolStudentScoreVo1 -> {
StudentScoreVo studentScoreVo = new StudentScoreVo();
BeanUtils.copyProperties(schoolStudentScoreVo1,studentScoreVo);
list.add(studentScoreVo);
});
ExcelUtil<StudentScoreVo> util = new ExcelUtil<StudentScoreVo>(StudentScoreVo.class);
util.exportExcel(response, list, "成绩管理数据");
}
/**
* 下载模板
*
* @return
......
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 {
/** 所选科目 */
private String selectedSubject;
/** 是否删除 */
private String delFalg;
private String delFlag;
}
package yangtz.cs.liu.campus.domain.curricula;
import com.core.domain.OurBaseEntity;
import lombok.Data;
@Data
public class SchoolDivisionClasses extends OurBaseEntity {
/** 选课id */
private Long curriculaId;
/** 课程 */
private String course;
/** 分班班级名称 */
private String divisionClassesName;
/** 分班规则(1平行分班,2分层分班) */
private String divisionClassesRule;
/** 分班次数(1首次分班,2二次分班) */
private String divisionClassesFrequency;
}
package yangtz.cs.liu.campus.domain.curricula;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@Data
public class SchoolDivisionStudent {
/** 主键id */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 分班班级主键id */
private Long divisionClassesId;
/** 学生主键id */
private Long studentId;
/** 删除状态 */
private String delFlag;
}
......@@ -241,15 +241,17 @@ public class SchoolClassEducational extends BaseEntity
{
return teacherWord;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
@Override
public String getDelFlag() {
return delFlag;
}
@Override
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public void setGradeId(Long gradeId)
{
this.gradeId = gradeId;
......
......@@ -25,6 +25,13 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/**
* 查看选课情况列表(班主任)
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListBzr(CurriculaStudentVo curriculaStudentVo);
/**
* 查看春季选课情况列表
* @param curriculaStudentVo
* @return
......@@ -39,6 +46,13 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季二次分班情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListXjEc(CurriculaStudentVo curriculaStudentVo);
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
......
......@@ -29,4 +29,10 @@ public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable>
* @return
*/
List<Map<String,String>> selectClass(@Param("grade") String grade);
/**
* 获取选课任务下拉框
* @return
*/
List<Map<String, String>> getGrade();
}
package yangtz.cs.liu.campus.mapper.curricula;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.SchoolDivisionClasses;
import java.util.List;
import java.util.Map;
public interface DivisionClassesMapper extends BaseMapper<SchoolDivisionClasses> {
/**
* 获取选择某种课程的总人数
* @param curriculaId
* @return
*/
List<Map<String, String>> getNumber(@Param("curriculaId") Long curriculaId);
}
package yangtz.cs.liu.campus.mapper.curricula;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.curricula.SchoolDivisionStudent;
public interface DivisionStudentMapper extends BaseMapper<SchoolDivisionStudent> {
}
......@@ -36,4 +36,18 @@ public interface ICurriculaStudentService extends IService<CurriculaStudent> {
*/
List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListXjQm(CurriculaStudentVo curriculaStudentVo);
/**
* 查看选课情况列表(班主任)
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListBzr(CurriculaStudentVo curriculaStudentVo);
}
package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo;
......@@ -49,4 +48,10 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> {
* @return
*/
int updateCurriculaVariable(CurriculaVariable curriculaVariable);
/**
* 获取选课任务下拉框
* @return
*/
List<Map<String,String>> getGrade();
}
package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.curricula.SchoolDivisionClasses;
import yangtz.cs.liu.campus.vo.curricula.SchoolDivisionClassesVo;
import java.util.List;
import java.util.Map;
public interface IDivisionClassesService extends IService<SchoolDivisionClasses> {
/**
* 首次分班规则
* @param list
* @return
*/
int insertDivisionClasses(List<SchoolDivisionClassesVo> list);
/**
* 获取每种课程选择人数
* @return
*/
List<Map<String,String>> getNumber(Long curriculaId);
/**
* 二次分班规则
* @param list
* @return
*/
int insertDivisionClassesEc(List<SchoolDivisionClassesVo> list);
}
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);
}
......@@ -43,7 +43,7 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap
}
/**
* 查看夏季选课情况列表
* 查看夏季选课情况列表(一次、二次、三次)
* @param curriculaStudentVo
* @return
*/
......@@ -54,7 +54,7 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap
//查询学生成绩
LambdaQueryWrapper<SchoolStudentScore> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudentScore::getStudentId,curriculaStudentVo1.getStudentId())
.like(SchoolStudentScore::getExamType,"1,2,3")
.in(SchoolStudentScore::getExamType,1,2,3)
.orderByDesc(SchoolStudentScore::getExamType).last("LIMIT 1");
SchoolStudentScore schoolStudentScore = studentScoreMapper.selectOne(wrapper);
if (StringUtils.isNotNull(schoolStudentScore)){
......@@ -173,4 +173,134 @@ public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMap
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentMapper.selectCurriculaStudentListYt(curriculaStudentVo);
return curriculaStudentVoList;
}
/**
* 查看夏季选课情况(期末)
* @param curriculaStudentVo
* @return
*/
@Override
public List<CurriculaStudentVo> selectCurriculaStudentListXjQm(CurriculaStudentVo curriculaStudentVo) {
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentMapper.selectCurriculaStudentListXjEc(curriculaStudentVo);
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
//查询学生成绩
LambdaQueryWrapper<SchoolStudentScore> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudentScore::getStudentId,curriculaStudentVo1.getStudentId())
.eq(SchoolStudentScore::getExamType,"4");
SchoolStudentScore schoolStudentScore = studentScoreMapper.selectOne(wrapper);
if (StringUtils.isNotNull(schoolStudentScore)){
//物理+政治+化学
if (curriculaStudentVo1.getSelectedCourse().equals("1")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+生物
if (curriculaStudentVo1.getSelectedCourse().equals("2")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("3")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("4")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+化学
if (curriculaStudentVo1.getSelectedCourse().equals("5")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+生物
if (curriculaStudentVo1.getSelectedCourse().equals("6")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+地理+化学
if (curriculaStudentVo1.getSelectedCourse().equals("7")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getGeography() + schoolStudentScore.getChemistry();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+地理+生物
if (curriculaStudentVo1.getSelectedCourse().equals("8")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getGeography() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+化学+生物
if (curriculaStudentVo1.getSelectedCourse().equals("9")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getChemistry() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//物理+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("10")){
double courseScore = schoolStudentScore.getPhysics() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("11")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("12")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+政治+生物
if (curriculaStudentVo1.getSelectedCourse().equals("13")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getPolitics() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("14")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+历史+生物
if (curriculaStudentVo1.getSelectedCourse().equals("15")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getHistory() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//化学+地理+生物
if (curriculaStudentVo1.getSelectedCourse().equals("16")){
double courseScore = schoolStudentScore.getChemistry() + schoolStudentScore.getGeography() + schoolStudentScore.getBiology();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+政治+地理
if (curriculaStudentVo1.getSelectedCourse().equals("17")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getPolitics() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("18")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
//生物+政治+历史
if (curriculaStudentVo1.getSelectedCourse().equals("19")){
double courseScore = schoolStudentScore.getBiology() + schoolStudentScore.getPolitics() + schoolStudentScore.getHistory();
curriculaStudentVo1.setCourseScore(courseScore);
}
//政治+历史+地理
if (curriculaStudentVo1.getSelectedCourse().equals("20")){
double courseScore = schoolStudentScore.getPolitics() + schoolStudentScore.getHistory() + schoolStudentScore.getGeography();
curriculaStudentVo1.setCourseScore(courseScore);
}
}
});
return curriculaStudentVoList;
}
/**
* 查看选课情况列表(班主任)
* @param curriculaStudentVo
* @return
*/
@Override
public List<CurriculaStudentVo> selectCurriculaStudentListBzr(CurriculaStudentVo curriculaStudentVo) {
return curriculaStudentMapper.selectCurriculaStudentListBzr(curriculaStudentVo);
}
}
......@@ -16,7 +16,6 @@ import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper;
import yangtz.cs.liu.campus.mapper.curricula.CurriculaVariableMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.service.curricula.ICurriculaVariableService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo;
import static com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank;
......@@ -161,4 +160,13 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
}
return curriculaVariableMapper.updateById(curriculaVariable);
}
/**
* 获取选课任务下拉框
* @return
*/
@Override
public List<Map<String, String>> getGrade() {
return curriculaVariableMapper.getGrade();
}
}
package yangtz.cs.liu.campus.vo.curricula;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
......@@ -16,6 +14,8 @@ public class CurriculaStudentVo {
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班主任id */
private Long bzrId;
/** 班级主键id */
private Long classId;
/** 班级 */
......
package yangtz.cs.liu.campus.vo.curricula;
import com.core.domain.OurBaseEntity;
import lombok.Data;
@Data
public class SchoolDivisionClassesVo extends OurBaseEntity {
/** 选课id */
private Long curriculaId;
/** 课程 */
private String course;
/** 课程名称 */
private String courseName;
/** 每种课程总人数 */
private Integer coursePeopleNumber;
/** 班级数量 */
private Integer classesNumber;
/** 每班人数 */
private Integer peopleNumber;
/** 分班班级名称 */
private String divisionClassesName;
/** 分班规则(1平行分班,2分层分班) */
private String divisionClassesRule;
/** 分班次数(1首次分班,2二次分班) */
private String divisionClassesFrequency;
}
package yangtz.cs.liu.campus.vo.curricula;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
@Data
public class StudentScoreVo {
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 考试类型 */
@Excel(name = "考试类型",combo = {"一次","二次","三次","期末"},readConverterExp = "1=一次,2=二次,3=三次,4=期末")
private String examType;
/** 总成绩 */
@Excel(name = "总成绩")
private double totalScore;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer ranking;
/** 班级排名 */
private Integer classRanking;
/** 语文 */
@Excel(name = "语文")
private double language;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer ywRanking;
/** 班级排名 */
private Integer ywClassRanking;
/** 数学 */
@Excel(name = "数学")
private double math;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer sxRanking;
/** 班级排名 */
private Integer sxClassRanking;
/** 英语 */
@Excel(name = "英语")
private double english;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer yyRanking;
/** 班级排名 */
private Integer yyClassRanking;
/** 政治 */
@Excel(name = "政治")
private double politics;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer zzRanking;
/** 班级排名 */
private Integer zzClassRanking;
/** 地理 */
@Excel(name = "地理")
private double geography;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer dlRanking;
/** 班级排名 */
private Integer dlClassRanking;
/** 历史 */
@Excel(name = "历史")
private double history;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer lsRanking;
/** 班级排名 */
private Integer lsClassRanking;
/** 物理 */
@Excel(name = "物理")
private double physics;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer wlRanking;
/** 班级排名 */
private Integer wlClassRanking;
/** 化学 */
@Excel(name = "化学")
private double chemistry;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer hxRanking;
/** 班级排名 */
private Integer hxClassRanking;
/** 生物 */
@Excel(name = "生物")
private double biology;
/** 年级排名 */
@Excel(name = "年级排名")
private Integer swRanking;
/** 班级排名 */
private Integer swClassRanking;
}
......@@ -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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils;
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.CurriclaStudentVo;
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.ICurriculaVariableService;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
/**
* 公众号,选课
*/
@RestController
@RequestMapping("/wx/course")
public class WxCouresSelection {
@Autowired
IStudentScoreService iStudentScoreService;
@Autowired
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);
}
/**
* 学生成绩查询
*/
@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.updateById(curriculaStudent);
return AjaxResult.success("选课成功");
}catch (Exception e){
return AjaxResult.error("选课失败");
}
}
}
......@@ -7,6 +7,7 @@
<result property="id" column="id" />
<result property="studentId" column="student_id" />
<result property="curriculaId" column="curricula_id" />
<result property="classId" column="class_id" />
<result property="className" column="class_name" />
<result property="studentName" column="student_name" />
<result property="idCard" column="id_card" />
......@@ -18,11 +19,11 @@
<result property="selectedMajor" column="selected_major" />
<result property="selectedSubject" column="selected_subject" />
<result property="divisionClassesName" column="division_classes_name" />
<result property="delFlag" column="del_flag" />
<result property="delFalg" column="del_flag" />
</resultMap>
<select id="countNum" parameterType="Long" resultType="Map">
SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE curricula_id = #{curriculaId} and curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0'
SELECT COUNT(id) as zrs, (SELECT COUNT(id) FROM curricula_student WHERE curricula_id = #{curriculaId} and curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0'
</select>
<!--选课情况列表-->
......@@ -53,6 +54,7 @@
<if test="courseType != null and courseType != ''">and xk.course_type = #{courseType}</if>
<if test="curriculaState != null and curriculaState != ''">and xk.curricula_state = #{curriculaState}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
group by xk.id,xk.student_id,xk.curricula_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject,dc.division_classes_name
</select>
<!--春季选课情况列表-->
......@@ -83,9 +85,9 @@
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedMajor != null and selectedMajor != ''">and xk.selected_major like concat('%', #{selectedMajor}, '%')</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
group by xk.id,xk.student_id,xk.curricula_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject,dc.division_classes_name
</select>
<!--夏季选课情况列表-->
<select id="selectCurriculaStudentListXj" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
......@@ -108,12 +110,45 @@
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id and dc.division_classes_frequency = '1'
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '2' and xk.del_flag = '0'
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedCourse != null and selectedCourse != ''">and xk.selected_course = #{selectedCourse}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
group by xk.id,xk.student_id,xk.curricula_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject
ORDER BY xk.selected_course ASC
</select>
<!--夏季二次分班情况列表-->
<select id="selectCurriculaStudentListXjEc" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id and dc.division_classes_frequency = '2'
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '2' and xk.del_flag = '0'
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedCourse != null and selectedCourse != ''">and xk.selected_course = #{selectedCourse}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
GROUP BY xk.id,xk.student_id,xk.curricula_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject
ORDER BY xk.selected_course ASC
</select>
......@@ -145,7 +180,41 @@
<if test="classId != null">and xs.class_id = #{classId}</if>
<if test="selectedSubject != null and selectedSubject != ''">and xk.selected_subject = #{selectedSubject}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
GROUP BY xk.id,xk.student_id,xk.curricula_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject,dc.division_classes_name
ORDER BY xk.selected_subject ASC
</select>
<!--查看选课情况列表(班主任)-->
<select id="selectCurriculaStudentListBzr" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
xs.class_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
WHERE
xk.curricula_id = #{curriculaId} AND xk.del_flag = '0' AND xs.class_id IN (SELECT class_id FROM school_class_headmaster WHERE teacher_id = #{teacherId})
<if test="courseType != null and courseType != ''">and xk.course_type = #{courseType}</if>
<if test="classId != null and classId != ''">and xs.class_id = #{classId}</if>
<if test="curriculaState != null and curriculaState != ''">and xk.curricula_state = #{curriculaState}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
GROUP BY xk.id,xk.student_id,xk.curricula_id,xs.class_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject
</select>
</mapper>
\ No newline at end of file
......@@ -63,4 +63,15 @@
<select id="selectClass" parameterType="String" resultType="Map">
SELECT id as classId,class_name as className FROM school_class WHERE grade_id = (SELECT id FROM school_grade where grade_year = #{grade} AND del_flag = '0')
</select>
<select id="getGrade" resultType="Map">
select
cv.id as curriculaId,
cv.task_name as curriculaName,
cv.grade as grade,
(SELECT COUNT(id) as yxrs FROM curricula_student WHERE curricula_id = cv.id and curricula_state = '2' AND del_flag = '0') as yxrs,
(SELECT COUNT(id) as zrs FROM curricula_student WHERE curricula_id = cv.id AND del_flag = '0') as zrs
from curricula_variable cv
where cv.del_flag = '0'
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.curricula.DivisionClassesMapper">
<select id="getNumber" parameterType="Long" resultType="Map">
SELECT cs.selected_course as selectedCourse, zd.dict_label as selectedCourseName, COUNT(cs.selected_course) as peopleNumber
FROM curricula_student cs
LEFT JOIN sys_dict_data zd ON cs.selected_course = zd.dict_value AND zd.dict_type = "section_type"
WHERE zd.dict_label IS NOT NULL AND cs.course_type = '2' AND cs.del_flag = '0' AND cs.curricula_id = #{curriculaId}
GROUP BY cs.selected_course
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.curricula.DivisionStudentMapper">
</mapper>
\ No newline at end of file
......@@ -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