fuliqi
2024-10-29 a0877d9c0e2cf8678c025ecd88a5045d6e581e56
试卷标题不能为空
5个文件已修改
22 ■■■■ 已修改文件
src/docker/Dockerfile 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ycl/jxkg/service/impl/ExamPaperServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-prod.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/docker/Dockerfile
@@ -10,10 +10,10 @@
COPY simsun.ttc /usr/share/fonts/
# easyExcel字体
RUN apk add fontconfig && apk add --update ttf-dejavu && fc-cache --force
# 同步docker内部的时间
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 设置时区
ENV TZ=Asia/Shanghai
# 同步docker内部的时间
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 8000
# 复制jar包到/user/local/java下
ARG JAR_FILE
src/main/java/com/ycl/jxkg/service/impl/ExamPaperServiceImpl.java
@@ -46,6 +46,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
@@ -74,9 +75,12 @@
        examPaper.setScore(new BigDecimal(form.getScore()));
        //随机试卷
        if (ExamPaperTypeEnum.Random.getCode().equals(form.getPaperType())) {
            //校验题目数量
            //校验标题是否填写、校验题目数量
            List<PaperQuestionSettingDTO> questionSetting = form.getQuestionSetting();
            for (PaperQuestionSettingDTO settingDTO : questionSetting) {
                if(StringUtils.isEmpty(settingDTO.getTitle())){
                    return Result.fail(SystemCode.InnerError.getCode(),"标题不能为空");
                }
                Integer questionType = settingDTO.getQuestionType();
                for (PaperSettingItem item : settingDTO.getSettingList()) {
                    Integer num = item.getNum();
@@ -100,6 +104,12 @@
            return Result.ok();
        } else if (ExamPaperTypeEnum.Fixed.getCode().equals(form.getPaperType())) {
            //固定试卷
            List<PaperFixQuestionDTO> questionTitleList = form.getQuestionTitleList();
            for (PaperFixQuestionDTO dto : questionTitleList) {
                if(StringUtils.isEmpty(dto.getTitle())){
                    return Result.fail(SystemCode.InnerError.getCode(),"标题不能为空");
                }
            }
            examPaper.setContent(JSON.toJSONString(form.getQuestionTitleList()));
            baseMapper.insert(examPaper);
            return Result.ok();
@@ -116,6 +126,9 @@
                List<PaperSettingItem> settingList = settingDTO.getSettingList();
                List<PaperQuestion> questionList = new ArrayList<>();
                for (PaperSettingItem item : settingList) {
                    if(StringUtils.isEmpty(settingDTO.getTitle())){
                        return Result.fail(SystemCode.InnerError.getCode(),"标题不能为空");
                    }
                    Integer num = item.getNum();
                    Integer difficult = item.getDifficult();
                    //需要配置的题目数量为0则跳过
src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
@@ -382,7 +382,6 @@
                doQuestionVO.setQuestionType(item.getQuestionType());
                //增加题目分数
                doQuestionVO.setQuestionScore(question.getScore());
                // 题目副本
                QuestionAnswerCopyVO copy = new QuestionAnswerCopyVO();
                copy.setId(question.getId());
src/main/resources/application-dev.yml
@@ -8,6 +8,7 @@
spring:
  config:
    # 教学资源访问路径
    url: http://localhost:8000
  datasource:
    url: jdbc:mysql://42.193.1.25:3306/xzs?useSSL=true&useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
src/main/resources/application-prod.yml
@@ -7,6 +7,7 @@
spring:
  config:
    # 教学资源访问路径
    url: http://25.30.6.246:8000
  datasource:
    driver-class-name: dm.jdbc.driver.DmDriver