feat: 新增小数位数字段

This commit is contained in:
han0
2025-02-21 13:16:06 +08:00
parent 422d71502c
commit 6f45083d9c
4 changed files with 34 additions and 1 deletions

View File

@@ -127,6 +127,14 @@ public class Material extends Model<Material> {
@TableField("SORT")
private Integer sort;
@ApiModelProperty("保留小数位数")
@TableField("ROUND_BIT")
private Integer roundBit;
@ApiModelProperty("保留小数具体方法")
@TableField("ROUND_METHOD")
private String roundMethod;
@ApiModelProperty("材料编码")
@TableField("CODE")
private String code;
@@ -172,6 +180,8 @@ public class Material extends Model<Material> {
this.tax = params.getTax();
this.type = params.getType();
this.sort = params.getSort();
this.roundBit = params.getRoundBit();
this.roundMethod = params.getRoundMethod();
this.code = buildCode(category1, category2, category3, category4);
this.updateTime = LocalDateTime.now();
this.createTime = LocalDateTime.now();
@@ -190,6 +200,8 @@ public class Material extends Model<Material> {
this.tax = params.getTax();
this.type = params.getType();
this.sort = params.getSort();
this.roundBit = params.getRoundBit();
this.roundMethod = params.getRoundMethod();
this.code = buildCode(category1, category2, category3, category4);
this.updateTime = LocalDateTime.now();
this.updateUserName = user.getName();

View File

@@ -39,6 +39,12 @@ public class MaterialCreateRequest {
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("保留小数位数")
private Integer roundBit;
@ApiModelProperty("保留小数具体方法")
private String roundMethod;
public void check() throws Exception {
if (ObjectUtil.isEmpty(category1) || category1.chars().count() != 2) {
throw new NcHttpException(HttpErrorResponseEnum.MATERIAL_CATEGORY_INVALID);

View File

@@ -36,6 +36,12 @@ public class MaterialEditRequest {
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("保留小数位数")
private Integer roundBit;
@ApiModelProperty("保留小数具体方法")
private String roundMethod;
public void check() throws Exception{
}