打印数据

This commit is contained in:
2026-04-16 14:38:14 +08:00
parent 710cca65d6
commit cef7e5315a
27 changed files with 467 additions and 86 deletions

View File

@@ -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);