bug924修改

This commit is contained in:
lym
2024-12-10 15:30:57 +08:00
parent 9aac3872f1
commit 9d14bb21be
3 changed files with 18 additions and 7 deletions
@@ -10,4 +10,7 @@ public class DictTypeConstants {
public static final String PLATE_TEXTURE = "plate_texture_type";// 板件纹里
public static final String PART_CATEGORY = "part_category";// 配件主类型
public static final String BOOLEAN_STRING = "infra_boolean_string"; // Boolean 是否类型
}
@@ -104,7 +104,7 @@ public class PartsController {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<PartsDO> list = partsService.getPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "配件表 parts_{N}.xls", "数据", PartsRespVO.class,
ExcelUtils.write(response, "配件表.xls", "数据", PartsRespVO.class,
BeanUtils.toBean(list, PartsRespVO.class));
}
@@ -138,7 +138,7 @@ public class PartsController {
if (list.isEmpty()){
PartsImportExcelVO partsImportExcelVO = PartsImportExcelVO.builder().result("导入失败,请保证导入文件中包含配件数据").build();
list.add(partsImportExcelVO);
ExcelUtils.write(response, IMPORT_TEMPLATE, "板材列表", PartsImportExcelVO.class, list);
ExcelUtils.write(response, IMPORT_TEMPLATE, "配件列表", PartsImportExcelVO.class, list);
} else {
partsService.importPartsList(list, updateSupport, organId);// 成功,批量导入
}
@@ -2,6 +2,7 @@ package com.cf.imes.module.manage.controller.admin.parts.vo;
import com.cf.imes.framework.common.validation.NumberValid;
import com.cf.imes.framework.excel.core.annotations.DictFormat;
import com.cf.imes.framework.excel.core.convert.DictConvert;
import com.cf.imes.module.manage.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -18,11 +19,11 @@ import javax.validation.constraints.Size;
public class PartsRespVO {
@Schema(description = "配件 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11238")
@ExcelProperty("配件 ID")
@ExcelProperty("配件ID")
private Long id;
@Schema(description = "设计端商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26589")
@ExcelProperty("设计端商品ID")
@ExcelProperty("配件编号")
private String goodsId;
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@@ -31,10 +32,11 @@ public class PartsRespVO {
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
@Size(max = 32, message = "颜色长度不能超过32个字符")
@ExcelProperty("颜色")
private String color;
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
@ExcelProperty("材质")
private String material;
@Schema(description = "配件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@@ -52,18 +54,22 @@ public class PartsRespVO {
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "价格")
@ExcelProperty("价格")
private Double price;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "宽度")
@ExcelProperty("宽度")
private Double width;
@Schema(description = "长度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "长度")
@ExcelProperty("长度")
private Double length;
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "厚度")
@ExcelProperty("厚度")
private Double thickness;
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -83,11 +89,13 @@ public class PartsRespVO {
private String unit;
@Schema(description = "是否复合部件:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否复合部件:0 否 1 是")
@ExcelProperty(value = "是否复合部件", converter = DictConvert.class)
@DictFormat(DictTypeConstants.BOOLEAN_STRING)
private Boolean isComposite;
@Schema(description = "子配件ID列表,复合部件时记录子配件ID,半角逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
@ExcelProperty("是否复合部件:0 否 1 是")
// @ExcelProperty("子配件ID列表")
@ExcelIgnore
private String subparts;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")