|
@@ -1,6 +1,7 @@
|
|
|
package com.cdf.service.impl;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.ExcelWriter;
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
@@ -16,11 +17,8 @@ import com.cdf.httpClient.response.cdf.CdfProduct;
|
|
|
import com.cdf.httpClient.response.cdf.CdfProductListByIdsRequest;
|
|
|
import com.cdf.httpClient.response.cdf.CdfProductListByIdsVo;
|
|
|
import com.cdf.request.UploadHotsParam;
|
|
|
-import com.cdf.response.HotExcelVo;
|
|
|
+import com.cdf.response.*;
|
|
|
import com.cdf.exception.BusinessException;
|
|
|
-import com.cdf.response.HotUploadTemplate;
|
|
|
-import com.cdf.response.OutlineUploadTemplate;
|
|
|
-import com.cdf.response.ProductUploadTemplate;
|
|
|
import com.cdf.service.*;
|
|
|
import com.cdf.util.ExcelUtil;
|
|
|
import com.cdf.util.UploadToCdfOssUtil;
|
|
@@ -85,10 +83,10 @@ public class ExcelService {
|
|
|
switch (type){
|
|
|
case 0 :
|
|
|
fileName ="导入外框模版";
|
|
|
- List<Brand> list1 = brandService.list();
|
|
|
+ List<HotOutline> list1 = hotOutlineService.list();
|
|
|
List<OutlineUploadTemplate> OutlineUploadTemplateList = new ArrayList<>();
|
|
|
- for (Brand brand : list1) {
|
|
|
- OutlineUploadTemplate template = new OutlineUploadTemplate(brand.getOutlineId()==null?"":brand.getOutlineId().toString(),brand.getCdfBrandId());
|
|
|
+ for (HotOutline hotOutline : list1) {
|
|
|
+ OutlineUploadTemplate template = new OutlineUploadTemplate(hotOutline.getId().toString());
|
|
|
OutlineUploadTemplateList.add(template);
|
|
|
}
|
|
|
|
|
@@ -490,4 +488,16 @@ public class ExcelService {
|
|
|
fdkkSceneEditService.writeHotJson(num,numRegion.getRegion());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void downBrandExcel(HttpServletRequest request,HttpServletResponse response) throws Exception {
|
|
|
+ List<Brand> list = brandService.list();
|
|
|
+ List<BrandExcelVo> voList = new ArrayList<>();
|
|
|
+ for (Brand brand : list) {
|
|
|
+ BrandExcelVo vo = new BrandExcelVo();
|
|
|
+ BeanUtil.copyProperties(brand,vo);
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.commonExport(request,response,"品牌信息",voList, BrandExcelVo.class);
|
|
|
+ }
|
|
|
}
|