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

sonar 检测问题修改

上级 2f0aa4cc
......@@ -14,19 +14,19 @@ import java.math.BigDecimal;
*/
public class WalletResidueDTO {
//余额
@ApiModelProperty(value = "余额", dataType = "double", example = "11.10")
private Long residue;
//冻结的资金
@ApiModelProperty(value = "冻结的资金", dataType = "double", example = "11.10")
private Long frozen;
//保证金
@ApiModelProperty(value = "保证金", dataType = "double", example = "11.10")
private Double deposit;
//状态0锁定1正常2异常
@ApiModelProperty(value = "状态0锁定1正常2异常", dataType = "int", example = "1")
private Integer status;
//是否设置交易密码0没有1有
@ApiModelProperty(value = "是否设置交易密码0没有1有", dataType = "String", example = "1")
private String pwd;
......@@ -56,7 +56,7 @@ public class WalletResidueDTO {
}
@JsonGetter(value="frozen")
public BigDecimal frozenFormat() {
return new BigDecimal(new Double(this.frozen)/100);
return BigDecimal.valueOf(new Double(this.frozen)/100);
}
@JsonGetter(value="residue")
public Double residueFormat() {
......@@ -64,7 +64,7 @@ public class WalletResidueDTO {
}
@JsonGetter(value="deposit")
public Double depositFormat() {
return new Double(this.deposit)/100;
return this.deposit/100;
}
public Double getDeposit() {
......
......@@ -38,7 +38,7 @@ public class OrderNoGenerateJob implements InitializingBean {
* 提前生成订单号
*/
@XxlJob("generateOrderNo")
public void generateOrderNo()throws InterruptedException {
public void generateOrderNo(){
LocalDateTime today = LocalDateTime.now();
//检验今天的订单池有没有,没有就生成一套
String todayKey = RedisConstants.CARRIER_ORDER_NUM_POOL_KEY.replace("{date}", today.format(DateTimeFormatter.BASIC_ISO_DATE));
......@@ -150,14 +150,14 @@ public class OrderNoGenerateJob implements InitializingBean {
*/
@Override
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet(){
//初始化redis中的订单池
executor.execute(new Runnable() {
@Override
public void run() {
try {
generateOrderNo();
} catch (InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
......
......@@ -89,8 +89,10 @@ public class PaymentServiceImpl implements PaymentService {
log.info("发起支付请求日志 {}", JSON.toJSONString(payUserDTO));
Result<Object> notify = (Result<Object>) postRequest(mslPaymentConfig.getHost()+ PERFORMANCE_PAY_CLX_PAYMENT.getUrl(), JSON.toJSONString(payUserDTO));
log.info("支付返回日志 {}", notify);
if (notify == null || notify.getCode() != 0) {
//FEGIN返回null
if (notify == null) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR);
}
if (notify.getCode() != 0) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, notify.getMsg());
}
return notify;
......@@ -130,8 +132,10 @@ public class PaymentServiceImpl implements PaymentService {
log.info("发起支付请求日志 {}", payUserDTO);
Result<Object> notify = (Result<Object>) postRequest(mslPaymentConfig.getHost()+ PERFORMANCE_PAY_CLX_PAYMENT.getUrl(), JSON.toJSONString(payUserDTO));
log.info("支付返回日志 {}", notify);
if (notify == null || notify.getCode() != 0) {
//FEGIN返回null
if (notify == null) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR);
}
if (notify.getCode() != 0) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, notify.getMsg());
}
return notify;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论