| | |
| | | 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; |
| | |
| | | * @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(); |
| | | examScore.setExamId(apply.getExamId().toString()); |
| | | examScore.setUserId(apply.getUserId().toString()); |
| | | examScore.setUserId(apply.getUserId()); |
| | | examScore.setApplyId(apply.getId()); |
| | | examScore.setCandidateNo(apply.getCandidateNo()); |
| | | examScore.setExamTime(new Date()); |
| | |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | return examScore; |
| | | map.put("examScore",examScore); |
| | | // 返回 |
| | | return map; |
| | | } |
| | | |
| | | |