|
@@ -1,49 +1,49 @@
|
|
|
-package com.qmth.distributed.print.business.service.impl;
|
|
|
-
|
|
|
-import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
|
-import com.qmth.boot.core.concurrent.annotation.Lockable;
|
|
|
-import com.qmth.distributed.print.business.entity.*;
|
|
|
-import com.qmth.distributed.print.business.enums.AssignModeEnum;
|
|
|
-import com.qmth.distributed.print.business.mapper.ExamTaskAssignPaperTypeMapper;
|
|
|
-import com.qmth.distributed.print.business.service.ExamDetailService;
|
|
|
-import com.qmth.distributed.print.business.service.ExamTaskAssignPaperTypeService;
|
|
|
-import com.qmth.distributed.print.business.util.CreatePdfUtil;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 服务实现类
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author xf
|
|
|
- * @since 2024-02-07
|
|
|
- */
|
|
|
-@Service
|
|
|
-public class ExamTaskAssignPaperTypeServiceImpl extends MppServiceImpl<ExamTaskAssignPaperTypeMapper, ExamTaskAssignPaperType> implements ExamTaskAssignPaperTypeService {
|
|
|
-
|
|
|
- @Resource
|
|
|
- ExamDetailService examDetailService;
|
|
|
- @Resource
|
|
|
- CreatePdfUtil createPdfUtil;
|
|
|
-
|
|
|
- @Lockable(name = "#p0.examId + '-' + #p1.paperNumber")
|
|
|
- @Override
|
|
|
- public ExamTaskAssignPaperType extractPaperType(TBTaskPdf tbTaskPdf, ExamDetailCourse examDetailCourse) {
|
|
|
- ExamDetail examDetail = examDetailService.getById(tbTaskPdf.getId());
|
|
|
- if (examDetail.getExamStartTime() == null) {
|
|
|
- examDetail.setExamStartTime(-1l);
|
|
|
- }
|
|
|
- if (examDetail.getExamEndTime() == null) {
|
|
|
- examDetail.setExamEndTime(-1l);
|
|
|
- }
|
|
|
- ExamTaskAssignPaperType examTaskAssignPaperType = this.selectByMultiId(new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime()));
|
|
|
- if (examTaskAssignPaperType == null) {
|
|
|
- String paperType = createPdfUtil.getPaperType(examDetail.getPrintPlanId(), examDetail.getExamId(), examDetailCourse.getPaperNumber());
|
|
|
- examTaskAssignPaperType = new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime(), paperType, AssignModeEnum.AUTO);
|
|
|
- this.saveOrUpdateByMultiId(examTaskAssignPaperType);
|
|
|
- }
|
|
|
- return examTaskAssignPaperType;
|
|
|
- }
|
|
|
-}
|
|
|
+package com.qmth.distributed.print.business.service.impl;
|
|
|
+
|
|
|
+import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
|
+import com.qmth.boot.core.concurrent.annotation.Lockable;
|
|
|
+import com.qmth.distributed.print.business.entity.*;
|
|
|
+import com.qmth.distributed.print.business.enums.AssignModeEnum;
|
|
|
+import com.qmth.distributed.print.business.mapper.ExamTaskAssignPaperTypeMapper;
|
|
|
+import com.qmth.distributed.print.business.service.ExamDetailService;
|
|
|
+import com.qmth.distributed.print.business.service.ExamTaskAssignPaperTypeService;
|
|
|
+import com.qmth.distributed.print.business.util.CreatePdfUtil;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author xf
|
|
|
+ * @since 2024-02-07
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ExamTaskAssignPaperTypeServiceImpl extends MppServiceImpl<ExamTaskAssignPaperTypeMapper, ExamTaskAssignPaperType> implements ExamTaskAssignPaperTypeService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ ExamDetailService examDetailService;
|
|
|
+ @Resource
|
|
|
+ CreatePdfUtil createPdfUtil;
|
|
|
+
|
|
|
+ @Lockable(name = "#p0.examId + '-' + #p1.paperNumber")
|
|
|
+ @Override
|
|
|
+ public ExamTaskAssignPaperType extractPaperType(TBTaskPdf tbTaskPdf, ExamDetailCourse examDetailCourse) {
|
|
|
+ ExamDetail examDetail = examDetailService.getById(tbTaskPdf.getId());
|
|
|
+ if (examDetail.getExamStartTime() == null) {
|
|
|
+ examDetail.setExamStartTime(-1L);
|
|
|
+ }
|
|
|
+ if (examDetail.getExamEndTime() == null) {
|
|
|
+ examDetail.setExamEndTime(-1L);
|
|
|
+ }
|
|
|
+ ExamTaskAssignPaperType examTaskAssignPaperType = this.selectByMultiId(new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime()));
|
|
|
+ if (examTaskAssignPaperType == null) {
|
|
|
+ String paperType = createPdfUtil.getPaperType(examDetail.getPrintPlanId(), examDetail.getExamId(), examDetailCourse.getPaperNumber());
|
|
|
+ examTaskAssignPaperType = new ExamTaskAssignPaperType(tbTaskPdf.getExamId(), examDetailCourse.getPaperNumber(), examDetail.getExamStartTime(), examDetail.getExamEndTime(), paperType, AssignModeEnum.AUTO);
|
|
|
+ this.saveOrUpdateByMultiId(examTaskAssignPaperType);
|
|
|
+ }
|
|
|
+ return examTaskAssignPaperType;
|
|
|
+ }
|
|
|
+}
|