|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.biemo.business.controller;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.system.domain.SysGradeWeight;
|
|
|
|
@ -12,6 +13,7 @@ import com.ruoyi.system.domain.SysTrainingScoreWithBLOBs;
|
|
|
|
|
import com.ruoyi.system.domain.vo.ReportDto;
|
|
|
|
|
import com.ruoyi.system.domain.vo.TrainingScoreVo;
|
|
|
|
|
import com.ruoyi.system.domain.vo.TrainingTotalScoreVo;
|
|
|
|
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysGradeWeightMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysTrainingScoreMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
|
@ -37,7 +39,8 @@ public class TrainingScoreController {
|
|
|
|
|
SysGradeWeightMapper gradeWeightMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
SysUserMapper sysUserMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
SysDeptMapper sysDeptMapper;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/addScore")
|
|
|
|
|
private void addScore(@RequestBody JSONObject jsonObject) {
|
|
|
|
@ -153,6 +156,7 @@ public class TrainingScoreController {
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 老师端文件下载
|
|
|
|
|
@GetMapping("/downloadReport")
|
|
|
|
|
public AjaxResult downloadReport(@RequestParam Long id, HttpServletResponse response) {
|
|
|
|
@ -173,9 +177,14 @@ public class TrainingScoreController {
|
|
|
|
|
|
|
|
|
|
// 老师端按班级导出
|
|
|
|
|
@GetMapping("/exportByClass")
|
|
|
|
|
public void exportByClass(HttpServletResponse response, @RequestParam String className) {
|
|
|
|
|
public void exportByClass(HttpServletResponse response, @RequestParam String className, @RequestParam Long deptId) {
|
|
|
|
|
// 根据班级名称查询对应的用户列表
|
|
|
|
|
List<SysUser> userList = sysUserMapper.selectClassStuNumberNameByClass(className);
|
|
|
|
|
List<SysUser> userList = new ArrayList<>();
|
|
|
|
|
if (deptId == 103) {
|
|
|
|
|
userList = sysUserMapper.selectClassStuNumberNameByAllClass(className);
|
|
|
|
|
} else {
|
|
|
|
|
userList = sysUserMapper.selectClassStuNumberNameByClass(/*className, */deptId);
|
|
|
|
|
}
|
|
|
|
|
SysTrainingScoreExample trainingScoreExample = new SysTrainingScoreExample();
|
|
|
|
|
List<SysTrainingScore> sysTrainingScores = trainingScoreMapper.selectByExample(trainingScoreExample);
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
@ -211,15 +220,19 @@ public class TrainingScoreController {
|
|
|
|
|
@RequestParam Double operatorWeight,
|
|
|
|
|
@RequestParam Double reportWeight,
|
|
|
|
|
@RequestParam(required = false) String keyWord,
|
|
|
|
|
@RequestParam(required = false) String stuClass) {
|
|
|
|
|
return trainingScoreService.teacherGetReport(index, size, reportWeight, operatorWeight, keyWord, stuClass);
|
|
|
|
|
@RequestParam(required = false) String stuClass,
|
|
|
|
|
@RequestParam Long deptId) {
|
|
|
|
|
return trainingScoreService.teacherGetReport(index, size, reportWeight, operatorWeight, keyWord, stuClass,deptId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 老师端下拉查询班级
|
|
|
|
|
@GetMapping("/selectClass")
|
|
|
|
|
public List<String> selectClass() {
|
|
|
|
|
return trainingScoreService.selectClass();
|
|
|
|
|
public List<String> selectClass(@RequestParam Integer deptId) {
|
|
|
|
|
if (deptId == 103) {
|
|
|
|
|
return sysUserMapper.selectClass();
|
|
|
|
|
}
|
|
|
|
|
return trainingScoreService.selectClassByDeptId(deptId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -251,7 +264,10 @@ public class TrainingScoreController {
|
|
|
|
|
public void saveWeight(@RequestBody JSONObject jsonObject) {
|
|
|
|
|
Double reportWeight = jsonObject.getDouble("reportWeight");
|
|
|
|
|
Double operatorWeight = jsonObject.getDouble("operatorWeight");
|
|
|
|
|
SysGradeWeight sysGradeWeight = gradeWeightMapper.selectByPrimaryKey(1L);
|
|
|
|
|
Long deptId = jsonObject.getLong("deptId");
|
|
|
|
|
SysDept sysDept = sysDeptMapper.selectDeptById(deptId); //根据二级班级ID 得到学校ID
|
|
|
|
|
Long parentId = sysDept.getParentId();
|
|
|
|
|
SysGradeWeight sysGradeWeight = gradeWeightMapper.selectByPrimaryKey(parentId);
|
|
|
|
|
sysGradeWeight.setReportWeight(reportWeight);
|
|
|
|
|
sysGradeWeight.setOperatorWeight(operatorWeight);
|
|
|
|
|
gradeWeightMapper.updateByPrimaryKeySelective(sysGradeWeight);
|
|
|
|
@ -259,8 +275,20 @@ public class TrainingScoreController {
|
|
|
|
|
|
|
|
|
|
// 老师端回显权重
|
|
|
|
|
@GetMapping("/getWeight")
|
|
|
|
|
public SysGradeWeight getWeight() {
|
|
|
|
|
return gradeWeightMapper.selectByPrimaryKey(1L);
|
|
|
|
|
public SysGradeWeight getWeight(@RequestParam Long deptId) {
|
|
|
|
|
SysDept sysDept = sysDeptMapper.selectDeptById(deptId); //根据二级班级ID 得到学校ID
|
|
|
|
|
Long parentId = sysDept.getParentId();
|
|
|
|
|
SysGradeWeight sysGradeWeight = gradeWeightMapper.selectByPrimaryKey(parentId);
|
|
|
|
|
if (sysGradeWeight == null) {
|
|
|
|
|
SysGradeWeight sysGradeWeight1 = new SysGradeWeight();
|
|
|
|
|
sysGradeWeight1.setUserid(parentId);
|
|
|
|
|
sysGradeWeight1.setReportWeight(0.2);
|
|
|
|
|
sysGradeWeight1.setOperatorWeight(0.8);
|
|
|
|
|
gradeWeightMapper.insert(sysGradeWeight1);
|
|
|
|
|
} else {
|
|
|
|
|
return sysGradeWeight;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 老师端右侧成绩(为经过权重计算)
|
|
|
|
|