|
@@ -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);
|
|
|
+ }
|
|
|
}
|