对交易状态的判定问题处理
This commit is contained in:
parent
007d69a887
commit
96e779eb28
@ -1,5 +1,6 @@
|
||||
package cn.lili.modules.order.order.entity.dos;
|
||||
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.mybatis.BaseEntity;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum;
|
||||
@ -82,6 +83,7 @@ public class Trade extends BaseEntity {
|
||||
}
|
||||
BeanUtil.copyProperties(tradeDTO, this);
|
||||
BeanUtil.copyProperties(tradeDTO.getPriceDetailDTO(), this);
|
||||
this.setPayStatus(PayStatusEnum.UNPAID.name());
|
||||
this.setId(originId);
|
||||
}
|
||||
}
|
@ -642,7 +642,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
public Double getPaymentTotal(String orderSn) {
|
||||
Order order = this.getBySn(orderSn);
|
||||
Trade trade = tradeService.getBySn(order.getTradeSn());
|
||||
if (trade.getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
||||
//如果交易不为空,则返回交易的金额,否则返回订单金额
|
||||
if (StringUtils.isNotEmpty(trade.getPayStatus())
|
||||
&& trade.getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
||||
return trade.getFlowPrice();
|
||||
}
|
||||
return order.getFlowPrice();
|
||||
|
Loading…
x
Reference in New Issue
Block a user