|
@@ -200,7 +200,12 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
|
|
|
return orderItem;
|
|
return orderItem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 支付订单
|
|
|
|
|
+ * @param productOrderPayRequest 订单支付请求
|
|
|
|
|
+ * @return R 订单支付结果
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
public R payOrder(ProductOrderPayRequest productOrderPayRequest) throws Exception {
|
|
public R payOrder(ProductOrderPayRequest productOrderPayRequest) throws Exception {
|
|
|
// 1、校验订单是否存在
|
|
// 1、校验订单是否存在
|
|
@@ -251,6 +256,7 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
|
|
|
public void orderPayManage(TWxUser user, ProductOrderInfo orderInfo) {
|
|
public void orderPayManage(TWxUser user, ProductOrderInfo orderInfo) {
|
|
|
// 更新用户金额 及下单此时
|
|
// 更新用户金额 及下单此时
|
|
|
TWxUser paramUser = new TWxUser();
|
|
TWxUser paramUser = new TWxUser();
|
|
|
|
|
+ paramUser.setId(user.getId());
|
|
|
paramUser.setcOpenid(user.getcOpenid());
|
|
paramUser.setcOpenid(user.getcOpenid());
|
|
|
// 余额支付
|
|
// 余额支付
|
|
|
if (orderInfo.getPayType().equals(MassageConstants.INTEGER_TWO)) {
|
|
if (orderInfo.getPayType().equals(MassageConstants.INTEGER_TWO)) {
|
|
@@ -258,8 +264,8 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
|
|
|
}
|
|
}
|
|
|
paramUser.setdMoney(user.getdMoney().add(orderInfo.getTotalAmount()));
|
|
paramUser.setdMoney(user.getdMoney().add(orderInfo.getTotalAmount()));
|
|
|
paramUser.setnNum(user.getnNum() + MassageConstants.INTEGER_ONE);
|
|
paramUser.setnNum(user.getnNum() + MassageConstants.INTEGER_ONE);
|
|
|
- paramUser.setId(user.getId());
|
|
|
|
|
wxUserService.updateById(paramUser);
|
|
wxUserService.updateById(paramUser);
|
|
|
|
|
+
|
|
|
//增加消费记录
|
|
//增加消费记录
|
|
|
TConsumptionLog tConsumptionLog = new TConsumptionLog();
|
|
TConsumptionLog tConsumptionLog = new TConsumptionLog();
|
|
|
tConsumptionLog.setAmount(orderInfo.getTotalAmount().negate());
|
|
tConsumptionLog.setAmount(orderInfo.getTotalAmount().negate());
|
|
@@ -272,13 +278,11 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
|
|
|
tConsumptionLog.setBillType(BillTypeEnum.WX_PAY.getCode());
|
|
tConsumptionLog.setBillType(BillTypeEnum.WX_PAY.getCode());
|
|
|
tConsumptionLog.setNote("微信支付");
|
|
tConsumptionLog.setNote("微信支付");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
consumptionLogService.save(tConsumptionLog);
|
|
consumptionLogService.save(tConsumptionLog);
|
|
|
|
|
|
|
|
ProductOrderInfo productOrderInfo = new ProductOrderInfo();
|
|
ProductOrderInfo productOrderInfo = new ProductOrderInfo();
|
|
|
productOrderInfo.setId(orderInfo.getId());
|
|
productOrderInfo.setId(orderInfo.getId());
|
|
|
productOrderInfo.setPayType(orderInfo.getPayType());
|
|
productOrderInfo.setPayType(orderInfo.getPayType());
|
|
|
- productOrderInfo.setOpenId(orderInfo.getOpenId());
|
|
|
|
|
//更新订单状态为待发货
|
|
//更新订单状态为待发货
|
|
|
productOrderInfo.setOrderStatus(ProductOrderStatusEnum.WAIT_DELIVERY.getCode());
|
|
productOrderInfo.setOrderStatus(ProductOrderStatusEnum.WAIT_DELIVERY.getCode());
|
|
|
productOrderInfo.setPayTime(LocalDateTime.now());
|
|
productOrderInfo.setPayTime(LocalDateTime.now());
|