|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
|
|
+import com.google.common.collect.ImmutableSet;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
@@ -12,6 +13,7 @@ import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.core.rateLimit.annotation.RateLimit;
|
|
import com.qmth.boot.core.rateLimit.annotation.RateLimit;
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
|
|
|
|
+import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
@@ -22,6 +24,7 @@ import com.qmth.teachcloud.common.enums.FieldUniqueEnum;
|
|
import com.qmth.teachcloud.common.enums.ImportTemplateEnum;
|
|
import com.qmth.teachcloud.common.enums.ImportTemplateEnum;
|
|
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
|
|
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
|
+import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
import com.qmth.teachcloud.common.service.FileUploadService;
|
|
import com.qmth.teachcloud.common.util.*;
|
|
import com.qmth.teachcloud.common.util.*;
|
|
@@ -116,6 +119,9 @@ public class TRBasicInfoController {
|
|
@Resource
|
|
@Resource
|
|
RedisUtil redisUtil;
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ BasicRoleDataPermissionService basicRoleDataPermissionService;
|
|
|
|
+
|
|
@ApiOperation(value = "报告管理列表")
|
|
@ApiOperation(value = "报告管理列表")
|
|
@RequestMapping(value = "/report/list", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/report/list", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ObeScoreResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ObeScoreResult.class)})
|
|
@@ -134,78 +140,82 @@ public class TRBasicInfoController {
|
|
@Transactional
|
|
@Transactional
|
|
public Result reportView(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
public Result reportView(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
- @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber) {
|
|
|
|
|
|
+ @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
|
+ @ApiParam(value = "考试id") @RequestParam(required = false) Long examId) {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
BasicCourse basicCourse = basicCourseService.getById(courseId);
|
|
BasicCourse basicCourse = basicCourseService.getById(courseId);
|
|
-
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
|
+// dpr.setOrgIdSet(ImmutableSet.of(1L));
|
|
|
|
+ Long createId = CollectionUtils.isEmpty(dpr.getOrgIdSet()) ? sysUser.getId() : -1L;
|
|
|
|
+ List<TRBasicInfo> trBasicInfoList = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber, examId, createId);
|
|
ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId,
|
|
ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId,
|
|
courseId);
|
|
courseId);
|
|
|
|
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
- log.info("ObeCourseWeightResult:{}", JacksonUtil.parseJson(obeCourseWeightResult));
|
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
|
|
if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
|
|
throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
|
|
throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
|
|
}
|
|
}
|
|
- MarkPaper markPaper = printCommonService.getMarkPaper(null, tcPaperStruct.getPaperNumber(), courseId);
|
|
|
|
- if (Objects.isNull(trBasicInfo)) {
|
|
|
|
- trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(),
|
|
|
|
- obeCourseWeightResult, cultureProgramId, courseId);
|
|
|
|
|
|
+ MarkPaper markPaper = printCommonService.getMarkPaper(examId, tcPaperStruct.getPaperNumber(), courseId);
|
|
|
|
+ if (CollectionUtils.isEmpty(trBasicInfoList)) {
|
|
|
|
+ trBasicInfoList = trBasicInfoService.getReportView(markPaper, createId, obeCourseWeightResult, cultureProgramId, courseId, examId, paperNumber);
|
|
} else {
|
|
} else {
|
|
- ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = Objects.nonNull(trBasicInfo.getCourseEvaluationResult()) ?
|
|
|
|
- JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class) :
|
|
|
|
- null;
|
|
|
|
- if (Objects.nonNull(reportCourseEvaluationResultDto)
|
|
|
|
- && Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign())
|
|
|
|
- && Objects.nonNull(obeCourseWeightResult)
|
|
|
|
- && Objects.nonNull(obeCourseWeightResult.getWeightSettingSign())
|
|
|
|
- && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != obeCourseWeightResult.getWeightSettingSign().longValue()) {
|
|
|
|
- trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber,
|
|
|
|
- Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
|
|
- && tcPaperStruct.getDimensionSign().longValue()
|
|
|
|
- != obeCourseWeightResult.getDimensionSign().longValue());
|
|
|
|
- trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(),
|
|
|
|
- obeCourseWeightResult, cultureProgramId, courseId);
|
|
|
|
- } else {
|
|
|
|
- ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
|
|
- ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = Objects.nonNull(trBasicInfo.getCourseEvaluationSpread()) ?
|
|
|
|
- JSONObject.parseObject(trBasicInfo.getCourseEvaluationSpread(), ReportCourseEvaluationSpreadDto.class) :
|
|
|
|
|
|
+ for (TRBasicInfo trBasicInfo : trBasicInfoList) {
|
|
|
|
+ ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = Objects.nonNull(trBasicInfo.getCourseEvaluationResult()) ?
|
|
|
|
+ JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class) :
|
|
null;
|
|
null;
|
|
- ReportCourseEvaluationResultDetailDto reportCourseEvaluationResultDetailDto = null;
|
|
|
|
- List<TRExamStudent> trExamStudentList = trExamStudentService.list(
|
|
|
|
- new QueryWrapper<TRExamStudent>().lambda().eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()));
|
|
|
|
- LinkedMultiValueMap<Long, Map<String, String>> finalScatterYMap = null;
|
|
|
|
- if (!CollectionUtils.isEmpty(trExamStudentList)) {
|
|
|
|
- Map<Long, ConcurrentMap<String, String>> scatterYMap = new LinkedHashMap<>();
|
|
|
|
- List<ReportExamStudentDto> examStudentList = new ArrayList<>(trExamStudentList.size());
|
|
|
|
- for (TRExamStudent trExamStudent : trExamStudentList) {
|
|
|
|
- if (!Objects.equals(trExamStudent.getName(), "各课程目标平均分")
|
|
|
|
- && !Objects.equals(trExamStudent.getName(), "平均分")
|
|
|
|
- && !Objects.equals(trExamStudent.getName(), "目标分")) {
|
|
|
|
- List<ReportExamStudentTargetDto> reportExamStudentTargetDtoList = JSONArray.parseArray(trExamStudent.getResultDetail(), ReportExamStudentTargetDto.class);
|
|
|
|
- for (ReportExamStudentTargetDto reportExamStudentTargetDto : reportExamStudentTargetDtoList) {
|
|
|
|
- if (Objects.nonNull(reportExamStudentTargetDto) && Objects.nonNull(reportExamStudentTargetDto.getMatrixDegree())) {
|
|
|
|
- trBasicInfoService.getScatterValue(scatterYMap, trExamStudent.getStudentCode(), reportExamStudentTargetDto);
|
|
|
|
|
|
+ if (Objects.nonNull(reportCourseEvaluationResultDto)
|
|
|
|
+ && Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign())
|
|
|
|
+ && Objects.nonNull(obeCourseWeightResult)
|
|
|
|
+ && Objects.nonNull(obeCourseWeightResult.getWeightSettingSign())
|
|
|
|
+ && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != obeCourseWeightResult.getWeightSettingSign().longValue()) {
|
|
|
|
+ trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId,
|
|
|
|
+ Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
|
|
+ && tcPaperStruct.getDimensionSign().longValue()
|
|
|
|
+ != obeCourseWeightResult.getDimensionSign().longValue());
|
|
|
|
+ trBasicInfoList = trBasicInfoService.getReportView(markPaper, createId, obeCourseWeightResult, cultureProgramId, courseId, examId, paperNumber);
|
|
|
|
+ } else {
|
|
|
|
+ ReportCourseBasicInfoDto reportCourseBasicInfoDto = new ReportCourseBasicInfoDto(trBasicInfo);
|
|
|
|
+ ReportCourseEvaluationSpreadDto reportCourseEvaluationSpreadDto = Objects.nonNull(trBasicInfo.getCourseEvaluationSpread()) ?
|
|
|
|
+ JSONObject.parseObject(trBasicInfo.getCourseEvaluationSpread(), ReportCourseEvaluationSpreadDto.class) :
|
|
|
|
+ null;
|
|
|
|
+ ReportCourseEvaluationResultDetailDto reportCourseEvaluationResultDetailDto = null;
|
|
|
|
+ List<TRExamStudent> trExamStudentList = trExamStudentService.list(
|
|
|
|
+ new QueryWrapper<TRExamStudent>().lambda().eq(TRExamStudent::getrBasicInfoId, trBasicInfo.getId()));
|
|
|
|
+ LinkedMultiValueMap<Long, Map<String, String>> finalScatterYMap = null;
|
|
|
|
+ if (!CollectionUtils.isEmpty(trExamStudentList)) {
|
|
|
|
+ Map<Long, ConcurrentMap<String, String>> scatterYMap = new LinkedHashMap<>();
|
|
|
|
+ List<ReportExamStudentDto> examStudentList = new ArrayList<>(trExamStudentList.size());
|
|
|
|
+ for (TRExamStudent trExamStudent : trExamStudentList) {
|
|
|
|
+ if (!Objects.equals(trExamStudent.getName(), "各课程目标平均分")
|
|
|
|
+ && !Objects.equals(trExamStudent.getName(), "平均分")
|
|
|
|
+ && !Objects.equals(trExamStudent.getName(), "目标分")) {
|
|
|
|
+ List<ReportExamStudentTargetDto> reportExamStudentTargetDtoList = JSONArray.parseArray(trExamStudent.getResultDetail(), ReportExamStudentTargetDto.class);
|
|
|
|
+ for (ReportExamStudentTargetDto reportExamStudentTargetDto : reportExamStudentTargetDtoList) {
|
|
|
|
+ if (Objects.nonNull(reportExamStudentTargetDto) && Objects.nonNull(reportExamStudentTargetDto.getMatrixDegree())) {
|
|
|
|
+ trBasicInfoService.getScatterValue(scatterYMap, trExamStudent.getStudentCode(), reportExamStudentTargetDto);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ examStudentList.add(new ReportExamStudentDto(trExamStudent));
|
|
}
|
|
}
|
|
- examStudentList.add(new ReportExamStudentDto(trExamStudent));
|
|
|
|
- }
|
|
|
|
- if (scatterYMap.size() > 0) {
|
|
|
|
- finalScatterYMap = trBasicInfoService.getFinalScatterValue(scatterYMap);
|
|
|
|
|
|
+ if (scatterYMap.size() > 0) {
|
|
|
|
+ finalScatterYMap = trBasicInfoService.getFinalScatterValue(scatterYMap);
|
|
|
|
+ }
|
|
|
|
+ reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentList);
|
|
}
|
|
}
|
|
- reportCourseEvaluationResultDetailDto = new ReportCourseEvaluationResultDetailDto(examStudentList);
|
|
|
|
|
|
+ trBasicInfo.setReportResult(new ReportResult(new ReportCommonDto(null, basicCourse.getCode(), markPaper.getCourseName(), paperNumber),
|
|
|
|
+ reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto,
|
|
|
|
+ reportCourseEvaluationResultDetailDto, trBasicInfo, finalScatterYMap));
|
|
|
|
+ trBasicInfo.updateInfo(sysUser.getId());
|
|
}
|
|
}
|
|
- trBasicInfo.setReportResult(new ReportResult(new ReportCommonDto(null, basicCourse.getCode(), markPaper.getCourseName(), paperNumber),
|
|
|
|
- reportCourseBasicInfoDto, reportCourseEvaluationSpreadDto, reportCourseEvaluationResultDto,
|
|
|
|
- reportCourseEvaluationResultDetailDto, trBasicInfo, finalScatterYMap));
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- trBasicInfo.updateInfo(sysUser.getId());
|
|
|
|
//课程目标达成评价明细结果-课程目标达成评价值图
|
|
//课程目标达成评价明细结果-课程目标达成评价值图
|
|
- trBasicInfoService.saveOrUpdate(trBasicInfo);
|
|
|
|
- return ResultUtil.ok(trBasicInfo.getReportResult());
|
|
|
|
|
|
+ trBasicInfoService.saveOrUpdateBatch(trBasicInfoList);
|
|
|
|
+ List<ReportResult> reportResultList = new ArrayList<>(trBasicInfoList.size());
|
|
|
|
+ trBasicInfoList.stream().peek(s -> reportResultList.add(s.getReportResult())).collect(Collectors.toList());
|
|
|
|
+ return ResultUtil.ok(reportResultList);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "报告重新计算")
|
|
@ApiOperation(value = "报告重新计算")
|
|
@@ -215,39 +225,39 @@ public class TRBasicInfoController {
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
public Result reportAgainCalculate(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
public Result reportAgainCalculate(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
- @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber) {
|
|
|
|
|
|
+ @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
|
+ @ApiParam(value = "考试id") @RequestParam(required = false) Long examId) {
|
|
String lockKey = SystemConstant.REDIS_COURSE_DEGREE_DATA_PREFIX + cultureProgramId + "_" + courseId;
|
|
String lockKey = SystemConstant.REDIS_COURSE_DEGREE_DATA_PREFIX + cultureProgramId + "_" + courseId;
|
|
boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_COURSE_DEGREE_DATA_TIME_OUT);
|
|
boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_COURSE_DEGREE_DATA_TIME_OUT);
|
|
if (!lock) {
|
|
if (!lock) {
|
|
throw ExceptionResultEnum.ERROR.exception("正在重新计算数据,请稍候再试!");
|
|
throw ExceptionResultEnum.ERROR.exception("正在重新计算数据,请稍候再试!");
|
|
}
|
|
}
|
|
- TRBasicInfo trBasicInfoAgainCalculate = null;
|
|
|
|
|
|
+ List<TRBasicInfo> trBasicInfoAgainCalculateList = null;
|
|
try {
|
|
try {
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
- ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId,
|
|
|
|
- courseId);
|
|
|
|
-
|
|
|
|
|
|
+ DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
|
+// dpr.setOrgIdSet(ImmutableSet.of(1L));
|
|
|
|
+ Long createId = CollectionUtils.isEmpty(dpr.getOrgIdSet()) ? sysUser.getId() : -1L;
|
|
|
|
+ ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
- log.info("ObeCourseWeightResult:{}", JacksonUtil.parseJson(obeCourseWeightResult));
|
|
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
|
|
if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
|
|
throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
|
|
throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
|
|
}
|
|
}
|
|
- MarkPaper markPaper = printCommonService.getMarkPaper(null, tcPaperStruct.getPaperNumber(), courseId);
|
|
|
|
-
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
|
|
|
|
- trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber,
|
|
|
|
|
|
+ MarkPaper markPaper = printCommonService.getMarkPaper(examId, tcPaperStruct.getPaperNumber(), courseId);
|
|
|
|
+ List<TRBasicInfo> trBasicInfoList = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, Objects.nonNull(paperNumber) ? paperNumber : markPaper.getPaperNumber(), Objects.nonNull(examId) ? examId : markPaper.getExamId(), createId);
|
|
|
|
+ trBasicInfoService.clearReportData(cultureProgramId, courseId, Objects.nonNull(paperNumber) ? paperNumber : markPaper.getPaperNumber(), Objects.nonNull(examId) ? examId : markPaper.getExamId(),
|
|
Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
|
|
|
|
- trBasicInfoAgainCalculate = trBasicInfoService.getReportView(null, markPaper, sysUser.getId(),
|
|
|
|
- obeCourseWeightResult, cultureProgramId, courseId);
|
|
|
|
- if (Objects.nonNull(trBasicInfo)) {
|
|
|
|
- trBasicInfoAgainCalculate.setCalculate(trBasicInfo);
|
|
|
|
|
|
+ trBasicInfoAgainCalculateList = trBasicInfoService.getReportView(markPaper, createId,
|
|
|
|
+ obeCourseWeightResult, cultureProgramId, courseId, Objects.nonNull(examId) ? examId : markPaper.getExamId(), Objects.nonNull(paperNumber) ? paperNumber : markPaper.getPaperNumber());
|
|
|
|
+ if (!CollectionUtils.isEmpty(trBasicInfoList) && !CollectionUtils.isEmpty(trBasicInfoAgainCalculateList)) {
|
|
|
|
+ trBasicInfoAgainCalculateList.stream().peek(s -> s.setCalculate(trBasicInfoList.get(0))).collect(Collectors.toList());
|
|
}
|
|
}
|
|
//课程目标达成评价明细结果-课程目标达成评价值图
|
|
//课程目标达成评价明细结果-课程目标达成评价值图
|
|
- trBasicInfoService.save(trBasicInfoAgainCalculate);
|
|
|
|
|
|
+ trBasicInfoService.saveOrUpdateBatch(trBasicInfoAgainCalculateList);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
if (e instanceof ApiException) {
|
|
if (e instanceof ApiException) {
|
|
@@ -258,7 +268,13 @@ public class TRBasicInfoController {
|
|
} finally {
|
|
} finally {
|
|
redisUtil.releaseLock(lockKey);
|
|
redisUtil.releaseLock(lockKey);
|
|
}
|
|
}
|
|
- return ResultUtil.ok(Objects.nonNull(trBasicInfoAgainCalculate) ? trBasicInfoAgainCalculate.getReportResult() : trBasicInfoAgainCalculate);
|
|
|
|
|
|
+ List<ReportResult> reportResultList = null;
|
|
|
|
+ if (!CollectionUtils.isEmpty(trBasicInfoAgainCalculateList)) {
|
|
|
|
+ reportResultList = new ArrayList<>(trBasicInfoAgainCalculateList.size());
|
|
|
|
+ List<ReportResult> finalReportResultList = reportResultList;
|
|
|
|
+ trBasicInfoAgainCalculateList.stream().peek(s -> finalReportResultList.add(s.getReportResult())).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return ResultUtil.ok(reportResultList);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "保存报告")
|
|
@ApiOperation(value = "保存报告")
|
|
@@ -270,21 +286,19 @@ public class TRBasicInfoController {
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
}
|
|
}
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
- TRBasicInfo trBasicInfoDb = null;
|
|
|
|
try {
|
|
try {
|
|
- trBasicInfoDb = trBasicInfoService.queryBasicInfo(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber());
|
|
|
|
- ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
|
|
|
|
|
|
+ TRBasicInfo trBasicInfoDb = trBasicInfoService.getById(trBasicInfo.getId());
|
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+ Objects.requireNonNull(trBasicInfoDb, "没有报告信息");
|
|
|
|
+ ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(trBasicInfoDb.getCultureProgramId(), trBasicInfoDb.getCourseId());
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber());
|
|
|
|
- MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber(), trBasicInfo.getCourseId());
|
|
|
|
- if (Objects.isNull(trBasicInfoDb)) {
|
|
|
|
- trBasicInfoDb = new TRBasicInfo(trBasicInfo, sysUser.getId());
|
|
|
|
- trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), obeCourseWeightResult, trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
|
|
|
|
- } else {
|
|
|
|
|
|
+ MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfoDb.getExamId(), trBasicInfoDb.getPaperNumber(), trBasicInfoDb.getCourseId());
|
|
|
|
+ List<TRBasicInfo> trBasicInfoList = trBasicInfoService.queryBasicInfo(trBasicInfoDb.getCultureProgramId(), trBasicInfoDb.getCourseId(), trBasicInfoDb.getPaperNumber(), trBasicInfoDb.getExamId(), null);
|
|
|
|
+ for (TRBasicInfo t : trBasicInfoList) {
|
|
ReportCourseBasicInfoDto reportCourseBasicInfoDto = trBasicInfoService.setBasicInfo(trBasicInfo, obeCourseOutline, markPaper, obeCourseWeightResult);
|
|
ReportCourseBasicInfoDto reportCourseBasicInfoDto = trBasicInfoService.setBasicInfo(trBasicInfo, obeCourseOutline, markPaper, obeCourseWeightResult);
|
|
- trBasicInfoDb.updateInfo(trBasicInfo, reportCourseBasicInfoDto, sysUser.getId());
|
|
|
|
|
|
+ t.updateInfo(trBasicInfo, reportCourseBasicInfoDto, sysUser.getId());
|
|
}
|
|
}
|
|
|
|
+ trBasicInfoService.saveOrUpdateBatch(trBasicInfoList);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
if (e instanceof DuplicateKeyException) {
|
|
if (e instanceof DuplicateKeyException) {
|
|
@@ -297,7 +311,7 @@ public class TRBasicInfoController {
|
|
ResultUtil.error(e.getMessage());
|
|
ResultUtil.error(e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return ResultUtil.ok(trBasicInfoService.saveOrUpdate(trBasicInfoDb));
|
|
|
|
|
|
+ return ResultUtil.ok(true);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出报告")
|
|
@ApiOperation(value = "导出报告")
|
|
@@ -305,22 +319,20 @@ public class TRBasicInfoController {
|
|
@OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
|
|
@OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
- public void reportExport(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
|
|
- @ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
|
|
- @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber) {
|
|
|
|
|
|
+ public void reportExport(@ApiParam(value = "报告id", required = true) @RequestParam Long id) {
|
|
File txtFileTemp = null, fileTemp = null;
|
|
File txtFileTemp = null, fileTemp = null;
|
|
try {
|
|
try {
|
|
- Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
- ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
|
|
|
|
- BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
|
-
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ TRBasicInfo trBasicInfo = trBasicInfoService.getById(id);
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "未设置课程目标,报告生成失败,请在课程大纲管理菜单设置课程目标");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "未设置课程目标,报告生成失败,请在课程大纲管理菜单设置课程目标");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
|
|
|
|
|
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
+ ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
|
|
|
|
+ BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
|
+
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber(), trBasicInfo.getExamId());
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
}.getType());
|
|
}.getType());
|
|
@@ -339,24 +351,25 @@ public class TRBasicInfoController {
|
|
|
|
|
|
ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
|
|
ReportCourseEvaluationResultDto reportCourseEvaluationResultDto = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResult(), ReportCourseEvaluationResultDto.class);
|
|
if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != obeCourseWeightResult.getWeightSettingSign().longValue()) {
|
|
if (Objects.nonNull(reportCourseEvaluationResultDto.getWeightSettingSign()) && reportCourseEvaluationResultDto.getWeightSettingSign().longValue() != obeCourseWeightResult.getWeightSettingSign().longValue()) {
|
|
- trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber,
|
|
|
|
|
|
+ trBasicInfoService.clearReportData(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber(), trBasicInfo.getExamId(),
|
|
Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getDimensionSign())
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
&& tcPaperStruct.getDimensionSign().longValue()
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
!= obeCourseWeightResult.getDimensionSign().longValue());
|
|
- this.reportView(cultureProgramId, courseId, paperNumber);
|
|
|
|
- this.reportExport(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ this.reportView(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber(), trBasicInfo.getExamId());
|
|
|
|
+ this.reportExport(trBasicInfo.getId());
|
|
} else {
|
|
} else {
|
|
XWPFTemplate template = null;
|
|
XWPFTemplate template = null;
|
|
String fileName = null;
|
|
String fileName = null;
|
|
InputStream inputStream = null;
|
|
InputStream inputStream = null;
|
|
txtFileTemp = SystemConstant.getFileTempVar(SystemConstant.WORD_PREFIX);
|
|
txtFileTemp = SystemConstant.getFileTempVar(SystemConstant.WORD_PREFIX);
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_COURSE_DEGREE_TEMPLATE);
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_COURSE_DEGREE_TEMPLATE);
|
|
|
|
+ String teachClassName = Objects.nonNull(trBasicInfo.getTeachClassName()) ? trBasicInfo.getTeachClassName() : "ALL";
|
|
if (Objects.isNull(sysConfig)) {
|
|
if (Objects.isNull(sysConfig)) {
|
|
inputStream = FileUtil.getStream("static/" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getTemplateName());
|
|
inputStream = FileUtil.getStream("static/" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getTemplateName());
|
|
FileUtils.copyInputStreamToFile(inputStream, txtFileTemp);
|
|
FileUtils.copyInputStreamToFile(inputStream, txtFileTemp);
|
|
CourseReportBean courseReportBean = trBasicInfoService.buildCommonCourseDegreeReport(trBasicInfo);
|
|
CourseReportBean courseReportBean = trBasicInfoService.buildCommonCourseDegreeReport(trBasicInfo);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(courseReportBean);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(courseReportBean);
|
|
- fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + SystemConstant.WORD_PREFIX : courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + SystemConstant.WORD_PREFIX;
|
|
|
|
|
|
+ fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + SystemConstant.WORD_PREFIX : courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + SystemConstant.WORD_PREFIX;
|
|
} else {
|
|
} else {
|
|
fileTemp = SystemConstant.getFileTempVar(SystemConstant.WORD_PREFIX);
|
|
fileTemp = SystemConstant.getFileTempVar(SystemConstant.WORD_PREFIX);
|
|
fileTemp = fileUploadService.downloadFile(Long.parseLong(sysConfig.getConfigValue()), fileTemp.getPath());
|
|
fileTemp = fileUploadService.downloadFile(Long.parseLong(sysConfig.getConfigValue()), fileTemp.getPath());
|
|
@@ -371,11 +384,11 @@ public class TRBasicInfoController {
|
|
if (Objects.nonNull(text) && text.contains("xagyuCourseBasicBean")) {
|
|
if (Objects.nonNull(text) && text.contains("xagyuCourseBasicBean")) {
|
|
XagyuCourseReportBean xagyuCourseReportBean = trBasicInfoService.buildXagyuCourseDegreeReport(trBasicInfo);
|
|
XagyuCourseReportBean xagyuCourseReportBean = trBasicInfoService.buildXagyuCourseDegreeReport(trBasicInfo);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(xagyuCourseReportBean);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(xagyuCourseReportBean);
|
|
- fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + xagyuCourseReportBean.getXagyuTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_定制" + SystemConstant.WORD_PREFIX : xagyuCourseReportBean.getXagyuTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_定制" + SystemConstant.WORD_PREFIX;
|
|
|
|
|
|
+ fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + xagyuCourseReportBean.getXagyuTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + "_定制" + SystemConstant.WORD_PREFIX : xagyuCourseReportBean.getXagyuTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + "_定制" + SystemConstant.WORD_PREFIX;
|
|
} else {
|
|
} else {
|
|
CourseReportBean courseReportBean = trBasicInfoService.buildCommonCourseDegreeReport(trBasicInfo);
|
|
CourseReportBean courseReportBean = trBasicInfoService.buildCommonCourseDegreeReport(trBasicInfo);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(courseReportBean);
|
|
template = XWPFTemplate.compile(txtFileTemp.getAbsolutePath()).render(courseReportBean);
|
|
- fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + SystemConstant.WORD_PREFIX : courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + SystemConstant.WORD_PREFIX;
|
|
|
|
|
|
+ fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + SystemConstant.WORD_PREFIX : courseReportBean.getTitle1() + "_" + ImportTemplateEnum.STATIC_COURSE_DEGREE_REPORT.getFileName() + "_" + teachClassName + SystemConstant.WORD_PREFIX;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
@@ -408,16 +421,15 @@ public class TRBasicInfoController {
|
|
public Result reportDataChange(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
public Result reportDataChange(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
@ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
@ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
|
|
|
|
+ @ApiParam(value = "考试id") @RequestParam(required = false) Long examId,
|
|
@ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report) {
|
|
@ApiParam(value = "true:报告,false:成绩管理", required = true) @RequestParam boolean report) {
|
|
ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
|
|
ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
|
|
ReportChangeResult reportChangeResult = new ReportChangeResult();
|
|
ReportChangeResult reportChangeResult = new ReportChangeResult();
|
|
- List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ List<TCUsualScore> tcUsualScoreList = tcUsualScoreService.queryUsualScore(cultureProgramId, courseId, paperNumber, examId, null);
|
|
if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
|
|
if (CollectionUtils.isNotEmpty(tcUsualScoreList)) {
|
|
Set<String> usualScoreCourseSet = new LinkedHashSet<>();
|
|
Set<String> usualScoreCourseSet = new LinkedHashSet<>();
|
|
TCUsualScore tcUsualScore = tcUsualScoreList.get(0);
|
|
TCUsualScore tcUsualScore = tcUsualScoreList.get(0);
|
|
List<TCUsualScoreDto> tcUsualScoreDtoList = JSONArray.parseArray(tcUsualScore.getScore(), TCUsualScoreDto.class);
|
|
List<TCUsualScoreDto> tcUsualScoreDtoList = JSONArray.parseArray(tcUsualScore.getScore(), TCUsualScoreDto.class);
|
|
- List<String> usualScoreList = tcUsualScoreDtoList.stream().map(s -> s.getName()).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
List<CourseWeightDto> courseWeightDtoList = trBasicInfoService.findCourseWeightDtoRmi(obeCourseOutline.getId());
|
|
List<CourseWeightDto> courseWeightDtoList = trBasicInfoService.findCourseWeightDtoRmi(obeCourseOutline.getId());
|
|
List<String> courseTargetList = new ArrayList<>(courseWeightDtoList.size());
|
|
List<String> courseTargetList = new ArrayList<>(courseWeightDtoList.size());
|
|
if (CollectionUtils.isNotEmpty(courseWeightDtoList)) {
|
|
if (CollectionUtils.isNotEmpty(courseWeightDtoList)) {
|
|
@@ -432,16 +444,20 @@ public class TRBasicInfoController {
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(usualScoreList) && CollectionUtils.isNotEmpty(usualScoreCourseSet)) {
|
|
|
|
- List<String> usualScoreCourseList = new ArrayList<>(usualScoreCourseSet);
|
|
|
|
- Collections.sort(usualScoreList);
|
|
|
|
- Collections.sort(usualScoreCourseList);
|
|
|
|
- if (!CollectionUtils.isEqualCollection(usualScoreList, usualScoreCourseList)) {
|
|
|
|
- reportChangeResult.setEvaluationChange(true);
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(tcUsualScoreDtoList)) {
|
|
|
|
+ List<String> usualScoreList = tcUsualScoreDtoList.stream().map(s -> s.getName()).collect(Collectors.toList());
|
|
|
|
+ if (CollectionUtils.isNotEmpty(usualScoreList) && CollectionUtils.isNotEmpty(usualScoreCourseSet)) {
|
|
|
|
+ List<String> usualScoreCourseList = new ArrayList<>(usualScoreCourseSet);
|
|
|
|
+ Collections.sort(usualScoreList);
|
|
|
|
+ Collections.sort(usualScoreCourseList);
|
|
|
|
+ if (!CollectionUtils.isEqualCollection(usualScoreList, usualScoreCourseList)) {
|
|
|
|
+ reportChangeResult.setEvaluationChange(true);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ List<TRBasicInfo> trBasicInfoList = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber, examId, null);
|
|
|
|
+ TRBasicInfo trBasicInfo = CollectionUtils.isNotEmpty(trBasicInfoList) ? trBasicInfoList.get(0) : null;
|
|
if (Objects.nonNull(trBasicInfo) && Objects.nonNull(trBasicInfo.getCourseEvaluationResultDetail())) {
|
|
if (Objects.nonNull(trBasicInfo) && Objects.nonNull(trBasicInfo.getCourseEvaluationResultDetail())) {
|
|
JSONObject jsonObject = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResultDetail());
|
|
JSONObject jsonObject = JSONObject.parseObject(trBasicInfo.getCourseEvaluationResultDetail());
|
|
List<CourseTargetWordDto> courseTargetWordDtoList = JSONArray.parseArray(jsonObject.get("targetWordMap").toString(), CourseTargetWordDto.class);
|
|
List<CourseTargetWordDto> courseTargetWordDtoList = JSONArray.parseArray(jsonObject.get("targetWordMap").toString(), CourseTargetWordDto.class);
|
|
@@ -457,7 +473,7 @@ public class TRBasicInfoController {
|
|
}
|
|
}
|
|
|
|
|
|
if (!report) {
|
|
if (!report) {
|
|
- TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
if (Objects.nonNull(tcPaperStruct) && Objects.nonNull(tcPaperStruct.getPaperStructDimension())) {
|
|
// List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
// List<PaperStructDimensionResult> paperStructDimensionResultList = GsonUtil.fromJson(tcPaperStruct.getPaperStructDimension(), new TypeToken<List<PaperStructDimensionResult>>() {
|
|
// }.getType());
|
|
// }.getType());
|
|
@@ -469,7 +485,7 @@ public class TRBasicInfoController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (reportChangeResult.isTargetScoreChange()) {
|
|
if (reportChangeResult.isTargetScoreChange()) {
|
|
- trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, false);
|
|
|
|
|
|
+ trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId, false);
|
|
reportChangeResult.setTargetScoreChangeStr(stringJoiner.toString());
|
|
reportChangeResult.setTargetScoreChangeStr(stringJoiner.toString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -483,10 +499,8 @@ public class TRBasicInfoController {
|
|
@OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
|
|
@OperationLogDetail(operationType = OperationTypeEnum.EXPORT)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
@Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
|
|
- public void reportUsualscoreExport(@ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId,
|
|
|
|
- @ApiParam(value = "课程id", required = true) @RequestParam Long courseId,
|
|
|
|
- @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber) {
|
|
|
|
- TRBasicInfo trBasicInfo = trBasicInfoService.queryBasicInfo(cultureProgramId, courseId, paperNumber);
|
|
|
|
|
|
+ public void reportUsualscoreExport(@ApiParam(value = "报告id", required = true) @RequestParam Long id) {
|
|
|
|
+ TRBasicInfo trBasicInfo = trBasicInfoService.getById(id);
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
Objects.requireNonNull(trBasicInfo, "没有报告信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "没有课程目标信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResult(), "没有课程目标信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
|
|
Objects.requireNonNull(trBasicInfo.getCourseEvaluationResultDetail(), "没有课程考生信息");
|
|
@@ -558,7 +572,8 @@ public class TRBasicInfoController {
|
|
|
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
- String fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》_平时成绩" : trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》_平时成绩";
|
|
|
|
|
|
+ String teachClassName = Objects.nonNull(trBasicInfo.getTeachClassName()) ? trBasicInfo.getTeachClassName() : "ALL";
|
|
|
|
+ String fileName = Objects.nonNull(basicSchool) ? basicSchool.getName() + "_" + trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》_" + teachClassName + "_平时成绩" : trBasicInfo.getOpenTime() + "《" + trBasicInfo.getCourseName() + "》_" + teachClassName + "_平时成绩";
|
|
|
|
|
|
//姓名
|
|
//姓名
|
|
this.drawExcelFixedHead(rowOne, headerStyle, sheet, "姓名", 0, 2, 3, 0, 0, sheet.getColumnWidth(0) * 17 / 10);
|
|
this.drawExcelFixedHead(rowOne, headerStyle, sheet, "姓名", 0, 2, 3, 0, 0, sheet.getColumnWidth(0) * 17 / 10);
|