whb 8 months ago
commit 1b6e200356

@ -33,5 +33,6 @@ public class Constant {
public static final String THEORY = "理论考试模块"; public static final String THEORY = "理论考试模块";
public static final String RESOURCE = "资源中心模块"; public static final String RESOURCE = "资源中心模块";
public static final String API_URL = "http://120.79.54.255:8889"; public static final String API_URL = "http://120.79.54.255:8889";
// public static final String API_URL = "http://192.168.2.11:8889";
} }

@ -240,9 +240,9 @@ public class ExerciseExperimentalTraining {
} catch (IOException e) { } catch (IOException e) {
return false; return false;
} }
if (resourceDataList != null) { if(resourceDataList.size()>0){
return true; return true;
} else { }else {
return false; return false;
} }
} }

@ -110,11 +110,8 @@ public class StuIndexController {
@PostMapping("getIndexResourceCenter") @PostMapping("getIndexResourceCenter")
public ResultEntity<Map<String, Integer>> getIndexResourceCenter(@RequestParam String schoolId, @RequestParam String systemOwner) { public ResultEntity<Map<String, Integer>> getIndexResourceCenter(@RequestParam String schoolId, @RequestParam String systemOwner) {
Map<String, Integer> resourceTypeCount = null; Map<String, Integer> resourceTypeCount = null;
try { resourceTypeCount = ResourceCenterApi.getResourceTypeCount(schoolId, systemOwner);
resourceTypeCount = ResourceCenterApi.getResourceTypeCount(schoolId, systemOwner); // return new ResultEntity(HttpStatus.BAD_REQUEST, "资源中心获取资源数量异常");
} catch (IOException e) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "资源中心获取资源数量异常");
}
return new ResultEntity<>(resourceTypeCount); return new ResultEntity<>(resourceTypeCount);
} }

@ -6,7 +6,6 @@ import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.resource_entity.SysThreeCatalog; import com.sztzjy.financial_bigdata.entity.resource_entity.SysThreeCatalog;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTrainingDto; import com.sztzjy.financial_bigdata.entity.stu_dto.StuTrainingDto;
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper; import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
import com.sztzjy.financial_bigdata.mapper.SysCourseChapterMapper;
import com.sztzjy.financial_bigdata.mapper.SysWeightMapper; import com.sztzjy.financial_bigdata.mapper.SysWeightMapper;
import com.sztzjy.financial_bigdata.mapper.TrainingReportMapper; import com.sztzjy.financial_bigdata.mapper.TrainingReportMapper;
import com.sztzjy.financial_bigdata.resourceCenterAPI.CourseAPI; import com.sztzjy.financial_bigdata.resourceCenterAPI.CourseAPI;
@ -91,9 +90,10 @@ public class StuScoreController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("实验报告展示") @ApiOperation("实验报告展示")
@PostMapping("getReportByUserId") @PostMapping("getReportByUserId")
public ResultEntity<List<TrainingReport>> getReportByUserId(@RequestParam String userId) { public ResultEntity<List<TrainingReport>> getReportByUserId(@RequestParam String userId,
@RequestParam String systemOwner) {
TrainingReportExample trainingReportExample = new TrainingReportExample(); TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andUserIdEqualTo(userId); trainingReportExample.createCriteria().andUserIdEqualTo(userId).andSystemOwnerEqualTo(systemOwner);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
return new ResultEntity<>(trainingReports); return new ResultEntity<>(trainingReports);
} }
@ -107,7 +107,8 @@ public class StuScoreController {
@RequestParam String trainingId, @RequestParam String trainingId,
@ApiParam("章节ID") @RequestParam String chapterId, @ApiParam("章节ID") @RequestParam String chapterId,
@ApiParam("章节名称") @RequestParam String chapterName, @ApiParam("章节名称") @RequestParam String chapterName,
@RequestParam String schoolId) { @RequestParam String schoolId,
@RequestParam String systemOwner) {
int size = (int) file.getSize() / (1024 * 1024); //拿到MB为单位的大小 int size = (int) file.getSize() / (1024 * 1024); //拿到MB为单位的大小
String originalFilename = file.getOriginalFilename(); String originalFilename = file.getOriginalFilename();
assert originalFilename != null; assert originalFilename != null;
@ -117,7 +118,7 @@ public class StuScoreController {
} }
//老师评分后不允许上传 //老师评分后不允许上传
TrainingReportExample example = new TrainingReportExample(); TrainingReportExample example = new TrainingReportExample();
example.createCriteria().andSchoolIdEqualTo(schoolId).andUserIdEqualTo(userId).andChapterIdEqualTo(chapterId); example.createCriteria().andSchoolIdEqualTo(schoolId).andUserIdEqualTo(userId).andChapterIdEqualTo(chapterId).andSystemOwnerEqualTo(systemOwner);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(example); List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(example);
if (!trainingReports.isEmpty()) { //上传过 if (!trainingReports.isEmpty()) { //上传过
TrainingReport trainingReport = trainingReports.get(0); TrainingReport trainingReport = trainingReports.get(0);
@ -145,6 +146,7 @@ public class StuScoreController {
trainingReport.setUserId(userId); trainingReport.setUserId(userId);
trainingReport.setSchoolId(schoolId); trainingReport.setSchoolId(schoolId);
trainingReport.setReportSize(size); trainingReport.setReportSize(size);
trainingReport.setSystemOwner(systemOwner);
StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(trainingId); StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(trainingId);
stuTrainingWithBLOBs.setReportId(trainingReport.getReportId()); // 第一次上传时设置实训表的报告ID stuTrainingWithBLOBs.setReportId(trainingReport.getReportId()); // 第一次上传时设置实训表的报告ID
trainingReportMapper.insert(trainingReport); trainingReportMapper.insert(trainingReport);

@ -4,12 +4,14 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess; import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.*; import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.resource_entity.SysObjectiveQuestions;
import com.sztzjy.financial_bigdata.entity.resource_entity.dto.SysObjectiveQuestionsDto; import com.sztzjy.financial_bigdata.entity.resource_entity.dto.SysObjectiveQuestionsDto;
import com.sztzjy.financial_bigdata.entity.tea_dto.TeaExamManageCountDto; 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.TeaExamManageDto;
import com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto; import com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto;
import com.sztzjy.financial_bigdata.mapper.*; import com.sztzjy.financial_bigdata.mapper.StuClassMapper;
import com.sztzjy.financial_bigdata.mapper.StuStudentExamMapper;
import com.sztzjy.financial_bigdata.mapper.TeaAndStudentExamMapper;
import com.sztzjy.financial_bigdata.mapper.TeaExamManageMapper;
import com.sztzjy.financial_bigdata.resourceCenterAPI.CaseApi; import com.sztzjy.financial_bigdata.resourceCenterAPI.CaseApi;
import com.sztzjy.financial_bigdata.resourceCenterAPI.ObjectiveApi; import com.sztzjy.financial_bigdata.resourceCenterAPI.ObjectiveApi;
import com.sztzjy.financial_bigdata.service.tea.ITeaExamManageService; import com.sztzjy.financial_bigdata.service.tea.ITeaExamManageService;
@ -70,7 +72,7 @@ public class TeaExamManageController {
@AnonymousAccess @AnonymousAccess
@PostMapping("/getAllCount") @PostMapping("/getAllCount")
@ApiOperation("***新增考试--获取题目总数量") @ApiOperation("***新增考试--获取题目总数量")
public ResultEntity<TeaExamManageCountDto> getAllCount(@RequestParam String schoolId,@RequestParam String systemOwner) { public ResultEntity<TeaExamManageCountDto> getAllCount(@RequestParam String schoolId, @RequestParam String systemOwner) {
try { try {
Integer single = ObjectiveApi.selectCountSingle(schoolId, systemOwner); Integer single = ObjectiveApi.selectCountSingle(schoolId, systemOwner);
Integer many = ObjectiveApi.selectCountMany(schoolId, systemOwner); Integer many = ObjectiveApi.selectCountMany(schoolId, systemOwner);
@ -89,7 +91,7 @@ public class TeaExamManageController {
@PostMapping("/selectObjectivityByType") @PostMapping("/selectObjectivityByType")
@ApiOperation("***新增考试--选择客观题时展示") @ApiOperation("***新增考试--选择客观题时展示")
public ResultEntity<List<SysObjectiveQuestionsDto>> selectObjectivityByType(@ApiParam("0单选 1多选 2判断") @RequestParam String type, public ResultEntity<List<SysObjectiveQuestionsDto>> selectObjectivityByType(@ApiParam("0单选 1多选 2判断") @RequestParam String type,
@RequestParam String schoolId,@RequestParam String systemOwner) { @RequestParam String schoolId, @RequestParam String systemOwner) {
List<SysObjectiveQuestionsDto> list = null; List<SysObjectiveQuestionsDto> list = null;
try { try {
list = ObjectiveApi.selectObjByType(type, schoolId, systemOwner); list = ObjectiveApi.selectObjByType(type, schoolId, systemOwner);
@ -127,11 +129,12 @@ public class TeaExamManageController {
public ResultEntity<PageInfo<TeaExamManageWithBLOBs>> selectExamList(@RequestParam Integer index, public ResultEntity<PageInfo<TeaExamManageWithBLOBs>> selectExamList(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam(required = false) @ApiParam("考试名称") String examName, @RequestParam(required = false) @ApiParam("考试名称") String examName,
@RequestParam String schoolId) { @RequestParam String schoolId,
@RequestParam String systemOwner) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
TeaExamManageExample teaExamManageExample = new TeaExamManageExample(); TeaExamManageExample teaExamManageExample = new TeaExamManageExample();
TeaExamManageExample.Criteria criteria = teaExamManageExample.createCriteria(); TeaExamManageExample.Criteria criteria = teaExamManageExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId); criteria.andSchoolIdEqualTo(schoolId).andSystemOwnerEqualTo(systemOwner);
if (StringUtils.isNotBlank(examName)) { if (StringUtils.isNotBlank(examName)) {
criteria.andExamNameEqualTo(examName); criteria.andExamNameEqualTo(examName);
} }

@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -78,9 +77,10 @@ public class TeaGradeManageController {
@ApiOperation("考试模式--页面展示(学生端实战考核复用)") @ApiOperation("考试模式--页面展示(学生端实战考核复用)")
public ResultEntity<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index, public ResultEntity<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@ApiParam("ManyAnswer为考试时间JudgeAnswer为发布人") @RequestParam String schoolId) { @ApiParam("ManyAnswer为考试时间JudgeAnswer为发布人") @RequestParam String schoolId,
@ApiParam("系统名称") @RequestParam String systemOwner) {
List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId); List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolIdAndSystemOwner(schoolId, systemOwner);
if (teaExamManages.isEmpty()) { if (teaExamManages.isEmpty()) {
return null; return null;
} }
@ -149,7 +149,7 @@ public class TeaGradeManageController {
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@RequestParam(required = false) String examManageId) { @RequestParam(required = false) String examManageId) {
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId); List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId);
if (list == null||list.isEmpty()) { if (list == null || list.isEmpty()) {
return new ResultEntity<PageInfo<TeaExamAndUserDto>>(new PageInfo<>()); return new ResultEntity<PageInfo<TeaExamAndUserDto>>(new PageInfo<>());
} }
// 先对列表按照 totalScore 进行降序排序 // 先对列表按照 totalScore 进行降序排序
@ -416,7 +416,7 @@ public class TeaGradeManageController {
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId,systemOwner)); return new ResultEntity<PageInfo<TeaTrainingInfoDTO>>(iTeaGradeManageService.getTrainingInfo(index, size, schoolId, keyWord, classId, systemOwner));
} }
@AnonymousAccess @AnonymousAccess
@ -427,7 +427,7 @@ public class TeaGradeManageController {
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord, @ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId,systemOwner); iTeaGradeManageService.exportTrainingInfo(response, schoolId, keyWord, classId, systemOwner);
} }
@AnonymousAccess @AnonymousAccess
@ -457,10 +457,11 @@ public class TeaGradeManageController {
@ApiOperation("练习模式--实训报告展示") @ApiOperation("练习模式--实训报告展示")
public ResultEntity<PageInfo<TrainingReportDto>> getReportBySchoolID(@RequestParam Integer index, public ResultEntity<PageInfo<TrainingReportDto>> getReportBySchoolID(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam String schoolId) { @RequestParam String schoolId,
@RequestParam String systemOwner) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
TrainingReportExample reportExample = new TrainingReportExample(); TrainingReportExample reportExample = new TrainingReportExample();
reportExample.createCriteria().andSchoolIdEqualTo(schoolId); reportExample.createCriteria().andSchoolIdEqualTo(schoolId).andSystemOwnerEqualTo(systemOwner);
List<TrainingReportDto> list = new AstList(); List<TrainingReportDto> list = new AstList();
List<TrainingReport> trainingReports = reportMapper.selectByExampleWithBLOBs(reportExample); List<TrainingReport> trainingReports = reportMapper.selectByExampleWithBLOBs(reportExample);
if (!trainingReports.isEmpty()) { if (!trainingReports.isEmpty()) {
@ -496,7 +497,7 @@ public class TeaGradeManageController {
@AnonymousAccess @AnonymousAccess
@PostMapping("/getChapterName") @PostMapping("/getChapterName")
@ApiOperation("***评阅-章节下拉框") @ApiOperation("***评阅-章节下拉框")
public ResultEntity<List<String>> getReportCorrect(String schoolId,String systemOwner) { public ResultEntity<List<String>> getReportCorrect(String schoolId, String systemOwner) {
List<String> list = null; List<String> list = null;
try { try {
list = CourseAPI.selectNameByCourseID(schoolId, systemOwner); list = CourseAPI.selectNameByCourseID(schoolId, systemOwner);
@ -553,7 +554,7 @@ public class TeaGradeManageController {
@ApiOperation("练习模式--成绩详情页面设置权重") @ApiOperation("练习模式--成绩详情页面设置权重")
public void updateWeightByModule(@ApiParam("所有框必须传") @RequestBody SysWeight sysWeight) { public void updateWeightByModule(@ApiParam("所有框必须传") @RequestBody SysWeight sysWeight) {
SysWeightExample sysWeightExample = new SysWeightExample(); SysWeightExample sysWeightExample = new SysWeightExample();
sysWeightExample.createCriteria().andCourseIdEqualTo(sysWeight.getCourseId()); sysWeightExample.createCriteria().andCourseIdEqualTo(sysWeight.getCourseId()).andSystemOwnerEqualTo(sysWeight.getSystemOwner());
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample); List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
if (!sysWeights.isEmpty()) {//有 update if (!sysWeights.isEmpty()) {//有 update
sysWeightMapper.updateByPrimaryKey(sysWeight); sysWeightMapper.updateByPrimaryKey(sysWeight);
@ -566,14 +567,14 @@ public class TeaGradeManageController {
@AnonymousAccess @AnonymousAccess
@PostMapping("/getModuleBySchoolId") @PostMapping("/getModuleBySchoolId")
@ApiOperation("***练习模式--权重页面下拉选择模块框") @ApiOperation("***练习模式--权重页面下拉选择模块框")
public ResultEntity<List<Map<String, String>>> getModuleBySchoolId(@RequestParam String schoolId,@RequestParam String systemOwner) { public ResultEntity<List<Map<String, String>>> getModuleBySchoolId(@RequestParam String schoolId, @RequestParam String systemOwner) {
List<Map<String,String>> list= null; List<Map<String, String>> list = null;
try { try {
List<SysTwoCatalog> twoCatalogs = CourseAPI.selectCourseList(systemOwner, schoolId); List<SysTwoCatalog> twoCatalogs = CourseAPI.selectCourseList(systemOwner, schoolId);
for (int i = 0; i < twoCatalogs.size(); i++) { for (int i = 0; i < twoCatalogs.size(); i++) {
HashMap<String, String> hashMap = new HashMap<>(); HashMap<String, String> hashMap = new HashMap<>();
SysTwoCatalog sysTwoCatalog = twoCatalogs.get(i); SysTwoCatalog sysTwoCatalog = twoCatalogs.get(i);
hashMap.put(sysTwoCatalog.getTwoId(),sysTwoCatalog.getTwoName()); hashMap.put(sysTwoCatalog.getTwoId(), sysTwoCatalog.getTwoName());
list.add(hashMap); list.add(hashMap);
} }
} catch (IOException e) { } catch (IOException e) {
@ -586,9 +587,10 @@ public class TeaGradeManageController {
@PostMapping("/getModuleByCourseId") @PostMapping("/getModuleByCourseId")
@ApiOperation("练习模式--权重回显") @ApiOperation("练习模式--权重回显")
public ResultEntity<SysWeight> getModuleByCourseId(@RequestParam String courseId, public ResultEntity<SysWeight> getModuleByCourseId(@RequestParam String courseId,
@RequestParam String schoolId) { @RequestParam String schoolId,
@RequestParam String systemOwner) {
SysWeightExample sysWeightExample = new SysWeightExample(); SysWeightExample sysWeightExample = new SysWeightExample();
sysWeightExample.createCriteria().andSchoolIdEqualTo(schoolId).andCourseIdEqualTo(courseId); sysWeightExample.createCriteria().andSchoolIdEqualTo(schoolId).andCourseIdEqualTo(courseId).andSystemOwnerEqualTo(systemOwner);
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample); List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
if (sysWeights.isEmpty()) { if (sysWeights.isEmpty()) {
//todo 是否需要设置默认权重 //todo 是否需要设置默认权重
@ -605,8 +607,9 @@ public class TeaGradeManageController {
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam String schoolId, @RequestParam String schoolId,
@RequestParam(required = false) String classId, @RequestParam(required = false) String classId,
@ApiParam("学号/姓名搜索框") @RequestParam(required = false) String keyWord) { @ApiParam("学号/姓名搜索框") @RequestParam(required = false) String keyWord,
return new ResultEntity<>(iTeaGradeManageService.getTheoryInfo(index, size, schoolId, classId, keyWord)); @RequestParam String systemOwner) {
return new ResultEntity<>(iTeaGradeManageService.getTheoryInfo(index, size, schoolId, classId, keyWord,systemOwner));
} }

@ -217,6 +217,7 @@ public class UserController {
@AnonymousAccess @AnonymousAccess
public String checkOrCreateForexSimulationUser(@RequestBody List<ZYUserInfo> zyUserInfoList, public String checkOrCreateForexSimulationUser(@RequestBody List<ZYUserInfo> zyUserInfoList,
@RequestParam String systemOwner) { @RequestParam String systemOwner) {
System.out.println(systemOwner);
List<StuUser> users = new ArrayList<>(); List<StuUser> users = new ArrayList<>();
Map<String, StuClass> map = new HashMap<>(); Map<String, StuClass> map = new HashMap<>();
for (int i = 0; i < zyUserInfoList.size(); i++) { for (int i = 0; i < zyUserInfoList.size(); i++) {

@ -87,6 +87,9 @@ public class TeaExamManageDto {
@ApiModelProperty("判断题答案(id, answer)") @ApiModelProperty("判断题答案(id, answer)")
private String judgeAnswer; private String judgeAnswer;
@ApiModelProperty("系统名称")
private String systemOwner;
@Nullable @Nullable
private MultipartFile file; private MultipartFile file;
} }

@ -58,4 +58,6 @@ public class TrainingReportDto {
@ApiModelProperty("教师评语") @ApiModelProperty("教师评语")
private String teacherComment; private String teacherComment;
@ApiModelProperty("归属系统")
private String systemOwner;
} }

@ -3,16 +3,14 @@ package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.TeaExamManage; import com.sztzjy.financial_bigdata.entity.TeaExamManage;
import com.sztzjy.financial_bigdata.entity.TeaExamManageExample; import com.sztzjy.financial_bigdata.entity.TeaExamManageExample;
import com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs; import com.sztzjy.financial_bigdata.entity.TeaExamManageWithBLOBs;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.sztzjy.financial_bigdata.entity.stu_dto.ReceiveDto; import com.sztzjy.financial_bigdata.entity.stu_dto.ReceiveDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface TeaExamManageMapper { public interface TeaExamManageMapper {
long countByExample(TeaExamManageExample example); long countByExample(TeaExamManageExample example);
@ -49,10 +47,11 @@ public interface TeaExamManageMapper {
List<TeaExamManageWithBLOBs> selectByUserId(@Param("userId") String userId); List<TeaExamManageWithBLOBs> selectByUserId(@Param("userId") String userId);
List<TeaExamManage> selectBySchoolId(@Param("schoolId")String schoolId); List<TeaExamManage> selectBySchoolIdAndSystemOwner(@Param("schoolId") String schoolId,
@Param("systemOwner") String systemOwner);
@Select("select exam_name,exam_manage_id from tea_exam_manage where school_id =#{schoolId}") @Select("select exam_name,exam_manage_id from tea_exam_manage where school_id =#{schoolId}")
List<Map<String, String>> selectNameAndIdBySchoolId(@Param("schoolId")String schoolId); List<Map<String, String>> selectNameAndIdBySchoolId(@Param("schoolId") String schoolId);
ReceiveDto getLastExamScore(@Param("userId")String userId); ReceiveDto getLastExamScore(@Param("userId") String userId);
} }

@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -88,11 +89,19 @@ public class ResourceCenterApi {
/** /**
* *
*/ */
public static Map<String,Integer> getResourceTypeCount(String schoolId ,String systemOwner) throws IOException { public static Map<String,Integer> getResourceTypeCount(String schoolId ,String systemOwner){
String requestBody="schoolId="+schoolId+"&systemOwner="+systemOwner; String requestBody="schoolId="+schoolId+"&systemOwner="+systemOwner;
JSONObject object = HttpUtils.sendPost( JSONObject object = null;
getResourceTypeCount, try {
requestBody); object = HttpUtils.sendPost(
getResourceTypeCount,
requestBody);
} catch (IOException e) {
if(object==null){
return new HashMap<>();
}
e.printStackTrace();
}
Gson gson = new GsonBuilder() Gson gson = new GsonBuilder()
.registerTypeAdapter(Date.class, new DateTypeAdapter()) .registerTypeAdapter(Date.class, new DateTypeAdapter())
.create(); .create();

@ -28,7 +28,7 @@ public interface ITeaGradeManageService {
PageInfo<StuUserDto> getReportCorrect(String schoolId, Integer index, Integer size, String module, String classId, String keyWord); PageInfo<StuUserDto> getReportCorrect(String schoolId, Integer index, Integer size, String module, String classId, String keyWord);
PageInfo<StuTheoryRecord> getTheoryInfo(Integer index, Integer size, String schoolId, String classId, String keyWord); PageInfo<StuTheoryRecord> getTheoryInfo(Integer index, Integer size, String schoolId, String classId, String keyWord,String systemOwner);
void exportTheoryExamInfo(HttpServletResponse response,String classId, String schoolId); void exportTheoryExamInfo(HttpServletResponse response,String classId, String schoolId);
} }

@ -66,6 +66,7 @@ public class TeaExamManageServiceImpl implements ITeaExamManageService {
teaAndStudentExam.setExamManageId(examManageId); teaAndStudentExam.setExamManageId(examManageId);
teaAndStudentExam.setClassId(teaExamManagedto.getClassId()); teaAndStudentExam.setClassId(teaExamManagedto.getClassId());
teaAndStudentExam.setClassName(teaExamManagedto.getClassName()); teaAndStudentExam.setClassName(teaExamManagedto.getClassName());
teaAndStudentExam.setSystemOwner(teaExamManagedto.getSystemOwner());
teaAndStudentExam.setId(IdUtil.randomUUID()); teaAndStudentExam.setId(IdUtil.randomUUID());
teaAndStudentExamMapper.insert(teaAndStudentExam); teaAndStudentExamMapper.insert(teaAndStudentExam);
teaExamManageWithBLOBs.setExamManageId(examManageId); teaExamManageWithBLOBs.setExamManageId(examManageId);

@ -51,8 +51,8 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
@Override @Override
public PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId,String systemOwner) { public PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId, String systemOwner) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId,systemOwner); List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId, systemOwner);
assert !list.isEmpty(); assert !list.isEmpty();
list.sort(new TotalScoreComparator()); list.sort(new TotalScoreComparator());
int i = 0; int i = 0;
@ -71,8 +71,8 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
* @Date 2024/3/19 * @Date 2024/3/19
*/ */
@Override @Override
public void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId,String systemOwner) { public void exportTrainingInfo(HttpServletResponse response, String schoolId, String keyWord, String classId, String systemOwner) {
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId,systemOwner); List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId, systemOwner);
//导出的表名 //导出的表名
String title = IdUtil.simpleUUID(); String title = IdUtil.simpleUUID();
//表中第一行表头字段 //表中第一行表头字段
@ -229,20 +229,20 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
} }
@Override @Override
public PageInfo<StuTheoryRecord> getTheoryInfo(Integer index, Integer size, String schoolId, String classId, String keyWord) { public PageInfo<StuTheoryRecord> getTheoryInfo(Integer index, Integer size, String schoolId, String classId, String keyWord, String systemOwner) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
List<StuTheoryRecord> list = getStuTheoryRecordPageInfo(schoolId, classId, keyWord); List<StuTheoryRecord> list = getStuTheoryRecordPageInfo(schoolId, classId, keyWord, systemOwner);
PageInfo<StuTheoryRecord> pageInfo = new PageInfo<>(list); PageInfo<StuTheoryRecord> pageInfo = new PageInfo<>(list);
return pageInfo; return pageInfo;
} }
//查询方法 //查询方法
private List<StuTheoryRecord> getStuTheoryRecordPageInfo(String schoolId, String classId, String keyWord) { private List<StuTheoryRecord> getStuTheoryRecordPageInfo(String schoolId, String classId, String keyWord, String systemOwner) {
StuTheoryRecordExample s = new StuTheoryRecordExample(); StuTheoryRecordExample s = new StuTheoryRecordExample();
StuTheoryRecordExample.Criteria criteria = s.createCriteria(); StuTheoryRecordExample.Criteria criteria = s.createCriteria();
StuTheoryRecordExample.Criteria orCriteria = s.createCriteria(); StuTheoryRecordExample.Criteria orCriteria = s.createCriteria();
criteria.andSchoolIdEqualTo(schoolId); criteria.andSchoolIdEqualTo(schoolId).andSystemOwnerEqualTo(systemOwner);
orCriteria.andSchoolIdEqualTo(schoolId); orCriteria.andSchoolIdEqualTo(schoolId).andSystemOwnerEqualTo(systemOwner);
if (StringUtils.isNotBlank(classId)) { if (StringUtils.isNotBlank(classId)) {
criteria.andClassIdEqualTo(classId); criteria.andClassIdEqualTo(classId);
orCriteria.andClassIdEqualTo(classId); orCriteria.andClassIdEqualTo(classId);
@ -288,7 +288,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
} }
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOS(String schoolId, String keyWord, String classId,String systemOwner) { private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOS(String schoolId, String keyWord, String classId, String systemOwner) {
StuUserExample userExample = new StuUserExample(); StuUserExample userExample = new StuUserExample();
StuUserExample.Criteria criteria = userExample.createCriteria(); StuUserExample.Criteria criteria = userExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4); criteria.andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4);
@ -317,7 +317,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
StuTrainingExample stuTrainingExample = new StuTrainingExample(); StuTrainingExample stuTrainingExample = new StuTrainingExample();
stuTrainingExample.createCriteria().andUserIdIn(new ArrayList<>(userIds)); stuTrainingExample.createCriteria().andUserIdIn(new ArrayList<>(userIds));
List<StuTrainingWithBLOBs> stuTrainingsWithBLOBs = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample); List<StuTrainingWithBLOBs> stuTrainingsWithBLOBs = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
if (stuTrainingsWithBLOBs.isEmpty()){ if (stuTrainingsWithBLOBs.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }
// 实训记录按用户ID分组 // 实训记录按用户ID分组

@ -541,11 +541,12 @@
where exam_manage_id = #{examManageId,jdbcType=VARCHAR} where exam_manage_id = #{examManageId,jdbcType=VARCHAR}
</update> </update>
<select id="selectBySchoolId" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> <select id="selectBySchoolIdAndSystemOwner" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tea_exam_manage from tea_exam_manage
where school_id = #{schoolId,jdbcType=VARCHAR} where school_id = #{schoolId,jdbcType=VARCHAR}
and system_owner = #{systemOwner,jdbcType=VARCHAR}
</select> </select>
<resultMap id="ReceiveDto" type="com.sztzjy.financial_bigdata.entity.stu_dto.ReceiveDto"> <resultMap id="ReceiveDto" type="com.sztzjy.financial_bigdata.entity.stu_dto.ReceiveDto">

Loading…
Cancel
Save