Browse Source

3.3.1 新需求

xiaofei 1 year ago
parent
commit
0d3cecda2e

+ 9 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/RequiredFieldsEnum.java

@@ -11,21 +11,22 @@ import java.util.List;
  */
 public enum RequiredFieldsEnum {
 
+    STUDENT_NAME("studentName","姓名", true, true),
     STUDENT_CODE("studentCode", "学号", true, true),
-//    TICKET_NUMBER("ticketNumber", "考号", false, false),
+    //    TICKET_NUMBER("ticketNumber", "考号", false, false),
     SITE_NUMBER("siteNumber", "座位号", false, false),
-    STUDENT_NAME("studentName","姓名", true, true),
-    COURSE_CODE("courseCode","课程代码", true, true),
     COURSE_NAME("courseName","课程名称", true, true),
+    COURSE_CODE("courseCode","课程代码", true, true),
     PAPER_NUMBER("paperNumber","试卷编号", true, true),
-    EXAM_PLACE("examPlace","校区", true, true),
-    EXAM_ROOM("examRoom","考试教室", true, true),
     EXAM_DATE("examDate","考试日期", true, true),
     EXAM_TIME("examTime","考试时间", true, true),
-    COLLEGE_NAME("collegeName","学院", false, false),
+    EXAM_PLACE("examPlace","校区(考点)", true, true),
+    EXAM_ROOM("examRoom","考试教室(考场)", true, true),
+    COLLEGE_NAME("collegeName","学院", true, true),
     MAJOR_NAME("majorName","专业", false, false),
-    CLAZZ_NAME("clazzName","班级", true, true),;
-
+    TEACH_CLAZZ_NAME("teachClazzName","教学班", true, true),
+    CLAZZ_NAME("clazzName","行政班", false, false),
+    TEACHER_NAME("teachName","任课老师", true, true);
 
     private final String code;
     private final String name;

+ 21 - 15
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamRuleServiceImpl.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.distributed.print.business.bean.examRule.CodeName;
+import com.qmth.distributed.print.business.bean.examRule.CodeNameEnableDisabled;
 import com.qmth.distributed.print.business.bean.examRule.FieldsDto;
 import com.qmth.distributed.print.business.entity.BasicExamRule;
 import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
@@ -60,10 +62,11 @@ public class BasicExamRuleServiceImpl extends ServiceImpl<BasicExamRuleMapper, B
             for (EnumResult enumResult : enumResultList) {
                 Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getCode().equals(t.getCode())).findFirst();
                 if (resultOptional.isPresent()) {
-                    enumResult.setEnable(resultOptional.get().getEnable());
-                } else {
-                    enumResult.setEnable(false);
+                    enumResult.setEnable(enumResult.getEnable() ? enumResult.getEnable() : resultOptional.get().getEnable());
                 }
+//                else {
+//                    enumResult.setEnable(false);
+//                }
             }
             basicExamRule.setRequiredFields(JSON.toJSONString(enumResultList));
 
@@ -74,21 +77,23 @@ public class BasicExamRuleServiceImpl extends ServiceImpl<BasicExamRuleMapper, B
             // 签到表范围
             if (StringUtils.isNotBlank(basicExamRule.getSignScope())) {
                 JSONObject signJson = JSON.parseObject(basicExamRule.getSignScope());
-                List<JSONObject> signScopeBasicFields = JSON.parseArray(signJson.getString("basic"), JSONObject.class);
-                List<JSONObject> newSignScopeBasicFields = new ArrayList<>();
-                for (JSONObject enumResult : signScopeBasicFields) {
-                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getString("code").equals(t.getCode())).findFirst();
+                List<CodeName> signScopeBasicFields = JSON.parseArray(signJson.getString("basic"), CodeName.class);
+                List<CodeName> newSignScopeBasicFields = new ArrayList<>();
+                for (CodeName enumResult : signScopeBasicFields) {
+                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getCode().equals(t.getCode())).findFirst();
                     if (resultOptional.isPresent() && resultOptional.get().getEnable()) {
+                        enumResult.setName(resultOptional.get().getName());
                         newSignScopeBasicFields.add(enumResult);
                     }
                 }
                 signJson.put("basic", newSignScopeBasicFields);
 
-                List<JSONObject> signScopeTableFields = JSON.parseArray(signJson.getString("table"), JSONObject.class);
-                List<JSONObject> newSignScopeTableFields = new ArrayList<>();
-                for (JSONObject enumResult : signScopeTableFields) {
-                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getString("code").equals(t.getCode())).findFirst();
+                List<CodeName> signScopeTableFields = JSON.parseArray(signJson.getString("table"), CodeName.class);
+                List<CodeName> newSignScopeTableFields = new ArrayList<>();
+                for (CodeName enumResult : signScopeTableFields) {
+                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getCode().equals(t.getCode())).findFirst();
                     if (resultOptional.isPresent() && resultOptional.get().getEnable()) {
+                        enumResult.setName(resultOptional.get().getName());
                         newSignScopeTableFields.add(enumResult);
                     }
                 }
@@ -99,11 +104,12 @@ public class BasicExamRuleServiceImpl extends ServiceImpl<BasicExamRuleMapper, B
             // 卷袋贴范围
             if (StringUtils.isNotBlank(basicExamRule.getPackageScope())) {
                 JSONObject packageJson = JSON.parseObject(basicExamRule.getPackageScope());
-                List<JSONObject> packageScopeFields = JSON.parseArray(packageJson.getString("basic"), JSONObject.class);
-                List<JSONObject> newPackageScopeFields = new ArrayList<>();
-                for (JSONObject enumResult : packageScopeFields) {
-                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getString("code").equals(t.getCode())).findFirst();
+                List<CodeName> packageScopeFields = JSON.parseArray(packageJson.getString("basic"), CodeName.class);
+                List<CodeName> newPackageScopeFields = new ArrayList<>();
+                for (CodeName enumResult : packageScopeFields) {
+                    Optional<EnumResult> resultOptional = requiredFields.stream().filter(t -> enumResult.getCode().equals(t.getCode())).findFirst();
                     if (resultOptional.isPresent() && resultOptional.get().getEnable()) {
+                        enumResult.setName(resultOptional.get().getName());
                         newPackageScopeFields.add(enumResult);
                     }
                 }

+ 9 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -528,8 +528,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Override
     public boolean taskCancel(Long id) {
         ExamDetail detail = this.getById(id);
-        if (!detail.getStatus().name().equals(ExamDetailStatusEnum.WAITING.name())) {
-            throw ExceptionResultEnum.ERROR.exception("印刷状态为[待印刷]的任务可撤回提交");
+        if (!detail.getStatus().equals(ExamDetailStatusEnum.WAITING)) {
+            throw ExceptionResultEnum.ERROR.exception("印刷状态为[" + ExamDetailStatusEnum.WAITING.getName() + "]的任务可撤回提交");
         }
         UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.READY).eq(ExamDetail::getId, id);
@@ -575,9 +575,15 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Transactional
     @Override
     public boolean taskBatchCancel(Map data) {
+        String type = String.valueOf(data.get("type"));
         String ids = String.valueOf(data.get("ids"));
         for (String id : ids.split(",")) {
-            taskCancel(Long.valueOf(id));
+            if ("submit".equals(type)) {
+                ExamDetail examDetail = this.getById(id);
+                submitTask(examDetail);
+            } else if ("cancel".equals(type)) {
+                taskCancel(Long.valueOf(id));
+            }
         }
         return true;
     }

+ 17 - 0
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -0,0 +1,17 @@
+-------------补考-----------
+update basic_exam t set t.category = 'MAKEUP' where t.category = 'ONLINE';
+update basic_exam t set t.category = 'FORMAL' where t.category = 'OFFLINE';
+
+ALTER TABLE `exam_print_plan` ADD COLUMN `category` VARCHAR(10) NULL COMMENT '考试类型' AFTER `org_id`;
+
+update exam_print_plan t set t.category = 'FORMAL' where t.category is null;
+
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('193', '补考任务查询', '/api/admin/exam/print/list_makeup_task', 'URL', '43', '5', 'AUTH', '1', '1', '1');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('194', '补考任务保存', '/api/admin/exam/print/save_makeup_task', 'URL', '43', '6', 'AUTH', '1', '1', '1');
+
+UPDATE `sys_privilege` SET `related` = '50,49,193,194,621' WHERE (`id` = '310');
+
+
+--------------3.3.1新需求--------------
+ALTER TABLE `mark_paper`
+    ADD COLUMN `open_double_marking` BIGINT(1) NULL DEFAULT 0 COMMENT '是否开启双评:true-开启,false-关闭' AFTER `paper_type`;

+ 13 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkPaper.java

@@ -112,11 +112,14 @@ public class MarkPaper implements Serializable {
     @ApiModelProperty(value = "是否开启分班阅")
     private Boolean openMarkClass;
 
+    @ApiModelProperty(value = "是否开启双评")
+    private Boolean openDoubleMarking;
+
     private MarkPaperStatus status;
     @ApiModelProperty(value = "命题老师ID")
     private Long userId;
 
-    @ApiModelProperty(value = "命题老师ID")
+    @ApiModelProperty(value = "试卷类型")
     private String paperType;
 
     public MarkPaper() {
@@ -140,6 +143,7 @@ public class MarkPaper implements Serializable {
         this.absentCount = 0;
         this.groupStatus = false;
         this.openMarkClass = false;
+        this.openDoubleMarking = false;
         this.status = MarkPaperStatus.FORMAL;
         this.passScore = 60D;
         this.excellentScore = 80D;
@@ -371,6 +375,14 @@ public class MarkPaper implements Serializable {
         this.openMarkClass = openMarkClass;
     }
 
+    public Boolean getOpenDoubleMarking() {
+        return openDoubleMarking;
+    }
+
+    public void setOpenDoubleMarking(Boolean openDoubleMarking) {
+        this.openDoubleMarking = openDoubleMarking;
+    }
+
     public MarkPaperStatus getStatus() {
         return status;
     }

+ 1 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java

@@ -112,6 +112,7 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
                 .set(MarkPaper::getSheetView, markPaper.getSheetView())
                 .set(MarkPaper::getShowObjectScore, markPaper.getShowObjectScore())
                 .set(MarkPaper::getAutoScroll, markPaper.getAutoScroll())
+                .set(MarkPaper::getOpenDoubleMarking, markPaper.getOpenDoubleMarking())
                 .set(MarkPaper::getPassScore, markPaper.getPassScore())
                 .set(MarkPaper::getExcellentScore, markPaper.getExcellentScore())
                 .set(MarkPaper::getSheetConfig, markPaper.getSheetConfig())