|
@@ -438,12 +438,12 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
|
|
|
if (clearReport) {
|
|
|
trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId, true);
|
|
|
}
|
|
|
- List<TCFinalScore> tcFinalScoreNotEqList = tcFinalScoreService.queryFinalScoreNotEq(cultureProgramId, courseId, paperNumber, examId);
|
|
|
- if (!CollectionUtils.isEmpty(tcFinalScoreNotEqList)) {
|
|
|
+ List<TCFinalScore> tcFinalScoreNotEqList = tcFinalScoreService.queryFinalScoreNotEq(cultureProgramId, courseId, paperNumber, examId, tcFinalScoreList.get(0).getCreateId());
|
|
|
+ if (!CollectionUtils.isEmpty(tcFinalScoreNotEqList) && !CollectionUtils.isEmpty(tcFinalScoreList)) {
|
|
|
for (TCFinalScore t : tcFinalScoreNotEqList) {
|
|
|
- tcUsualScoreService.remove(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId());
|
|
|
- tcFinalScoreService.remove(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId());
|
|
|
- trBasicInfoService.clearReportData(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId(), true);
|
|
|
+ tcUsualScoreService.remove(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId(), tcFinalScoreList.get(0).getCreateId());
|
|
|
+ tcFinalScoreService.remove(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId(), tcFinalScoreList.get(0).getCreateId());
|
|
|
+ trBasicInfoService.clearReportData(t.getCultureProgramId(), t.getCourseId(), t.getPaperNumber(), t.getExamId(), true, tcFinalScoreList.get(0).getCreateId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -476,6 +476,36 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Boolean remove(Long cultureProgramId, Long courseId, String paperNumber, Long examId) {
|
|
|
+ return tcFinalScoreService.remove(this.commonQueryWrapper(cultureProgramId, courseId, paperNumber, examId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param cultureProgramId
|
|
|
+ * @param courseId
|
|
|
+ * @param paperNumber
|
|
|
+ * @param examId
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public Boolean remove(Long cultureProgramId, Long courseId, String paperNumber, Long examId, Long userId) {
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ QueryWrapper<TCFinalScore> queryWrapper = this.commonQueryWrapper(cultureProgramId, courseId, paperNumber, examId);
|
|
|
+ queryWrapper.lambda().eq(TCFinalScore::getCreateId, sysUser.getId());
|
|
|
+ return tcFinalScoreService.remove(queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 共用查询
|
|
|
+ *
|
|
|
+ * @param cultureProgramId
|
|
|
+ * @param courseId
|
|
|
+ * @param paperNumber
|
|
|
+ * @param examId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ protected QueryWrapper<TCFinalScore> commonQueryWrapper(Long cultureProgramId, Long courseId, String paperNumber, Long examId) {
|
|
|
QueryWrapper<TCFinalScore> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.lambda().eq(TCFinalScore::getCultureProgramId, cultureProgramId)
|
|
|
.eq(TCFinalScore::getCourseId, courseId);
|
|
@@ -485,7 +515,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
|
|
|
if (Objects.nonNull(examId)) {
|
|
|
queryWrapper.lambda().eq(TCFinalScore::getExamId, examId);
|
|
|
}
|
|
|
- return tcFinalScoreService.remove(queryWrapper);
|
|
|
+ return queryWrapper;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -511,13 +541,16 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
|
|
|
* @param courseId
|
|
|
* @param paperNumber
|
|
|
* @param examId
|
|
|
+ * @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<TCFinalScore> queryFinalScoreNotEq(Long cultureProgramId, Long courseId, String paperNumber, Long examId) {
|
|
|
+ public List<TCFinalScore> queryFinalScoreNotEq(Long cultureProgramId, Long courseId, String paperNumber, Long examId, Long userId) {
|
|
|
QueryWrapper<TCFinalScore> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.select(" distinct culture_program_id as cultureProgramId,course_id as courseId,exam_id as examId,paper_number as paperNumber");
|
|
|
- queryWrapper.lambda().eq(TCFinalScore::getCultureProgramId, cultureProgramId).eq(TCFinalScore::getCourseId, courseId);
|
|
|
+ queryWrapper.lambda().eq(TCFinalScore::getCultureProgramId, cultureProgramId)
|
|
|
+ .eq(TCFinalScore::getCourseId, courseId)
|
|
|
+ .eq(TCFinalScore::getCreateId, userId);
|
|
|
if (Objects.nonNull(paperNumber)) {
|
|
|
queryWrapper.lambda().and(w -> w.ne(TCFinalScore::getPaperNumber, paperNumber).or().isNull(TCFinalScore::getPaperNumber));
|
|
|
}
|