Browse Source

支付接口微调

v1.0
15989082884@163.com 2 years ago
parent
commit
99e433c3a5
  1. 4
      src/main/java/com/qs/serve/modules/pay/entity/bo/PayPaymentBo.java
  2. 14
      src/main/java/com/qs/serve/modules/pay/service/impl/PayPaymentServiceImpl.java

4
src/main/java/com/qs/serve/modules/pay/entity/bo/PayPaymentBo.java

@ -31,8 +31,8 @@ public class PayPaymentBo implements Serializable {
private String verificationSubCode;
/** 支付金额 */
@DecimalMin(value = "0.01",message = "支付金额必须大于0元")
@NotNull(message = "支付金额不能为空")
// @DecimalMin(value = "0.01",message = "支付金额必须大于0元")
// @NotNull(message = "支付金额不能为空")
private BigDecimal payAmount;
/** ERP编码 */

14
src/main/java/com/qs/serve/modules/pay/service/impl/PayPaymentServiceImpl.java

@ -106,6 +106,10 @@ public class PayPaymentServiceImpl extends ServiceImpl<PayPaymentMapper,PayPayme
}
BigDecimal notPayAmount = verificationAmount.subtract(payedAmount);
if(paymentBo.getPayAmount()==null){
Assert.throwEx("支付金额不能为空!");
}
if(paymentBo.getPayAmount().compareTo(notPayAmount)>0){
Assert.throwEx("支付金额已超出可支付额");
}
@ -218,11 +222,15 @@ public class PayPaymentServiceImpl extends ServiceImpl<PayPaymentMapper,PayPayme
}
BigDecimal notPayAmount = verificationAmount.subtract(payedAmount);
if(paymentBo.getPayAmount().compareTo(notPayAmount)>0){
Assert.throwEx("支付金额已超出可支付额");
if(1 != paymentBo.getRelease()) {
if(paymentBo.getPayAmount()==null){
Assert.throwEx("支付金额不能为空!");
}
if (paymentBo.getPayAmount().compareTo(notPayAmount) > 0) {
Assert.throwEx("支付金额已超出可支付额");
}
}
PayPayment payPayment = new PayPayment();
payPayment.setPayType("unPay");
payPayment.setPayCode(paymentBo.getErpId());

Loading…
Cancel
Save