update:
1. fix
This commit is contained in:
@@ -188,7 +188,7 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
throw new ServiceException("用户没有该操作权限");
|
throw new ServiceException("用户没有该操作权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getUserId, userId).eq(MerchantInventoryEntity::getStatus, MerchantProductStatus.ON_SHELF).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId));
|
MerchantInventoryEntity inventory = getOne(Wrappers.lambdaQuery(MerchantInventoryEntity.class).eq(MerchantInventoryEntity::getProductId, productId).eq(MerchantInventoryEntity::getUserId, userId).eq(MerchantInventoryEntity::getStatus, MerchantProductStatus.ON_SHELF.getCode()).eq(MerchantInventoryEntity::getIsDeleted, 0).orderByDesc(MerchantInventoryEntity::getId));
|
||||||
if (Objects.isNull(inventory)) {
|
if (Objects.isNull(inventory)) {
|
||||||
throw new ServiceException("商品不存在");
|
throw new ServiceException("商品不存在");
|
||||||
}
|
}
|
||||||
@@ -202,7 +202,7 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
if (Objects.isNull(catalog)) {
|
if (Objects.isNull(catalog)) {
|
||||||
throw new ServiceException("未找到商品目录,操作失败");
|
throw new ServiceException("未找到商品目录,操作失败");
|
||||||
}
|
}
|
||||||
if (inventoryType == MerchantProductType.PLATFORM){
|
if (inventoryType == MerchantProductType.PLATFORM) {
|
||||||
BigDecimal totalCashCouponAmount = catalog.getCostPrice().multiply(BigDecimal.valueOf(inventory.getStock()));
|
BigDecimal totalCashCouponAmount = catalog.getCostPrice().multiply(BigDecimal.valueOf(inventory.getStock()));
|
||||||
if (!cashCouponService.addCashCoupon(new MarketCashCouponApiDTO(userId, totalCashCouponAmount, MarketBusinessModule.MERCHANT_UNLIST, null, "", String.format("下架商品[%s],ID[%d],数量[%d]", catalog.getProductName(), catalog.getId(), inventory.getStock())))) {
|
if (!cashCouponService.addCashCoupon(new MarketCashCouponApiDTO(userId, totalCashCouponAmount, MarketBusinessModule.MERCHANT_UNLIST, null, "", String.format("下架商品[%s],ID[%d],数量[%d]", catalog.getProductName(), catalog.getId(), inventory.getStock())))) {
|
||||||
throw new ServiceException("返还现金券失败");
|
throw new ServiceException("返还现金券失败");
|
||||||
@@ -211,7 +211,7 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
BigDecimal totalBenefitPointAmount = inventory.getUnitGiftAmount().multiply(BigDecimal.valueOf(inventory.getStock()));
|
BigDecimal totalBenefitPointAmount = inventory.getUnitGiftAmount().multiply(BigDecimal.valueOf(inventory.getStock()));
|
||||||
BigDecimal fee = totalBenefitPointAmount.multiply(BigDecimal.valueOf(0.2));
|
BigDecimal fee = totalBenefitPointAmount.multiply(BigDecimal.valueOf(0.2));
|
||||||
totalBenefitPointAmount = totalBenefitPointAmount.add(fee);
|
totalBenefitPointAmount = totalBenefitPointAmount.add(fee);
|
||||||
if (!benefitPointService.addBenefitPoint(new MarketBenefitPointApiDTO(userId, totalBenefitPointAmount, fee, MarketBusinessModule.MERCHANT_UNLIST, null, "", String.format("下架商品[%s],ID[%d],数量[%d]", catalog.getProductName(), catalog.getId(), inventory.getStock())))){
|
if (!benefitPointService.addBenefitPoint(new MarketBenefitPointApiDTO(userId, totalBenefitPointAmount, fee, MarketBusinessModule.MERCHANT_UNLIST, null, "", String.format("下架商品[%s],ID[%d],数量[%d]", catalog.getProductName(), catalog.getId(), inventory.getStock())))) {
|
||||||
throw new ServiceException("返还福利积分失败");
|
throw new ServiceException("返还福利积分失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user