xml导入修改,新增price,新增孔类型和id

This commit is contained in:
lym
2024-11-28 11:01:22 +08:00
parent 683eb69efd
commit d3847c9745
51 changed files with 580 additions and 159 deletions
@@ -54,6 +54,9 @@ public class PartsImportExcelVO {
@ExcelProperty("厂家")
private String factor;
@ExcelProperty("价格")// float(8,3)
private String price;
@ExcelProperty("长度")// float(8,3)
private String length;
@@ -54,6 +54,10 @@ public class PartsPageReqVO extends PageParam {
@Size(max = 64, message = "配件规格不能超过64个字符")
private String spec;
@Schema(description = "价格")
@PartsNumberValid(name = "价格")
private Double[] price;
@Schema(description = "宽度")
@PartsNumberValid(name = "宽度")
private Double[] width;
@@ -50,6 +50,10 @@ public class PartsRespVO {
@ExcelProperty("型号")
private String model;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "价格")
private Double price;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "宽度")
private Double width;
@@ -49,6 +49,10 @@ public class PartsSaveReqVO {
@Size(max = 64, message = "型号长度不能超过64个字符")
private String model;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "价格")
private Double price;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "宽度")
private Double width;
@@ -120,9 +120,9 @@ public class PlateController {
// 手动创建导出 demo
List<PlateImportExcelVO> list = Arrays.asList(
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("5mm-多层板-高级灰").material("多层板").width(String.valueOf(1220)).height(String.valueOf(2440))
.thickness(String.valueOf(5)).brand("AAA").spec("2440*1220*5").remark("板材样本").color("高级灰").texture("").build(),
.thickness(String.valueOf(5)).brand("AAA").spec("2440*1220*5").remark("板材样本").color("高级灰").price("120").texture("").build(),
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("白玉木兰-欧松板").material("欧松板").width(String.valueOf(1220)).height(String.valueOf(2750))
.thickness(String.valueOf(18)).brand("鸿达树").spec("2750*1220*18").remark("测试").color("白玉木兰").texture("").build()
.thickness(String.valueOf(18)).brand("鸿达树").spec("2750*1220*18").remark("测试").color("白玉木兰").price("120").texture("").build()
);
// 输出
ExcelUtils.write(response, IMPORT_TEMPLATE, "板材列表", PlateImportExcelVO.class, list);
@@ -51,9 +51,9 @@ public class PlateImportExcelVO {
@NotEmpty(message = "厚度不能为空")
private String thickness;
// @ExcelProperty("价格")
// @NotEmpty(message = "价格不能为空")
// private String price;
@ExcelProperty("价格")
@NotEmpty(message = "价格不能为空")
private String price;
@ExcelProperty("品牌")
@NotEmpty(message = "品牌不能为空")
@@ -45,8 +45,8 @@ public class PlatePageReqVO extends PageParam {
@Schema(description = "厚度")
private Double thickness;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "价格", example = "3380")
private Double price;
@Schema(description = "品牌")
@Size(max = 64, message = "品牌长度不能超过64个字符")
@@ -51,9 +51,9 @@ public class PlateRespVO {
@ExcelProperty("厚度")
private Double thickness;
// @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
// @ExcelProperty("价格")
// private Double price;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
@ExcelProperty("价格")
private Double price;
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("品牌")
@@ -53,8 +53,8 @@ public class PlateSaveReqVO {
@NumberValid(name = "厚度")
private Double thickness;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "价格", example = "3380")
private Double price;
@Schema(description = "品牌")
@Size(max = 64, message = "品牌长度不能超过64个字符")
@@ -0,0 +1,58 @@
package com.cf.imes.module.manage.controller.admin.plate.vo.remain;
import com.cf.imes.framework.common.validation.NumberValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
/**
* 余料修改字段
*/
@Schema(description = "管理后台 - 余料修改字段 VO")
@Data
public class RemainPlateUpSaveVO {
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "宽度不能为空")
@NumberValid(name = "宽度")
private BigDecimal width;
@Schema(description = "长度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "长度不能为空")
@NumberValid(name = "长度")
private BigDecimal length;
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "厚度不能为空")
@NumberValid(name = "厚度")
private BigDecimal thickness;
@Schema(description = "纹理 有 无", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean texture;
@Schema(description = "材料", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "材料不能为空")
@Size(max = 50, message = "材料长度不能超过50个字符")
private String material;
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "颜色不能为空")
@Size(max = 50, message = "颜色长度不能超过50个字符")
private String color;
@Schema(description = "品牌")
@Size(max = 50, message = "品牌长度不能超过50个字符")
private String brand;
@Schema(description = "仓库名")
@Size(max = 64, message = "品牌长度不能超过64个字符")
private String store;
@Schema(description = "备注", example = "随便")
@Size(max = 255, message = "品牌长度不能超过255个字符")
private String remark;
}
@@ -45,6 +45,10 @@ public class PartsDO extends BaseDO {
* 颜色
*/
private String color;
/**
* 价格
*/
private Double price;
/**
* 配件类型
*/
@@ -64,7 +64,7 @@ public class PlateDO extends BaseDO {
/**
* 价格
*/
// private Double price;
private Double price;
/**
* 品牌
*/
@@ -34,7 +34,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
.likeIfPresent(PlateDO::getBrand, reqVO.getBrand())
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
// .eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
.eqIfPresent(PlateDO::getTexture, reqVO.getTexture())
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime());
@@ -52,6 +52,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
case "height" -> queryWrapper.orderByAsc(PlateDO::getHeight);
case "thickness" -> queryWrapper.orderByAsc(PlateDO::getThickness);
case "brand" -> queryWrapper.orderByAsc(PlateDO::getBrand);
case "price" -> queryWrapper.orderByAsc(PlateDO::getPrice);
default -> {
// default不排序
}
@@ -67,6 +68,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
case "height" -> queryWrapper.orderByDesc(PlateDO::getHeight);
case "thickness" -> queryWrapper.orderByDesc(PlateDO::getThickness);
case "brand" -> queryWrapper.orderByDesc(PlateDO::getBrand);
case "price" -> queryWrapper.orderByDesc(PlateDO::getPrice);
default -> {
// default不排序
}
@@ -35,7 +35,10 @@ public final class PlateExcelListener<T> extends AnalysisEventListener<PlateImpo
checkData(data.getHeight(),"高度",data);
checkData(data.getWidth(),"宽度",data);
checkData(data.getThickness(),"厚度",data);
// checkData(data.getPrice(),"价格",data);
if (data.getPrice() == null || data.getPrice().equals("")) {
data.setPrice("0");
}
checkData(data.getPrice(),"价格",data);
checkTexture(data.getTexture(),"纹理",data);
if (data.getResult() != null)
data.setResult(data.getResult().replace("null,", ""));
@@ -3,6 +3,7 @@ package com.cf.imes.module.manage.service.remainplaten;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlatePageReqVO;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlateSaveReqVO;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlateUpSaveVO;
import com.cf.imes.module.manage.dal.dataobject.remainplaten.RemainPlateDO;
import com.cf.imes.module.manage.dal.mysql.remainplaten.RemainPlateMapper;
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
@@ -118,7 +119,10 @@ public class RemainPlateServiceImpl implements RemainPlateService {
updateObj.setRemark(updateReqVO.getRemark());
updateObj.setStore(updateReqVO.getStore());
} else {
updateObj = BeanUtils.toBean(updateReqVO, RemainPlateDO.class);
RemainPlateUpSaveVO updateUpSaveVO = BeanUtils.toBean(updateReqVO, RemainPlateUpSaveVO.class);
updateObj.setWidth(updateUpSaveVO.getWidth()).setLength(updateUpSaveVO.getLength()).setThickness(updateUpSaveVO.getThickness())
.setMaterial(updateUpSaveVO.getMaterial()).setColor(updateUpSaveVO.getColor()).setBrand(updateUpSaveVO.getBrand())
.setRemark(updateUpSaveVO.getRemark()).setStore(updateUpSaveVO.getStore()).setTexture(updateUpSaveVO.getTexture());
}
remainPlateMapper.updateById(updateObj);
}
@@ -10,6 +10,7 @@
goods_name,
material,
color,
price,
width,
height,
texture,