Commit 81bbd8f7 by xuwenhao

8.7修改学生选课

parent 36f607ea
......@@ -10,9 +10,13 @@ spring:
# username: root
# password: password
master:
url: jdbc:mysql://43.143.63.140:3306/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
url: jdbc:mysql://1.116.38.25:3986/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root
password: lbt@@18062367596
password: qianhe2022
# master:
# url: jdbc:mysql://43.143.63.140:3306/school_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
# username: root
# password: lbt@@18062367596
# master:
# url: jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
# username: root
......
......@@ -12,7 +12,7 @@ ruoyi:
profile: D:/ruoyi/uploadPath
# profile: /home/ruoyi/uploadPath
#指定上传文件到哪个服务器,读取文件(本地选localhost,测试选47.105.176.202,试运行选10.20.100.201)
serverAddress: localhost:8848
serverAddress: http://192.168.1.109:8848
# serverAddress: http://47.105.176.202:8137
# serverAddress: http://10.20.100.201:57321
# 获取ip地址开关
......@@ -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:
......
......@@ -56,7 +56,7 @@ public class CurriCulaVariableController extends BaseController {
*/
@PostMapping("/edit")
public AjaxResult edit(@RequestBody CurriculaVariable curriculaVariable){
return toAjax(curriculaVariableService.updateById(curriculaVariable));
return toAjax(curriculaVariableService.updateCurriculaVariable(curriculaVariable));
}
/**
......@@ -67,4 +67,14 @@ public class CurriCulaVariableController extends BaseController {
public AjaxResult getNewGrade(){
return AjaxResult.success(curriculaVariableService.getNewGrade());
}
/**
* 获取班级下拉框
* @param grade
* @return
*/
@GetMapping("/selectClass")
public AjaxResult selectClass(@RequestParam("grade") String grade){
return AjaxResult.success(curriculaVariableService.selectClass(grade));
}
}
\ No newline at end of file
......@@ -5,15 +5,18 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentCjVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentXjVo;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentYtVo;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -25,6 +28,8 @@ public class CurriculaStudentController extends BaseController {
@Autowired
private ICurriculaStudentService curriculaStudentService;
@Autowired
private ISysDictDataService sysDictDataService;
/**
* 查看选课情况列表
......@@ -38,28 +43,144 @@ public class CurriculaStudentController extends BaseController {
}
/**
* 查看春季选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listCj")
public TableDataInfo listCj(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListCj(curriculaStudentVo));
}
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listXj")
public TableDataInfo listXj(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListXj(curriculaStudentVo));
}
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/listYt")
public TableDataInfo listYt(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentListYt(curriculaStudentVo));
}
/**
* 导出选课情况列表
*/
@Log(title = "选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurriculaStudentVo curriculaStudentVo)
public void export(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo);
list.forEach(curriculaStudentVo1 -> {
if (null != curriculaStudentVo1.getSelectedMajor() && "".equals(curriculaStudentVo1.getSelectedMajor())){
// 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){
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, "选课情况数据");
}
/**
* 导出春季选课情况列表
*/
@Log(title = "春季选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportCj")
public void exportCj(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListCj(curriculaStudentVo);
List<CurriculaStudentCjVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentCjVo studentCjVo = new CurriculaStudentCjVo();
//已选专业
String[] split = curriculaStudentVo1.getSelectedMajor().split(",");
String selectedMajorName = "";
for (int i=0;i<split.length;i++) {
if (i == split.length - 1){
selectedMajorName += curriculaStudentService.selectZyZd(split[i]) + ",";
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]);
}else {
selectedMajorName += curriculaStudentService.selectZyZd(split[i]);
selectedMajorName += sysDictDataService.selectDictLabel("specialty",split[i]) + ",";
}
}
curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
BeanUtils.copyProperties(curriculaStudentVo1,studentCjVo);
list.add(studentCjVo);
});
ExcelUtil<CurriculaStudentCjVo> util = new ExcelUtil<CurriculaStudentCjVo>(CurriculaStudentCjVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 导出夏季选课情况列表
*/
@Log(title = "夏季选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportXj")
public void exportXj(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListXj(curriculaStudentVo);
List<CurriculaStudentXjVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentXjVo curriculaStudentXjVo = new CurriculaStudentXjVo();
BeanUtils.copyProperties(curriculaStudentVo1,curriculaStudentXjVo);
list.add(curriculaStudentXjVo);
});
ExcelUtil<CurriculaStudentVo> util = new ExcelUtil<CurriculaStudentVo>(CurriculaStudentVo.class);
ExcelUtil<CurriculaStudentXjVo> util = new ExcelUtil<CurriculaStudentXjVo>(CurriculaStudentXjVo.class);
util.exportExcel(response, list, "选课情况数据");
}
/**
* 导出艺体选课情况列表
*/
@Log(title = "艺体选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/exportYt")
public void exportYt(HttpServletResponse response,CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> curriculaStudentVoList = curriculaStudentService.selectCurriculaStudentListYt(curriculaStudentVo);
List<CurriculaStudentYtVo> list = new ArrayList<>();
curriculaStudentVoList.forEach(curriculaStudentVo1 -> {
CurriculaStudentYtVo curriculaStudentYtVo = new CurriculaStudentYtVo();
BeanUtils.copyProperties(curriculaStudentVo1,curriculaStudentYtVo);
list.add(curriculaStudentYtVo);
});
ExcelUtil<CurriculaStudentYtVo> util = new ExcelUtil<CurriculaStudentYtVo>(CurriculaStudentYtVo.class);
util.exportExcel(response, list, "选课情况数据");
}
}
......@@ -5,12 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
......@@ -28,6 +24,11 @@ public class StudentScoreController extends BaseController {
@Autowired
private IStudentScoreService studentScoreService;
/**
* 查看成绩管理列表
* @param schoolStudentScoreVo
* @return
*/
@GetMapping("/list")
public TableDataInfo list(SchoolStudentScoreVo schoolStudentScoreVo){
startPage();
......@@ -52,13 +53,64 @@ public class StudentScoreController extends BaseController {
* @throws Exception
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
public AjaxResult importData(MultipartFile file,Long curriculaId) throws Exception {
ExcelUtil<SchoolStudentScoreVo> util = new ExcelUtil<SchoolStudentScoreVo>(SchoolStudentScoreVo.class);
List<SchoolStudentScoreVo> list = util.importExcel(file.getInputStream());
//校验
studentScoreService.checkImport(list);
//导入
String message = studentScoreService.importExamDetail(list);
String message = studentScoreService.importExamDetail(list,curriculaId);
return AjaxResult.success(message);
}
/**
* 根据身份证号查询学生信息
* @param idCard
* @return
*/
@GetMapping("/selectStudent")
public AjaxResult selectStudent(@RequestParam("idCard") String idCard){
return AjaxResult.success(studentScoreService.selectStudent(idCard));
}
/**
* 查询学生成绩详细信息
* @param id
* @return
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(studentScoreService.selectStudentScoreById(id));
}
/**
* 新增学生成绩信息
* @param schoolStudentScore
* @return
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolStudentScore schoolStudentScore){
return toAjax(studentScoreService.insertStudentScore(schoolStudentScore));
}
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolStudentScore schoolStudentScore){
return toAjax(studentScoreService.updateStudentScore(schoolStudentScore));
}
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
@DeleteMapping("/delete/{ids}")
public AjaxResult delete(@PathVariable Long[] ids){
return toAjax(studentScoreService.deleteStudentScore(ids));
}
}
......@@ -25,11 +25,11 @@ public class CurriculaStudent {
/** 选课状态(1-未选课,2-已选课) */
private String curriculaState;
/** 已选课程 */
private Integer selectedCourse;
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 所选科目 */
private Integer selectedSubject;
private String selectedSubject;
/** 是否删除 */
private String delFalg;
}
......@@ -18,22 +18,22 @@ public class SchoolStudentScore extends OurBaseEntity {
/** 考试类型 */
private String examType;
/** 语文 */
private Integer language;
private double language;
/** 数学 */
private Integer math;
private double math;
/** 英语 */
private Integer english;
private double english;
/** 政治 */
private Integer politics;
private double politics;
/** 地理 */
private Integer geography;
private double geography;
/** 历史 */
private Integer history;
private double history;
/** 物理 */
private Integer physics;
private double physics;
/** 化学 */
private Integer chemistry;
private double chemistry;
/** 生物 */
private Integer biology;
private double biology;
}
......@@ -25,9 +25,23 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/**
* 查询专业字典
* @param dictValue
* 查看春季选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListCj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
*/
String selectZyZd(@Param("dictValue") String dictValue);
List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo);
}
......@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import java.util.List;
import java.util.Map;
public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable>
{
......@@ -21,4 +22,11 @@ public interface CurriculaVariableMapper extends BaseMapper<CurriculaVariable>
* @return
*/
List<Long> selectByGrade(@Param("grade") String grade);
/**
* 获取班级下拉框
* @param grade
* @return
*/
List<Map<String,String>> selectClass(@Param("grade") String grade);
}
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.student.SchoolStudentScore;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
......@@ -14,4 +15,25 @@ public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> {
* @return
*/
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
SchoolStudentScoreVo selectStudent(@Param("idCard") String idCard);
/**
* 查询学生成绩详细信息
* @param id
* @return
*/
SchoolStudentScoreVo selectStudentScoreById(Long id);
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
int deleteStudentScore(Long[] ids);
}
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.CurriculaStudent;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
......@@ -17,9 +16,24 @@ public interface ICurriculaStudentService extends IService<CurriculaStudent> {
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/**
* 查询专业字典
* @param dictValue
* 查看春季选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListCj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看夏季选课情况列表
* @param curriculaStudentVo
* @return
*/
String selectZyZd(String dictValue);
List<CurriculaStudentVo> selectCurriculaStudentListXj(CurriculaStudentVo curriculaStudentVo);
/**
* 查看艺体选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentListYt(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;
......@@ -35,4 +36,17 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> {
*/
Map<String,String> getNewGrade();
/**
* 获取班级下拉框
* @param grade
* @return
*/
List<Map<String,String>> selectClass(String grade);
/**
* 修改选课任务
* @param curriculaVariable
* @return
*/
int updateCurriculaVariable(CurriculaVariable curriculaVariable);
}
......@@ -16,15 +16,50 @@ public interface IStudentScoreService extends IService<SchoolStudentScore> {
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
/**
* 查询学生成绩详细信息
* @param id
* @return
*/
SchoolStudentScoreVo selectStudentScoreById(Long id);
/**
* 导入
* @param list
* @return
*/
String importExamDetail(List<SchoolStudentScoreVo> list);
String importExamDetail(List<SchoolStudentScoreVo> list,Long curriculaId);
/**
* 校验
* @param list
*/
void checkImport(List<SchoolStudentScoreVo> list);
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
SchoolStudentScoreVo selectStudent(String idCard);
/**
* 新增学生成绩
* @param schoolStudentScore
* @return
*/
int insertStudentScore(SchoolStudentScore schoolStudentScore);
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
int updateStudentScore(SchoolStudentScore schoolStudentScore);
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
int deleteStudentScore(Long[] ids);
}
......@@ -133,4 +133,32 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
map.put("grade",schoolGrade.getGradeYear());
return map;
}
/**
* 获取班级下拉框
* @param grade
* @return
*/
@Override
public List<Map<String, String>> selectClass(String grade) {
return curriculaVariableMapper.selectClass(grade);
}
/**
* 修改选课任务
* @param curriculaVariable
* @return
*/
@Override
public int updateCurriculaVariable(CurriculaVariable curriculaVariable) {
LambdaQueryWrapper<CurriculaVariable> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CurriculaVariable::getGrade,curriculaVariable.getGrade())
.ne(CurriculaVariable::getId,curriculaVariable.getId())
.eq(CurriculaVariable::getDelFlag,'0');
List<CurriculaVariable> curriculaVariables = curriculaVariableMapper.selectList(wrapper);
if (curriculaVariables.size() > 0){
throw new ServiceException("已存在当前级部");
}
return curriculaVariableMapper.updateById(curriculaVariable);
}
}
......@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
......@@ -323,13 +324,23 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
}
/**
* 查看学生成绩详细信息
* @param id
* @return
*/
@Override
public SchoolStudentScoreVo selectStudentScoreById(Long id) {
return studentScoreMapper.selectStudentScoreById(id);
}
/**
* 导入
* @param list
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String importExamDetail(List<SchoolStudentScoreVo> list) {
public String importExamDetail(List<SchoolStudentScoreVo> list,Long curriculaId) {
// 准备记录日志数据
int successNum = 0;
StringBuilder successMsg = new StringBuilder();
......@@ -341,18 +352,40 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
//赋值
SchoolStudentScore schoolStudentScore = new SchoolStudentScore();
schoolStudentScore.setStudentId(schoolStudent.getId());
schoolStudentScore.setCurriculaId(curriculaId);
schoolStudentScore.setClassId(schoolStudent.getClassId());
schoolStudentScore.setExamType(schoolStudentScoreVo.getExamType());
// schoolStudentScore.setLanguage(schoolStudentScoreVo.getLanguage());
// schoolStudentScore.setMath(schoolStudentScoreVo.getMath());
// schoolStudentScore.setEnglish(schoolStudentScoreVo.getEnglish());
// schoolStudentScore.setPolitics(schoolStudentScoreVo.getPolitics());
// schoolStudentScore.setGeography(schoolStudentScoreVo.getGeography());
// schoolStudentScore.setHistory(schoolStudentScoreVo.getHistory());
// schoolStudentScore.setPhysics(schoolStudentScoreVo.getPhysics());
// schoolStudentScore.setChemistry(schoolStudentScoreVo.getChemistry());
// schoolStudentScore.setBiology(schoolStudentScoreVo.getBiology());
schoolStudentScore.setLanguage(schoolStudentScoreVo.getLanguage());
schoolStudentScore.setMath(schoolStudentScoreVo.getMath());
schoolStudentScore.setEnglish(schoolStudentScoreVo.getEnglish());
schoolStudentScore.setPolitics(schoolStudentScoreVo.getPolitics());
schoolStudentScore.setGeography(schoolStudentScoreVo.getGeography());
schoolStudentScore.setHistory(schoolStudentScoreVo.getHistory());
schoolStudentScore.setPhysics(schoolStudentScoreVo.getPhysics());
schoolStudentScore.setChemistry(schoolStudentScoreVo.getChemistry());
schoolStudentScore.setBiology(schoolStudentScoreVo.getBiology());
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate());
LambdaQueryWrapper<SchoolStudentScore> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SchoolStudentScore::getExamType,schoolStudentScore.getExamType())
.eq(SchoolStudentScore::getStudentId,schoolStudentScore.getStudentId())
.eq(SchoolStudentScore::getDelFlag,"0");
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(wrapper1);
String examType = schoolStudentScoreVo.getExamType();
switch (examType){
case "1":
examType = "一次";
break;
case "2":
examType = "二次";
break;
case "3":
examType = "三次";
break;
}
if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在" + schoolStudentScoreVo.getStudentName() + "学生" + examType + "考试成绩");
}
studentScoreMapper.insert(schoolStudentScore);
successNum ++;
}
......@@ -416,4 +449,64 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
throw new BaseException(failureMsg.toString());
}
}
/**
* 根据身份证号获取学生信息
* @param idCard
* @return
*/
@Override
public SchoolStudentScoreVo selectStudent(String idCard) {
SchoolStudentScoreVo schoolStudentScoreVo = studentScoreMapper.selectStudent(idCard);
if (StringUtils.isNull(schoolStudentScoreVo)){
throw new ServiceException("未查询到该学生信息,请仔细核对身份证号码");
}
return schoolStudentScoreVo;
}
/**
* 新增学生成绩信息
* @param schoolStudentScore
* @return
*/
@Override
@Transactional
public int insertStudentScore(SchoolStudentScore schoolStudentScore) {
//判断是否存在该学生此次考试成绩
LambdaQueryWrapper<SchoolStudentScore> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudentScore::getExamType,schoolStudentScore.getExamType())
.eq(SchoolStudentScore::getStudentId,schoolStudentScore.getStudentId())
.eq(SchoolStudentScore::getDelFlag,"0");
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(wrapper);
if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在该学生此次考试成绩");
}
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate());
return studentScoreMapper.insert(schoolStudentScore);
}
/**
* 修改学生成绩信息
* @param schoolStudentScore
* @return
*/
@Override
public int updateStudentScore(SchoolStudentScore schoolStudentScore) {
schoolStudentScore.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setUpdateTime(DateUtils.getNowDate());
return studentScoreMapper.updateById(schoolStudentScore);
}
/**
* 批量删除学生成绩信息
* @param ids
* @return
*/
@Override
public int deleteStudentScore(Long[] ids) {
return studentScoreMapper.deleteStudentScore(ids);
}
}
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentCjVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
private double courseScore;
/** 已选课程 */
// @Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
// ",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
// ",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
@Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
// @Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 所分班级 */
// @Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
......@@ -16,6 +16,8 @@ public class CurriculaStudentVo {
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
......@@ -28,6 +30,9 @@ public class CurriculaStudentVo {
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 成绩 */
@Excel(name = "成绩")
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
......@@ -38,11 +43,13 @@ public class CurriculaStudentVo {
/** 选课状态(1-未选课,2-已选课) */
@Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
private double courseScore;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private Integer selectedCourse;
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
......@@ -50,10 +57,10 @@ public class CurriculaStudentVo {
private String selectedMajorName;
/** 所选科目 */
@Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private Integer selectedSubject;
private String selectedSubject;
/** 所分班级 */
@Excel(name = "所分班级")
private String divisionClasses;
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentXjVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
// @Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// @Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
@Excel(name = "成绩")
private double courseScore;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
// @Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
// @Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 所分班级 */
@Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
package yangtz.cs.liu.campus.vo.curricula;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentYtVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 成绩 */
private double achievement;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
// @Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程成绩 */
// @Excel(name = "成绩")
private double courseScore;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
// @Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
@Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private String selectedSubject;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private String selectedCourse;
/** 所分班级 */
// @Excel(name = "所分班级")
private String divisionClassesName;
/** 是否删除 */
private String delFalg;
}
......@@ -17,14 +17,15 @@
<result property="selectedCourse" column="selected_course" />
<result property="selectedMajor" column="selected_major" />
<result property="selectedSubject" column="selected_subject" />
<result property="divisionClasses" column="division_classes" />
<result property="divisionClassesName" column="division_classes_name" />
<result property="delFlag" column="del_flag" />
</resultMap>
<select id="countNum" parameterType="Long" resultType="Map">
SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE 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>
<!--选课情况列表-->
<select id="selectCurriculaStudentList" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
......@@ -54,8 +55,97 @@
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
</select>
<select id="selectZyZd" parameterType="String" resultType="String">
SELECT dict_label FROM `sys_dict_data` WHERE dict_value=#{dictValue} AND dict_type = "specialty"
<!--春季选课情况列表-->
<select id="selectCurriculaStudentListCj" 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
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '1' and xk.del_flag = '0'
<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>
</select>
<!--夏季选课情况列表-->
<select id="selectCurriculaStudentListXj" 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
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>
ORDER BY xk.selected_course ASC
</select>
<!--艺体选课情况列表-->
<select id="selectCurriculaStudentListYt" 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
WHERE
xk.curricula_id = #{curriculaId} and xk.course_type = '3' and xk.del_flag = '0'
<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>
ORDER BY xk.selected_subject ASC
</select>
</mapper>
\ No newline at end of file
......@@ -59,4 +59,8 @@
g.grade_year = #{grade}
AND g.del_flag = '0')
</select>
<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>
</mapper>
\ No newline at end of file
......@@ -64,10 +64,58 @@
<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>
<if test="className != null and className != ''">and xs.class_name like concat('%', #{className}, '%')</if>
<if test="className != null and className != ''">and bj.class_name like concat('%', #{className}, '%')</if>
ORDER BY
student_id,
exam_type ASC
</select>
<select id="selectStudent" parameterType="String" resultMap="SchoolStudentScoreVoResult">
SELECT xs.class_id,bj.class_name,xs.id as student_id,xs.student_name,xs.id_card,xs.school_no as student_number
FROM curricula_student cs
LEFT JOIN school_student xs ON cs.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
WHERE xs.id_card = #{idCard} AND xs.del_flag = '0'
</select>
<select id="selectStudentScoreById" parameterType="Long" resultMap="SchoolStudentScoreVoResult">
SELECT
cj.id,
cj.student_id,
cj.curricula_id,
xs.student_name,
xs.id_card,
xs.school_no as student_number,
cj.class_id,
bj.class_name,
cj.exam_type,
(cj.`language` + cj.math + cj.english + cj.politics + cj.geography + cj.history + cj.physics + cj.chemistry + cj.biology) as total_score,
cj.`language`,
cj.math,
cj.english,
cj.politics,
cj.geography,
cj.history,
cj.physics,
cj.chemistry,
cj.biology,
cj.create_by,
cj.create_time,
cj.update_by,
cj.update_time
FROM
school_student_score cj
LEFT JOIN school_student xs ON cj.student_id = xs.id
LEFT JOIN school_class bj ON cj.class_id = bj.id
WHERE
cj.id = #{id}
</select>
<update id="deleteStudentScore" parameterType="String">
update school_student_score set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file
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