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

sonar 检测问题修改

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