|
@@ -821,7 +821,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
//返还余额
|
|
//返还余额
|
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), UserBalanceSourceRecord.Source.close, orderDon.getYhsId());
|
|
|
|
|
|
|
+ userBenefitsService.addUserBalance(orderDon.getUserId(), orderDon.getBalance(), null, null, null, null, false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//是否是礼品卡 现金支付订单
|
|
//是否是礼品卡 现金支付订单
|
|
@@ -1222,24 +1222,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("订单异常");
|
|
throw BusinessRuntimeException.getInstance("订单异常");
|
|
|
}
|
|
}
|
|
|
- if (orderDon.getStatus() != OrderDon.Status.noPayment) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("订单状态已修改");
|
|
|
|
|
- }
|
|
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
|
|
|
GoodsDonSku sku = null;
|
|
GoodsDonSku sku = null;
|
|
|
if (orderDon.getSkuId() != null) {
|
|
if (orderDon.getSkuId() != null) {
|
|
|
sku = goodsDonSkuMapper.selectById(orderDon.getSkuId());
|
|
sku = goodsDonSkuMapper.selectById(orderDon.getSkuId());
|
|
|
}
|
|
}
|
|
|
- orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
|
|
|
|
|
- updateGroupsTicket(orderDon, goodsDon, sku);
|
|
|
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
orderDon.setType(OrderDon.Type.BALANCE);
|
|
orderDon.setType(OrderDon.Type.BALANCE);
|
|
|
orderDon.setPayTime(DateTime.now());
|
|
orderDon.setPayTime(DateTime.now());
|
|
|
}
|
|
}
|
|
|
- this.updateById(orderDon);
|
|
|
|
|
-
|
|
|
|
|
- //调整指定规格车队下次可 停用车位数的时间
|
|
|
|
|
- groupRelationFrontService.adjustGroupsParkingTime(orderDon.getRelationId(), sku);
|
|
|
|
|
|
|
+ unifiedHandlerOrderNotify(orderDon, goodsDon, sku);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void updateCarParkAndSendMsg(GoodsDon goodsDon, GoodsDonSku sku, OrderDon order) {
|
|
public void updateCarParkAndSendMsg(GoodsDon goodsDon, GoodsDonSku sku, OrderDon order) {
|
|
@@ -2186,7 +2178,6 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
Integer success = userMapper.deductBalance(user.getId(), subBalance, userBalance);
|
|
Integer success = userMapper.deductBalance(user.getId(), subBalance, userBalance);
|
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的余额不足!");
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的余额不足!");
|
|
|
orderDon.setBalance(subBalance);
|
|
orderDon.setBalance(subBalance);
|
|
|
- userBenefitsService.recordBalanceBySource(user.getId(), BigDecimal.valueOf(-subBalance.longValue()), UserBalanceSourceRecord.Source.payment);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2270,7 +2261,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
.in(OrderDon::getStatus, List.of(OrderDon.Status.noPayment, OrderDon.Status.close))
|
|
.in(OrderDon::getStatus, List.of(OrderDon.Status.noPayment, OrderDon.Status.close))
|
|
|
.eq(OrderDon::getId, orderDon.getId()));
|
|
.eq(OrderDon::getId, orderDon.getId()));
|
|
|
if (!isSuccess) {
|
|
if (!isSuccess) {
|
|
|
- log.info("支付宝回调商家订单号:{}订单状态已修改", orderDon.getOrderNo());
|
|
|
|
|
|
|
+ log.info("该订单{}状态已修改", orderDon.getOrderNo());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2293,6 +2284,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//调整指定规格车队下次可 停用车位数的时间
|
|
//调整指定规格车队下次可 停用车位数的时间
|
|
|
groupRelationFrontService.adjustGroupsParkingTime(orderDon.getRelationId(), sku);
|
|
groupRelationFrontService.adjustGroupsParkingTime(orderDon.getRelationId(), sku);
|
|
|
|
|
|
|
|
|
|
+ //余额使用记录
|
|
|
|
|
+ if (orderDon.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ userBenefitsService.recordBalanceBySource(orderDon.getUserId(), orderDon.getBalance().negate(), UserBalanceSourceRecord.Source.payment, orderDon.getId(), goodsDon.getTitle() + UserBalanceSourceRecord.Source.payment);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
TASK_POOL.execute(()->{
|
|
TASK_POOL.execute(()->{
|
|
|
try {
|
|
try {
|
|
|
//发放积分
|
|
//发放积分
|