wangliang il y a 1 an
Parent
commit
bce501d26d

+ 5 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCPaperStructServiceImpl.java

@@ -74,11 +74,9 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
     @Override
     @Transactional
     public Boolean remove(Long examId, String courseCode, String paperNumber) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         return tcPaperStructService.remove(new QueryWrapper<TCPaperStruct>().lambda().eq(TCPaperStruct::getExamId, examId)
                 .eq(TCPaperStruct::getCourseCode, courseCode)
-                .eq(TCPaperStruct::getPaperNumber, paperNumber)
-                .eq(TCPaperStruct::getCreateId, sysUser.getId()));
+                .eq(TCPaperStruct::getPaperNumber, paperNumber));
     }
 
     /**
@@ -218,13 +216,17 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
                     tcPaperStruct.setPaperStructDimension(JacksonUtil.parseJson(paperStructDimensionResultList));
 
                     if (!tcPaperStruct.equals(tcPaperStructDb)) {
+                        tcFinalScoreService.remove(examId, courseCode, paperNumber);
                         trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
                     }
+                    tcPaperStruct.setPaperStruct(null);
                     tcPaperStruct.updateInfo(sysUser.getId());
                 } else {
+                    tcPaperStructService.remove(examId, courseCode, paperNumber);
                     MarkPaper markPaper = printCommonService.getMarkPaper(examId, paperNumber);
                     CourseWeightResult courseWeightResult = trBasicInfoService.findCourseWeightResultRmi(examId, courseCode);
                     tcPaperStruct = new TCPaperStruct(examId, courseCode, markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId(), courseWeightResult.getDimensionSign());
+                    tcFinalScoreService.remove(examId, courseCode, paperNumber);
                     trBasicInfoService.clearReportData(examId, courseCode, paperNumber, false);
                 }
                 tcPaperStructService.saveOrUpdate(tcPaperStruct);