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