|
@@ -178,6 +178,8 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
private final OrderMasterDonService orderMasterDonService;
|
|
private final OrderMasterDonService orderMasterDonService;
|
|
|
|
|
|
|
|
private final CouponMapper couponMapper;
|
|
private final CouponMapper couponMapper;
|
|
|
|
|
+
|
|
|
|
|
+ private final UserGalaxycoinRecordMapper userGalaxycoinRecordMapper;
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -740,6 +742,25 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.balance, orderDon.getYhsId());
|
|
userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.balance, orderDon.getYhsId());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //存在银河币支付,退还银河币
|
|
|
|
|
+ BigDecimal galaxycoin = orderDon.getGalaxycoin();
|
|
|
|
|
+ if (galaxycoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ userBenefitsService.updateGalaxycoin(orderDon.getUserId(), orderDon.getMOid(), galaxycoin, UserGalaxycoinRecord.Source.refund_return);
|
|
|
|
|
+ }
|
|
|
|
|
+ //退款多少扣除多少银河币
|
|
|
|
|
+ BigDecimal refundGalaxycoin = orderDon.getRefundMoney().add(orderDon.getBalance());
|
|
|
|
|
+ if (refundGalaxycoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ UserGalaxycoinRecord userGalaxycoinRecord = userGalaxycoinRecordMapper.selectOne(Wrappers.lambdaQuery(UserGalaxycoinRecord.class)
|
|
|
|
|
+ .eq(UserGalaxycoinRecord::getMOid, orderDon.getMOid())
|
|
|
|
|
+ .eq(UserGalaxycoinRecord::getSource, UserGalaxycoinRecord.Source.payment)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ //存在下单返银河币
|
|
|
|
|
+ if (userGalaxycoinRecord != null) {
|
|
|
|
|
+ userBenefitsService.updateGalaxycoin(orderDon.getUserId(), orderDon.getMOid(), refundGalaxycoin.negate(), UserGalaxycoinRecord.Source.refund_return);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
|
|
marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
|
|
|
if (goodsDon.getType() == 2) {
|
|
if (goodsDon.getType() == 2) {
|
|
@@ -851,12 +872,6 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
giftCardOrderUseRecordService.returnGiftCardCash(orderDon.getId());
|
|
giftCardOrderUseRecordService.returnGiftCardCash(orderDon.getId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //记录银河币明细
|
|
|
|
|
- BigDecimal refundGalaxycoin = orderDon.getGalaxycoin();
|
|
|
|
|
- if (refundGalaxycoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
- userBenefitsService.updateGalaxycoin(orderDon.getUserId(), refundGalaxycoin.negate(), UserGalaxycoinRecord.Source.refund);
|
|
|
|
|
- }
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|