mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 13:22:07 +08:00
sonar代码规范问题修复;
This commit is contained in:
+2
-2
@@ -2,7 +2,7 @@ package com.cf.imes.framework.organ.core.job;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.organ.core.service.OrganFrameworkService;
|
||||
import com.cf.imes.framework.organ.core.util.OrganUtils;
|
||||
@@ -51,7 +51,7 @@ public class OrganJobAspect {
|
||||
} catch (Throwable e) {
|
||||
results.put(organId, ExceptionUtil.getRootCauseMessage(e));
|
||||
// 打印异常
|
||||
XxlJobHelper.log(StrUtil.format("[多组织({}) 执行任务({}),发生异常:{}]",
|
||||
XxlJobHelper.log(CharSequenceUtil.format("[多组织({}) 执行任务({}),发生异常:{}]",
|
||||
organId, joinPoint.getSignature(), ExceptionUtils.getStackTrace(e)));
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.framework.organ.core.mq.kafka;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.env.EnvironmentPostProcessor;
|
||||
@@ -23,7 +23,7 @@ public class OrganKafkaEnvironmentPostProcessor implements EnvironmentPostProces
|
||||
// 添加 OrganKafkaProducerInterceptor 拦截器
|
||||
try {
|
||||
String value = environment.getProperty(PROPERTY_KEY_INTERCEPTOR_CLASSES);
|
||||
if (StrUtil.isEmpty(value)) {
|
||||
if (CharSequenceUtil.isEmpty(value)) {
|
||||
value = OrganKafkaProducerInterceptor.class.getName();
|
||||
} else {
|
||||
value += "," + OrganKafkaProducerInterceptor.class.getName();
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.cf.imes.framework.organ.core.mq.redis;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.mq.redis.core.interceptor.RedisMessageInterceptor;
|
||||
import com.cf.imes.framework.mq.redis.core.message.AbstractRedisMessage;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
@@ -28,7 +28,7 @@ public class OrganRedisMessageInterceptor implements RedisMessageInterceptor {
|
||||
@Override
|
||||
public void consumeMessageBefore(AbstractRedisMessage message) {
|
||||
String organIdStr = message.getHeader(HEADER_ORGAN_ID);
|
||||
if (StrUtil.isNotEmpty(organIdStr)) {
|
||||
if (CharSequenceUtil.isNotEmpty(organIdStr)) {
|
||||
OrganContextHolder.setOrganId(Long.valueOf(organIdStr));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.framework.organ.core.mq.rocketmq;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import org.apache.rocketmq.client.hook.ConsumeMessageContext;
|
||||
import org.apache.rocketmq.client.hook.ConsumeMessageHook;
|
||||
@@ -33,7 +33,7 @@ public class OrganRocketMQConsumeMessageHook implements ConsumeMessageHook {
|
||||
Assert.isTrue(messages.size() == 1, "消息条数({})不正确", messages.size());
|
||||
// 设置组织编号
|
||||
String organId = messages.get(0).getUserProperty(HEADER_ORGAN_ID);
|
||||
if (StrUtil.isNotEmpty(organId)) {
|
||||
if (CharSequenceUtil.isNotEmpty(organId)) {
|
||||
OrganContextHolder.setOrganId(Long.parseLong(organId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user