打印数据
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.constants.SystemConstants;
|
||||
import com.czg.excel.ExcelExportUtil;
|
||||
@@ -22,6 +23,8 @@ import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 店铺商品分类
|
||||
@@ -64,6 +67,17 @@ public class ShopProdCategoryServiceImpl extends ServiceImpl<ShopProdCategoryMap
|
||||
return super.listAs(queryWrapper, ShopProdCategoryDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, String> getCategoryIdNameMap(Long shopId) {
|
||||
QueryWrapper queryWrapper = query().select(ShopProdCategory::getId, ShopProdCategory::getName)
|
||||
.eq(ShopProdCategory::getShopId, shopId).eq(ShopProdCategory::getStatus, SystemConstants.OneZero.ONE);
|
||||
List<ShopProdCategory> list = list(queryWrapper);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return Map.of();
|
||||
}
|
||||
return list.stream().collect(Collectors.toMap(ShopProdCategory::getId, ShopProdCategory::getName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportShopProdCategory(ShopProdCategoryDTO param, HttpServletResponse response) {
|
||||
QueryWrapper queryWrapper = buildQueryWrapper(param);
|
||||
|
||||
Reference in New Issue
Block a user