|
|
@@ -74,19 +74,19 @@ public class ProductItemFacade implements IProductItemFacade {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Boolean add(ProductItemAddReq productItemSearchReq) {
|
|
|
- ProductInfo productInfo = productInfoService.lambdaQuery().eq(ProductInfo::getSku, productItemSearchReq.getRelationSku()).one();
|
|
|
+ public Boolean add(ProductItemAddReq productItemAddReq) {
|
|
|
+ ProductInfo productInfo = productInfoService.lambdaQuery().eq(ProductInfo::getSku, productItemAddReq.getRelationSku()).one();
|
|
|
Assert.notNull(productInfo, "the_product_does_not_exist");
|
|
|
- sysDictDataService.validateOptions(ProductConstant.DICT_KEY_ITEM_SPEC, StrUtil.toString(productItemSearchReq.getSpec()));
|
|
|
+ sysDictDataService.validateOptions(ProductConstant.DICT_KEY_ITEM_SPEC, StrUtil.toString(productItemAddReq.getSpec()));
|
|
|
ProductItem productItem = ProductItem.builder()
|
|
|
.relationSku(productInfo.getSku())
|
|
|
.productName(productInfo.getProductName())
|
|
|
.itemType(ItemTypeEnum.FLASH_SALE.getCode())
|
|
|
.fromSource(FromSourceEnum.ECO_SALE.getCode())
|
|
|
- .itemSpec(productItemSearchReq.getSpec())
|
|
|
+ .itemSpec(productItemAddReq.getSpec())
|
|
|
.status(ItemStatusEnum.OFF_SHELF.getCode())
|
|
|
- .itemPrice(productItemSearchReq.getPrice())
|
|
|
- .inventory(productItemSearchReq.getInventory())
|
|
|
+ .itemPrice(productItemAddReq.getPrice())
|
|
|
+ .inventory(productItemAddReq.getInventory())
|
|
|
.frozenInventory(0)
|
|
|
.sales(0)
|
|
|
.publisher(Objects.nonNull(ServletUtils.getCurrentUser()) ? ServletUtils.getCurrentUser().getString(ProductConstant.SUB) : null)
|
|
|
@@ -107,6 +107,7 @@ public class ProductItemFacade implements IProductItemFacade {
|
|
|
public Boolean edit(ProductItemEditReq productItemEditReq) {
|
|
|
sysDictDataService.validateOptions(ProductConstant.DICT_KEY_ITEM_SPEC, StrUtil.toString(productItemEditReq.getSpec()));
|
|
|
ProductItem productItem = this.productItemService.lambdaQuery().eq(ProductItem::getId, productItemEditReq.getId()).one();
|
|
|
+ Assert.notNull(productItem, "the_product_does_not_exist");
|
|
|
if (Objects.nonNull(productItemEditReq.getSpec())) {
|
|
|
productItem.setItemSpec(productItemEditReq.getSpec());
|
|
|
}
|
|
|
@@ -125,7 +126,7 @@ public class ProductItemFacade implements IProductItemFacade {
|
|
|
public PageInfo<OrderServiceProductItemSearchRes> list(OrderServiceProductItemSearchReq orderServiceProductItemSearchReq) {
|
|
|
PageHelper.startPage(orderServiceProductItemSearchReq.getPage(), orderServiceProductItemSearchReq.getPageSize());
|
|
|
LambdaQueryWrapper<ProductItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (StrUtil.isBlank(orderServiceProductItemSearchReq.getProductName())) {
|
|
|
+ if (StrUtil.isNotBlank(orderServiceProductItemSearchReq.getProductName())) {
|
|
|
lambdaQueryWrapper.likeRight(ProductItem::getProductName, orderServiceProductItemSearchReq.getProductName());
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(orderServiceProductItemSearchReq.getItemList())) {
|