refactor(system): 统一查询方法命名规范
This commit is contained in:
+2
-2
@@ -52,7 +52,7 @@ public class SystemAuthService {
|
||||
KitRsaEncryptUtil.decryptByPrivateKey(properties.getRsa().getPrivateKey(), loginArgs.getPassword());
|
||||
// 校验验证码
|
||||
systemCaptchaService.validate(loginArgs.getUuid(), loginArgs.getCode());
|
||||
// 获取用户信息
|
||||
// 查询用户信息
|
||||
SystemUserJwtVo jwtUser = userDetailsService.loadUserByUsername(loginArgs.getUsername());
|
||||
// 验证用户密码
|
||||
if (!passwordEncoder.matches(password, jwtUser.getPassword())) {
|
||||
@@ -83,7 +83,7 @@ public class SystemAuthService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录人信息 -> TestPassed
|
||||
* 查询当前登录人信息 -> TestPassed
|
||||
*/
|
||||
public SystemUserJwtVo getCurrentUserInfo() {
|
||||
SystemUserJwtVo jwtUser = (SystemUserJwtVo) KitSecurityHelper.getCurrentUser();
|
||||
|
||||
+2
-2
@@ -26,10 +26,10 @@ public class SystemCaptchaService {
|
||||
private AppProperties properties;
|
||||
|
||||
/**
|
||||
* 获取登录验证码 -> TestPassed
|
||||
* 查询登录验证码 -> TestPassed
|
||||
*/
|
||||
public SystemCaptchaVo getLoginCaptcha() {
|
||||
// 获取运算的结果
|
||||
// 查询运算的结果
|
||||
Captcha captcha = properties.getLogin().getCaptchaSetting().getCaptcha();
|
||||
String uuid = SystemCacheKey.CAPTCHA_LOGIN + IdUtil.simpleUUID();
|
||||
//当验证码类型为 arithmetic时且长度 >= 2 时, captcha.text()的结果有几率为浮点型
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ public class SystemDataService {
|
||||
private SystemRoleDeptService systemRoleDeptService;
|
||||
|
||||
/**
|
||||
* 获取数据权限 -> TestPassed
|
||||
* 查询数据权限 -> TestPassed
|
||||
*
|
||||
* @param user /
|
||||
* @return /
|
||||
@@ -54,7 +54,7 @@ public class SystemDataService {
|
||||
List<Long> deptIds = new ArrayList<>();
|
||||
// 查询用户角色
|
||||
Set<SystemRoleTb> roleList = systemUserRoleService.listUserRoleByUserId(user.getId());
|
||||
// 获取对应的部门ID
|
||||
// 查询对应的部门ID
|
||||
for (SystemRoleTb role : roleList) {
|
||||
SystemDataScopeEnum dataScopeEnum = SystemDataScopeEnum.find(role.getDataScope());
|
||||
switch (Objects.requireNonNull(dataScopeEnum)) {
|
||||
@@ -75,7 +75,7 @@ public class SystemDataService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自定义的数据权限 -> TestPassed
|
||||
* 查询自定义的数据权限 -> TestPassed
|
||||
*
|
||||
* @param deptIds 部门ID(外部数据)
|
||||
* @param roleId 角色ID
|
||||
|
||||
+6
-6
@@ -100,7 +100,7 @@ public class SystemDeptService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门信息 -> TestPassed
|
||||
* 根据部门id查询部门信息 -> TestPassed
|
||||
*
|
||||
* @param id 部门id
|
||||
* @return /
|
||||
@@ -116,7 +116,7 @@ public class SystemDeptService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDeptByIds(Set<Long> ids) {
|
||||
// 获取部门, 和其所有子部门
|
||||
// 查询部门, 和其所有子部门
|
||||
Set<SystemDeptVo> depts = this.traverseDeptByIdWithPids(ids);
|
||||
// 验证是否被角色或用户关联
|
||||
this.verifyBindRelationByIds(depts);
|
||||
@@ -229,7 +229,7 @@ public class SystemDeptService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门下所有关联的部门
|
||||
* 查询部门下所有关联的部门
|
||||
*
|
||||
* @param deptTbList /
|
||||
* @param depts /
|
||||
@@ -263,7 +263,7 @@ public class SystemDeptService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取同级与上级数据
|
||||
* 根据ID查询同级与上级数据
|
||||
*
|
||||
* @param dept /
|
||||
* @param deptList /
|
||||
@@ -388,7 +388,7 @@ public class SystemDeptService {
|
||||
}
|
||||
|
||||
private List<SystemProductLineVo> buildDeptSelectOptions(List<SystemDeptTb> depts) {
|
||||
// 获取所有部门并按父子关系组织
|
||||
// 查询所有部门并按父子关系组织
|
||||
Map<Long, SystemDeptTb> deptMap =
|
||||
depts.stream().collect(Collectors.toMap(SystemDeptTb::getId, Function.identity()));
|
||||
List<SystemProductLineVo> options = new ArrayList<>();
|
||||
@@ -433,7 +433,7 @@ public class SystemDeptService {
|
||||
|
||||
public List<SystemProductLineTreeVo> listDeptSelectProDataSource() {
|
||||
List<SystemDeptTb> depts = this.listEnabledDepts();
|
||||
// 获取所有部门并按父子关系组织
|
||||
// 查询所有部门并按父子关系组织
|
||||
Map<Long, SystemDeptTb> deptMap =
|
||||
depts.stream().collect(Collectors.toMap(SystemDeptTb::getId, Function.identity()));
|
||||
List<SystemProductLineTreeVo> options = new ArrayList<>();
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ public class SystemDictDetailService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典名称获取字典详情 -> TestPassed
|
||||
* 根据字典名称查询字典详情 -> TestPassed
|
||||
*
|
||||
* @param name 字典名称
|
||||
* @return /
|
||||
|
||||
+8
-1
@@ -121,13 +121,17 @@ public class SystemJobService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位名称查询启用的岗位信息 -> TestPassed
|
||||
*/
|
||||
public SystemJobTb getJobByName(String name) {
|
||||
LambdaQueryWrapper<SystemJobTb> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SystemJobTb::getName, name);
|
||||
wrapper.eq(SystemJobTb::getEnabled, 1);
|
||||
return systemJobMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
public void injectQueryParams(SystemQueryJobArgs args, LambdaQueryWrapper<SystemJobTb> wrapper) {
|
||||
private void injectQueryParams(SystemQueryJobArgs args, LambdaQueryWrapper<SystemJobTb> wrapper) {
|
||||
if (args != null) {
|
||||
wrapper.like(StrUtil.isNotBlank(args.getName()), SystemJobTb::getName, args.getName());
|
||||
wrapper.eq(args.getEnabled() != null, SystemJobTb::getEnabled, args.getEnabled());
|
||||
@@ -138,6 +142,9 @@ public class SystemJobService {
|
||||
wrapper.orderByDesc(SystemJobTb::getJobSort, SystemJobTb::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出岗位数据 -> TestPassed
|
||||
*/
|
||||
public void exportJobXlsx(HttpServletResponse response, SystemQueryJobArgs args) {
|
||||
List<SystemJobTb> systemJobTbs = this.queryJobByArgs(args);
|
||||
List<SystemJobExportRowVo> rowVos = new ArrayList<>();
|
||||
|
||||
+4
-4
@@ -212,7 +212,7 @@ public class SystemMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前用户获取菜单
|
||||
* 根据当前用户查询菜单
|
||||
*
|
||||
* @param currentUserId /
|
||||
* @return /
|
||||
@@ -224,7 +224,7 @@ public class SystemMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有子节点, 包含自身ID
|
||||
* 查询所有子节点, 包含自身ID
|
||||
*
|
||||
* @param menuList /
|
||||
* @param menuSet /
|
||||
@@ -261,7 +261,7 @@ public class SystemMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取同级与上级数据
|
||||
* 根据ID查询同级与上级数据
|
||||
*
|
||||
* @param menu /
|
||||
* @param menus /
|
||||
@@ -355,7 +355,7 @@ public class SystemMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 MenuResponse
|
||||
* 查询 MenuResponse
|
||||
*
|
||||
* @param menu /
|
||||
* @param menuVo /
|
||||
|
||||
+5
-5
@@ -75,7 +75,7 @@ public class SystemMonitorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取磁盘信息
|
||||
* 查询磁盘信息
|
||||
*
|
||||
* @return /
|
||||
*/
|
||||
@@ -109,7 +109,7 @@ public class SystemMonitorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交换区信息
|
||||
* 查询交换区信息
|
||||
*
|
||||
* @param memory /
|
||||
* @return /
|
||||
@@ -131,7 +131,7 @@ public class SystemMonitorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内存信息
|
||||
* 查询内存信息
|
||||
*
|
||||
* @param memory /
|
||||
* @return /
|
||||
@@ -147,7 +147,7 @@ public class SystemMonitorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Cpu相关信息
|
||||
* 查询Cpu相关信息
|
||||
*
|
||||
* @param processor /
|
||||
* @return /
|
||||
@@ -194,7 +194,7 @@ public class SystemMonitorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统相关信息,系统、运行天数、系统IP
|
||||
* 查询系统相关信息,系统、运行天数、系统IP
|
||||
*
|
||||
* @param os /
|
||||
* @return /
|
||||
|
||||
+2
-2
@@ -182,10 +182,10 @@ public class SystemQuartzJobService {
|
||||
quartzJob.setUuid(uuid);
|
||||
// 执行任务
|
||||
startQuartzJob(quartzJob);
|
||||
// 获取执行状态, 如果执行失败则停止后面的子任务执行
|
||||
// 查询执行状态, 如果执行失败则停止后面的子任务执行
|
||||
Boolean result = redisHelper.get(uuid, Boolean.class);
|
||||
while (result == null) {
|
||||
// 休眠5秒, 再次获取子任务执行情况
|
||||
// 休眠5秒, 再次查询子任务执行情况
|
||||
Thread.sleep(5000);
|
||||
result = redisHelper.get(uuid, Boolean.class);
|
||||
}
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ public class SystemRoleService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限信息 -> TestPassed
|
||||
* 查询用户权限信息 -> TestPassed
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 权限信息
|
||||
|
||||
+3
@@ -13,6 +13,9 @@ public class SystemUserDeptService {
|
||||
@Autowired
|
||||
private SystemUserMapper systemUserMapper;
|
||||
|
||||
/**
|
||||
* 根据部门id统计用户数量 -> TestPassed
|
||||
*/
|
||||
public long countUserByDeptIds(Set<Long> deptIds) {
|
||||
LambdaQueryWrapper<SystemUserTb> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SystemUserTb::getDeptId, deptIds);
|
||||
|
||||
Reference in New Issue
Block a user