Quellcode durchsuchen

新增推送设置

wangliang vor 2 Jahren
Ursprung
Commit
3700a0e4eb
17 geänderte Dateien mit 123 neuen und 23 gelöschten Zeilen
  1. 0 3
      themis-admin/src/main/java/com/qmth/themis/admin/api/SysConfigController.java
  2. 6 1
      themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java
  3. 0 1
      themis-admin/src/main/java/com/qmth/themis/admin/api/TSBlackListController.java
  4. 0 3
      themis-admin/src/main/java/com/qmth/themis/admin/api/TSNotifyController.java
  5. 33 0
      themis-business/src/main/java/com/qmth/themis/business/cache/bean/ExamCacheBean.java
  6. 3 0
      themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java
  7. 2 1
      themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java
  8. 2 1
      themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java
  9. 12 0
      themis-business/src/main/java/com/qmth/themis/business/dto/request/TEExamDto.java
  10. 34 0
      themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java
  11. 2 1
      themis-business/src/main/java/com/qmth/themis/business/service/TEExamStudentService.java
  12. 2 1
      themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java
  13. 3 2
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamStudentServiceImpl.java
  14. 3 2
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java
  15. 11 4
      themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java
  16. 4 1
      themis-business/src/main/resources/mapper/TEExamStudentMapper.xml
  17. 6 2
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

+ 0 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/SysConfigController.java

@@ -83,9 +83,6 @@ public class SysConfigController {
     @Transactional
     public Result enable(@ApiParam(value = "系统参数id", required = true) @RequestParam Long id,
                          @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable) {
-        Optional.ofNullable(id).orElseThrow(() -> new BusinessException("系统参数id不能为空"));
-        Optional.ofNullable(enable).orElseThrow(() -> new BusinessException("启用/禁用不能为空"));
-
         SysConfig sysConfig = sysConfigService.getById(id);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("系统参数信息为空"));
 

+ 6 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -555,11 +555,14 @@ public class TEExamController {
     @ApiOperation(value = "推送考试数据到云阅卷")
     @ApiResponses({@ApiResponse(code = 200, message = "推送考试数据到云阅卷", response = Result.class)})
     @RequestMapping(value = "/cloud_mark/push/data", method = RequestMethod.POST)
-    public Result pushData(@ApiParam(value = "考试ID", required = true) @RequestParam String examId) {
+    public Result pushData(@ApiParam(value = "考试ID", required = true) @RequestParam String examId,
+                           @ApiParam(value = "是否推送客观分", required = true) @RequestParam Boolean objectiveScorePush,
+                           @ApiParam(value = "是否推送违纪考生", required = true) @RequestParam Boolean examStudentBreachPush) {
         TBTaskHistory tbTaskHistory = null;
         try {
             ExamCacheBean examCacheBean = teExamService.getExamCacheBean(Long.parseLong(examId));
             Optional.ofNullable(examCacheBean).orElseThrow(() -> new BusinessException(ExceptionResultEnum.EXAM_NO));
+
             InvigilateMonitorStatusEnum invigilateMonitorStatusEnum = examCacheBean.getMonitorStatus();//监考状态
             if (Objects.nonNull(invigilateMonitorStatusEnum) && !Objects
                     .equals(invigilateMonitorStatusEnum, InvigilateMonitorStatusEnum.FINISHED)) {
@@ -614,6 +617,8 @@ public class TEExamController {
             transMap.put(SystemConstant.ORG_ID, tbUser.getOrgId());
             transMap.put(SystemConstant.EXAM_ID, Long.parseLong(examId));
             transMap.put(SystemConstant.EXAM_CODE, examCacheBean.getCode());
+            transMap.put(SystemConstant.OBJECTIVE_SCORE_PUSH, objectiveScorePush);
+            transMap.put(SystemConstant.EXAM_STUDENT_BREACH_PUSH, examStudentBreachPush);
             //mq发送消息start
             MqDto mqDto = new MqDto(mqUtil.getTopic(), MqTagEnum.CLOUD_MARK_DATA_PUSH.name(),
                     transMap, MqTagEnum.CLOUD_MARK_DATA_PUSH, String.valueOf(tbTaskHistory.getId()),

+ 0 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TSBlackListController.java

@@ -83,7 +83,6 @@ public class TSBlackListController {
     @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = Result.class)})
     @Transactional
     public Result delete(@ApiParam(value = "黑名单id", required = true) @RequestParam Long id) {
-        Optional.ofNullable(id).orElseThrow(() -> new BusinessException("黑名单id不能为空"));
         tsBlackListService.removeById(id);
         themisCacheService.removeBlackListCache();
         return ResultUtil.ok(true);

+ 0 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TSNotifyController.java

@@ -85,9 +85,6 @@ public class TSNotifyController {
     @Transactional
     public Result enable(@ApiParam(value = "系统通知信息id", required = true) @RequestParam Long id,
                          @ApiParam(value = "启用/禁用", required = true) @RequestParam Boolean enable) {
-        Optional.ofNullable(id).orElseThrow(() -> new BusinessException("通知信息id不能为空"));
-        Optional.ofNullable(enable).orElseThrow(() -> new BusinessException("启用/禁用不能为空"));
-
         TSNotify tsNotify = tsNotifyService.getById(id);
         Optional.ofNullable(tsNotify).orElseThrow(() -> new BusinessException("系统通知信息为空"));
 

+ 33 - 0
themis-business/src/main/java/com/qmth/themis/business/cache/bean/ExamCacheBean.java

@@ -175,6 +175,39 @@ public class ExamCacheBean implements Serializable {
     @ApiModelProperty(value = "第三方考试id")
     private String thirdExamId;
 
+    @ApiModelProperty(value = "是否允许考生发起语音通话,0:否,1:是")
+    private Integer examStudentCallEnable;
+
+    @ApiModelProperty(value = "是否推送客观分,0:否,1:是")
+    private Integer objectiveScorePush;
+
+    @ApiModelProperty(value = "是否推送违纪考生,0:否,1:是")
+    private Integer examStudentBreachPush;
+
+    public Integer getExamStudentCallEnable() {
+        return examStudentCallEnable;
+    }
+
+    public void setExamStudentCallEnable(Integer examStudentCallEnable) {
+        this.examStudentCallEnable = examStudentCallEnable;
+    }
+
+    public Integer getObjectiveScorePush() {
+        return objectiveScorePush;
+    }
+
+    public void setObjectiveScorePush(Integer objectiveScorePush) {
+        this.objectiveScorePush = objectiveScorePush;
+    }
+
+    public Integer getExamStudentBreachPush() {
+        return examStudentBreachPush;
+    }
+
+    public void setExamStudentBreachPush(Integer examStudentBreachPush) {
+        this.examStudentBreachPush = examStudentBreachPush;
+    }
+
     public Long getScanTime() {
         return scanTime;
     }

+ 3 - 0
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -216,6 +216,9 @@ public class SystemConstant {
     public static final String WEBSOCKET_OE_PREFIX = "/ws/oe";
     public static final String WEBSOCKET_MOBILE_PREFIX = "/ws/mobile";
 
+
+    public static final String OBJECTIVE_SCORE_PUSH = "objectiveScorePush";
+    public static final String EXAM_STUDENT_BREACH_PUSH = "examStudentBreachPush";
     public static final String EXAM_ID = "examId";
 
     public static final String EXAM_CODE = "examCode";

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java

@@ -115,9 +115,10 @@ public interface TEExamStudentMapper extends CustomBaseMapper<TEExamStudent> {
      *
      * @param examId
      * @param examPaperIdSet
+     * @param examStudentBreachPush
      * @return
      */
-    public List<TEExamStudent> findExamStudentNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet);
+    public List<TEExamStudent> findExamStudentNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet, @Param("examStudentBreachPush") Boolean examStudentBreachPush);
 
     /**
      * 获取考试次数为0的考生

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -537,9 +537,10 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param examId
      * @param examPaperIdSet
      * @param many
+     * @param examStudentBreachPush
      * @return
      */
-    public List<TOeExamRecord> findExamRecordNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet, @Param("many") Boolean many);
+    public List<TOeExamRecord> findExamRecordNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet, @Param("many") Boolean many,@Param("examStudentBreachPush") Boolean examStudentBreachPush);
 
     /**
      * 修正作答记录缓存到数据库

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/request/TEExamDto.java

@@ -196,6 +196,9 @@ public class TEExamDto extends BaseEntity {
     @TableField(value = "in_process_realness_verify")
     private Integer inProcessRealnessVerify;
 
+    @ApiModelProperty(value = "是否允许考生发起语音通话,0:否,1:是")
+    private Integer examStudentCallEnable = 1;
+
     public TEExamDto() {
 
     }
@@ -268,6 +271,15 @@ public class TEExamDto extends BaseEntity {
         setUpdateId(teExam.getUpdateId());
         setUpdateTime(teExam.getUpdateTime());
         this.invigilateVerify = teExam.getInvigilateVerify();
+        this.examStudentCallEnable = teExam.getExamStudentCallEnable();
+    }
+
+    public Integer getExamStudentCallEnable() {
+        return examStudentCallEnable;
+    }
+
+    public void setExamStudentCallEnable(Integer examStudentCallEnable) {
+        this.examStudentCallEnable = examStudentCallEnable;
     }
 
     public InvigilateMonitorStatusEnum getMonitorStatus() {

+ 34 - 0
themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java

@@ -208,6 +208,15 @@ public class TEExam extends BaseEntity {
     @TableField(value = "third_exam_id", updateStrategy = FieldStrategy.IGNORED)
     private String thirdExamId;
 
+    @ApiModelProperty(value = "是否允许考生发起语音通话,0:否,1:是")
+    private Integer examStudentCallEnable = 1;
+
+    @ApiModelProperty(value = "是否推送客观分,0:否,1:是")
+    private Integer objectiveScorePush = 0;
+
+    @ApiModelProperty(value = "是否推送违纪考生,0:否,1:是")
+    private Integer examStudentBreachPush = 0;
+
     public TEExam() {
 
     }
@@ -286,6 +295,31 @@ public class TEExam extends BaseEntity {
         setUpdateTime(teExamDto.getUpdateTime());
         this.invigilateVerify = teExamDto.getInvigilateVerify();
         this.monitorStatus = teExamDto.getMonitorStatus();
+        this.examStudentCallEnable = teExamDto.getExamStudentCallEnable();
+    }
+
+    public Integer getExamStudentCallEnable() {
+        return examStudentCallEnable;
+    }
+
+    public void setExamStudentCallEnable(Integer examStudentCallEnable) {
+        this.examStudentCallEnable = examStudentCallEnable;
+    }
+
+    public Integer getObjectiveScorePush() {
+        return objectiveScorePush;
+    }
+
+    public void setObjectiveScorePush(Integer objectiveScorePush) {
+        this.objectiveScorePush = objectiveScorePush;
+    }
+
+    public Integer getExamStudentBreachPush() {
+        return examStudentBreachPush;
+    }
+
+    public void setExamStudentBreachPush(Integer examStudentBreachPush) {
+        this.examStudentBreachPush = examStudentBreachPush;
     }
 
     public String getThirdExamId() {

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TEExamStudentService.java

@@ -99,9 +99,10 @@ public interface TEExamStudentService extends IService<TEExamStudent> {
      *
      * @param examId
      * @param examPaperIdSet
+     * @param examStudentBreachPush
      * @return
      */
-    public List<TEExamStudent> findExamStudentNeedMarkAll(Long examId, Set<Long> examPaperIdSet);
+    public List<TEExamStudent> findExamStudentNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean examStudentBreachPush);
 
     /**
      * 更新学生缓存

+ 2 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -528,9 +528,10 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param examId
      * @param examPaperIdSet
      * @param many
+     * @param examStudentBreachPush
      * @return
      */
-    public List<TOeExamRecord> findExamRecordNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean many);
+    public List<TOeExamRecord> findExamRecordNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean many, Boolean examStudentBreachPush);
 
     /**
      * 修正作答记录缓存到数据库

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamStudentServiceImpl.java

@@ -197,11 +197,12 @@ public class TEExamStudentServiceImpl extends ServiceImpl<TEExamStudentMapper, T
      *
      * @param examId
      * @param examPaperIdSet
+     * @param examStudentBreachPush
      * @return
      */
     @Override
-    public List<TEExamStudent> findExamStudentNeedMarkAll(Long examId, Set<Long> examPaperIdSet) {
-        return teExamStudentMapper.findExamStudentNeedMarkAll(examId, examPaperIdSet);
+    public List<TEExamStudent> findExamStudentNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean examStudentBreachPush) {
+        return teExamStudentMapper.findExamStudentNeedMarkAll(examId, examPaperIdSet, examStudentBreachPush);
     }
 
     /**

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -1375,11 +1375,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param examId
      * @param examPaperIdSet
      * @param many
+     * @param examStudentBreachPush
      * @return
      */
     @Override
-    public List<TOeExamRecord> findExamRecordNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean many) {
-        return tOeExamRecordMapper.findExamRecordNeedMarkAll(examId, examPaperIdSet, many);
+    public List<TOeExamRecord> findExamRecordNeedMarkAll(Long examId, Set<Long> examPaperIdSet, Boolean many, Boolean examStudentBreachPush) {
+        return tOeExamRecordMapper.findExamRecordNeedMarkAll(examId, examPaperIdSet, many, examStudentBreachPush);
     }
 
     /**

+ 11 - 4
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -361,7 +361,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
             List<TOeExamRecord> tOeExamRecordList = getExamRecordOnce(map, jsonObject, examPaperIdSet);
 
             //获取多次考试记录的考试
-            List<TOeExamRecord> tOeExamRecordManyList = tOeExamRecordService.findExamRecordNeedMarkAll(examId, examPaperIdSet, true);
+            Boolean examStudentBreachPush = (Boolean) map.get(SystemConstant.EXAM_STUDENT_BREACH_PUSH);
+            List<TOeExamRecord> tOeExamRecordManyList = tOeExamRecordService.findExamRecordNeedMarkAll(examId, examPaperIdSet, true, examStudentBreachPush);
             if (!CollectionUtils.isEmpty(tOeExamRecordManyList)) {
                 Set<Long> manyExamStudentIdSet = tOeExamRecordManyList.stream().map(s -> s.getExamStudentId()).collect(Collectors.toSet());
                 jsonObject.put("examRecordManyListSize", manyExamStudentIdSet.size());
@@ -419,7 +420,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                                                   Set<Long> examPaperIdSet) {
         Long examId = (Long) map.get(SystemConstant.EXAM_ID);
         TBTaskHistory tbTaskHistory = (TBTaskHistory) map.get("tbTaskHistory");
-        List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordNeedMarkAll(examId, examPaperIdSet, false);
+        Boolean examStudentBreachPush = (Boolean) map.get(SystemConstant.EXAM_STUDENT_BREACH_PUSH);
+        List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordNeedMarkAll(examId, examPaperIdSet, false, examStudentBreachPush);
         if (!CollectionUtils.isEmpty(tOeExamRecordList)) {
             jsonObject.put("examRecordListSize", tOeExamRecordList.size());
 
@@ -459,7 +461,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                                                           Integer jsCurrentTaskSize) {
         Long examId = (Long) map.get(SystemConstant.EXAM_ID);
         TBTaskHistory tbTaskHistory = (TBTaskHistory) map.get("tbTaskHistory");
-        List<TEExamStudent> teExamStudentList = teExamStudentService.findExamStudentNeedMarkAll(examId, examPaperIdSet);
+        Boolean examStudentBreachPush = (Boolean) map.get(SystemConstant.EXAM_STUDENT_BREACH_PUSH);
+        List<TEExamStudent> teExamStudentList = teExamStudentService.findExamStudentNeedMarkAll(examId, examPaperIdSet, examStudentBreachPush);
         if (CollectionUtils.isEmpty(teExamStudentList)) {
             throw new BusinessException("没有待阅卷的考生");
         }
@@ -497,6 +500,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                                       Long cloudMarkExamId) throws IOException {
         Long orgId = Long.parseLong(String.valueOf(map.get(SystemConstant.ORG_ID)));
         TBTaskHistory tbTaskHistory = (TBTaskHistory) map.get("tbTaskHistory");
+        Boolean objectiveScorePush = (Boolean) map.get(SystemConstant.OBJECTIVE_SCORE_PUSH);
+
         BigDecimal progress = new BigDecimal(0);
         BigDecimal b = new BigDecimal(100);
         TBOrg tbOrg = themisCacheService.addOrgCache(orgId);
@@ -545,7 +550,9 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                                 courseCode,
                                 t.getCourseName()));
 
-                        cloudMarkUtil.callStudentObjectiveScoreApi(new StudentObjectiveScoreParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), tOeExamRecord.getObjectiveScore()));
+                        if (Objects.nonNull(objectiveScorePush) && objectiveScorePush) {
+                            cloudMarkUtil.callStudentObjectiveScoreApi(new StudentObjectiveScoreParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), tOeExamRecord.getObjectiveScore()));
+                        }
 
                         OpenRecordNeedMarkBean openRecordNeedMarkBean = GsonUtil.fromJson(GsonUtil.toJson(tOeExamRecord), OpenRecordNeedMarkBean.class);
                         List<OpenRecordAnswerTempBean> answersTemp = examAnswerService.findByExamRecordId(tOeExamRecord.getId());

+ 4 - 1
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -497,7 +497,10 @@
           and (toer.status = 'FINISHED' or toer.status = 'PERSISTED')
           and toer.first_start_time is not null
           and toer.finish_time is not null
-          and (toer.breach_status is null or toer.breach_status = 1) order by tees.id
+          <if test="examStudentBreachPush != null and (examStudentBreachPush == false or examStudentBreachPush == 0)">
+              and (toer.breach_status is null or toer.breach_status = 1)
+          </if>
+            order by tees.id
             <!--limit 510-->
         </where>
     </select>

+ 6 - 2
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -1779,7 +1779,9 @@
                               and (toer.status = 'FINISHED' or toer.status = 'PERSISTED')
                               and toer.first_start_time is not null
                               and toer.finish_time is not null
-                              and (toer.breach_status is null or toer.breach_status = 1)
+                              <if test="examStudentBreachPush != null and (examStudentBreachPush == false or examStudentBreachPush == 0)">
+                                and (toer.breach_status is null or toer.breach_status = 1)
+                              </if>
                               and t.exam_student_id = tees.id
                         </where>)
                 group by
@@ -1800,7 +1802,9 @@
                 where (t1.status = 'FINISHED' or t1.status = 'PERSISTED')
                 and t1.first_start_time is not null
                 and t1.finish_time is not null
-                and (t1.breach_status is null or t1.breach_status = 1)
+                <if test="examStudentBreachPush != null and (examStudentBreachPush == false or examStudentBreachPush == 0)">
+                    and (t1.breach_status is null or t1.breach_status = 1)
+                </if>
                 <!--<if test="many != null and many != '' or many == 0">
                     <choose>
                         <when test="many == true">