Commit 7447d990 authored by 于桐's avatar 于桐

sonar fix

parent 3d99e408
......@@ -60,7 +60,8 @@ public class RedisLockAspect {
} else if (StringUtils.isNotBlank(annotation.key())) {
String keySPEL = annotation.key();
try {
if (keySPEL.startsWith("#this")) {//判断是否是spel表达式
String keyPrefix = "#this";
if (keySPEL.startsWith(keyPrefix)) {//判断是否是spel表达式
Expression expression = new SpelExpressionParser().parseExpression(keySPEL);
String value = expression.getValue(args, String.class);
lockKey = prefix.concat(":").concat(value);
......
......@@ -24,8 +24,8 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
private String routingKey;
@Resource
private RabbitTemplate registeredNotifyBlackHoleRabbitTemplate;
long [] templateIds = {8l,280l};
long [] templateIds_159913 = {433l,434l}; // 羊小咩小程序的渠道,合同内容不包含现金分期业务,如果这种情况较多可以考虑配置化
private long [] templateIds = {8L,280L};
private long [] templateIds_159913 = {433L,434L}; // 羊小咩小程序的渠道,合同内容不包含现金分期业务,如果这种情况较多可以考虑配置化
private static final Long YXM_CHANNEL = 159913L; // 羊小咩小程序的渠道(小程序_电商,小程序_VCC)
@Override
......@@ -37,7 +37,7 @@ public class BlackHoleRegisteredEventListener implements ApplicationListener<Reg
String dateStr = signDate.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"));
int day = signDate.getDayOfMonth();
// 信用钱包服务与隐私协议
long[] regTempIds = userRegisterParam.getRegisterFrom().equals(YXM_CHANNEL) ? templateIds_159913 : templateIds;
long[] regTempIds = YXM_CHANNEL.equals(userRegisterParam.getRegisterFrom()) ? templateIds_159913 : templateIds;
for (long id : regTempIds) {
JSONObject fields = new JSONObject();
fields.put("phoneNo", user.getPhoneNo());
......
......@@ -261,7 +261,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
List<UserHashMapping> userHashMappings = userHashMappingRepository.findByIdNoMd5AndIdNoMd5Short(md5Value, value);
if (!CollectionUtils.isEmpty(userHashMappings)) {
//如果多个只返回最新的
userHashMapping = userHashMappings.stream().max(Comparator.comparing(UserHashMapping::getId)).get();
userHashMapping = userHashMappings.stream().max(Comparator.comparing(UserHashMapping::getId)).orElse(null);
}
} else {
userHashMapping = null;
......
......@@ -221,8 +221,11 @@ public class RedisLock {
retryCount++;
if (timeout > 100) {
timeout -= 100; }
else
timeout = 1; {
else {
timeout = 1;
}
// TODO sonar检查,else语句缺少大括号发现问题,下面这个大括号什么鬼?
{
Thread.sleep(100); }
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment