小么熊🐻 před 2 roky
rodič
revize
72022aa87f

+ 27 - 5
nbjk-admin/src/main/java/com/miaxis/app/controller/score/ScoreInfoController.java

@@ -7,8 +7,6 @@ import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.common.enums.BusinessTypeEnum;
 import com.miaxis.common.utils.SecurityUtils;
-import com.miaxis.common.utils.poi.ExcelUtil;
-import com.miaxis.question.domain.QuestionCollection;
 import com.miaxis.score.domain.ScoreInfo;
 import com.miaxis.score.dto.ScoreInfoAllDTO;
 import com.miaxis.score.dto.ScoreInfoDTO;
@@ -16,13 +14,10 @@ import com.miaxis.score.service.IScoreInfoService;
 import io.swagger.annotations.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 【模拟考成绩】Controller
@@ -75,6 +70,33 @@ public class ScoreInfoController extends BaseController{
     @PostMapping
     @ApiOperation("新增模拟考成绩")
     public Response<Integer> add(@RequestBody ScoreInfoDTO scoreInfoDTO){
+
+
+        //线上数据出错的转换
+        if("1".equals(scoreInfoDTO.getType())){
+            scoreInfoDTO.setType("小车");
+        } else if ("2".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setType("客车");
+        } else if ("3".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setType("货车");
+        } else if ("4".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setType("摩托车");
+        } else  {
+            scoreInfoDTO.setType("三力测试");
+        }
+        //线上数据出错的转换
+        if("科目一".equals(scoreInfoDTO.getKskm())){
+            scoreInfoDTO.setKskm("1");
+        } else if ("2".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setKskm("2");
+        } else if ("3".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setKskm("3");
+        } else if ("4".equals(scoreInfoDTO.getType())) {
+            scoreInfoDTO.setKskm("4");
+        } else  {
+            scoreInfoDTO.setKskm("1");
+        }
+
         ScoreInfo scoreInfo = new ScoreInfo();
         BeanUtils.copyProperties(scoreInfoDTO,scoreInfo);
         scoreInfo.setUserId(SecurityUtils.getLoginUser().getStudent().getId());

+ 1 - 1
nbjk-service/src/main/java/com/miaxis/exam/service/IExamInfoService.java

@@ -19,7 +19,7 @@ public interface IExamInfoService extends IService<ExamInfo>{
      * @param examInfo 考场信息
      * @return 考场信息集合
      */
-    public List<ExamInfo> selectExamInfoList(ExamInfo examInfo);
+    List<ExamInfo> selectExamInfoList(ExamInfo examInfo);
 
     List<ExamInfoProviceVo> getProvice();
 

+ 2 - 2
nbjk-service/src/main/java/com/miaxis/score/dto/ScoreInfoDTO.java

@@ -19,11 +19,11 @@ public class ScoreInfoDTO extends BaseBusinessEntity{
 //    private Long userId;
 
     /** 考试车型 */
-    @ApiModelProperty(value = "考试车型(小车、客车、货车、摩托车)")
+    @ApiModelProperty(value = "考试车型(小车、客车、货车、摩托车、三力测试)")
     private String type;
 
     /** 考试科目 */
-    @ApiModelProperty(value = "考试科目(科目一、科目二、科目三、科目四)")
+    @ApiModelProperty(value = "考试科目(1、2、3、4)")
     private String kskm;
 
     /** 分数 */