feat(material): 变更 material 数据结构

This commit is contained in:
han0
2023-12-12 08:53:15 +08:00
parent c1f4b6be79
commit 21bb92bba1
3 changed files with 72 additions and 24 deletions

View File

@@ -95,6 +95,22 @@ public class Material extends Model<Material> {
@TableField("CATEGORY4") @TableField("CATEGORY4")
private String category4; private String category4;
@ApiModelProperty("名称")
@TableField("NAME")
private String name;
@ApiModelProperty("单位")
@TableField("UNIT")
private String unit;
@ApiModelProperty("规格")
@TableField("SPEC")
private String spec;
@ApiModelProperty("税率%")
@TableField("TAX")
private Integer tax;
@ApiModelProperty("是否初始内建类型(不允许删除)") @ApiModelProperty("是否初始内建类型(不允许删除)")
@TableField("IS_BUILTIN") @TableField("IS_BUILTIN")
private Integer isBuiltin; private Integer isBuiltin;
@@ -120,10 +136,14 @@ public class Material extends Model<Material> {
public Material(MaterialCreateRequest params, SaBaseLoginUser user) { public Material(MaterialCreateRequest params, SaBaseLoginUser user) {
this.id = params.getId(); this.id = params.getId();
this.parentId = params.getParentId(); this.parentId = params.getParentId();
this.category1 = params.getCategory1(); // this.category1 = params.getCategory1();
this.category2 = params.getCategory2(); // this.category2 = params.getCategory2();
this.category3 = params.getCategory3(); // this.category3 = params.getCategory3();
this.category4 = params.getCategory4(); // this.category4 = params.getCategory4();
this.name = params.getName();
this.unit = params.getUnit();
this.spec = params.getSpec();
this.tax = params.getTax();
this.updateTime = LocalDateTime.now(); this.updateTime = LocalDateTime.now();
this.createTime = LocalDateTime.now(); this.createTime = LocalDateTime.now();
this.createUserName = user.getName(); this.createUserName = user.getName();
@@ -131,10 +151,14 @@ public class Material extends Model<Material> {
} }
public void edit(MaterialEditRequest params, SaBaseLoginUser user) { public void edit(MaterialEditRequest params, SaBaseLoginUser user) {
this.category1 = params.getCategory1(); // this.category1 = params.getCategory1();
this.category2 = params.getCategory2(); // this.category2 = params.getCategory2();
this.category3 = params.getCategory3(); // this.category3 = params.getCategory3();
this.category4 = params.getCategory4(); // this.category4 = params.getCategory4();
this.name = params.getName();
this.unit = params.getUnit();
this.spec = params.getSpec();
this.tax = params.getTax();
this.updateTime = LocalDateTime.now(); this.updateTime = LocalDateTime.now();
this.updateUserName = user.getName(); this.updateUserName = user.getName();
this.updateUserId = user.getId(); this.updateUserId = user.getId();

View File

@@ -16,17 +16,29 @@ public class MaterialCreateRequest {
@ApiModelProperty("父级id") @ApiModelProperty("父级id")
private String parentId; private String parentId;
@ApiModelProperty("分类1") // @ApiModelProperty("分类1")
private String category1; // private String category1;
//
// @ApiModelProperty("分类2")
// private String category2;
//
// @ApiModelProperty("分类3")
// private String category3;
//
// @ApiModelProperty("分类4")
// private String category4;
@ApiModelProperty("分类2") @ApiModelProperty("名称")
private String category2; private String name;
@ApiModelProperty("分类3") @ApiModelProperty("单位")
private String category3; private String unit;
@ApiModelProperty("分类4") @ApiModelProperty("规格")
private String category4; private String spec;
@ApiModelProperty("税率")
private Integer tax;
public void check() throws Exception{ public void check() throws Exception{
String flag = this.parentId.replace(".00", ""); String flag = this.parentId.replace(".00", "");

View File

@@ -6,17 +6,29 @@ import lombok.Data;
@Data @Data
public class MaterialEditRequest { public class MaterialEditRequest {
@ApiModelProperty("分类1") // @ApiModelProperty("分类1")
private String category1; // private String category1;
//
// @ApiModelProperty("分类2")
// private String category2;
//
// @ApiModelProperty("分类3")
// private String category3;
//
// @ApiModelProperty("分类4")
// private String category4;
@ApiModelProperty("类2") @ApiModelProperty("名称")
private String category2; private String name;
@ApiModelProperty("类3") @ApiModelProperty("单位")
private String category3; private String unit;
@ApiModelProperty("类4") @ApiModelProperty("规格")
private String category4; private String spec;
@ApiModelProperty("税率")
private Integer tax;
public void check() throws Exception{ public void check() throws Exception{