dzx 3 місяців тому
батько
коміт
f7ffc1f6a9

+ 0 - 5
src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java

@@ -18,8 +18,6 @@ import com.xjrsoft.module.base.vo.WhitelistManagementVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -34,7 +32,6 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -52,8 +49,6 @@ import java.util.concurrent.CompletableFuture;
 @AllArgsConstructor
 public class WhitelistManagementController {
 
-
-    private static final Logger log = LoggerFactory.getLogger(WhitelistManagementController.class);
     private final IWhitelistManagementService whitelistManagementService;
 
     @GetMapping(value = "/page")

+ 9 - 0
src/main/java/com/xjrsoft/module/base/dto/AddWhitelistManagementDto.java

@@ -45,4 +45,13 @@ public class AddWhitelistManagementDto implements Serializable {
     @ApiModelProperty("手机号")
     private String phone;
 
+    @ApiModelProperty("是否临时性的(1:是 0:否)")
+    private Integer isTemporary;
+
+    @ApiModelProperty("临时使用开始时间")
+    private LocalDateTime startTime;
+
+    @ApiModelProperty("临时使用结束时间")
+    private LocalDateTime endTime;
+
 }

+ 11 - 5
src/main/java/com/xjrsoft/module/base/entity/WhitelistManagement.java

@@ -2,18 +2,15 @@ package com.xjrsoft.module.base.entity;
 
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.github.yulichang.annotation.EntityMapping;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
 import java.io.Serializable;
-import java.time.LocalTime;
 import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
 
 
@@ -82,5 +79,14 @@ public class WhitelistManagement implements Serializable {
     @ApiModelProperty("手机号")
     private String phone;
 
+    @ApiModelProperty("是否临时性的(1:是 0:否)")
+    private Integer isTemporary;
+
+    @ApiModelProperty("临时使用开始时间")
+    private LocalDateTime startTime;
+
+    @ApiModelProperty("临时使用结束时间")
+    private LocalDateTime endTime;
+
 
 }

+ 29 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java

@@ -1,11 +1,15 @@
 package com.xjrsoft.module.student.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.base.entity.WhitelistManagement;
+import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
@@ -18,6 +22,7 @@ import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
+import com.xjrsoft.module.student.vo.WhitelistInfoVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -45,7 +50,7 @@ public class  BaseStudentInfoController {
 
     private final IStudentManagerService studentManagerService;
     private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
-
+    private final IWhitelistManagementService whitelistService;
     @GetMapping(value = "/mobile-page")
     @ApiOperation(value="学生列表(分页)")
     @SaCheckPermission("basestudentpost:detail")
@@ -103,4 +108,27 @@ public class  BaseStudentInfoController {
         return RT.ok(infos);
     }
 
+    @GetMapping(value = "/getWhitelistInfo")
+    @ApiOperation(value="根据userId查询白名单信息(不传默认查询登录者)")
+    @SaCheckPermission("room:detail")
+    public RT<WhitelistInfoVo> getWhitelistInfo(Long userId){
+        if(userId == null){
+            userId = StpUtil.getLoginIdAsLong();
+        }
+
+        WhitelistManagement one = whitelistService.getOne(
+                new QueryWrapper<WhitelistManagement>().lambda()
+                        .eq(WhitelistManagement::getUserId, userId)
+        );
+        WhitelistInfoVo whitelistInfoVo = new WhitelistInfoVo();
+        whitelistInfoVo.setWhitelistStatus(0);
+        if(one != null){
+            whitelistInfoVo.setWhitelistStatus(1);
+            whitelistInfoVo.setEndTime(one.getEndTime());
+            whitelistInfoVo.setIsTemporary(one.getIsTemporary());
+        }
+
+        return RT.ok(whitelistInfoVo);
+    }
+
 }

+ 25 - 0
src/main/java/com/xjrsoft/module/student/vo/WhitelistInfoVo.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+* @title: 专业分类表表单出参
+* @Author szs
+* @Date: 2024-04-01
+* @Version 1.0
+*/
+@Data
+public class WhitelistInfoVo {
+
+    @ApiModelProperty("是否存在于白名单中(1:是 0:否)")
+    public Integer whitelistStatus;
+
+    @ApiModelProperty("截止日期")
+    private LocalDateTime endTime;
+
+    @ApiModelProperty("是否临时性的(1:是 0:否)")
+    private Integer isTemporary;
+}