|
|
@@ -990,182 +990,180 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
* 退款后 处理关联
|
|
|
*/
|
|
|
public void commonRefund(OrderDon orderDon, BigDecimal refundMoney, String operator, GoodsDon goodsDon, GoodsDonSku sku, String outNo, String refundType, Boolean isOnly, BigDecimal refundBalance, String chatImg, BigDecimal deductBalance) {
|
|
|
- TASK_POOL.execute(() -> {
|
|
|
- orderRefundService.refundRecord(orderDon, refundMoney, operator, goodsDon, sku, outNo, refundType, chatImg);
|
|
|
- //退款一次
|
|
|
- goodsDonStockService.upStockRelate(null, orderDon.getId(), "refund");
|
|
|
- try {
|
|
|
- //虚物订单退款,清出车队,车票变为已过期
|
|
|
- orderCommonService.clearUnrealGoodsDetail(orderDon, goodsDon.getType(), sku);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("清除车票错误:{}", StringUtil.getErrorText(e));
|
|
|
- }
|
|
|
- //若存在优惠券使用,退还优惠券
|
|
|
- if (orderDon.getCouponUserId() != 0) {
|
|
|
- couponFontService.updateOrderDonCouponStatus(orderDon);
|
|
|
- }
|
|
|
- //退等比例
|
|
|
- if (isOnly != null && isOnly) {
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
- BigDecimal orderDonRefundBalance = Optional.ofNullable(orderDon.getRefundBalance()).orElse(BigDecimal.ZERO);
|
|
|
- orderDon.setRefundBalance(orderDonRefundBalance.add(refundBalance));
|
|
|
- }
|
|
|
+ orderRefundService.refundRecord(orderDon, refundMoney, operator, goodsDon, sku, outNo, refundType, chatImg);
|
|
|
+ //退款一次
|
|
|
+ goodsDonStockService.upStockRelate(null, orderDon.getId(), "refund");
|
|
|
+ try {
|
|
|
+ //虚物订单退款,清出车队,车票变为已过期
|
|
|
+ orderCommonService.clearUnrealGoodsDetail(orderDon, goodsDon.getType(), sku);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("清除车票错误:{}", StringUtil.getErrorText(e));
|
|
|
+ }
|
|
|
+ //若存在优惠券使用,退还优惠券
|
|
|
+ if (orderDon.getCouponUserId() != 0) {
|
|
|
+ couponFontService.updateOrderDonCouponStatus(orderDon);
|
|
|
+ }
|
|
|
+ //退等比例
|
|
|
+ if (isOnly != null && isOnly) {
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
+ BigDecimal orderDonRefundBalance = Optional.ofNullable(orderDon.getRefundBalance()).orElse(BigDecimal.ZERO);
|
|
|
+ orderDon.setRefundBalance(orderDonRefundBalance.add(refundBalance));
|
|
|
+ }
|
|
|
|
|
|
- //若存在余额支付,退还余额
|
|
|
- if (isOnly == null && orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- BigDecimal addBalance = orderDon.getBalance();
|
|
|
- //需额外扣除余额
|
|
|
- if (deductBalance != null && deductBalance.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- addBalance = addBalance.subtract(deductBalance);
|
|
|
- }
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), addBalance, UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
+ //若存在余额支付,退还余额
|
|
|
+ if (isOnly == null && orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal addBalance = orderDon.getBalance();
|
|
|
+ //需额外扣除余额
|
|
|
+ if (deductBalance != null && deductBalance.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ addBalance = addBalance.subtract(deductBalance);
|
|
|
}
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), addBalance, UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
+ }
|
|
|
|
|
|
- try {
|
|
|
- marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
|
|
|
- if (goodsDon.getType() == 2 && !orderDon.getIsDistribute()) {
|
|
|
- equipmentDistributeService.subDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
|
|
|
- //扣除用户自身实物权益
|
|
|
- userRealOrderBenefitsService.deductUserRealGoodsBenefits(orderDon.getId());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("wx减少抽奖机会错误,orderId:{},error:{}", orderDon.getId(), e);
|
|
|
+ try {
|
|
|
+ marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
|
|
|
+ if (goodsDon.getType() == 2 && !orderDon.getIsDistribute()) {
|
|
|
+ equipmentDistributeService.subDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
|
|
|
+ //扣除用户自身实物权益
|
|
|
+ userRealOrderBenefitsService.deductUserRealGoodsBenefits(orderDon.getId());
|
|
|
}
|
|
|
- if (OrderDon.Type.BALANCE.getType().equals(refundType)) {
|
|
|
- if (isOnly == null && orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
- }
|
|
|
- } else {
|
|
|
- //余额退款不需要扣除积分
|
|
|
- //分销提成积分扣除
|
|
|
- deductDsPoints(orderDon);
|
|
|
- //店铺 分销提成金额扣除
|
|
|
- yhShopDistributeService.deductDsMoney(orderDon);
|
|
|
- //镜像店铺 分销提成金额扣除
|
|
|
- deductUserMirrorShopMoney(orderDon);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("wx减少抽奖机会错误,orderId:{},error:{}", orderDon.getId(), e);
|
|
|
+ }
|
|
|
+ if (OrderDon.Type.BALANCE.getType().equals(refundType)) {
|
|
|
+ if (isOnly == null && orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId(), orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.refund.getDesc(), true);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //余额退款不需要扣除积分
|
|
|
+ //分销提成积分扣除
|
|
|
+ deductDsPoints(orderDon);
|
|
|
+ //店铺 分销提成金额扣除
|
|
|
+ yhShopDistributeService.deductDsMoney(orderDon);
|
|
|
+ //镜像店铺 分销提成金额扣除
|
|
|
+ deductUserMirrorShopMoney(orderDon);
|
|
|
+ }
|
|
|
|
|
|
- if (orderDon.getIsFixedDistribute()) {
|
|
|
- //商务提成 因订单退款去掉
|
|
|
- UserDistributeBusinessOrderDonRecord record = businessOrderDonRecordMapper.selectOne(Wrappers.lambdaQuery(UserDistributeBusinessOrderDonRecord.class)
|
|
|
- .eq(UserDistributeBusinessOrderDonRecord::getOrderId, orderDon.getId())
|
|
|
- .eq(UserDistributeBusinessOrderDonRecord::getStatus, UserDistributeBusinessOrderDonRecord.Status.success)
|
|
|
- .last("limit 1"));
|
|
|
- if (record != null) {
|
|
|
- record.setStatus(UserDistributeBusinessOrderDonRecord.Status.refund);
|
|
|
- businessOrderDonRecordMapper.updateById(record);
|
|
|
- }
|
|
|
+ if (orderDon.getIsFixedDistribute()) {
|
|
|
+ //商务提成 因订单退款去掉
|
|
|
+ UserDistributeBusinessOrderDonRecord record = businessOrderDonRecordMapper.selectOne(Wrappers.lambdaQuery(UserDistributeBusinessOrderDonRecord.class)
|
|
|
+ .eq(UserDistributeBusinessOrderDonRecord::getOrderId, orderDon.getId())
|
|
|
+ .eq(UserDistributeBusinessOrderDonRecord::getStatus, UserDistributeBusinessOrderDonRecord.Status.success)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (record != null) {
|
|
|
+ record.setStatus(UserDistributeBusinessOrderDonRecord.Status.refund);
|
|
|
+ businessOrderDonRecordMapper.updateById(record);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //店铺商务提成
|
|
|
- if (orderDon.getYhsId() != null && orderDon.getYhsId() > 0) {
|
|
|
- YhShopUserDistributeBusinessOrderDonRecord shop_record = yhShopBusinessOrderDonRecordMapper.selectOne(Wrappers.lambdaQuery(YhShopUserDistributeBusinessOrderDonRecord.class)
|
|
|
- .eq(YhShopUserDistributeBusinessOrderDonRecord::getOrderId, orderDon.getId())
|
|
|
- .eq(YhShopUserDistributeBusinessOrderDonRecord::getStatus, YhShopUserDistributeBusinessOrderDonRecord.Status.success)
|
|
|
- .last("limit 1"));
|
|
|
- if (shop_record != null) {
|
|
|
- shop_record.setStatus(YhShopUserDistributeBusinessOrderDonRecord.Status.refund);
|
|
|
- yhShopBusinessOrderDonRecordMapper.updateById(shop_record);
|
|
|
- }
|
|
|
+ //店铺商务提成
|
|
|
+ if (orderDon.getYhsId() != null && orderDon.getYhsId() > 0) {
|
|
|
+ YhShopUserDistributeBusinessOrderDonRecord shop_record = yhShopBusinessOrderDonRecordMapper.selectOne(Wrappers.lambdaQuery(YhShopUserDistributeBusinessOrderDonRecord.class)
|
|
|
+ .eq(YhShopUserDistributeBusinessOrderDonRecord::getOrderId, orderDon.getId())
|
|
|
+ .eq(YhShopUserDistributeBusinessOrderDonRecord::getStatus, YhShopUserDistributeBusinessOrderDonRecord.Status.success)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (shop_record != null) {
|
|
|
+ shop_record.setStatus(YhShopUserDistributeBusinessOrderDonRecord.Status.refund);
|
|
|
+ yhShopBusinessOrderDonRecordMapper.updateById(shop_record);
|
|
|
}
|
|
|
- //是否是优惠加购关联订单
|
|
|
- if (orderDon.getIsDp()) {
|
|
|
- OrderDiscountPlusPurchaseSkuRelation discountPlusPurchaseSkuRelation = orderDiscountPlusPurchaseSkuRelationMapper.selectOne(Wrappers.lambdaQuery(OrderDiscountPlusPurchaseSkuRelation.class)
|
|
|
- .eq(OrderDiscountPlusPurchaseSkuRelation::getOrderId, orderDon.getId()).last("limit 1"));
|
|
|
- if (discountPlusPurchaseSkuRelation != null) {
|
|
|
- String relationIdsStr = discountPlusPurchaseSkuRelation.getRelationIds();
|
|
|
- if (StrUtil.isNotBlank(relationIdsStr)) {
|
|
|
- try {
|
|
|
- List<Long> relationIds = Jsons.parseList(relationIdsStr, Long.class);
|
|
|
- List<GroupsRelation> groupsRelations = relationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
- .in(GroupsRelation::getId, relationIds));
|
|
|
- log.info("优惠加购订单orderId:{}退款,清除相关车票relation_ids:{}", orderDon.getId(), relationIds);
|
|
|
- groupsRelations.forEach(relation -> relationClearService.clearTicket(relation, UserTicketClearedRecord.Source.dp));
|
|
|
- } catch (Exception e) {
|
|
|
- }
|
|
|
- }
|
|
|
- String plusOrderIds = discountPlusPurchaseSkuRelation.getPlusOrderIds();
|
|
|
- if (StrUtil.isNotBlank(plusOrderIds)) {
|
|
|
- try {
|
|
|
- log.info("关闭优惠加购orderId:{}关联实物订单", orderDon.getId());
|
|
|
- List<Long> plusOrderIdList = Jsons.parseList(plusOrderIds, Long.class);
|
|
|
- List<OrderDon> relate_orderDons = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
- .in(OrderDon::getId, plusOrderIdList)
|
|
|
- .notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
- relate_orderDons.forEach(relate_o -> {
|
|
|
- //扣除用户自身实物权益
|
|
|
- userRealOrderBenefitsService.deductUserRealGoodsBenefits(relate_o.getId());
|
|
|
- });
|
|
|
- orderDonMapper.update(null, Wrappers.lambdaUpdate(OrderDon.class)
|
|
|
- .set(OrderDon::getStatus, OrderDon.Status.refund)
|
|
|
- .in(OrderDon::getId, plusOrderIdList)
|
|
|
- .ne(OrderDon::getStatus, OrderDon.Status.refund));
|
|
|
- } catch (Exception e) {
|
|
|
- }
|
|
|
+ }
|
|
|
+ //是否是优惠加购关联订单
|
|
|
+ if (orderDon.getIsDp()) {
|
|
|
+ OrderDiscountPlusPurchaseSkuRelation discountPlusPurchaseSkuRelation = orderDiscountPlusPurchaseSkuRelationMapper.selectOne(Wrappers.lambdaQuery(OrderDiscountPlusPurchaseSkuRelation.class)
|
|
|
+ .eq(OrderDiscountPlusPurchaseSkuRelation::getOrderId, orderDon.getId()).last("limit 1"));
|
|
|
+ if (discountPlusPurchaseSkuRelation != null) {
|
|
|
+ String relationIdsStr = discountPlusPurchaseSkuRelation.getRelationIds();
|
|
|
+ if (StrUtil.isNotBlank(relationIdsStr)) {
|
|
|
+ try {
|
|
|
+ List<Long> relationIds = Jsons.parseList(relationIdsStr, Long.class);
|
|
|
+ List<GroupsRelation> groupsRelations = relationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
+ .in(GroupsRelation::getId, relationIds));
|
|
|
+ log.info("优惠加购订单orderId:{}退款,清除相关车票relation_ids:{}", orderDon.getId(), relationIds);
|
|
|
+ groupsRelations.forEach(relation -> relationClearService.clearTicket(relation, UserTicketClearedRecord.Source.dp));
|
|
|
+ } catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- //同步车票退款 重购记录
|
|
|
- TASK_POOL.execute(() -> {
|
|
|
- GroupsRelationExpiryRecord groupsRelationExpiryRecord = groupsRelationExpiryRecordService.getOne(Wrappers.lambdaQuery(GroupsRelationExpiryRecord.class)
|
|
|
- .in(GroupsRelationExpiryRecord::getReBuyOrderId, orderDon.getId())
|
|
|
- .eq(GroupsRelationExpiryRecord::getRelationId, orderDon.getRelationId()).last("limit 1"));
|
|
|
- if (groupsRelationExpiryRecord == null) {
|
|
|
- log.info("订单orderId:{}退款,同步是否有重购记录不是直接续费车票", orderDon.getId());
|
|
|
- List<GroupsRelationExpiryRecord> groupsRelationExpiryRecords = groupsRelationExpiryRecordService.list(Wrappers.lambdaQuery(GroupsRelationExpiryRecord.class)
|
|
|
- .in(GroupsRelationExpiryRecord::getReBuyOrderId, orderDon.getId()));
|
|
|
- log.info("订单orderId:{}退款,重购记录不是直接续费车票大小:{}", groupsRelationExpiryRecords.size());
|
|
|
- if (CollUtil.isNotEmpty(groupsRelationExpiryRecords)) {
|
|
|
- groupsRelationExpiryRecords.forEach(data -> {
|
|
|
- data.setIsReBuy(false);
|
|
|
+ String plusOrderIds = discountPlusPurchaseSkuRelation.getPlusOrderIds();
|
|
|
+ if (StrUtil.isNotBlank(plusOrderIds)) {
|
|
|
+ try {
|
|
|
+ log.info("关闭优惠加购orderId:{}关联实物订单", orderDon.getId());
|
|
|
+ List<Long> plusOrderIdList = Jsons.parseList(plusOrderIds, Long.class);
|
|
|
+ List<OrderDon> relate_orderDons = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .in(OrderDon::getId, plusOrderIdList)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
+ relate_orderDons.forEach(relate_o -> {
|
|
|
+ //扣除用户自身实物权益
|
|
|
+ userRealOrderBenefitsService.deductUserRealGoodsBenefits(relate_o.getId());
|
|
|
});
|
|
|
- groupsRelationExpiryRecordService.saveOrUpdateBatch(groupsRelationExpiryRecords);
|
|
|
+ orderDonMapper.update(null, Wrappers.lambdaUpdate(OrderDon.class)
|
|
|
+ .set(OrderDon::getStatus, OrderDon.Status.refund)
|
|
|
+ .in(OrderDon::getId, plusOrderIdList)
|
|
|
+ .ne(OrderDon::getStatus, OrderDon.Status.refund));
|
|
|
+ } catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- if (groupsRelationExpiryRecord != null) {
|
|
|
- groupsRelationExpiryRecord.setIsReBuy(false);
|
|
|
- groupsRelationExpiryRecordService.saveOrUpdate(groupsRelationExpiryRecord);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- //是否是礼品卡 现金支付订单
|
|
|
- BigDecimal gcCash = orderDon.getGcCash();
|
|
|
- if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- giftCardOrderUseRecordService.returnGiftCardCash(orderDon.getId());
|
|
|
}
|
|
|
- //清除礼品卡
|
|
|
- if (goodsDon.getSpecialType() != null && goodsDon.getSpecialType() == GoodsDon.SpecialType.giftCard) {
|
|
|
- giftCardUserRecordMapper.update(null, Wrappers.lambdaUpdate(GiftCardUserRecord.class)
|
|
|
- .set(GiftCardUserRecord::getIsPay, 0)
|
|
|
- .eq(GiftCardUserRecord::getOrderId, orderDon.getId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ //同步车票退款 重购记录
|
|
|
+ TASK_POOL.execute(() -> {
|
|
|
+ GroupsRelationExpiryRecord groupsRelationExpiryRecord = groupsRelationExpiryRecordService.getOne(Wrappers.lambdaQuery(GroupsRelationExpiryRecord.class)
|
|
|
+ .in(GroupsRelationExpiryRecord::getReBuyOrderId, orderDon.getId())
|
|
|
+ .eq(GroupsRelationExpiryRecord::getRelationId, orderDon.getRelationId()).last("limit 1"));
|
|
|
+ if (groupsRelationExpiryRecord == null) {
|
|
|
+ log.info("订单orderId:{}退款,同步是否有重购记录不是直接续费车票", orderDon.getId());
|
|
|
+ List<GroupsRelationExpiryRecord> groupsRelationExpiryRecords = groupsRelationExpiryRecordService.list(Wrappers.lambdaQuery(GroupsRelationExpiryRecord.class)
|
|
|
+ .in(GroupsRelationExpiryRecord::getReBuyOrderId, orderDon.getId()));
|
|
|
+ log.info("订单orderId:{}退款,重购记录不是直接续费车票大小:{}", groupsRelationExpiryRecords.size());
|
|
|
+ if (CollUtil.isNotEmpty(groupsRelationExpiryRecords)) {
|
|
|
+ groupsRelationExpiryRecords.forEach(data -> {
|
|
|
+ data.setIsReBuy(false);
|
|
|
+ });
|
|
|
+ groupsRelationExpiryRecordService.saveOrUpdateBatch(groupsRelationExpiryRecords);
|
|
|
+ }
|
|
|
}
|
|
|
- //是否是GPT镜像规格
|
|
|
- if (orderDon.getOrderType() == 1) {
|
|
|
- mirrorUserCleatService.delMirrorUser(orderDon.getGoodsId(), orderDon.getRelationId());
|
|
|
+ if (groupsRelationExpiryRecord != null) {
|
|
|
+ groupsRelationExpiryRecord.setIsReBuy(false);
|
|
|
+ groupsRelationExpiryRecordService.saveOrUpdate(groupsRelationExpiryRecord);
|
|
|
}
|
|
|
- //是否是分销订单
|
|
|
- //处理下级渠道分销提成
|
|
|
- handleSubRewards(orderDon);
|
|
|
-
|
|
|
- //是否是用户套餐优惠权益订单
|
|
|
- if (orderDon.getGoodsId()==15) {
|
|
|
- UserBenefitsComboRelationRecord userBenefitsComboRelationRecord = userBenefitsComboRelationRecordMapper.selectOne(Wrappers.lambdaQuery(UserBenefitsComboRelationRecord.class)
|
|
|
- .eq(UserBenefitsComboRelationRecord::getOrderId, orderDon.getId()).last("limit 1"));
|
|
|
- if (userBenefitsComboRelationRecord != null) {
|
|
|
- try {
|
|
|
- String relationIds = userBenefitsComboRelationRecord.getRelationIds();
|
|
|
- List<Long> relationIdList = Jsons.parseList(relationIds, Long.class);
|
|
|
- //清空车票或减少车票时间
|
|
|
- relationIdList.forEach(relationId->{
|
|
|
- orderCommonService.clearUserTicketTime(relationId);
|
|
|
- });
|
|
|
- } catch (Exception e) {
|
|
|
+ });
|
|
|
+
|
|
|
+ //是否是礼品卡 现金支付订单
|
|
|
+ BigDecimal gcCash = orderDon.getGcCash();
|
|
|
+ if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ giftCardOrderUseRecordService.returnGiftCardCash(orderDon.getId());
|
|
|
+ }
|
|
|
+ //清除礼品卡
|
|
|
+ if (goodsDon.getSpecialType() != null && goodsDon.getSpecialType() == GoodsDon.SpecialType.giftCard) {
|
|
|
+ giftCardUserRecordMapper.update(null, Wrappers.lambdaUpdate(GiftCardUserRecord.class)
|
|
|
+ .set(GiftCardUserRecord::getIsPay, 0)
|
|
|
+ .eq(GiftCardUserRecord::getOrderId, orderDon.getId()));
|
|
|
+ }
|
|
|
+ //是否是GPT镜像规格
|
|
|
+ if (orderDon.getOrderType() == 1) {
|
|
|
+ mirrorUserCleatService.delMirrorUser(orderDon.getGoodsId(), orderDon.getRelationId());
|
|
|
+ }
|
|
|
+ //是否是分销订单
|
|
|
+ //处理下级渠道分销提成
|
|
|
+ handleSubRewards(orderDon);
|
|
|
+
|
|
|
+ //是否是用户套餐优惠权益订单
|
|
|
+ if (orderDon.getGoodsId() == 15) {
|
|
|
+ UserBenefitsComboRelationRecord userBenefitsComboRelationRecord = userBenefitsComboRelationRecordMapper.selectOne(Wrappers.lambdaQuery(UserBenefitsComboRelationRecord.class)
|
|
|
+ .eq(UserBenefitsComboRelationRecord::getOrderId, orderDon.getId()).last("limit 1"));
|
|
|
+ if (userBenefitsComboRelationRecord != null) {
|
|
|
+ try {
|
|
|
+ String relationIds = userBenefitsComboRelationRecord.getRelationIds();
|
|
|
+ List<Long> relationIdList = Jsons.parseList(relationIds, Long.class);
|
|
|
+ //清空车票或减少车票时间
|
|
|
+ relationIdList.forEach(relationId -> {
|
|
|
+ orderCommonService.clearUserTicketTime(relationId);
|
|
|
+ });
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//处理下级渠道分销提成
|