提交 45504dd9 authored 作者: 李瑞鑫's avatar 李瑞鑫

sonar 检测问题修改

上级 1dfbe045
......@@ -13,6 +13,7 @@ import com.clx.performance.param.app.SendMobileCaptchaParam;
import com.msl.common.exception.ServiceSystemException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -80,9 +81,8 @@ public class SendMessageMachineCheckComponent {
//response的code枚举:100验签通过,900验签失败
AuthenticateSigResponse response = client.getAcsResponse(request);
resultCode = response.getCode();
// TODO
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return resultCode;
}
......@@ -113,7 +113,7 @@ public class SendMessageMachineCheckComponent {
}
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
}
}
......
package com.clx.performance.encryption.oldmsl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bouncycastle.util.encoders.Base64;
import javax.crypto.Cipher;
......@@ -18,6 +20,7 @@ import java.util.Map;
* @date 2017年4月13日
* @description
*/
@Slf4j
public class RSACoder {
public static final String KEY_ALGORITHM = "RSA";
public static final String SIGNATURE_ALGORITHM = "MD5withRSA";
......@@ -67,7 +70,7 @@ public class RSACoder {
byte[] dataBytes = Base64.encode(signature.sign());
ret = new String(dataBytes);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......@@ -118,7 +121,7 @@ public class RSACoder {
// 验证签名是否正常
ret = signature.verify(Base64.decode(sign));
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......@@ -181,7 +184,7 @@ public class RSACoder {
cipher.init(Cipher.DECRYPT_MODE, privateKey);
ret = cipher.doFinal(data);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......@@ -259,7 +262,7 @@ public class RSACoder {
cipher.init(Cipher.DECRYPT_MODE, publicKey);
ret = cipher.doFinal(data);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......@@ -321,7 +324,7 @@ public class RSACoder {
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
ret = cipher.doFinal(data);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......@@ -398,7 +401,7 @@ public class RSACoder {
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
ret = cipher.doFinal(data);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
return ret;
}
......
......@@ -46,7 +46,7 @@ public class NetworkDriverAccountSyncJob {
param.setMobile(vo.getMobile());
try {
Thread.sleep(2000L);
} catch (InterruptedException e) {
} catch (Exception e) {
throw new RuntimeException(e);
}
networkDriverAccountService.createNetworkDriverAccount(param);
......
......@@ -7,6 +7,7 @@ import com.clx.performance.model.OrderGoods;
import com.clx.performance.service.IntegralMqService;
import com.msl.common.base.Optional;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -47,7 +48,7 @@ public class RabbitOrderGoodsStatusOnHandler {
orderGoods.getSendAddressId(), orderGoods.getSendAddressShorter(),
orderGoods.getReceiveAddressId(), orderGoods.getReceiveAddressShorter());
}catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
}
......
......@@ -146,7 +146,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
orderChildPoundLogDao.saveEntity(poundLog);
//保存运单日志数据
orderChildLogService.saveOrderChildLog(param.getChildNo(),type,OrderChildLogEnum.Type.getByCode(type).get().getMsg(),
orderChildLogService.saveOrderChildLog(param.getChildNo(),type,OrderChildLogEnum.Type.getByCode(type).isPresent() ? OrderChildLogEnum.Type.getByCode(type).get().getMsg() :"",
OrderChildLogEnum.CreateType.PLATFORM.getCode(), loginUserInfo.getUserNo(),loginUserInfo.getUserName());
}
......
......@@ -58,6 +58,7 @@ import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
......@@ -202,7 +203,7 @@ public class OrderChildServiceImpl implements OrderChildService {
try {
flag = lock.tryLock(1, 3, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SAVE_FAIL, e.getMessage());
}
if (!flag) {
......@@ -229,7 +230,7 @@ public class OrderChildServiceImpl implements OrderChildService {
} catch (ServiceSystemException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtils.getStackTrace(e));
throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SAVE_FAIL, e.getMessage());
} finally {
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论