mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 07:49:20 +08:00
fix: 内部 SKU 拉入选择器防抖并去掉 focus 重复请求
This commit is contained in:
-1
@@ -3,7 +3,6 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.publishdesk.model.vo
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发布草稿 VO。
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ public class PddGoodsPublishDeskServiceImpl implements PddGoodsPublishDeskServic
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
Long userId = currentUserContext.getCurrentUserId();
|
||||
List<Long> ids = dto.getDraftIds().stream().distinct().toList();
|
||||
List<PddGoodsPublishDraftPO> drafts = draftMapper.selectBatchIds(ids);
|
||||
List<PddGoodsPublishDraftPO> drafts = draftMapper.selectByIds(ids);
|
||||
if (drafts.size() != ids.size()) {
|
||||
throw new BusinessException("部分草稿不存在");
|
||||
}
|
||||
|
||||
+1
@@ -19,5 +19,6 @@ public class ProductSkuFilterDTO {
|
||||
|
||||
private String skuCode;
|
||||
|
||||
/** 模糊匹配:SKU 名称、SKU 编码、所属商品名称、商品编码 */
|
||||
private String keywords;
|
||||
}
|
||||
|
||||
+17
-4
@@ -231,10 +231,23 @@ public class ProductSkuServiceImpl extends ServiceImpl<ProductSkuMapper, Product
|
||||
}
|
||||
if (filter.getKeywords() != null && !filter.getKeywords().trim().isEmpty()) {
|
||||
String keywords = filter.getKeywords().trim();
|
||||
wrapper.and(w -> w
|
||||
.like(ProductSkuPO::getName, keywords)
|
||||
.or()
|
||||
.like(ProductSkuPO::getSkuCode, keywords));
|
||||
LambdaQueryWrapper<ProductPO> productKw = new LambdaQueryWrapper<>();
|
||||
productKw.select(ProductPO::getId)
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.and(p -> p.like(ProductPO::getName, keywords)
|
||||
.or()
|
||||
.like(ProductPO::getProductCode, keywords));
|
||||
List<Long> matchedProductIds = productService.list(productKw).stream()
|
||||
.map(ProductPO::getId)
|
||||
.toList();
|
||||
wrapper.and(w -> {
|
||||
w.like(ProductSkuPO::getName, keywords)
|
||||
.or()
|
||||
.like(ProductSkuPO::getSkuCode, keywords);
|
||||
if (!matchedProductIds.isEmpty()) {
|
||||
w.or().in(ProductSkuPO::getProductId, matchedProductIds);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (filter.getName() != null && !filter.getName().trim().isEmpty()) {
|
||||
wrapper.like(ProductSkuPO::getName, filter.getName());
|
||||
|
||||
Reference in New Issue
Block a user