1. fix
This commit is contained in:
2026-04-26 15:16:29 +08:00
parent 007a29e385
commit 90f973adad

View File

@@ -128,8 +128,13 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
} }
} }
} }
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getUserId, userId) MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class)
.eq(MerchantInventoryEntity::getType, currentType.getCode()).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getStatus, MerchantProductStatus.ON_SHELF.getCode()).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId)); .eq(MerchantInventoryEntity::getUserId, userId)
.eq(MerchantInventoryEntity::getType, currentType.getCode())
.eq(MerchantInventoryEntity::getProductId, productId)
.eq(MerchantInventoryEntity::getStatus, MerchantProductStatus.ON_SHELF.getCode())
.eq(MerchantInventoryEntity::getIsDeleted, 0)
.orderByDesc(MerchantInventoryEntity::getId));
BigDecimal totalBenefitPointAmount = BigDecimal.ZERO; BigDecimal totalBenefitPointAmount = BigDecimal.ZERO;
if (Objects.nonNull(inventory)) { if (Objects.nonNull(inventory)) {
BigDecimal multiply = inventory.getUnitGiftAmount().multiply(BigDecimal.valueOf(num)); BigDecimal multiply = inventory.getUnitGiftAmount().multiply(BigDecimal.valueOf(num));