|
@@ -391,7 +391,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
}
|
|
}
|
|
|
orderDon.setRefundDesc(refundReq.getRefundDesc());
|
|
orderDon.setRefundDesc(refundReq.getRefundDesc());
|
|
|
//记录退款信息
|
|
//记录退款信息
|
|
|
- commonRefund(orderDon, refundReq.getRefundMoney(), refundReq.getOperator(), goodsDon, sku, outNo, refundType, refundReq.getIsOnly(), refundReq.getRefundBalance(), refundReq.getChatImg(), refundReq.getDeductBalance());
|
|
|
|
|
|
|
+ commonRefund(orderDon, refundReq.getRefundMoney(), refundReq.getOperator(), goodsDon, sku, outNo, refundType, refundReq.getIsOnly(), refundReq.getRefundBalance(), refundReq.getChatImg(), refundReq.getDeductBalance(), refundReq.getDpRelationIds());
|
|
|
//修改订单状态
|
|
//修改订单状态
|
|
|
orderDon.setStatus(OrderDon.Status.refund);
|
|
orderDon.setStatus(OrderDon.Status.refund);
|
|
|
orderDonMapper.updateById(orderDon);
|
|
orderDonMapper.updateById(orderDon);
|
|
@@ -989,13 +989,15 @@ 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) {
|
|
|
|
|
|
|
+ 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, List<Long> dpRelationIds) {
|
|
|
orderRefundService.refundRecord(orderDon, refundMoney, operator, goodsDon, sku, outNo, refundType, chatImg);
|
|
orderRefundService.refundRecord(orderDon, refundMoney, operator, goodsDon, sku, outNo, refundType, chatImg);
|
|
|
//退款一次
|
|
//退款一次
|
|
|
goodsDonStockService.upStockRelate(null, orderDon.getId(), "refund");
|
|
goodsDonStockService.upStockRelate(null, orderDon.getId(), "refund");
|
|
|
try {
|
|
try {
|
|
|
- //虚物订单退款,清出车队,车票变为已过期
|
|
|
|
|
- orderCommonService.clearUnrealGoodsDetail(orderDon, goodsDon.getType(), sku);
|
|
|
|
|
|
|
+ if (!orderDon.getIsDp()) {
|
|
|
|
|
+ //虚物订单退款,清出车队,车票变为已过期
|
|
|
|
|
+ orderCommonService.clearUnrealGoodsDetail(orderDon, goodsDon.getType(), sku);
|
|
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("清除车票错误:{}", StringUtil.getErrorText(e));
|
|
log.error("清除车票错误:{}", StringUtil.getErrorText(e));
|
|
|
}
|
|
}
|
|
@@ -1076,7 +1078,12 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (StrUtil.isNotBlank(relationIdsStr)) {
|
|
if (StrUtil.isNotBlank(relationIdsStr)) {
|
|
|
try {
|
|
try {
|
|
|
List<Long> relationIds = Jsons.parseList(relationIdsStr, Long.class);
|
|
List<Long> relationIds = Jsons.parseList(relationIdsStr, Long.class);
|
|
|
|
|
+ //选择清除加购车票
|
|
|
|
|
+ if (CollUtil.isNotEmpty(dpRelationIds)) {
|
|
|
|
|
+ relationIds = dpRelationIds;
|
|
|
|
|
+ }
|
|
|
List<GroupsRelation> groupsRelations = relationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
List<GroupsRelation> groupsRelations = relationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
|
|
+ .eq(GroupsRelation::getUserId, orderDon.getUserId())
|
|
|
.in(GroupsRelation::getId, relationIds));
|
|
.in(GroupsRelation::getId, relationIds));
|
|
|
log.info("优惠加购订单orderId:{}退款,清除相关车票relation_ids:{}", orderDon.getId(), relationIds);
|
|
log.info("优惠加购订单orderId:{}退款,清除相关车票relation_ids:{}", orderDon.getId(), relationIds);
|
|
|
groupsRelations.forEach(relation -> relationClearService.clearTicket(relation, UserTicketClearedRecord.Source.dp));
|
|
groupsRelations.forEach(relation -> relationClearService.clearTicket(relation, UserTicketClearedRecord.Source.dp));
|