mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
sonarqube质量修复
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ public class ApplicationApiImpl implements ApplicationApi{
|
||||
throw exception(APPLICATION_NOT_EXISTS);
|
||||
}
|
||||
// 数据转json
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(applicationDO);
|
||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(applicationDO);
|
||||
System.out.println(" jsonObject " + jsonObject);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.captcha;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.util.servlet.ServletUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.xingyuv.captcha.model.common.ResponseModel;
|
||||
@@ -47,7 +47,7 @@ public class CaptchaController {
|
||||
public static String getRemoteId(HttpServletRequest request) {
|
||||
String ip = ServletUtils.getClientIP(request);
|
||||
String ua = request.getHeader("user-agent");
|
||||
if (StrUtil.isNotBlank(ip)) {
|
||||
if (CharSequenceUtil.isNotBlank(ip)) {
|
||||
return ip + ua;
|
||||
}
|
||||
return request.getRemoteAddr() + ua;
|
||||
|
||||
+9
-7
@@ -1,9 +1,9 @@
|
||||
package com.cf.imes.module.system.controller.admin.oauth2;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.http.HttpUtils;
|
||||
@@ -71,6 +71,8 @@ public class OAuth2OpenController {
|
||||
@Resource
|
||||
private OAuth2TokenService oauth2TokenService;
|
||||
|
||||
private static final String TOKEN_NOTNULL_NOTIFICATION = "访问令牌不能为空";
|
||||
|
||||
/**
|
||||
* 对应 Spring Security OAuth 的 TokenEndpoint 类的 postAccessToken 方法
|
||||
*
|
||||
@@ -109,7 +111,7 @@ public class OAuth2OpenController {
|
||||
// 1.1 校验授权类型
|
||||
OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGranType(grantType);
|
||||
if (grantTypeEnum == null) {
|
||||
throw exception0(BAD_REQUEST.getCode(), StrUtil.format("未知授权类型({})", grantType));
|
||||
throw exception0(BAD_REQUEST.getCode(), CharSequenceUtil.format("未知授权类型({})", grantType));
|
||||
}
|
||||
if (grantTypeEnum == OAuth2GrantTypeEnum.IMPLICIT) {
|
||||
throw exception0(BAD_REQUEST.getCode(), "Token 接口不支持 implicit 授权模式");
|
||||
@@ -138,7 +140,7 @@ public class OAuth2OpenController {
|
||||
default:
|
||||
throw new IllegalArgumentException("未知授权类型:" + grantType);
|
||||
}
|
||||
Assert.notNull(accessTokenDO, "访问令牌不能为空"); // 防御性检查
|
||||
Assert.notNull(accessTokenDO, TOKEN_NOTNULL_NOTIFICATION); // 防御性检查
|
||||
return success(OAuth2OpenConvert.INSTANCE.convert(accessTokenDO));
|
||||
}
|
||||
|
||||
@@ -175,7 +177,7 @@ public class OAuth2OpenController {
|
||||
|
||||
// 校验令牌
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.checkAccessToken(token);
|
||||
Assert.notNull(accessTokenDO, "访问令牌不能为空"); // 防御性检查
|
||||
Assert.notNull(accessTokenDO, TOKEN_NOTNULL_NOTIFICATION); // 防御性检查
|
||||
return success(OAuth2OpenConvert.INSTANCE.convert2(accessTokenDO));
|
||||
}
|
||||
|
||||
@@ -258,10 +260,10 @@ public class OAuth2OpenController {
|
||||
}
|
||||
|
||||
private static OAuth2GrantTypeEnum getGrantTypeEnum(String responseType) {
|
||||
if (StrUtil.equals(responseType, "code")) {
|
||||
if (CharSequenceUtil.equals(responseType, "code")) {
|
||||
return OAuth2GrantTypeEnum.AUTHORIZATION_CODE;
|
||||
}
|
||||
if (StrUtil.equalsAny(responseType, "token")) {
|
||||
if (CharSequenceUtil.equalsAny(responseType, "token")) {
|
||||
return OAuth2GrantTypeEnum.IMPLICIT;
|
||||
}
|
||||
throw exception0(BAD_REQUEST.getCode(), "response_type 参数值只允许 code 和 token");
|
||||
@@ -271,7 +273,7 @@ public class OAuth2OpenController {
|
||||
List<String> scopes, String redirectUri, String state) {
|
||||
// 1. 创建 access token 访问令牌
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2GrantService.grantImplicit(userId, getUserType(), client.getClientId(), scopes);
|
||||
Assert.notNull(accessTokenDO, "访问令牌不能为空"); // 防御性检查
|
||||
Assert.notNull(accessTokenDO, TOKEN_NOTNULL_NOTIFICATION); // 防御性检查
|
||||
// 2. 拼接重定向的 URL
|
||||
// noinspection unchecked
|
||||
return OAuth2Utils.buildImplicitRedirectUri(redirectUri, accessTokenDO.getAccessToken(), state, accessTokenDO.getExpiresTime(),
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.oauth2.vo.client;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -75,7 +75,7 @@ public class OAuth2ClientSaveReqVO {
|
||||
|
||||
@AssertTrue(message = "附加信息必须是 JSON 格式")
|
||||
public boolean isAdditionalInformationJson() {
|
||||
return StrUtil.isEmpty(additionalInformation) || JsonUtils.isJson(additionalInformation);
|
||||
return CharSequenceUtil.isEmpty(additionalInformation) || JsonUtils.isJson(additionalInformation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.organ;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -107,7 +106,7 @@ public class OrganController {
|
||||
@PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
public CommonResult<PageResult<OrganRespVO>> getOrganPage(@Valid OrganPageReqVO pageVO) {
|
||||
PageResult<OrganizationDO> pageResult = organService.getOrganPage(pageVO);
|
||||
if(CollectionUtil.isEmpty(pageResult.getList())) {
|
||||
if(CollUtil.isEmpty(pageResult.getList())) {
|
||||
return success(new PageResult<>());
|
||||
}
|
||||
PageResult<OrganRespVO> bean = BeanUtils.toBean(pageResult, OrganRespVO.class);
|
||||
@@ -132,7 +131,7 @@ public class OrganController {
|
||||
HttpServletResponse response) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrganizationDO> list = organService.getOrganPage(exportReqVO).getList();
|
||||
if(CollectionUtil.isEmpty(list)) {
|
||||
if(CollUtil.isEmpty(list)) {
|
||||
ExcelUtils.write(response, "组织.xls", "数据", OrganExportRespVO.class, new ArrayList<>());
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.socail.vo.client;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
@@ -55,7 +55,7 @@ public class SocialClientSaveReqVO {
|
||||
public boolean isAgentIdValid() {
|
||||
// 如果是企业微信,必须填写 agentId 属性
|
||||
return !Objects.equals(socialType, SocialTypeEnum.WECHAT_ENTERPRISE.getType())
|
||||
|| !StrUtil.isEmpty(agentId);
|
||||
|| !CharSequenceUtil.isEmpty(agentId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.convert.mail;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.extra.mail.MailAccount;
|
||||
import com.cf.imes.module.system.dal.dataobject.mail.MailAccountDO;
|
||||
import org.mapstruct.Mapper;
|
||||
@@ -12,7 +12,7 @@ public interface MailAccountConvert {
|
||||
MailAccountConvert INSTANCE = Mappers.getMapper(MailAccountConvert.class);
|
||||
|
||||
default MailAccount convert(MailAccountDO account, String nickname) {
|
||||
String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail();
|
||||
String from = CharSequenceUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail();
|
||||
return new MailAccount().setFrom(from).setAuth(true)
|
||||
.setUser(account.getUsername()).setPass(account.getPassword())
|
||||
.setHost(account.getHost()).setPort(account.getPort()).setSslEnable(account.getSslEnable());
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.dal.mysql.organ;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@@ -31,10 +31,10 @@ public interface OrganMapper extends BaseMapperX<OrganizationDO> {
|
||||
.likeIfPresent(OrganizationDO::getContactMobile, reqVO.getContactMobile())
|
||||
.eqIfPresent(OrganizationDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(OrganizationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.and(StrUtil.isNotBlank(reqVO.getName()), wrapper ->{
|
||||
.and(CharSequenceUtil.isNotBlank(reqVO.getName()), wrapper ->{
|
||||
wrapper.or(Boolean.TRUE).like(OrganizationDO::getName, reqVO.getName());
|
||||
wrapper.or(StrUtil.isNotBlank(reqVO.getPyAll())).like(OrganizationDO::getPinyinFull, reqVO.getPyAll());
|
||||
wrapper.or(StrUtil.isNotBlank(reqVO.getPyFirstChar())).like(OrganizationDO::getPinyinInitial, reqVO.getPyFirstChar());
|
||||
wrapper.or(CharSequenceUtil.isNotBlank(reqVO.getPyAll())).like(OrganizationDO::getPinyinFull, reqVO.getPyAll());
|
||||
wrapper.or(CharSequenceUtil.isNotBlank(reqVO.getPyFirstChar())).like(OrganizationDO::getPinyinInitial, reqVO.getPyFirstChar());
|
||||
})
|
||||
/*.likeIfPresent(OrganizationDO::getName, reqVO.getName())
|
||||
.or(StrUtil.isNotBlank(reqVO.getName()))
|
||||
|
||||
+6
@@ -37,11 +37,17 @@ public interface ProcessGroupMapper extends BaseMapperX<ProcessGroupDO> {
|
||||
switch (reqVO.getField()) {
|
||||
case "name" -> queryWrapper.orderByAsc(ProcessGroupDO::getName);
|
||||
case "sort" -> queryWrapper.orderByAsc(ProcessGroupDO::getSort);
|
||||
default -> {
|
||||
// default 不排序
|
||||
}
|
||||
}
|
||||
}else if (reqVO.getOrder().equals("descend")) {
|
||||
switch (reqVO.getField()) {
|
||||
case "name" -> queryWrapper.orderByDesc(ProcessGroupDO::getName);
|
||||
case "sort" -> queryWrapper.orderByDesc(ProcessGroupDO::getSort);
|
||||
default -> {
|
||||
// default 不排序
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.system.dal.mysql.user;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -49,7 +49,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
AdminUserDO adminUserDO = null;
|
||||
List<AdminUserDO> adminUserDOS = selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.eq(AdminUserDO::getUsername, userName));
|
||||
if (CollectionUtil.isNotEmpty(adminUserDOS)) {
|
||||
if (CollUtil.isNotEmpty(adminUserDOS)) {
|
||||
if (adminUserDOS.size() > 1) {
|
||||
throw ServiceExceptionUtil.exception(USERNAME_MULTIPLE_ERROR, userName);
|
||||
}
|
||||
@@ -82,14 +82,14 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
|
||||
.inIfPresent(AdminUserDO::getDeptId, deptIds)
|
||||
.and(StrUtil.isNotBlank(reqVO.getNickname()), wrapper -> {
|
||||
if (StrUtil.isNotBlank(reqVO.getPyAll())) {
|
||||
.and(CharSequenceUtil.isNotBlank(reqVO.getNickname()), wrapper -> {
|
||||
if (CharSequenceUtil.isNotBlank(reqVO.getPyAll())) {
|
||||
wrapper.or(Boolean.TRUE).like(AdminUserDO::getPinyinFull, reqVO.getPyAll()) ;
|
||||
}
|
||||
if (StrUtil.isNotBlank(reqVO.getPyFirstChar())) {
|
||||
if (CharSequenceUtil.isNotBlank(reqVO.getPyFirstChar())) {
|
||||
wrapper.or(Boolean.TRUE).like(AdminUserDO::getPinyinInitial, reqVO.getPyFirstChar()) ;
|
||||
}
|
||||
if(StrUtil.isNotBlank(reqVO.getNickname())) {
|
||||
if(CharSequenceUtil.isNotBlank(reqVO.getNickname())) {
|
||||
wrapper.or(Boolean.TRUE).like(AdminUserDO::getNickname, reqVO.getNickname()) ;
|
||||
}
|
||||
})
|
||||
|
||||
+14
-14
@@ -7,7 +7,7 @@ import com.cf.imes.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public interface RedisKeyConstants {
|
||||
public class RedisKeyConstants {
|
||||
|
||||
/**
|
||||
* 指定部门的所有子部门编号数组的缓存
|
||||
@@ -15,7 +15,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:dept_children_ids:{id}
|
||||
* VALUE 数据类型:String 子部门编号集合
|
||||
*/
|
||||
String DEPT_CHILDREN_ID_LIST = "dept_children_ids";
|
||||
public static final String DEPT_CHILDREN_ID_LIST = "dept_children_ids";
|
||||
|
||||
/**
|
||||
* 角色的缓存
|
||||
@@ -23,7 +23,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:role:{id}
|
||||
* VALUE 数据类型:String 角色信息
|
||||
*/
|
||||
String ROLE = "role";
|
||||
public static final String ROLE = "role";
|
||||
|
||||
/**
|
||||
* 用户拥有的角色编号的缓存
|
||||
@@ -31,7 +31,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:user_role_ids:{userId}
|
||||
* VALUE 数据类型:String 角色编号集合
|
||||
*/
|
||||
String USER_ROLE_ID_LIST = "user_role_ids";
|
||||
public static final String USER_ROLE_ID_LIST = "user_role_ids";
|
||||
|
||||
/**
|
||||
* 拥有指定菜单的角色编号的缓存
|
||||
@@ -39,7 +39,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:user_role_ids:{menuId}
|
||||
* VALUE 数据类型:String 角色编号集合
|
||||
*/
|
||||
String MENU_ROLE_ID_LIST = "menu_role_ids";
|
||||
public static final String MENU_ROLE_ID_LIST = "menu_role_ids";
|
||||
|
||||
/**
|
||||
* 拥有权限对应的菜单编号数组的缓存
|
||||
@@ -47,7 +47,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:permission_menu_ids:{permission}
|
||||
* VALUE 数据类型:String 菜单编号数组
|
||||
*/
|
||||
String PERMISSION_MENU_ID_LIST = "permission_menu_ids";
|
||||
public static final String PERMISSION_MENU_ID_LIST = "permission_menu_ids";
|
||||
|
||||
/**
|
||||
* OAuth2 客户端的缓存
|
||||
@@ -55,7 +55,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:user:{id}
|
||||
* VALUE 数据类型:String 客户端信息
|
||||
*/
|
||||
String OAUTH_CLIENT = "oauth_client";
|
||||
public static final String OAUTH_CLIENT = "oauth_client";
|
||||
|
||||
/**
|
||||
* 访问令牌的缓存
|
||||
@@ -65,7 +65,7 @@ public interface RedisKeyConstants {
|
||||
* <p>
|
||||
* 由于动态过期时间,使用 RedisTemplate 操作
|
||||
*/
|
||||
String OAUTH2_ACCESS_TOKEN = "oauth2_access_token:%s";
|
||||
public static final String OAUTH2_ACCESS_TOKEN = "oauth2_access_token:%s";
|
||||
|
||||
/**
|
||||
* 站内信模版的缓存
|
||||
@@ -73,7 +73,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:notify_template:{code}
|
||||
* VALUE 数据格式:String 模版信息
|
||||
*/
|
||||
String NOTIFY_TEMPLATE = "notify_template";
|
||||
public static final String NOTIFY_TEMPLATE = "notify_template";
|
||||
|
||||
/**
|
||||
* 邮件账号的缓存
|
||||
@@ -81,7 +81,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:sms_template:{id}
|
||||
* VALUE 数据格式:String 账号信息
|
||||
*/
|
||||
String MAIL_ACCOUNT = "mail_account";
|
||||
public static final String MAIL_ACCOUNT = "mail_account";
|
||||
|
||||
/**
|
||||
* 邮件模版的缓存
|
||||
@@ -89,7 +89,7 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:mail_template:{code}
|
||||
* VALUE 数据格式:String 模版信息
|
||||
*/
|
||||
String MAIL_TEMPLATE = "mail_template";
|
||||
public static final String MAIL_TEMPLATE = "mail_template";
|
||||
|
||||
/**
|
||||
* 短信模版的缓存
|
||||
@@ -97,15 +97,15 @@ public interface RedisKeyConstants {
|
||||
* KEY 格式:sms_template:{id}
|
||||
* VALUE 数据格式:String 模版信息
|
||||
*/
|
||||
String SMS_TEMPLATE = "sms_template";
|
||||
public static final String SMS_TEMPLATE = "sms_template";
|
||||
|
||||
/**
|
||||
* 短信验证码的缓存
|
||||
*/
|
||||
String SMS_CAPTCHA_VERIFICATION = "sms_captcha_verification:%s";
|
||||
public static final String SMS_CAPTCHA_VERIFICATION = "sms_captcha_verification:%s";
|
||||
|
||||
/**
|
||||
* 短信验证码次数上限的缓存
|
||||
*/
|
||||
String SMS_CAPTCHA_VERIFICATION_LIMIT = "sms_captcha_verification_limit:%s";
|
||||
public static final String SMS_CAPTCHA_VERIFICATION_LIMIT = "sms_captcha_verification_limit:%s";
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,10 +6,10 @@ package com.cf.imes.module.system.dal.redis;
|
||||
* @author Gqr
|
||||
* @since 2024/6/13 14:55
|
||||
*/
|
||||
public interface RedisRefreshChannelTopicConstants {
|
||||
public class RedisRefreshChannelTopicConstants {
|
||||
|
||||
/**
|
||||
* 刷新权限
|
||||
*/
|
||||
String PERMISSION_REFRESH = "PERMISSION_REFRESH";
|
||||
public static final String PERMISSION_REFRESH = "PERMISSION_REFRESH";
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.framework.operatelog.core;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import com.cf.imes.module.system.api.user.dto.AdminUserRespDTO;
|
||||
@@ -42,10 +43,10 @@ public class AdminUserParseFunction implements IParseFunction {
|
||||
}
|
||||
// 返回格式 晨丰科技(13888888888)
|
||||
String nickname = user.getNickname();
|
||||
if (StrUtil.isEmpty(user.getMobile())) {
|
||||
if (CharSequenceUtil.isEmpty(user.getMobile())) {
|
||||
return nickname;
|
||||
}
|
||||
return StrUtil.format("{}({})", nickname, user.getMobile());
|
||||
return CharSequenceUtil.format("{}({})", nickname, user.getMobile());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-7
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.datasource;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch.core.*;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
@@ -67,6 +67,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
|
||||
String MACHINE_DATA_SOURCE = "imes_machine_data_source";
|
||||
|
||||
private static final String FIELD_MACHINEID = "machineId";
|
||||
|
||||
@Override
|
||||
public void createDataSource(List<DataSourceSaveReqVO> createReqVO) {
|
||||
@@ -639,7 +640,9 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
data.append(dataQuery.dataGetMachine(machineDataSourceKeyName14,machineId));
|
||||
}
|
||||
|
||||
|
||||
default -> {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,13 +738,13 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
builder.index(index);
|
||||
|
||||
builder.query(q -> q.bool(b -> b
|
||||
.must(m->m.term(t->t.field("machineId").value(machineId)))
|
||||
.must(m->m.term(t->t.field(FIELD_MACHINEID).value(machineId)))
|
||||
.must(m->m.match(t->t.field("dataSource.parentSourceId").query(parentSourceId)))));
|
||||
|
||||
try {
|
||||
SearchResponse<MachineDataSourceDO> search = elasticsearchClient.search(builder.build(), MachineDataSourceDO.class);
|
||||
List<Hit<MachineDataSourceDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
@@ -758,12 +761,12 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.query(q -> q.term(b -> b.field("machineId").value(machineId)));
|
||||
builder.query(q -> q.term(b -> b.field(FIELD_MACHINEID).value(machineId)));
|
||||
|
||||
try {
|
||||
SearchResponse<MachineDataSourceDO> search = elasticsearchClient.search(builder.build(), MachineDataSourceDO.class);
|
||||
List<Hit<MachineDataSourceDO>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
@@ -779,7 +782,7 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
public void deleteByMachineId(Long machineId, String index) {
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.query(q -> q.term(t -> t.field("machineId").value(machineId)));
|
||||
builder.query(q -> q.term(t -> t.field(FIELD_MACHINEID).value(machineId)));
|
||||
try {
|
||||
DeleteByQueryResponse response = elasticsearchClient.deleteByQuery(builder.build());
|
||||
log.info("Deleted {} documents with planId {}", response.deleted(), machineId);
|
||||
|
||||
+2
-4
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.system.service.dict;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
@@ -23,8 +23,6 @@ import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 字典类型 Service 实现类
|
||||
*
|
||||
@@ -127,7 +125,7 @@ public class DictTypeServiceImpl implements DictTypeService {
|
||||
|
||||
@VisibleForTesting
|
||||
void validateDictTypeUnique(Long id, String type) {
|
||||
if (StrUtil.isEmpty(type)) {
|
||||
if (CharSequenceUtil.isEmpty(type)) {
|
||||
return;
|
||||
}
|
||||
DictTypeDO dictType = dictTypeMapper.selectByType(type);
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.labeltemplate;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -102,7 +102,7 @@ public class LabelTemplateServiceImpl implements LabelTemplateService {
|
||||
.eq(LabelTemplateDO::getIsDefault, Boolean.TRUE)
|
||||
.eq(LabelTemplateDO::getType, type)
|
||||
);
|
||||
if(CollectionUtil.isNotEmpty(labelTemplateDOS)) {
|
||||
if(CollUtil.isNotEmpty(labelTemplateDOS)) {
|
||||
if (labelTemplateDOS.size() > 1) {
|
||||
throw exception(DEFAULT_TEMPLATE_COUNT);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.system.service.logger;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.common.util.string.StrUtils;
|
||||
@@ -54,7 +54,7 @@ public class OperateLogServiceImpl implements OperateLogService {
|
||||
public PageResult<OperateLogDO> getOperateLogPage(OperateLogPageReqVO pageReqVO) {
|
||||
// 处理基于用户昵称的查询
|
||||
Collection<Long> userIds = null;
|
||||
if (StrUtil.isNotEmpty(pageReqVO.getUserNickname())) {
|
||||
if (CharSequenceUtil.isNotEmpty(pageReqVO.getUserNickname())) {
|
||||
userIds = convertSet(userService.getUserListByNickname(pageReqVO.getUserNickname()), AdminUserDO::getId);
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
return PageResult.empty();
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.machine;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.TermQuery;
|
||||
@@ -369,7 +369,7 @@ public class MachineServiceImpl implements MachineService {
|
||||
@Override
|
||||
public void batchDeleteCutting(List<Long> ids) {
|
||||
List<MachineDO> machineDOS = machineMapper.selectBatchIds(ids);
|
||||
if (CollectionUtil.isEmpty(machineDOS)) {
|
||||
if (CollUtil.isEmpty(machineDOS)) {
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
}
|
||||
machineMapper.deleteBatchIds(ids);
|
||||
@@ -646,7 +646,7 @@ public class MachineServiceImpl implements MachineService {
|
||||
try {
|
||||
SearchResponse<?> search = elasticsearchClient.search(builder.build(), clazz);
|
||||
List<? extends Hit<?>> hits = search.hits().hits();
|
||||
if (CollectionUtil.isNotEmpty(hits)) {
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
Hit<?> hit = hits.get(0);
|
||||
return hit.source();
|
||||
}
|
||||
|
||||
+2
-6
@@ -1,11 +1,8 @@
|
||||
package com.cf.imes.module.system.service.machine;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.Result;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.*;
|
||||
import co.elastic.clients.elasticsearch.core.IndexResponse;
|
||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -18,7 +15,6 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -40,7 +36,7 @@ public class MachineSettingServiceImpl implements MachineSettingService {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
List<MachineDO> userMachineDOS = new ArrayList<>();
|
||||
List<Query> queryList = new ArrayList<>();
|
||||
if(StrUtil.isNotEmpty(pageReqVO.getName())) {
|
||||
if(CharSequenceUtil.isNotEmpty(pageReqVO.getName())) {
|
||||
MatchQuery query = MatchQuery.of(e -> e.field("name").query(pageReqVO.getName()));
|
||||
queryList.add(query._toQuery());
|
||||
}
|
||||
|
||||
+2
-7
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.machine;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
@@ -47,11 +47,6 @@ import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
@Slf4j
|
||||
public class MachineTemplateServiceImpl implements MachineTemplateService {
|
||||
|
||||
//开料机台模板配置索引
|
||||
private static final String CUTTING_MACHINE_INX = "cutting_machine_template";
|
||||
//钻孔机台模板配置索引
|
||||
private static final String DRILL_MACHINE_INX = "drill_machine_template";
|
||||
|
||||
|
||||
@Resource
|
||||
private UserMachineMapper userMachineMapper;
|
||||
@@ -418,7 +413,7 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auth(MachineAuthVO vo) {
|
||||
userMachineMapper.delete(new LambdaQueryWrapperX<UserMachineDO>().eq(UserMachineDO::getUserId, vo.getUserId()));
|
||||
if (CollectionUtil.isNotEmpty(vo.getMachinesIds())) {
|
||||
if (CollUtil.isNotEmpty(vo.getMachinesIds())) {
|
||||
ArrayList<UserMachineDO> userMachineDOS = new ArrayList<>();
|
||||
for (Long machinesId : vo.getMachinesIds()) {
|
||||
userMachineDOS.add(UserMachineDO.builder()
|
||||
|
||||
+4
-6
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.mail;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.extra.mail.MailAccount;
|
||||
import cn.hutool.extra.mail.MailUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
@@ -23,8 +23,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 邮箱发送 Service 实现类
|
||||
*
|
||||
@@ -55,7 +53,7 @@ public class MailSendServiceImpl implements MailSendService {
|
||||
public Long sendSingleMailToAdmin(String mail, Long userId,
|
||||
String templateCode, Map<String, Object> templateParams) {
|
||||
// 如果 mail 为空,则加载用户编号对应的邮箱
|
||||
if (StrUtil.isEmpty(mail)) {
|
||||
if (CharSequenceUtil.isEmpty(mail)) {
|
||||
AdminUserDO user = adminUserService.getUser(userId);
|
||||
if (user != null) {
|
||||
mail = user.getEmail();
|
||||
@@ -69,7 +67,7 @@ public class MailSendServiceImpl implements MailSendService {
|
||||
public Long sendSingleMailToMember(String mail, Long userId,
|
||||
String templateCode, Map<String, Object> templateParams) {
|
||||
// 如果 mail 为空,则加载用户编号对应的邮箱
|
||||
if (StrUtil.isEmpty(mail)) {
|
||||
if (CharSequenceUtil.isEmpty(mail)) {
|
||||
mail = memberService.getMemberUserEmail(userId);
|
||||
}
|
||||
// 执行发送
|
||||
@@ -143,7 +141,7 @@ public class MailSendServiceImpl implements MailSendService {
|
||||
|
||||
@VisibleForTesting
|
||||
String validateMail(String mail) {
|
||||
if (StrUtil.isEmpty(mail)) {
|
||||
if (CharSequenceUtil.isEmpty(mail)) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.MAIL_SEND_MAIL_NOT_EXISTS);
|
||||
}
|
||||
return mail;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.mail;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
@@ -81,7 +81,7 @@ public class MailTemplateServiceImpl implements MailTemplateService {
|
||||
}
|
||||
// 存在 template 记录的情况下
|
||||
if (id == null // 新增时,说明重复
|
||||
|| ObjUtil.notEqual(id, template.getId())) { // 更新时,如果 id 不一致,说明重复
|
||||
|| ObjectUtil.notEqual(id, template.getId())) { // 更新时,如果 id 不一致,说明重复
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.MAIL_TEMPLATE_CODE_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package com.cf.imes.module.system.service.oauth2;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -123,11 +123,11 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService {
|
||||
}
|
||||
|
||||
// 校验客户端密钥
|
||||
if (StrUtil.isNotEmpty(clientSecret) && ObjectUtil.notEqual(client.getSecret(), clientSecret)) {
|
||||
if (CharSequenceUtil.isNotEmpty(clientSecret) && ObjectUtil.notEqual(client.getSecret(), clientSecret)) {
|
||||
throw exception(OAUTH2_CLIENT_CLIENT_SECRET_ERROR);
|
||||
}
|
||||
// 校验授权方式
|
||||
if (StrUtil.isNotEmpty(authorizedGrantType) && !CollUtil.contains(client.getAuthorizedGrantTypes(), authorizedGrantType)) {
|
||||
if (CharSequenceUtil.isNotEmpty(authorizedGrantType) && !CollUtil.contains(client.getAuthorizedGrantTypes(), authorizedGrantType)) {
|
||||
throw exception(OAUTH2_CLIENT_AUTHORIZED_GRANT_TYPE_NOT_EXISTS);
|
||||
}
|
||||
// 校验授权范围
|
||||
@@ -135,7 +135,7 @@ public class OAuth2ClientServiceImpl implements OAuth2ClientService {
|
||||
throw exception(OAUTH2_CLIENT_SCOPE_OVER);
|
||||
}
|
||||
// 校验回调地址
|
||||
if (StrUtil.isNotEmpty(redirectUri) && !StrUtils.startWithAny(redirectUri, client.getRedirectUris())) {
|
||||
if (CharSequenceUtil.isNotEmpty(redirectUri) && !StrUtils.startWithAny(redirectUri, client.getRedirectUris())) {
|
||||
throw exception(OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH, redirectUri);
|
||||
}
|
||||
return client;
|
||||
|
||||
+8
-8
@@ -3,8 +3,8 @@ package com.cf.imes.module.system.service.organ;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.collection.CollectionUtils;
|
||||
@@ -133,8 +133,8 @@ public class OrganServiceImpl implements OrganService {
|
||||
// 创建组织
|
||||
OrganizationDO tenant = BeanUtils.toBean(createReqVO, OrganizationDO.class);
|
||||
String pinyinFull = PinYinUtils.convertToPinyin(tenant.getName());
|
||||
if(StrUtil.isNotBlank(pinyinFull)) {
|
||||
pinyinFull = pinyinFull.replaceAll(" ", "");
|
||||
if(CharSequenceUtil.isNotBlank(pinyinFull)) {
|
||||
pinyinFull = pinyinFull.replace(" ", "");
|
||||
}
|
||||
tenant.setPinyinFull(pinyinFull);
|
||||
tenant.setLarge(createReqVO.getLarge() == null ? Boolean.FALSE : createReqVO.getLarge());
|
||||
@@ -203,8 +203,8 @@ public class OrganServiceImpl implements OrganService {
|
||||
TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId());
|
||||
if(!Objects.equals(tenant.getName(), updateReqVO.getName())) {
|
||||
String pinyinFull = PinYinUtils.convertToPinyin(tenant.getName());
|
||||
if(StrUtil.isNotBlank(pinyinFull)) {
|
||||
pinyinFull = pinyinFull.replaceAll(" ", "");
|
||||
if(CharSequenceUtil.isNotBlank(pinyinFull)) {
|
||||
pinyinFull = pinyinFull.replace(" ", "");
|
||||
}
|
||||
tenant.setPinyinFull(pinyinFull);
|
||||
tenant.setPinyinInitial(PinYinUtils.convertFirstChar(tenant.getName()));
|
||||
@@ -233,7 +233,7 @@ public class OrganServiceImpl implements OrganService {
|
||||
}
|
||||
|
||||
private void validTenantWebsiteDuplicate(String website, Long id) {
|
||||
if (StrUtil.isEmpty(website)) {
|
||||
if (CharSequenceUtil.isEmpty(website)) {
|
||||
return;
|
||||
}
|
||||
OrganizationDO tenant = organMapper.selectByWebsite(website);
|
||||
@@ -301,9 +301,9 @@ public class OrganServiceImpl implements OrganService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrganizationDO> getOrganPage(OrganPageReqVO pageReqVO) {
|
||||
if(StrUtil.isNotBlank(pageReqVO.getName())) {
|
||||
if(CharSequenceUtil.isNotBlank(pageReqVO.getName())) {
|
||||
pageReqVO.setPyFirstChar(PinYinUtils.convertFirstChar(pageReqVO.getName()));
|
||||
pageReqVO.setPyAll(PinYinUtils.convertToPinyin(pageReqVO.getName()).replaceAll(" ", ""));
|
||||
pageReqVO.setPyAll(PinYinUtils.convertToPinyin(pageReqVO.getName()).replace(" ", ""));
|
||||
}
|
||||
return organMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.system.service.permission;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||
@@ -180,7 +179,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
}
|
||||
cursor.close();
|
||||
// 删除匹配到的key
|
||||
if (CollectionUtil.isNotEmpty(delKeys)) {
|
||||
if (CollUtil.isNotEmpty(delKeys)) {
|
||||
return redisTemplate.delete(delKeys);
|
||||
}
|
||||
return 0L;
|
||||
|
||||
+4
-5
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.system.service.permission;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
@@ -224,7 +223,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
|
||||
@Override
|
||||
public List<RoleDO> getRoleList(Collection<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return roleMapper.selectBatchIds(ids);
|
||||
@@ -232,7 +231,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
|
||||
@Override
|
||||
public List<RoleDO> getRoleListFromCache(Collection<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 这里采用 for 循环从缓存中获取,主要考虑 Spring CacheManager 无法批量操作的问题
|
||||
@@ -249,7 +248,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
|
||||
@Override
|
||||
public boolean hasAnySuperAdmin(Collection<Long> ids) {
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
RoleServiceImpl self = getSelf();
|
||||
@@ -291,7 +290,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
@Override
|
||||
@OrganIgnore
|
||||
public List<RoleDO> getRoleList1(Set<Long> roleIds) {
|
||||
if (CollectionUtil.isEmpty(roleIds)) {
|
||||
if (CollUtil.isEmpty(roleIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return roleMapper.selectBatchIds(roleIds);
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.module.system.service.sms;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
@@ -115,7 +115,7 @@ public class SmsChannelServiceImpl implements SmsChannelService {
|
||||
*/
|
||||
private void clearCache(Long id, String code) {
|
||||
idClientCache.invalidate(id);
|
||||
if (StrUtil.isNotEmpty(code)) {
|
||||
if (CharSequenceUtil.isNotEmpty(code)) {
|
||||
codeClientCache.invalidate(code);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
|
||||
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -321,7 +321,7 @@ public class SocialClientServiceImpl implements SocialClientService {
|
||||
return;
|
||||
}
|
||||
if (id == null // 新增时,说明重复
|
||||
|| ObjUtil.notEqual(id, client.getId())) { // 更新时,如果 id 不一致,说明重复
|
||||
|| ObjectUtil.notEqual(id, client.getId())) { // 更新时,如果 id 不一致,说明重复
|
||||
throw exception(SOCIAL_CLIENT_UNIQUE);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ package com.cf.imes.module.system.util.oauth2;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.util.http.HttpUtils;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
|
||||
@@ -97,7 +97,7 @@ public class OAuth2Utils {
|
||||
}
|
||||
|
||||
public static List<String> buildScopes(String scope) {
|
||||
return StrUtil.split(scope, ' ');
|
||||
return CharSequenceUtil.split(scope, ' ');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user