|
|
@@ -396,6 +396,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
public void changeRelation(ChangeRelationReq req) throws Exception {
|
|
|
Long relationId = req.getRelationId();
|
|
|
Long groupId = req.getGroupsId();
|
|
|
+ Long yhsId = req.getYhsId();
|
|
|
UserTicketClearedRecord.Source source = req.getSource();
|
|
|
if (source == null) source = UserTicketClearedRecord.Source.change_ticket;
|
|
|
GroupsRelation relation = relationMapper.selectById(relationId);
|
|
|
@@ -472,6 +473,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
newRelation.setUserId(relation.getUserId());
|
|
|
newRelation.setStartTime(relation.getStartTime());
|
|
|
newRelation.setExpiryTime(relation.getExpiryTime());
|
|
|
+ newRelation.setYhsId(yhsId);
|
|
|
newRelation.setCustomerService(relation.getCustomerService());
|
|
|
if (newRelation.getStatus() != GroupsRelation.Status.outside) {
|
|
|
newRelation.setStatus(GroupsRelation.Status.validity);
|
|
|
@@ -698,7 +700,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
}
|
|
|
//若存在余额支付,退还余额
|
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.balance);
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.balance, orderDon.getYhsId());
|
|
|
}
|
|
|
try {
|
|
|
marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
|
|
|
@@ -712,7 +714,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
}
|
|
|
if (OrderDon.Type.BALANCE.getType().equals(refundType)) {
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund);
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getRefundBalance(), UserBalanceSourceRecord.Source.refund, orderDon.getYhsId());
|
|
|
}
|
|
|
} else {
|
|
|
//余额退款不需要扣除积分
|
|
|
@@ -923,11 +925,14 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("该订单是0元订单,无法补差价");
|
|
|
}
|
|
|
+ if (Constant.noOrderAllStatus.contains(orderDon.getStatus().name())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("订单不是已支付状态");
|
|
|
+ }
|
|
|
BigDecimal refundBalance = orderRefundReq.getRefundBalance();
|
|
|
if (refundBalance == null || refundBalance.compareTo(BigDecimal.ZERO) <= 0 || refundBalance.compareTo(orderDon.getMoney()) > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的差价金额");
|
|
|
}
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.price_differ);
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), refundBalance, UserBalanceSourceRecord.Source.price_differ, orderDon.getYhsId());
|
|
|
}
|
|
|
|
|
|
/**
|