自动生成配置文件和mapper xml

newBigdata
xiaoCJ 11 months ago
parent a5ccb5b057
commit fc24e264f7

@ -1,5 +1,13 @@
package com.sztzjy.financial_bigdata.controller.stu;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseChapterDto;
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseDto;
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
import com.sztzjy.financial_bigdata.mapper.SysCourseChapterMapper;
import com.sztzjy.financial_bigdata.mapper.SysCourseMapper;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestion;
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample;
@ -11,6 +19,13 @@ import com.sztzjy.financial_bigdata.service.tea.ITeaCaseStepService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -18,11 +33,21 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
//实训演练-实训案例-实验实训
@RestController
@Api(tags = "实训演练-实训案例-实验实训")
@RequestMapping("api/stu/exercise/experimentalTrainingController")
public class ExerciseExperimentalTraining {
@Autowired
private SysCourseMapper sysCourseMapper;
@Autowired
private SysCourseChapterMapper sysCourseChapterMapper;
@Autowired
private StuTrainingMapper stuTrainingMapper;
@Autowired
SysCaseQuestionMapper caseQuestionMapper;
@Autowired
@ -71,4 +96,45 @@ public class ExerciseExperimentalTraining {
//python在线运行
@AnonymousAccess
@ApiOperation("实训演练页面查询")
@PostMapping("getCourseChapter")
public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String schoolId, @RequestParam String userId) {
List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId(schoolId);
List<SysCourseDto> dtoList = new ArrayList<>();
for (SysCourse sysCourse : sysCourseList) {
SysCourseDto newDto = new SysCourseDto();
BeanUtils.copyProperties(sysCourse, newDto);
String courseId = newDto.getCourseId();
SysCourseChapterExample courseChapterExample = new SysCourseChapterExample();
courseChapterExample.createCriteria().andCourseIdEqualTo(courseId);
courseChapterExample.setOrderByClause("sequence ASC");
List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample);
List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>();
for (SysCourseChapter sysCourseChapter : sysCourseChapters) {
SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto();
BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto);
StuTrainingExample example = new StuTrainingExample();
example.createCriteria().andUserIdEqualTo(userId).andChapterIdEqualTo(sysCourseChapter.getChapterId());
List<StuTrainingWithBLOBs> list = stuTrainingMapper.selectByExampleWithBLOBs(example);
if (!list.isEmpty()) {
StuTrainingWithBLOBs stuTrainingWithBLOBs = list.get(0);
sysCourseChapterDto.setSchedule(stuTrainingWithBLOBs.getProgress());
}
CourseChapterDtoList.add(sysCourseChapterDto);
}
newDto.setSysCourseChapterDtos(CourseChapterDtoList);
dtoList.add(newDto);
}
return new ResultEntity<List<SysCourseDto>>(dtoList);
}
@AnonymousAccess
@ApiOperation("点击某个章节跳转到知识测评")
@PostMapping("/skipKnowledge")
public ResultEntity<List<SysCourseDto>> skipKnowledge(@RequestParam String schoolId, @RequestParam String userId) {
return null;
}
}

@ -5,12 +5,11 @@ import com.sztzjy.financial_bigdata.config.Constant;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto;
import com.sztzjy.financial_bigdata.mapper.*;
import com.sztzjy.financial_bigdata.service.stu.StuIndexService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.geolatte.geom.M;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -43,6 +42,8 @@ public class StuIndexController {
private TeaExamManageMapper teaExamManageMapper;
@Autowired
private SysResourceDataMapper sysResourceDataMapper;
@Autowired
private StuIndexService stuIndexService;
@AnonymousAccess
@ApiOperation("课程数据展示")
@ -151,7 +152,8 @@ public class StuIndexController {
@AnonymousAccess
@ApiOperation("学习数据统计分析")
@PostMapping("learnDataCountAnalysis")
public ResultEntity learnDataCountAnalysis() {
public ResultEntity learnDataCountAnalysis(@RequestParam String userId,@RequestParam String schoolId) {
stuIndexService.learnDataCountAnalysis(userId,schoolId);
return null;
}
}

@ -3,12 +3,12 @@ package com.sztzjy.financial_bigdata.controller.tea;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
import com.sztzjy.financial_bigdata.entity.TeaExamManage;
import com.sztzjy.financial_bigdata.entity.TeaExamManageExample;
import com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs;
import com.sztzjy.financial_bigdata.config.Constant;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.tea_dto.TeaExamManageCountDto;
import com.sztzjy.financial_bigdata.entity.tea_dto.TeaExamManageDto;
import com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto;
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
import com.sztzjy.financial_bigdata.mapper.SysObjectiveQuestionMapper;
import com.sztzjy.financial_bigdata.mapper.TeaExamManageMapper;
import com.sztzjy.financial_bigdata.service.tea.ITeaExamManageService;
@ -38,12 +38,14 @@ public class TeaExamManageController {
private SysObjectiveQuestionMapper sysObjectiveQuestionMapper;
@Autowired
private TeaExamManageMapper teaExamManageMapper;
@Autowired
private StuTrainingMapper stuTrainingMapper;
@AnonymousAccess
@PostMapping("/getSelectCountAndScore")
@ApiOperation("新增考试管理--获取选题量和分数")
public ResultEntity<Map<Integer, BigDecimal>> getsingleId(@RequestParam @ApiParam("所有ID用,隔开一次传过来") String ids) {
@ApiOperation("新增考试--获取选题量和分数")
public ResultEntity<Map<Integer, BigDecimal>> getsingleId(@RequestBody @ApiParam("所有ID用,隔开一次传过来") String ids) {
List<String> idList = new ArrayList<>(Arrays.asList(ids.split(",")));
Map<Integer, BigDecimal> map = new HashMap<>();
int i = 0;
@ -60,20 +62,42 @@ public class TeaExamManageController {
@AnonymousAccess
@PostMapping("/getAllCount")
@ApiOperation("考试管理--获取题目总数量")
@ApiOperation("新增考试--获取题目总数量")
public ResultEntity<TeaExamManageCountDto> getAllCount(@RequestParam String schoolId) {
TeaExamManageCountDto teaExamManageCountDto = sysObjectiveQuestionMapper.selectAllCount(schoolId);
return new ResultEntity<TeaExamManageCountDto>(teaExamManageCountDto);
}
@AnonymousAccess
@PostMapping("/selectObjectivityByType")
@ApiOperation("新增考试--选择客观题时展示")
public ResultEntity<List<SysObjectiveQuestion>> selectObjectivityByType(@ApiParam("0单选 1多选 2判断") @RequestParam String type,
@RequestParam String schoolId) {
SysObjectiveQuestionExample sysObjectiveQuestionExample = new SysObjectiveQuestionExample();
List<String> l = new ArrayList<>();
l.add(schoolId);
l.add(Constant.BUILT_IN_SCHOOL_ID);
sysObjectiveQuestionExample.createCriteria().andTypeEqualTo(type).andSchoolIdIn(l);
return new ResultEntity<List<SysObjectiveQuestion>>(sysObjectiveQuestionMapper.selectByExample(sysObjectiveQuestionExample));
}
@AnonymousAccess
@PostMapping("/selectTrainingByIds")
@ApiOperation("新增考试--展示案例题详细信息")
public ResultEntity<List<TrainingDto>> selectTrainingByIds(@RequestBody List<String> ids) {
return new ResultEntity<List<TrainingDto>>(stuTrainingMapper.selectTrainingByIds(ids));
}
@AnonymousAccess
@PostMapping("/addExam")
@ApiOperation("考试管理--新增考试")
public ResultEntity<HttpStatus> addExam(@ModelAttribute @ApiParam("file传图片/时间传年月日时分秒") TeaExamManageDto teaExamManagedto) {
return examManageService.addExam(teaExamManagedto);
}
@AnonymousAccess
@PostMapping("/selectExamList")
@ApiOperation("考试管理--查询考试列表")
public ResultEntity<PageInfo> selectExamList(@RequestParam Integer index,
@ -108,29 +132,31 @@ public class TeaExamManageController {
return new ResultEntity<>(new PageInfo(teaExamManageWithBLOBs));
}
@AnonymousAccess
@PostMapping("/updateExam")
@ApiOperation("考试管理--编辑")
public ResultEntity<HttpStatus> updateExam(@RequestBody(required = false)@ApiParam("ID必传") TeaExamManageWithBLOBs examManage) {
if (StringUtils.isBlank(examManage.getExamManageId())){
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST,"缺少必须的主键ID");
public ResultEntity<HttpStatus> updateExam(@RequestBody(required = false) @ApiParam("ID必传") TeaExamManageWithBLOBs examManage) {
if (StringUtils.isBlank(examManage.getExamManageId())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "缺少必须的主键ID");
}
teaExamManageMapper.updateByPrimaryKeyWithBLOBs(examManage);
return new ResultEntity<HttpStatus>(HttpStatus.OK,"修改成功!");
return new ResultEntity<HttpStatus>(HttpStatus.OK, "修改成功!");
}
@AnonymousAccess
@PostMapping("/selectExamById")
@ApiOperation("考试管理--预览")
public ResultEntity<TeaExamManage> selectExamById(@RequestParam String examId) {
return new ResultEntity<TeaExamManage>(teaExamManageMapper.selectByPrimaryKey(examId));
}
@AnonymousAccess
@PostMapping("/deleteExam")
@ApiOperation("考试管理--删除")
public ResultEntity<HttpStatus> deleteExam(@RequestParam String examId) {
teaExamManageMapper.deleteByPrimaryKey(examId);
return new ResultEntity<HttpStatus>(HttpStatus.OK,"删除成功!");
return new ResultEntity<HttpStatus>(HttpStatus.OK, "删除成功!");
}
@AnonymousAccess
@PostMapping("/reloadExamById")
@ApiOperation("考试管理--指定人重考")
public ResultEntity reloadExamById(@RequestParam String examId) {

@ -63,7 +63,7 @@ public class TeaGradeManageController {
@AnonymousAccess
@PostMapping("/getExamInfo")
@ApiOperation("考试模式--页面展示")
@ApiOperation("考试模式--页面展示(学生端实战考核复用)")
public ResultEntity<PageInfo> getExamInfo(@RequestParam Integer index,
@RequestParam Integer size,
@ApiParam("ManyAnswer为考试时间JudgeAnswer为发布人") @RequestParam String schoolId) {
@ -108,7 +108,7 @@ public class TeaGradeManageController {
}
@PostMapping("/exportExam")
@GetMapping("/exportExam")
@ApiOperation("考试模式--页面单个考试导出")
public void exportExam() {
//TODO 待写 页面单个考试导出
@ -166,7 +166,7 @@ public class TeaGradeManageController {
}
@AnonymousAccess
@PostMapping("/exportRank")
@GetMapping("/exportRank")
@ApiOperation("考试模式--成绩排名页面导出")
public void exportRank(HttpServletResponse response,
@RequestParam String schoolId,
@ -245,29 +245,31 @@ public class TeaGradeManageController {
@RequestParam Integer size,
@RequestParam String schoolId,
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId) {
return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId));
@RequestParam(required = false) String classId,
@RequestParam String userId) {
return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId,userId));
}
@AnonymousAccess
@PostMapping("/exportTrainingInfo")
@GetMapping("/exportTrainingInfo")
@ApiOperation("练习模式--页面导出")
public void exportTrainingInfo(HttpServletResponse response,
@RequestParam String schoolId,
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId) {
iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId);
@RequestParam(required = false) String classId,
@RequestParam String userId) {
iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId,userId);
}
@AnonymousAccess
@PostMapping("/getTrainingDetailsInfo")
@ApiOperation("练习模式--详情页面展示")
public ResultEntity<List<TeaTrainingDto>> getTrainingDetailsInfo(@RequestParam String trainingId) {
return new ResultEntity<>(iTeaGradeManageService.getTrainingDetailsInfo(trainingId));
public ResultEntity<List<TeaTrainingDto>> getTrainingDetailsInfo(@RequestParam String userId) {
return new ResultEntity<>(iTeaGradeManageService.getTrainingDetailsInfo(userId));
}
@AnonymousAccess
@PostMapping("/exportTrainingDetailsInfo")
@GetMapping("/exportTrainingDetailsInfo")
@ApiOperation("练习模式--详情页面导出")
public void exportTrainingDetailsInfo(HttpServletResponse response, @RequestParam String trainingId) {
iTeaGradeManageService.exportTrainingDetailsInfo(response, trainingId);
@ -355,7 +357,7 @@ public class TeaGradeManageController {
@AnonymousAccess
@PostMapping("/exportTheoryExamInfo")
@GetMapping("/exportTheoryExamInfo")
@ApiOperation("理论考试--导出理论考试信息")
public void exportTheoryExamInfo(HttpServletResponse response,
@ApiParam("不选择班级就是学习全部导出") @RequestParam(required = false) String classId,
@ -374,6 +376,7 @@ public class TeaGradeManageController {
StuTheoryExamExample stuTheoryExamExample = new StuTheoryExamExample();
stuTheoryExamExample.createCriteria().andUserIdEqualTo(userId);
List<StuTheoryExamWithBLOBs> stuTheoryExamWithBLOBs = stuTheoryExamMapper.selectByExampleWithBLOBs(stuTheoryExamExample);
stuTheoryExamExample.setOrderByClause("score ASC");
PageInfo<StuTheoryExamWithBLOBs> pageInfo = new PageInfo(stuTheoryExamWithBLOBs);
return new ResultEntity<>(pageInfo);
}

@ -28,6 +28,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -103,6 +104,7 @@ public class UserController {
SecurityContextHolder.getContext().setAuthentication(authentication);
String token = TokenProvider.createToken(jwtUser);
LoginResult loginResult = LoginResult.create(jwtUser, token);
//todo 从智云登录后将用户添加到本地用户表
return new ResultEntity(HttpStatus.OK, loginResult);
}
}
@ -118,8 +120,6 @@ public class UserController {
}
@ApiOperation("根据用户Code查询该用户是否存在个人赛用户数据存在则返回不存在则新增后返回用于智云3.0创建用户后调用该接口创建用户个人赛")
@PostMapping("/checkOrCreateForexSimulationUser")
@AnonymousAccess
@ -165,28 +165,28 @@ public class UserController {
}
/*
* @author xcj
* @Date 2024/3/11
*/
@PostMapping("/addClass")
@ApiOperation("班级管理--添加班级")
public ResultEntity<HttpStatus> addClass(@RequestBody StuClass stuClass) {
if (StringUtils.isBlank(stuClass.getClassName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写班级名称");
}
if (StringUtils.isBlank(stuClass.getSchoolName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写学校名称");
}
StuClass stuClass1 = classMapper.selectByPrimaryKey(stuClass.getClassName());
if (stuClass1 != null) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "该班级已存在");
}
stuClass.setCreateTime(new Date());
stuClass.setClassId(IdUtil.randomUUID());
classMapper.insert(stuClass);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功");
}
// /* 添加班级
// * @author xcj
// * @Date 2024/3/11
// */
// @PostMapping("/addClass")
// @ApiOperation("班级管理--添加班级")
// public ResultEntity<HttpStatus> addClass(@RequestBody StuClass stuClass) {
// if (StringUtils.isBlank(stuClass.getClassName())) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写班级名称");
// }
// if (StringUtils.isBlank(stuClass.getSchoolName())) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请填写学校名称");
// }
// StuClass stuClass1 = classMapper.selectByPrimaryKey(stuClass.getClassName());
// if (stuClass1 != null) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "该班级已存在");
// }
// stuClass.setCreateTime(new Date());
// stuClass.setClassId(IdUtil.randomUUID());
// classMapper.insert(stuClass);
// return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功");
// }
/*
* @author xcj
@ -243,43 +243,38 @@ public class UserController {
@AnonymousAccess
@PostMapping("/selectAllClassNameBySchoolId")
@ApiOperation("班级下拉框")
public ResultEntity< List<Map<String,String>>> selectAllClassNameBySchoolId(@RequestParam String schoolId) {
public ResultEntity<List<Map<String, String>>> selectAllClassNameBySchoolId(@RequestParam String schoolId) {
return new ResultEntity<>(classMapper.selectAllClassNameBySchoolId(schoolId));
}
/*
* @author xcj
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/addStudent")
@ApiOperation("学生管理--添加学生")
public ResultEntity<HttpStatus> addStudent(@ApiParam("所属班级(id)、姓名、学号三个必填") @RequestBody StuUser stuUser) {
if (StringUtils.isBlank(stuUser.getClassId())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请选择班级");
}
if (StringUtils.isBlank(stuUser.getName())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请输入学生姓名");
}
if (StringUtils.isBlank(stuUser.getStudentId())) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请输入学号");
}
stuUser.setRoleId(0);
stuUser.setPassword("tzs!@#888");
stuUser.setCreateTime(new Date());
stuUser.setUserid(IdUtil.randomUUID());
stuUser.setUsername(stuUser.getStudentId());//同学号
stuUser.setStatus(0);
stuUserMapper.insert(stuUser);
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功");
}
// /*
// * @author xcj
// * @Date 2024/3/12
// */
// @AnonymousAccess
// @PostMapping("/addStudent")
// @ApiOperation("学生管理--添加学生")
// public ResultEntity<HttpStatus> addStudent(@ApiParam("所属班级(id)、姓名、学号三个必填") @RequestBody StuUser stuUser) {
// if (StringUtils.isBlank(stuUser.getClassId())) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请选择班级");
// }
// if (StringUtils.isBlank(stuUser.getName())) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请输入学生姓名");
// }
// if (StringUtils.isBlank(stuUser.getStudentId())) {
// return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "请输入学号");
// }
// stuUser.setRoleId(0);
// stuUser.setPassword("tzs!@#888");
// stuUser.setCreateTime(new Date());
// stuUser.setUserid(IdUtil.randomUUID());
// stuUser.setUsername(stuUser.getStudentId());//同学号
// stuUser.setStatus(0);
// stuUserMapper.insert(stuUser);
// return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功");
// }
@PostMapping("/batchImportStu")
@ApiOperation("学生管理--批量导入学生")
public void batchImport() { //todo 学生管理--批量导入学生
}
/*
@ -374,7 +369,7 @@ public class UserController {
* @Date 2024/3/12
*/
@AnonymousAccess
@PostMapping("/exportStu")
@GetMapping("/exportStu")
@ApiOperation("学生管理--导出")
public void exportStu(HttpServletResponse response,
@ApiParam("按班级导出时传班级ID默认按学校") @RequestParam(required = false) String classId,
@ -422,7 +417,7 @@ public class UserController {
@AnonymousAccess
@PostMapping("/logExport")
@GetMapping("/logExport")
@ApiOperation("学生管理--日志查导出")
public void logExport(HttpServletResponse response,
@RequestParam String schoolId,

@ -6,10 +6,13 @@ import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* sys_weight
* sys_weights
*/
public class SysWeight {
@ApiModelProperty("学校ID")
@ApiModelProperty("权重ID")
private String weightId;
@ApiModelProperty("学校ID ")
private String schoolId;
@ApiModelProperty("课程/模块ID")
@ -42,6 +45,14 @@ public class SysWeight {
@ApiModelProperty("实验实训默认计分规则")
private BigDecimal expTrainingDefautRule;
public String getWeightId() {
return weightId;
}
public void setWeightId(String weightId) {
this.weightId = weightId == null ? null : weightId.trim();
}
public String getSchoolId() {
return schoolId;
}

@ -105,6 +105,76 @@ public class SysWeightExample {
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andWeightIdIsNull() {
addCriterion("weight_Id is null");
return (Criteria) this;
}
public Criteria andWeightIdIsNotNull() {
addCriterion("weight_Id is not null");
return (Criteria) this;
}
public Criteria andWeightIdEqualTo(String value) {
addCriterion("weight_Id =", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdNotEqualTo(String value) {
addCriterion("weight_Id <>", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdGreaterThan(String value) {
addCriterion("weight_Id >", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdGreaterThanOrEqualTo(String value) {
addCriterion("weight_Id >=", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdLessThan(String value) {
addCriterion("weight_Id <", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdLessThanOrEqualTo(String value) {
addCriterion("weight_Id <=", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdLike(String value) {
addCriterion("weight_Id like", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdNotLike(String value) {
addCriterion("weight_Id not like", value, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdIn(List<String> values) {
addCriterion("weight_Id in", values, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdNotIn(List<String> values) {
addCriterion("weight_Id not in", values, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdBetween(String value1, String value2) {
addCriterion("weight_Id between", value1, value2, "weightId");
return (Criteria) this;
}
public Criteria andWeightIdNotBetween(String value1, String value2) {
addCriterion("weight_Id not between", value1, value2, "weightId");
return (Criteria) this;
}
public Criteria andSchoolIdIsNull() {
addCriterion("school_Id is null");
return (Criteria) this;

@ -0,0 +1,30 @@
package com.sztzjy.financial_bigdata.entity.sys_dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author xcj
* @Date 2024/4/17
*/
@Data
@NoArgsConstructor
public class SysCourseChapterDto {
@ApiModelProperty("章节ID")
private String chapterId;
@ApiModelProperty("章节名称")
private String chapterName;
@ApiModelProperty("课程ID")
private String courseId;
@ApiModelProperty("排序")
private Integer sequence;
@ApiModelProperty("进度")
private BigDecimal schedule;
}

@ -0,0 +1,33 @@
package com.sztzjy.financial_bigdata.entity.sys_dto;
import com.sztzjy.financial_bigdata.entity.SysCourseChapter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @Author xcj
* @Date 2024/4/17
*/
@Data
@NoArgsConstructor
public class SysCourseDto {
@ApiModelProperty("课程ID")
private String courseId;
@ApiModelProperty("课程名称")
private String courseName;
@ApiModelProperty("排序")
private Integer sequence;
@ApiModelProperty("学校ID")
private String schoolId;
@ApiModelProperty("0为老师导入 1为内置")
private String inputType;
private List<SysCourseChapterDto> sysCourseChapterDtos;
}

@ -13,8 +13,7 @@ import java.math.BigDecimal;
@Data
@NoArgsConstructor
public class TeaTrainingInfoDTO {
@ApiModelProperty("排名")
private String trainingId;
private String userId;
@ApiModelProperty("排名")
private int rank;

@ -0,0 +1,24 @@
package com.sztzjy.financial_bigdata.entity.tea_dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author xcj
* @Date 2024/4/22
*/
@Data
@NoArgsConstructor
public class TrainingDto {
@ApiModelProperty("案例名称")
private String name;
@ApiModelProperty("所属任务")
private String task;
@ApiModelProperty("步骤数量")
private int count;
@ApiModelProperty("案例分值")
private BigDecimal score;
}

@ -36,4 +36,6 @@ public interface StuStudentExamMapper {
int updateByPrimaryKeyWithBLOBs(StuStudentExamWithBLOBs record);
int updateByPrimaryKey(StuStudentExam record);
int selectLastExamRank(@Param("userId") String userId);
}

@ -3,10 +3,15 @@ package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.StuTraining;
import com.sztzjy.financial_bigdata.entity.StuTrainingExample;
import com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs;
import java.math.BigDecimal;
import java.util.List;
import com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface StuTrainingMapper {
long countByExample(StuTrainingExample example);
@ -36,4 +41,12 @@ public interface StuTrainingMapper {
int updateByPrimaryKeyWithBLOBs(StuTrainingWithBLOBs record);
int updateByPrimaryKey(StuTraining record);
@Select("select count(progress) FROM stu_training WHERE progress = 1 and user_id = #{userId}")
int selectProgressFinish(@Param("userId") String userId);
@Select("SELECT COUNT(progress) FROM stu_training WHERE user_id = '8' AND (exp_training_score <> 0 AND exp_training_score IS NOT NULL)")
BigDecimal selectTrainingProgressFinish(@Param("userId") String userId);
List<TrainingDto> selectTrainingByIds(@Param("ids") List<String> ids);
}

@ -6,6 +6,8 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface SysCourseChapterMapper {
long countByExample(SysCourseChapterExample example);
@ -29,4 +31,7 @@ public interface SysCourseChapterMapper {
int updateByPrimaryKeySelective(SysCourseChapter record);
int updateByPrimaryKey(SysCourseChapter record);
@Select("SELECT COUNT(chapter_id) FROM sys_course JOIN sys_course_chapter WHERE sys_course.course_id = sys_course_chapter.course_id AND school_Id in(999999999,#{schoolId})")
int selectChapterBySchoolId(@Param("schoolId")String schoolId);
}

@ -5,6 +5,7 @@ import com.sztzjy.financial_bigdata.entity.SysCourseExample;
import java.util.List;
import java.util.Map;
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -35,6 +36,9 @@ public interface SysCourseMapper {
List<SysCourse> selectCourse(@Param("schoolId") String schoolId);
@Select("SELECT course_id,course_name FROM sys_course WHERE school_id = #{schoolId}")
@Select("SELECT course_id,course_name FROM sys_course WHERE school_id in (999999999,#{schoolId}) ORDER BY sequence ASC")
List<Map<String,String>> getModuleBySchoolId(@Param("schoolId") String schoolId);
List<SysCourse> getBySchoolId(@Param("schoolId")String schoolId);
}

@ -6,7 +6,6 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface SysWeightMapper {
@ -14,7 +13,7 @@ public interface SysWeightMapper {
int deleteByExample(SysWeightExample example);
int deleteByPrimaryKey(String schoolId);
int deleteByPrimaryKey(String weightId);
int insert(SysWeight record);
@ -22,7 +21,7 @@ public interface SysWeightMapper {
List<SysWeight> selectByExample(SysWeightExample example);
SysWeight selectByPrimaryKey(String schoolId);
SysWeight selectByPrimaryKey(String weightId);
int updateByExampleSelective(@Param("record") SysWeight record, @Param("example") SysWeightExample example);

@ -36,4 +36,6 @@ public interface TeaExamManageMapper {
int updateByPrimaryKeyWithBLOBs(TeaExamManageWithBLOBs record);
int updateByPrimaryKey(TeaExamManage record);
void selectByIds(List<String> ids);
}

@ -0,0 +1,9 @@
package com.sztzjy.financial_bigdata.service.stu;
/**
* @Author xcj
* @Date 2024/4/22
*/
public interface StuIndexService {
void learnDataCountAnalysis(String userId,String schoolId);
}

@ -0,0 +1,54 @@
package com.sztzjy.financial_bigdata.service.stu.impl;
import com.sztzjy.financial_bigdata.entity.StuStudentExamExample;
import com.sztzjy.financial_bigdata.entity.StuStudentExamWithBLOBs;
import com.sztzjy.financial_bigdata.entity.StuTrainingExample;
import com.sztzjy.financial_bigdata.mapper.StuStudentExamMapper;
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
import com.sztzjy.financial_bigdata.mapper.SysCourseChapterMapper;
import com.sztzjy.financial_bigdata.mapper.TeaExamManageMapper;
import com.sztzjy.financial_bigdata.service.stu.StuIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @Author xcj
* @Date 2024/4/22
*/
@Service
public class StuIndexServiceImpl implements StuIndexService {
@Autowired
StuTrainingMapper stuTrainingMapper;
@Autowired
SysCourseChapterMapper sysCourseChapterMapper;
@Autowired
StuStudentExamMapper studentExamMapper;
@Autowired
TeaExamManageMapper teaExamManageMapper;
@Override
public void learnDataCountAnalysis(String userId, String schoolId) {
//实训演练学习数据
int progressFinishNum = stuTrainingMapper.selectProgressFinish(userId); //已学任务数量
BigDecimal trainingNum = stuTrainingMapper.selectTrainingProgressFinish(userId); //已学案例数量
//TODO 学习时长
int totalChapterNum = sysCourseChapterMapper.selectChapterBySchoolId(schoolId); //总章节数量
int finalProgress = progressFinishNum / totalChapterNum; //任务进度 = 已学数量/总章节数量
//实战考核学习数据
StuStudentExamExample example = new StuStudentExamExample();
example.createCriteria().andUseridEqualTo(userId);
List<StuStudentExamWithBLOBs> stuStudentExamWithBLOBs = studentExamMapper.selectByExampleWithBLOBs(example);
int examSize = stuStudentExamWithBLOBs.size(); //参与考核次数
//最近一次考核正确率:
int lastRank = studentExamMapper.selectLastExamRank(userId); // 最近一次考核排名:
//正确率最低的考核案例:
}
}

@ -15,13 +15,13 @@ import java.util.List;
* @Date 2024/3/19
*/
public interface ITeaGradeManageService {
PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId);
PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId,String userId);
void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId);
void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId,String userId);
TeaExaminationDetailsDto getCountChart(String examManageId, String classId);
List<TeaTrainingDto> getTrainingDetailsInfo(String trainingId);
List<TeaTrainingDto> getTrainingDetailsInfo(String userId);
void exportTrainingDetailsInfo(HttpServletResponse response, String trainingId);

@ -3,6 +3,7 @@ package com.sztzjy.financial_bigdata.service.tea;
import com.github.pagehelper.PageInfo;
import com.sztzjy.financial_bigdata.entity.SysLoginLog;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;

@ -17,7 +17,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/**
@ -44,11 +43,14 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
private StuStudentExamMapper studentExamMapper;
@Autowired
private StuTheoryRecordMapper stuTheoryRecordMapper;
@Autowired
private StuTrainingMapper stuTrainingMapper;
@Override
public PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId);
public PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId,String userId) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId,userId);
list.sort(new TotalScoreComparator());
int i = 0;
for (TeaTrainingInfoDTO teaTrainingInfoDTO : list) {
@ -66,8 +68,8 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
* @Date 2024/3/19
*/
@Override
public void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId);
public void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId,String userId) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId,userId);
//导出的表名
String title = IdUtil.simpleUUID();
//表中第一行表头字段
@ -174,9 +176,11 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
TeaTrainingDto newData = new TeaTrainingDto();
BeanUtils.copyProperties(stuTrainingWithBLOBs, newData);
newData.setTaskModule(sysCourseChapter.getChapterName());
if (StringUtils.isNotBlank(stuTrainingWithBLOB.getReportId())) {
String reportId = stuTrainingWithBLOB.getReportId();
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(reportId);
newData.setReportScore(trainingReport.getTeacherScore());
}
newData.setModuleScore(moduleScore);
list.add(newData);
}
@ -258,7 +262,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
s.setOrderByClause("average_score ASC");
List<StuTheoryRecord> list = stuTheoryRecordMapper.selectByExample(s);
List<StuTheoryRecordDto> dtoList = new ArrayList<>();
BeanUtils.copyProperties(list,dtoList);
BeanUtils.copyProperties(list, dtoList);
int i = 0;
for (StuTheoryRecordDto stuTheoryRecordDto : dtoList) {
stuTheoryRecordDto.setRank(i++);
@ -278,7 +282,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
}
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOS(String schoolId, String keyWord, String classId) {
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOS(String schoolId, String keyWord, String classId,String userId) {
StuUserExample userExample = new StuUserExample();
StuUserExample.Criteria criteria = userExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId);
@ -289,58 +293,74 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
userExample.or().andSchoolIdEqualTo(schoolId).andStudentIdEqualTo(keyWord);
userExample.or().andSchoolIdEqualTo(schoolId).andNameEqualTo(keyWord);
}
SysWeight sysWeight = sysWeightMapper.selectByPrimaryKey(schoolId);
BigDecimal expTrainingWeight = sysWeight.getExpTrainingWeight(); //实验实训权重
BigDecimal knowledgeSummaryWeight = sysWeight.getKnowledgeSummaryWeight();//知识概要权重
BigDecimal resourceLearningWeight = sysWeight.getResourceLearningWeight(); //资源学习权重
BigDecimal learningEvalWeight = sysWeight.getLearningEvalWeight(); //学习测评权重
BigDecimal reportWeight = sysWeight.getReportWeight();//实验报告权重
List<TeaTrainingInfoDTO> list = new ArrayList<>();
int chapterNum = sysCourseChapterMapper.selectChapterBySchoolId(schoolId);
List<StuUser> stuUsers = userMapper.selectByExample(userExample);
List<TeaTrainingInfoDTO> list = new ArrayList<>();
if (stuUsers.isEmpty()) {
return null;
} else {
for (StuUser stuUser : stuUsers) {
TeaTrainingInfoDTO teaTrainingInfoDTO = new TeaTrainingInfoDTO();
StuClass stuClass = classMapper.selectByPrimaryKey(classId);
StuClass stuClass = classMapper.selectByPrimaryKey(stuUser.getClassId());
//封装user表的数据
teaTrainingInfoDTO.setClassName(stuClass.getClassName());
teaTrainingInfoDTO.setStudentId(stuUser.getStudentId());
teaTrainingInfoDTO.setName(stuUser.getName());
teaTrainingInfoDTO.setUserId(stuUser.getUserid());
//求实训进度
StuTrainingExample stuTrainingExample = new StuTrainingExample();
stuTrainingExample.createCriteria().andUserIdEqualTo(stuUser.getUserid());
List<StuTrainingWithBLOBs> stuTrainingWithBLOBs = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
for (StuTrainingWithBLOBs stuTrainingWithBLOB : stuTrainingWithBLOBs) {
if (StringUtils.isNotBlank(stuTrainingWithBLOB.getReportId())) { //之展示提交完报告的数据
stuTrainingExample.createCriteria().andProgressEqualTo(BigDecimal.valueOf(6)).andUserIdEqualTo(stuUser.getUserid()); //进度为6代表这个章节完成了
List<StuTrainingWithBLOBs> stuTrainings = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
int trainingSize = stuTrainingMapper.selectProgressFinish(userId); //已学任务数量
if (stuTrainings.isEmpty()) {
teaTrainingInfoDTO.setProgress(BigDecimal.ZERO); //实训表为0设置为0
teaTrainingInfoDTO.setTotalScore(BigDecimal.ZERO);
list.add(teaTrainingInfoDTO);
}
if (trainingSize != 0 && chapterNum != 0) {
int i = chapterNum / trainingSize; //综合进度
teaTrainingInfoDTO.setProgress(BigDecimal.valueOf(i));
}
//求综合得分 拿到每个已完成的章节分数
BigDecimal totalScore = BigDecimal.valueOf(0);
if (stuTrainings.isEmpty()) {
list.add(teaTrainingInfoDTO);
continue;
}
for (StuTrainingWithBLOBs stuTrainingWithBLOB : stuTrainings) {
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(stuTrainingWithBLOB.getReportId());
BigDecimal reportScore = trainingReport.getTeacherScore();
BigDecimal expTrainingScore = stuTrainingWithBLOB.getExpTrainingScore();
BigDecimal knowledgeSummaryScore = stuTrainingWithBLOB.getKnowledgeSummaryScore();
BigDecimal resourceLearningScore = stuTrainingWithBLOB.getResourceLearningScore();
BigDecimal learningEvalScore = stuTrainingWithBLOB.getLearningEvalScore();
teaTrainingInfoDTO.setProgress(stuTrainingWithBLOB.getProgress());
BigDecimal totalScore = BigDecimal.valueOf(0);
if (reportScore != null && BigDecimal.ZERO.compareTo(reportScore) == 0) {
totalScore = totalScore.add(reportScore.multiply(reportWeight).setScale(2, RoundingMode.HALF_UP));
}
if (reportScore != null && BigDecimal.ZERO.compareTo(reportScore) == 0) { //报告得分不等于0或null
totalScore = totalScore.add(reportScore);
if (expTrainingScore != null && BigDecimal.ZERO.compareTo(expTrainingScore) == 0) {
totalScore = totalScore.add(expTrainingScore.multiply(expTrainingWeight).setScale(2, RoundingMode.HALF_UP));
totalScore = totalScore.add(expTrainingScore);
}
if (knowledgeSummaryScore != null && BigDecimal.ZERO.compareTo(knowledgeSummaryScore) == 0) {
totalScore = totalScore.add(knowledgeSummaryScore.multiply(knowledgeSummaryWeight).setScale(2, RoundingMode.HALF_UP));
totalScore = totalScore.add(knowledgeSummaryScore);
}
if (resourceLearningScore != null && BigDecimal.ZERO.compareTo(resourceLearningScore) == 0) {
totalScore = totalScore.add(resourceLearningScore.multiply(resourceLearningWeight).setScale(2, RoundingMode.HALF_UP));
totalScore = totalScore.add(resourceLearningScore);
}
if (learningEvalScore != null && BigDecimal.ZERO.compareTo(learningEvalScore) == 0) {
totalScore = totalScore.add(learningEvalScore.multiply(learningEvalWeight).setScale(2, RoundingMode.HALF_UP));
totalScore = totalScore.add(learningEvalScore);
}
teaTrainingInfoDTO.setTotalScore(totalScore);
teaTrainingInfoDTO.setTrainingId(stuTrainingWithBLOB.getTrainingId());
list.add(teaTrainingInfoDTO);
}
}
int score = totalScore.intValue() / chapterNum; //已完成的模块分数/总模块数量
teaTrainingInfoDTO.setTotalScore(BigDecimal.valueOf(score));
list.add(teaTrainingInfoDTO);
}
return list;
}
}
public class TotalScoreComparator implements Comparator<TeaTrainingInfoDTO> {
@Override

@ -13,10 +13,15 @@ import com.sztzjy.financial_bigdata.service.tea.ITeaUserService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import com.sztzjy.financial_bigdata.util.excel.FilePortUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -84,4 +89,6 @@ public class TeaUserServiceImpl implements ITeaUserService {
e.printStackTrace();
}
}
}
Loading…
Cancel
Save