瀏覽代碼

fix 做题锁定

he2802 3 年之前
父節點
當前提交
1124562d2d

+ 6 - 10
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/LockController.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.controller.base;
 
+import cn.hutool.core.lang.Validator;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
@@ -10,22 +11,17 @@ import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.base.bo.ActionLockQueryBo;
-import com.zhongzheng.modules.base.bo.ApplyAreasQueryBo;
-import com.zhongzheng.modules.base.domain.ApplyAreas;
-import com.zhongzheng.modules.base.service.IApplyAreasService;
-import com.zhongzheng.modules.base.vo.ApplyAreasVo;
-import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
+
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -51,10 +47,10 @@ public class LockController extends BaseController {
     @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
     @Log(title = "锁定行为", businessType = BusinessType.UPDATE)
     @PostMapping("/lockAction")
-    public AjaxResult<Void> lockAction(@RequestBody ActionLockQueryBo bo) {
+    public AjaxResult<Void> lockAction(@Validated @RequestBody ActionLockQueryBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         String key = "LockAppAction_"+bo.getAction()+"-"+loginUser.getUser().getUserId();
-        redisCache.setCacheObject(key, SecurityUtils.getUsername(),13, TimeUnit.SECONDS);//13秒锁定
+        redisCache.setCacheObject(key, bo.getAction(),13, TimeUnit.SECONDS);//13秒锁定
         return AjaxResult.success();
     }
 

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ActionLockQueryBo.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import javax.validation.constraints.NotBlank;
 import java.util.List;
 
 /**
@@ -21,6 +22,7 @@ public class ActionLockQueryBo extends BaseEntity {
 
 
 	@ApiModelProperty("行为 bank 题库 ,jxjy 继续教育课程")
+	@NotBlank(message = "行为不能为空")
 	private String action;
 
 }

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -354,4 +354,12 @@ public class GoodsUserVo {
 	@Excel(name = "是否学时推送 0未推送 1推送")
 	@ApiModelProperty("是否学时推送 0未推送 1推送")
 	private Integer periodPlush;
+	/** 服务有效期开始 */
+	@Excel(name = "服务有效期开始")
+	@ApiModelProperty("服务有效期开始")
+	private Long serviceStartTime;
+	/** 服务有效期结束 */
+	@Excel(name = "服务有效期结束")
+	@ApiModelProperty("服务有效期结束")
+	private Long serviceEndTime;
 }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -184,6 +184,8 @@
         <result property="subApplySiteExamTime" column="sub_apply_site_exam_time"/>
         <result property="gradeId" column="grade_id"/>
         <result property="subscribeId" column="subscribe_id"/>
+        <result property="serviceStartTime" column="service_start_time"/>
+        <result property="serviceEndTime" column="service_end_time"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -470,6 +472,8 @@
         og.study_count as order_study_count,
         og.order_goods_id,
         og.grade_id,
+        og.service_start_time,
+        og.service_end_time,
         (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
         (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
         (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,