给商品导出excel的列名进行优化

This commit is contained in:
jishenghua 2025-03-27 22:23:41 +08:00
parent aecd647223
commit affb7a70b6
2 changed files with 7 additions and 3 deletions

View File

@ -480,7 +480,7 @@ public class MaterialController extends BaseController {
materialService.exportExcel(StringUtil.toNull(categoryId), StringUtil.toNull(materialParam), StringUtil.toNull(color), materialService.exportExcel(StringUtil.toNull(categoryId), StringUtil.toNull(materialParam), StringUtil.toNull(color),
StringUtil.toNull(materialOther), StringUtil.toNull(weight), StringUtil.toNull(materialOther), StringUtil.toNull(weight),
StringUtil.toNull(expiryNum), StringUtil.toNull(enabled), StringUtil.toNull(enableSerialNumber), StringUtil.toNull(expiryNum), StringUtil.toNull(enabled), StringUtil.toNull(enableSerialNumber),
StringUtil.toNull(enableBatchNumber), StringUtil.toNull(remark), response); StringUtil.toNull(enableBatchNumber), StringUtil.toNull(remark), mpList, response);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
} }

View File

@ -464,7 +464,7 @@ public class MaterialService {
public void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight, public void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight,
String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber, String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber,
String remark, HttpServletResponse response)throws Exception { String remark, String mpList, HttpServletResponse response)throws Exception {
List<Long> idList = new ArrayList<>(); List<Long> idList = new ArrayList<>();
if(StringUtil.isNotEmpty(categoryId)){ if(StringUtil.isNotEmpty(categoryId)){
idList = getListByParentId(Long.parseLong(categoryId)); idList = getListByParentId(Long.parseLong(categoryId));
@ -479,8 +479,12 @@ public class MaterialService {
//遇到多个副条码的情况只加第一个 //遇到多个副条码的情况只加第一个
otherMaterialMap.putIfAbsent(me.getMaterialId(), me); otherMaterialMap.putIfAbsent(me.getMaterialId(), me);
} }
String otherField = "扩展1,扩展2,扩展3";
if(StringUtil.isNotEmpty(mpList)) {
otherField = mpList;
}
String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),保质期(天),基本单位*,副单位,基本条码*,副条码,比例,多属性," + String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),保质期(天),基本单位*,副单位,基本条码*,副条码,比例,多属性," +
"采购价,零售价,销售价,最低售价,状态*,序列号,批号,仓位货架,制造商,扩展1,扩展2,扩展3,备注"; "采购价,零售价,销售价,最低售价,状态*,序列号,批号,仓位货架,制造商," + otherField + ",备注";
List<String> nameList = StringUtil.strToStringList(nameStr); List<String> nameList = StringUtil.strToStringList(nameStr);
//仓库列表 //仓库列表
List<Depot> depotList = depotService.getAllList(); List<Depot> depotList = depotService.getAllList();