智慧保安后台管理-外网项目备份
1. 同一人考试成绩生成多次 bug 修复
2. 配置文件上传临时路径,解决文件上传临时文件丢失问题
4 files modified
30 ■■■■ changed files
src/main/java/org/springblade/modules/apply/controller/ApplyController.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 4 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -1,6 +1,7 @@
package org.springblade.modules.apply.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -720,7 +721,21 @@
     * @return
     */
    @PostMapping("/updateApplyStatus")
    public ExamScore updateApplyStatus(@RequestBody ApplyVO apply) {
    public Map<String, Object> updateApplyStatus(@RequestBody ApplyVO apply) {
        Map<String, Object> map = new HashMap<>();
        // 默认第一次进来(调用)
        map.put("type",0);
        // 通过准考证号,用户id判断是否已开始考试(登录进来后页面点击)
        QueryWrapper<ExamScore> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id", apply.getUserId().toString()).eq("candidate_no", apply.getCandidateNo());
        // 查询
        List<ExamScore> examScoreList = examScoreService.list(wrapper);
        if (examScoreList.size()>0){
            map.put("type",1);
            map.put("examScore",examScoreList.get(0));
            // 直接返回
            return map;
        }
        applyService.updateApplyStatus(apply);
        //新增考试成绩,没有成绩数据,待提交答题后更新数据
        ExamScore examScore = new ExamScore();
@@ -745,7 +760,9 @@
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.dataSync(s);
        }
        return examScore;
        map.put("examScore",examScore);
        // 返回
        return map;
    }
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java
@@ -206,8 +206,6 @@
            });
            //批量新增
            baseMapper.insertBatch(list);
//            long after = System.currentTimeMillis();
//            System.out.println("时间差"+(after-before));
            //新增试卷关联信息
            return examSubjectChoicesVOS;
        }
src/main/resources/application-test.yml
@@ -13,9 +13,9 @@
    #  commandTimeout: 5000
  datasource:
    # MySql
    url: jdbc:mysql://60.220.177.113:3308/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    url: jdbc:mysql://127.0.0.1:3308/zhbaw_test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: Zhba@jc@2023
    password: 123456
    # rabbitmq 设置
#  rabbitmq:
#    host: 192.168.0.191
src/main/resources/application.yml
@@ -41,6 +41,9 @@
        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
        session-stat-enable: true
        session-stat-max-count: 10
  servlet:
    multipart:
      location: /tmp/undertow
# mybatis