Selaa lähdekoodia

fix 锁定审核

he2802 3 vuotta sitten
vanhempi
commit
43f904751a

+ 31 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -4,11 +4,14 @@ import java.io.FileOutputStream;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import cn.hutool.core.lang.Validator;
+import com.zhongzheng.common.core.redis.RedisCache;
+import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
@@ -64,6 +67,8 @@ public class ClassGradeController extends BaseController {
 
     private final IUserPeriodStatusService userPeriodStatusService;
 
+    private final RedisCache redisCache;
+
     /**
      * 查询班级列表
      */
@@ -484,4 +489,30 @@ public class ClassGradeController extends BaseController {
     public AjaxResult<Void> rollbackPeriod(@RequestBody UserPeriodEditBo bo) {
         return toAjax(iUserPeriodService.rollbackPeriod(bo) ? 1 : 0);
     }
+
+    /**
+     * 锁定学时审核页面
+     */
+    @ApiOperation("锁定学时审核页面")
+    @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
+    @Log(title = "锁定学时审核页面", businessType = BusinessType.UPDATE)
+    @PostMapping("/lockPeriod")
+    public AjaxResult<Void> lockPeriod(@RequestBody UserPeriodEditBo bo) {
+        String key = "LockPeriod_"+bo.getGradeId()+"-"+bo.getUserId();
+        redisCache.setCacheObject(key, SecurityUtils.getUsername(),15, TimeUnit.SECONDS);//15秒锁定
+        return AjaxResult.success();
+    }
+
+    /**
+     * 查看学时审核锁定状态
+     */
+    @ApiOperation("查看学时审核锁定状态")
+    @PreAuthorize("@ss.hasPermi('grade:grade:edit')")
+    @Log(title = "查看学时审核锁定状态", businessType = BusinessType.UPDATE)
+    @PostMapping("/lockPeriodStatus")
+    public AjaxResult<Void> lockPeriodStatus(@RequestBody UserPeriodEditBo bo) {
+        String key = "LockPeriod_"+bo.getGradeId()+"-"+bo.getUserId();
+        String username = redisCache.getCacheObject(key);
+        return toAjax(Validator.isNotEmpty(username) ? 1 : 0);
+    }
 }

+ 2 - 7
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassStudentController.java

@@ -5,6 +5,7 @@ import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.grade.bo.*;
@@ -40,19 +41,13 @@ import java.util.List;
 @RequestMapping("/grade/student")
 public class ClassStudentController extends BaseController {
 
-    private final IClassGradeService iClassGradeService;
-
-    private final IClassGradeInterfaceService iClassGradeInterfaceService;
-
-    private final IClassGradeSysService iClassGradeSysService;
-
     private final IClassGradeUserService iClassGradeUserService;
 
     private final IUserStudyRecordService iUserStudyRecordService;
 
     private final IUserService iUserService;
-    private final IUserUpdateService iUserUpdateService;
 
+    private final IUserUpdateService iUserUpdateService;
 
     /**
      * 查询學員用户列表

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -568,7 +568,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         params.put("ksrq",DateUtils.timestampToDate(firstVo.getFirstStartTime()));
         params.put("jsrq",DateUtils.timestampToDate(userVo.getPeriodWaitTime()));
         String  dataTxt = params.get("zh")+params.get("bh")+params.get("xm")+params.get("sfz")+params.get("ksrq")+params.get("jsrq");
-        System.out.println(dataTxt+"学时数据");
         String encrypted = dataSign(dataTxt,OFFICIALPUSH_TOKEN);
         params.put("SignMsg",encrypted);
         String respone = "";