|
|
@@ -278,8 +278,11 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
public void unifiedRefund(OrderRefundReq refundReq) throws Exception {
|
|
|
OrderDon orderDon = orderDonMapper.selectById(refundReq.getOrderId());
|
|
|
- GoodsDonSku sku = goodsDonSkuMapper.selectById(orderDon.getSkuId());
|
|
|
- GoodsDon goodsDon = goodsDonMapper.selectById(sku.getGoodsId());
|
|
|
+ GoodsDonSku sku = null;
|
|
|
+ if (orderDon.getSkuId() != null) {
|
|
|
+ sku = goodsDonSkuMapper.selectById(orderDon.getSkuId());
|
|
|
+ }
|
|
|
+ GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
|
|
|
if (StrUtil.isEmpty(refundReq.getRefundType())) {
|
|
|
refundReq.setRefundType("money");
|
|
|
}
|
|
|
@@ -557,7 +560,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (OrderDon.Status.noPayment == orderDon.getStatus() || OrderDon.Status.close == orderDon.getStatus()) {
|
|
|
throw BusinessRuntimeException.getInstance("订单{0}状态不支持退款", orderDon.getStatus());
|
|
|
}
|
|
|
- if (goodsDon.getType() == 1) {
|
|
|
+ if (goodsDon.getType() == 1 && sku != null) {
|
|
|
//虚拟原订单是否已过期
|
|
|
Integer months = sku.getMonths();
|
|
|
Integer days = sku.getDays();
|