派生自 projectDept/qhighschool

EricsHu
2022-12-05 068fc7f2e81178e55fa191a13709af64b1a163f6
src/main/java/com/qxueyou/scc/exam/service/impl/ExamPaperService.java
@@ -21,7 +21,7 @@
import com.qxueyou.scc.exercise.service.IExerciseGroupService;
/**
 * 试卷管理服务层
 * 试卷管理服务层
 * 
 * @author kevin
 * @createTime 2017-11-1
@@ -41,13 +41,13 @@
      String examPaperId = null, groupId = null;
      ExerciseGroup exerciseGroup = null;
      
      //创建试卷关联题库
      //创建试卷关联题库
      exerciseGroup = new ExerciseGroup();
      exerciseGroup.setName(examPaperInfo.getExamPaperName()+"-试卷题库");
      exerciseGroup.setName(examPaperInfo.getExamPaperName()+"-试卷题库");
      exerciseGroup.setType(ExerciseGroup.TYPE_EXERCISE_EXAM_ITEM);
      groupId = exerciseGroupService.addExerciseGroup(exerciseGroup);
      
      //保存试卷
      //保存试卷
      examPaperId = UUIDUtils.generateUUID().replace("-", "");
      examPaperInfo.setExamPaperId(examPaperId);
      examPaperInfo.setPaperStatus(ExamPaperInfo.STATUS_DRAFT);
@@ -92,11 +92,11 @@
         for (ExamPaperInfo examPaperInfo : lstExamPaperInfo) {
            if(ExamPaperInfo.STATUS_DRAFT!=examPaperInfo.getPaperStatus()){
               return new Result(false, "只有草稿状态的试卷,才能发布。");
               return new Result(false, "只有草稿状态的试卷,才能发布。");
            }
            
            if(examPaperInfo.getTotalScore()<=0){
               return new Result(false, "试卷总分大于零,才能发布。");
               return new Result(false, "试卷总分大于零,才能发布。");
            }
            
            examPaperInfo.setPaperStatus(ExamPaperInfo.STATUS_PUBLISH);
@@ -104,7 +104,7 @@
            save(examPaperInfo);
         }
      }else{
         return new Result(false, "没有选择要发布的试卷。");
         return new Result(false, "没有选择要发布的试卷。");
      }
      return new Result(true);
   }
@@ -119,14 +119,14 @@
         List<ExamPaperInfo> lstExamPaperInfo = this.findByComplexHql(hql,pramMap, ExamPaperInfo.class);
         for (ExamPaperInfo examPaperInfo : lstExamPaperInfo) {
            if(ExamPaperInfo.STATUS_PUBLISH!=examPaperInfo.getPaperStatus()){
               return new Result(false, "只有发布状态的试卷,才能撤回。");
               return new Result(false, "只有发布状态的试卷,才能撤回。");
            }
            examPaperInfo.setPaperStatus(ExamPaperInfo.STATUS_DRAFT);
            TraceUtils.setUpdateTrace(examPaperInfo);
            save(examPaperInfo);
         }
      }else{
         return new Result(false, "没有选择要撤回的试卷。");
         return new Result(false, "没有选择要撤回的试卷。");
      }
      
      return new Result(true);