fix
This commit is contained in:
2026-04-20 10:51:02 +08:00
parent 2f5879baae
commit 87b400e702

View File

@@ -458,25 +458,22 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
if (!BusinessModule.fromCodeIgnoreCaseOrNull(order.getOrderType()).equals(BusinessModule.SELF_OPERATED_MALL)) { if (!BusinessModule.fromCodeIgnoreCaseOrNull(order.getOrderType()).equals(BusinessModule.SELF_OPERATED_MALL)) {
throw new ServiceException("无效业务订单"); throw new ServiceException("无效业务订单");
} }
boolean updated = update(Wrappers.<CommonUserOrderEntity>lambdaUpdate() boolean updated = update(Wrappers.lambdaUpdate(CommonUserOrderEntity.class)
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.COMPLETED.getCode()) .set(CommonUserOrderEntity::getOrderStatus, OrderStatus.COMPLETED.getCode())
.eq(CommonUserOrderEntity::getId, order.getId()) .eq(CommonUserOrderEntity::getId, order.getId())
.eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.SHIPPED.getCode())); .eq(CommonUserOrderEntity::getOrderStatus, OrderStatus.SHIPPED.getCode()));
if (!updated) { if (!updated) {
throw new ServiceException("无效订单"); throw new ServiceException("无效订单");
} }
if (order.getPaymentType().equals(PaymentType.OFFLINE.getCode())) {
return true;
}
if (order.getOrderType().equalsIgnoreCase(BusinessModule.SELF_OPERATED_MALL.getCode())) { if (order.getOrderType().equalsIgnoreCase(BusinessModule.SELF_OPERATED_MALL.getCode())) {
userPointService.grantPointsByUserOrder(order); if (!order.getPaymentType().equals(PaymentType.OFFLINE.getCode())) {
MarketInfoEntity marketInfo = marketInfoService.getById(AuthUtil.getUserId()); userPointService.grantPointsByUserOrder(order);
Assert.notNull(marketInfo, "无效用户"); MarketInfoEntity marketInfo = marketInfoService.getById(AuthUtil.getUserId());
if (marketInfo.getPid() != null) { Assert.notNull(marketInfo, "无效用户");
commissionService.earnedCommissionByUserOrder(order, marketInfo.getPid()); if (marketInfo.getPid() != null) {
commissionService.earnedCommissionByUserOrder(order, marketInfo.getPid());
}
} }
CommonOrderConfirmLogEntity commonOrderConfirmLog = new CommonOrderConfirmLogEntity() CommonOrderConfirmLogEntity commonOrderConfirmLog = new CommonOrderConfirmLogEntity()
.setOrderId(order.getId()) .setOrderId(order.getId())
.setUserId(order.getUserId()) .setUserId(order.getUserId())
@@ -513,7 +510,7 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode())); MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode()));
Assert.notNull(product, "无效商品"); Assert.notNull(product, "无效商品");
if (product.getStatus() != 1){ if (product.getStatus() != 1) {
throw new ServiceException("商品已下架"); throw new ServiceException("商品已下架");
} }
CommonUserOrderEntity order = AppCommonConvert.INSTANCE.convertMallProductToOrder(request, product); CommonUserOrderEntity order = AppCommonConvert.INSTANCE.convertMallProductToOrder(request, product);