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

sonar 检测问题修改

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