|
@@ -2,6 +2,7 @@ package com.xjrsoft.module.base.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -43,11 +44,11 @@ import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
-import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
+import java.util.function.Consumer;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -60,7 +61,7 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<WhitelistManagementMapper, WhitelistManagement> implements IWhitelistManagementService {
|
|
public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<WhitelistManagementMapper, WhitelistManagement> implements IWhitelistManagementService {
|
|
- private final WhitelistManagementMapper whitelistManagementMapper;
|
|
|
|
|
|
+ private final WhitelistManagementMapper managementMapper;
|
|
|
|
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@@ -72,37 +73,37 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
private final IUserRoleRelationService roleRelationService;
|
|
private final IUserRoleRelationService roleRelationService;
|
|
@Override
|
|
@Override
|
|
public Page<WhitelistManagementPageVo> getPage(Page<Object> objectPage, WhitelistManagementPageDto dto) {
|
|
public Page<WhitelistManagementPageVo> getPage(Page<Object> objectPage, WhitelistManagementPageDto dto) {
|
|
- return whitelistManagementMapper.getPage(objectPage, dto);
|
|
|
|
|
|
+ return managementMapper.getPage(objectPage, dto);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String GetName(String name) {
|
|
public String GetName(String name) {
|
|
- return whitelistManagementMapper.getName(name);
|
|
|
|
|
|
+ return managementMapper.getName(name);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String GetCredentialNumber(String credentialNumber) {
|
|
public String GetCredentialNumber(String credentialNumber) {
|
|
- return whitelistManagementMapper.getCredentialNumber(credentialNumber);
|
|
|
|
|
|
+ return managementMapper.getCredentialNumber(credentialNumber);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String GetPhone(String phone) {
|
|
public String GetPhone(String phone) {
|
|
- return whitelistManagementMapper.getPhone(phone);
|
|
|
|
|
|
+ return managementMapper.getPhone(phone);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Long getUserId(String credentialNumber) {
|
|
public Long getUserId(String credentialNumber) {
|
|
- return whitelistManagementMapper.getUserId(credentialNumber);
|
|
|
|
|
|
+ return managementMapper.getUserId(credentialNumber);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public boolean checkExist(String credentialNumber) {
|
|
public boolean checkExist(String credentialNumber) {
|
|
- return whitelistManagementMapper.checkExits(credentialNumber);
|
|
|
|
|
|
+ return managementMapper.checkExits(credentialNumber);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<TreeNode> getTreeStructure() {
|
|
public List<TreeNode> getTreeStructure() {
|
|
- List<WhiteBaseGrade> grades = whitelistManagementMapper.getAllGrades();
|
|
|
|
|
|
+ List<WhiteBaseGrade> grades = managementMapper.getAllGrades();
|
|
List<TreeNode> treeNodes = new ArrayList<>();
|
|
List<TreeNode> treeNodes = new ArrayList<>();
|
|
|
|
|
|
for (WhiteBaseGrade grade : grades) {
|
|
for (WhiteBaseGrade grade : grades) {
|
|
@@ -110,7 +111,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
gradeNode.setId(grade.getId());
|
|
gradeNode.setId(grade.getId());
|
|
gradeNode.setName(grade.getName());
|
|
gradeNode.setName(grade.getName());
|
|
|
|
|
|
- List<WhiteBaseClass> classes = whitelistManagementMapper.getClassesByGradeId(grade.getId());
|
|
|
|
|
|
+ List<WhiteBaseClass> classes = managementMapper.getClassesByGradeId(grade.getId());
|
|
List<TreeNode> classNodes = new ArrayList<>();
|
|
List<TreeNode> classNodes = new ArrayList<>();
|
|
|
|
|
|
for (WhiteBaseClass clazz : classes) {
|
|
for (WhiteBaseClass clazz : classes) {
|
|
@@ -133,7 +134,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
@Async
|
|
@Async
|
|
public void loadCaches() {
|
|
public void loadCaches() {
|
|
log.info("XJRSOFT: 加载所有学生电信开卡用户缓存开始");
|
|
log.info("XJRSOFT: 加载所有学生电信开卡用户缓存开始");
|
|
- List<WhitelistManagement> list = whitelistManagementMapper.selectList(Wrappers.<WhitelistManagement>query().lambda().select(WhitelistManagement::getUserId));
|
|
|
|
|
|
+ List<WhitelistManagement> list = managementMapper.getCachesList();
|
|
|
|
|
|
Map<Long, Long> map = list.stream().collect(Collectors.toMap(WhitelistManagement::getUserId, WhitelistManagement::getUserId));
|
|
Map<Long, Long> map = list.stream().collect(Collectors.toMap(WhitelistManagement::getUserId, WhitelistManagement::getUserId));
|
|
redisUtil.set(GlobalConstant.WHITE_MANAGEMENT_CACHE_KEY, map);
|
|
redisUtil.set(GlobalConstant.WHITE_MANAGEMENT_CACHE_KEY, map);
|
|
@@ -373,4 +374,9 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
|
|
|
|
return errorList;
|
|
return errorList;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<WhitelistManagement> getCachesList() {
|
|
|
|
+ return this.baseMapper.getCachesList();
|
|
|
|
+ }
|
|
}
|
|
}
|