소스 검색

fix 预约模考添加字段

tanzh 3 년 전
부모
커밋
b4e01ecbfe

+ 1 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserMockSubscribeController.java

@@ -104,7 +104,7 @@ public class UserMockSubscribeController extends BaseController {
     @ApiOperation("修改用户预约模考")
     @PreAuthorize("@ss.hasPermi('system:subscribe:edit')")
     @Log(title = "用户预约模考", businessType = BusinessType.UPDATE)
-    @PutMapping()
+    @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody UserMockSubscribeEditBo bo) {
         return toAjax(iUserMockSubscribeService.updateByEditBo(bo) ? 1 : 0);
     }

+ 14 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeAddBo.java

@@ -2,8 +2,9 @@ package com.zhongzheng.modules.user.bo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+
+import java.math.BigDecimal;
 import java.util.Date;
 
 
@@ -60,4 +61,16 @@ public class UserMockSubscribeAddBo {
     /** 考试日期 */
     @ApiModelProperty("考试日期")
     private Long applySiteExamTime;
+    /** 做题次数 */
+    @ApiModelProperty("做题次数")
+    private Long doNum;
+    /** 第一次做题得分 */
+    @ApiModelProperty("第一次做题得分")
+    private BigDecimal firstScore;
+    /** 第一次主观题待评分 0否 1是 */
+    @ApiModelProperty("第一次主观题待评分 0否 1是")
+    private Integer firstSubjectiveScore;
+    /** 第一次交卷时间 */
+    @ApiModelProperty("第一次交卷时间")
+    private Long firstHandTime;
 }

+ 18 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeEditBo.java

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+
+import java.math.BigDecimal;
 import java.util.Date;
 
 
@@ -74,4 +76,20 @@ public class UserMockSubscribeEditBo {
     @ApiModelProperty("考试日期")
     private Long applySiteExamTime;
 
+    /** 做题次数 */
+    @ApiModelProperty("做题次数")
+    private Long doNum;
+
+    /** 第一次做题得分 */
+    @ApiModelProperty("第一次做题得分")
+    private BigDecimal firstScore;
+
+    /** 第一次主观题待评分 0否 1是 */
+    @ApiModelProperty("第一次主观题待评分 0否 1是")
+    private Integer firstSubjectiveScore;
+
+    /** 第一次交卷时间 */
+    @ApiModelProperty("第一次交卷时间")
+    private Long firstHandTime;
+
 }

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeQueryBo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Map;
 import java.util.HashMap;
@@ -72,4 +73,17 @@ public class UserMockSubscribeQueryBo extends BaseEntity {
 	/** 考试日期 */
 	@ApiModelProperty("考试日期")
 	private Long applySiteExamTime;
+
+	/** 做题次数 */
+	@ApiModelProperty("做题次数")
+	private Long doNum;
+	/** 第一次做题得分 */
+	@ApiModelProperty("第一次做题得分")
+	private BigDecimal firstScore;
+	/** 第一次主观题待评分 0否 1是 */
+	@ApiModelProperty("第一次主观题待评分 0否 1是")
+	private Integer firstSubjectiveScore;
+	/** 第一次交卷时间 */
+	@ApiModelProperty("第一次交卷时间")
+	private Long firstHandTime;
 }

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserMockSubscribe.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.user.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -56,4 +57,12 @@ private static final long serialVersionUID=1L;
     private String applySiteEndTime;
     /** 考试日期 */
     private Long applySiteExamTime;
+    /** 做题次数 */
+    private Long doNum;
+    /** 第一次做题得分 */
+    private BigDecimal firstScore;
+    /** 第一次主观题待评分 0否 1是 */
+    private Integer firstSubjectiveScore;
+    /** 第一次交卷时间 */
+    private Long firstHandTime;
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserMockSubscribeServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.user.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
@@ -72,6 +73,10 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
         lqw.eq(StrUtil.isNotBlank(bo.getApplySiteStartTime()), UserMockSubscribe::getApplySiteStartTime, bo.getApplySiteStartTime());
         lqw.eq(StrUtil.isNotBlank(bo.getApplySiteEndTime()), UserMockSubscribe::getApplySiteEndTime, bo.getApplySiteEndTime());
         lqw.eq(bo.getApplySiteExamTime() != null, UserMockSubscribe::getApplySiteExamTime, bo.getApplySiteExamTime());
+        lqw.eq(bo.getDoNum() != null, UserMockSubscribe::getDoNum, bo.getDoNum());
+        lqw.eq(bo.getFirstScore() != null, UserMockSubscribe::getFirstScore, bo.getFirstScore());
+        lqw.eq(bo.getFirstSubjectiveScore() != null, UserMockSubscribe::getFirstSubjectiveScore, bo.getFirstSubjectiveScore());
+        lqw.eq(bo.getFirstHandTime() != null, UserMockSubscribe::getFirstHandTime, bo.getFirstHandTime());
         return entity2Vo(this.list(lqw));
     }
 
@@ -169,6 +174,21 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
     public Boolean updateByEditBo(UserMockSubscribeEditBo bo) {
         UserMockSubscribe update = BeanUtil.toBean(bo, UserMockSubscribe.class);
         validEntityBeforeSave(update);
+        UserMockSubscribeVo userMockSubscribeVo = this.queryById(update.getSubscribeId());
+        if (BeanUtil.isNotEmpty(userMockSubscribeVo)) {
+            if (Validator.isNotEmpty(userMockSubscribeVo.getFirstScore())) {
+                update.setFirstScore(null);
+            }
+            if (Validator.isNotEmpty(userMockSubscribeVo.getFirstSubjectiveScore()) && userMockSubscribeVo.getFirstSubjectiveScore() == 1) {
+                update.setFirstSubjectiveScore(null);
+            }
+            if (Validator.isNotEmpty(userMockSubscribeVo.getFirstHandTime())) {
+                update.setFirstHandTime(null);
+            }
+            if (Validator.isNotEmpty(bo.getHandStatus()) && bo.getHandStatus() != 0) {
+                update.setDoNum(userMockSubscribeVo.getDoNum() + 1);
+            }
+        }
         update.setUpdateTime(DateUtils.getNowTime());
         return this.updateById(update);
     }

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserMockSubscribeVo.java

@@ -5,6 +5,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
+import java.math.BigDecimal;
 import java.util.Date;
 
 
@@ -122,4 +124,24 @@ public class UserMockSubscribeVo {
 	@Excel(name = "开考限制时间")
 	@ApiModelProperty("开考限制时间")
 	private String timeLimit;
+
+	/** 做题次数 */
+	@Excel(name = "做题次数")
+	@ApiModelProperty("做题次数")
+	private Long doNum;
+
+	/** 第一次做题得分 */
+	@Excel(name = "第一次做题得分")
+	@ApiModelProperty("第一次做题得分")
+	private BigDecimal firstScore;
+
+	/** 第一次主观题待评分 0否 1是 */
+	@Excel(name = "第一次主观题待评分 0否 1是")
+	@ApiModelProperty("第一次主观题待评分 0否 1是")
+	private Integer firstSubjectiveScore;
+
+	/** 第一次交卷时间 */
+	@Excel(name = "第一次交卷时间")
+	@ApiModelProperty("第一次交卷时间")
+	private Long firstHandTime;
 }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMockSubscribeMapper.xml

@@ -46,6 +46,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectId" column="subject_id"/>
         <result property="subjectName" column="subject_name"/>
         <result property="timeLimit" column="time_limit"/>
+        <result property="doNum" column="do_num"/>
+        <result property="firstScore" column="first_score"/>
+        <result property="firstSubjectiveScore" column="first_subjective_score"/>
+        <result property="firstHandTime" column="first_hand_time"/>
     </resultMap>
     <select id="getInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
         SELECT 	ums.*,