|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.apache.dubbo.common.logger.FluentLogger;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
@@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.easyes.core.biz.EsPageInfo;
|
|
|
import org.dromara.easyes.core.biz.SAPageInfo;
|
|
|
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
|
|
|
+import org.dromara.external.api.service.RemoteExternalProductService;
|
|
|
import org.dromara.product.api.domain.ProductVo;
|
|
|
import org.dromara.product.domain.*;
|
|
|
import org.dromara.product.domain.vo.ProductBrandVo;
|
|
|
@@ -112,6 +114,9 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
|
|
|
private final ProductEsMapper esMapper;
|
|
|
|
|
|
+ @DubboReference
|
|
|
+ private RemoteExternalProductService externalProductService;
|
|
|
+
|
|
|
/**
|
|
|
* Callback used to run the bean.
|
|
|
* 优化说明:针对200万级别数据,采用分批流式处理,避免OOM
|
|
|
@@ -351,6 +356,9 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
int limit = pageQuery.getPageSize() + 1;
|
|
|
lqw.last("limit "+ limit );
|
|
|
List<ProductBaseVo> result = baseMapper.selectAllList(lqw);
|
|
|
+ result.forEach(vo -> {
|
|
|
+
|
|
|
+ });
|
|
|
int size = result.size();
|
|
|
if (size > pageQuery.getPageSize()) {
|
|
|
result.remove(result.size() - 1);
|
|
|
@@ -1075,6 +1083,22 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 商品类型改变
|
|
|
+ *
|
|
|
+ * @param bo
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void changeProductType(ProductBaseBo bo) {
|
|
|
+ if( ObjectUtil.isEmpty(bo.getProductCategory())){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ baseMapper.update(Wrappers.lambdaUpdate(ProductBase.class)
|
|
|
+ .set(ProductBase::getProductCategory, bo.getProductCategory())
|
|
|
+ .eq(ProductBase::getId, bo.getId())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询推荐商品列表(联表查询分类名称)
|
|
|
*
|