mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
xml导入-版一
This commit is contained in:
@@ -48,7 +48,10 @@
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-error-code</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
||||
</dependency>
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
|
||||
+5
-5
@@ -106,7 +106,7 @@ public class PlateController {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlateDO> list = plateService.getPlatePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "板材信息表 plate_{N}.xls", "数据", PlateRespVO.class,
|
||||
ExcelUtils.write(response, "板材信息表.xls", "数据", PlateRespVO.class,
|
||||
BeanUtils.toBean(list, PlateRespVO.class));
|
||||
}
|
||||
|
||||
@@ -117,10 +117,10 @@ public class PlateController {
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
// 手动创建导出 demo
|
||||
List<PlateImportExcelVO> list = Arrays.asList(
|
||||
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("xixih").material("颗粒板").width(String.valueOf(1212.3)).height(String.valueOf(12131.6))
|
||||
.thickness(String.valueOf(0.2)).brand("鹅厂").spec("大厂").remark("测试").color("黑色").texture("有").build(),
|
||||
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("2L").material("yuanma@cf.com").width(String.valueOf(21.6)).height(String.valueOf(12231.6))
|
||||
.thickness(String.valueOf(5.3)).brand("kkkkkk").spec("大厂").remark("测试").color("黑色").texture("无").build()
|
||||
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("尼龙板").material("PVC").width(String.valueOf(1200.000)).height(String.valueOf(2400.000))
|
||||
.thickness(String.valueOf(18)).brand("黑天鹅").spec("1200*2400*18").remark("板材样本").color("黑色").texture("无").build(),
|
||||
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("电木板").material("塑料").width(String.valueOf(1800.000)).height(String.valueOf(2800.000))
|
||||
.thickness(String.valueOf(24)).brand("东粤橡塑厂").spec("1800*2800*24").remark("测试").color("黑色").texture("无").build()
|
||||
);
|
||||
// 输出
|
||||
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ package com.cf.imes.module.manage.controller.admin.plate.vo.plate;
|
||||
|
||||
import com.cf.imes.framework.excel.core.annotations.DictFormat;
|
||||
import com.cf.imes.framework.excel.core.convert.DictConvert;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import com.cf.imes.module.manage.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@@ -34,9 +34,9 @@ public class PlateRespVO {
|
||||
@ExcelProperty("颜色")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "纹理", example = "true")
|
||||
@ExcelProperty(value = "纹理", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.USER_SEX)
|
||||
@DictFormat(DictTypeConstants.PLATE_TEXTURE)
|
||||
private Boolean texture;
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
+4
@@ -41,6 +41,10 @@ public class PlateDO extends BaseDO {
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
// /**
|
||||
// * 背面颜色
|
||||
// */
|
||||
// private String colorBlack;
|
||||
/**
|
||||
* 纹理
|
||||
*/
|
||||
|
||||
+4
@@ -66,6 +66,10 @@ public class RemainPlateDO extends BaseDO {
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
/**
|
||||
* 背面颜色
|
||||
*/
|
||||
private String colorBlack;
|
||||
/**
|
||||
* 纹理
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user