|
@@ -29,6 +29,7 @@ import com.qmth.distributed.print.business.entity.TRExamStudent;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
import com.qmth.teachcloud.common.entity.SysConfig;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
@@ -36,6 +37,7 @@ import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.enums.FieldUniqueEnum;
|
|
|
import com.qmth.teachcloud.common.enums.ImportTemplateEnum;
|
|
|
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
|
|
|
+import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
@@ -96,13 +98,15 @@ public class TRBasicInfoController {
|
|
|
|
|
|
@Resource
|
|
|
TCUsualScoreService tcUsualScoreService;
|
|
|
+ @Resource
|
|
|
+ BasicCourseService basicCourseService;
|
|
|
|
|
|
@ApiOperation(value = "报告管理列表")
|
|
|
@RequestMapping(value = "/report/list", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ScoreResult.class)})
|
|
|
public Result reportList(@ApiParam(value = "学期ID", required = true) @RequestParam(required = false) Long semesterId,
|
|
|
@ApiParam(value = "考试ID", required = true) @RequestParam(required = false) Long examId,
|
|
|
- @ApiParam(value = "课程编码") @RequestParam(required = false) String courseCode,
|
|
|
+ @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
|
|
|
@ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
@ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
if (semesterId == null) {
|
|
@@ -111,7 +115,7 @@ public class TRBasicInfoController {
|
|
|
if (examId == null) {
|
|
|
throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
|
|
|
}
|
|
|
- return ResultUtil.ok(printCommonService.scoreList(new Page<>(pageNumber, pageSize), examId, courseCode));
|
|
|
+ return ResultUtil.ok(printCommonService.scoreList(new Page<>(pageNumber, pageSize), examId, courseId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查看报告")
|
|
@@ -119,14 +123,14 @@ public class TRBasicInfoController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = ReportResult.class)})
|
|
|
@Transactional
|
|
|
public Result reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
- @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
|
+ @ApiParam(value = "课程ID", required = true) @RequestParam Long courseId,
|
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
@ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseId, paperNumber, teachCourseId);
|
|
|
|
|
|
CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseId, paperNumber, teachCourseId);
|
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
|
}.getType());
|
|
@@ -135,19 +139,19 @@ public class TRBasicInfoController {
|
|
|
Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
|
Objects.requireNonNull(c.getTotalScore(), "[" + c.getCourseTargetName() + "]未设置目标分值");
|
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
|
- trBasicInfoService.clearReportData(examId, courseCode, paperNumber, teachCourseId, false);
|
|
|
+ trBasicInfoService.clearReportData(examId, courseId, paperNumber, teachCourseId, false);
|
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]包含的小题总分与权重设置不一致,请到期末成绩--试卷蓝图设置里调整");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MarkPaper markPaper = printCommonService.getMarkPaper(examId, courseCode, tcPaperStruct.getPaperNumber());
|
|
|
+ MarkPaper markPaper = printCommonService.getMarkPaper(examId, courseId, tcPaperStruct.getPaperNumber());
|
|
|
if (Objects.isNull(trBasicInfo)) {
|
|
|
trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(), courseWeightResult, teachCourseId);
|
|
|
} else {
|
|
|
ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = Objects.nonNull(trBasicInfo.getCourseEvaluationResult()) ? JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class) : null;
|
|
|
if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
|
|
|
- trBasicInfoService.clearReportData(examId, courseCode, paperNumber, teachCourseId, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
|
|
|
+ trBasicInfoService.clearReportData(examId, courseId, paperNumber, teachCourseId, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
|
|
|
trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(), courseWeightResult, teachCourseId);
|
|
|
} else {
|
|
|
ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
@@ -161,7 +165,8 @@ public class TRBasicInfoController {
|
|
|
}
|
|
|
reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentList);
|
|
|
}
|
|
|
- trBasicInfo.setReportResult(new ReportResult(new ReportCommonDto(examId, courseCode, markPaper.getCourseName(), paperNumber), reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto, reportCourseEvaluationResultDetailDto));
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(courseId);
|
|
|
+ trBasicInfo.setReportResult(new ReportResult(new ReportCommonDto(examId, courseId, basicCourse.getCode(), basicCourse.getName(), paperNumber), reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto, reportCourseEvaluationResultDetailDto));
|
|
|
}
|
|
|
}
|
|
|
trBasicInfo.updateInfo(sysUser.getId());
|
|
@@ -182,11 +187,11 @@ public class TRBasicInfoController {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
TRBasicInfo trBasicInfoDb = null;
|
|
|
try {
|
|
|
- trBasicInfoDb = trBasicInfoService.queryBasicInfo(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), trBasicInfo.getPaperNumber(), trBasicInfo.getTeachCourseId());
|
|
|
+ trBasicInfoDb = trBasicInfoService.queryBasicInfo(trBasicInfo.getExamId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber(), trBasicInfo.getTeachCourseId());
|
|
|
if (Objects.isNull(trBasicInfoDb)) {
|
|
|
trBasicInfoDb = new TRBasicInfo(trBasicInfo, sysUser.getId());
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), trBasicInfo.getPaperNumber(), trBasicInfo.getTeachCourseId());
|
|
|
- MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber());
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getExamId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber(), trBasicInfo.getTeachCourseId());
|
|
|
+ MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), trBasicInfo.getCourseId(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber());
|
|
|
trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(trBasicInfo.getTeachCourseId()), trBasicInfo.getTeachCourseId());
|
|
|
} else {
|
|
|
trBasicInfoDb.updateInfo(trBasicInfo, sysUser.getId());
|
|
@@ -212,7 +217,7 @@ public class TRBasicInfoController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
|
public void reportExport(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
- @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
|
+ @ApiParam(value = "课程ID", required = true) @RequestParam Long courseId,
|
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
@ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
|
|
|
File txtFileTemp = null, fileTemp = null;
|
|
@@ -220,13 +225,13 @@ public class TRBasicInfoController {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseId, paperNumber, teachCourseId);
|
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "没有课程目标信息");
|
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
|
|
|
|
|
|
CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(teachCourseId);
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseId, paperNumber, teachCourseId);
|
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
|
}.getType());
|
|
@@ -235,7 +240,7 @@ public class TRBasicInfoController {
|
|
|
Objects.requireNonNull(c.getTotalWeight(), "[" + c.getCourseTargetName() + "]未设置权重");
|
|
|
Objects.requireNonNull(c.getTotalScore(), "[" + c.getCourseTargetName() + "]未设置目标分值");
|
|
|
if (new BigDecimal(score).compareTo(c.getTotalWeight()) == 1) {
|
|
|
- trBasicInfoService.clearReportData(examId, courseCode, paperNumber, teachCourseId, false);
|
|
|
+ trBasicInfoService.clearReportData(examId, courseId, paperNumber, teachCourseId, false);
|
|
|
throw ExceptionResultEnum.ERROR.exception("[" + c.getCourseTargetName() + "]包含的小题总分与权重设置不一致,请到期末成绩--试卷蓝图设置里调整");
|
|
|
}
|
|
|
}
|
|
@@ -243,9 +248,9 @@ public class TRBasicInfoController {
|
|
|
|
|
|
ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
|
|
|
if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != courseWeightResult.getWeightSettingSign().longValue()) {
|
|
|
- trBasicInfoService.clearReportData(examId, courseCode, paperNumber, teachCourseId, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
|
|
|
- this.reportView(examId, courseCode, paperNumber, teachCourseId);
|
|
|
- this.reportExport(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ trBasicInfoService.clearReportData(examId, courseId, paperNumber, teachCourseId, Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign()) && tcPaperStruct.getDimensionSign().longValue() != courseWeightResult.getDimensionSign().longValue() ? true : false);
|
|
|
+ this.reportView(examId, courseId, paperNumber, teachCourseId);
|
|
|
+ this.reportExport(examId, courseId, paperNumber, teachCourseId);
|
|
|
} else {
|
|
|
//评价样本的基本信息
|
|
|
String period = Objects.nonNull(trBasicInfo.getPeriod()) ? trBasicInfo.getPeriod() : null;
|
|
@@ -260,13 +265,17 @@ public class TRBasicInfoController {
|
|
|
courseTarget.add(" ").add(s.getTargetName()).add("——").add(s.getGraduationRequirementPoint()).add("\r\n");
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- CourseBasicBean courseBasicBean = new CourseBasicBean(trBasicInfo.getCourseName(),
|
|
|
- trBasicInfo.getCourseCode(), null, trBasicInfo.getCourseType(),
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(trBasicInfo.getCourseId());
|
|
|
+ if(basicCourse == null){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("课程不存在");
|
|
|
+ }
|
|
|
+ CourseBasicBean courseBasicBean = new CourseBasicBean(basicCourse.getName(),
|
|
|
+ basicCourse.getCode(), null, trBasicInfo.getCourseType(),
|
|
|
period, null, null, trBasicInfo.getDirector(),
|
|
|
DateUtil.format(new Date(trBasicInfo.getCreateTime()), SystemConstant.DEFAULT_DATE_PATTERN),
|
|
|
courseTarget.toString(), reportCourseEvaluationResultDto.getTargetList().size());
|
|
|
|
|
|
- CourseReportBean courseReportBean = new CourseReportBean(trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》", courseBasicBean);
|
|
|
+ CourseReportBean courseReportBean = new CourseReportBean(trBasicInfo.getOpenTime() + "《" + basicCourse.getName() + "》", courseBasicBean);
|
|
|
//table1-课程目标目标与毕业要求指标点的对应关系
|
|
|
courseReportBean.setCourseTargetTable1(trBasicInfoService.buildWordTable1(courseTargetWordDtoList));
|
|
|
|
|
@@ -321,12 +330,12 @@ public class TRBasicInfoController {
|
|
|
@RequestMapping(value = "/report/change", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
|
public Result reportDataChange(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
|
- @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
|
+ @ApiParam(value = "课程ID", required = true) @RequestParam Long courseId,
|
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
@ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report,
|
|
|
- @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) throws IOException {
|
|
|
+ @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) {
|
|
|
ReportChangeResult reportChangeResult = new ReportChangeResult();
|
|
|
- List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(examId, courseId, paperNumber, teachCourseId);
|
|
|
if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
|
|
|
Set<String> usualScoreCourseSet = new LinkedHashSet<>();
|
|
|
TCUsualScore tcUsualScore = tcUsualScoreList.get(0);
|
|
@@ -356,7 +365,7 @@ public class TRBasicInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(examId, courseId, paperNumber, teachCourseId);
|
|
|
if (Objects.nonNull(trBasicInfo) && Objects.nonNull(trBasicInfo.getCourseEvaluationResultDetail())) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResultDetail());
|
|
|
List<CourseTargetWordDto> courseTargetWordDtoList = JSONArray.parseArray(jsonObject.get("targetWordMap").toString(), CourseTargetWordDto.class);
|
|
@@ -371,7 +380,7 @@ public class TRBasicInfoController {
|
|
|
}
|
|
|
|
|
|
if (!report) {
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseCode, paperNumber, teachCourseId);
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(examId, courseId, paperNumber, teachCourseId);
|
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
|
}.getType());
|
|
@@ -390,7 +399,7 @@ public class TRBasicInfoController {
|
|
|
}
|
|
|
}
|
|
|
if (reportChangeResult.isTargetScoreChange()) {
|
|
|
- trBasicInfoService.clearReportData(examId, courseCode, paperNumber, teachCourseId, false);
|
|
|
+ trBasicInfoService.clearReportData(examId, courseId, paperNumber, teachCourseId, false);
|
|
|
reportChangeResult.setTargetScoreChangeStr(stringJoiner.toString());
|
|
|
}
|
|
|
}
|