feat: 新增小数位数字段
This commit is contained in:
@@ -127,6 +127,14 @@ public class Material extends Model<Material> {
|
|||||||
@TableField("SORT")
|
@TableField("SORT")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数位数")
|
||||||
|
@TableField("ROUND_BIT")
|
||||||
|
private Integer roundBit;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数具体方法")
|
||||||
|
@TableField("ROUND_METHOD")
|
||||||
|
private String roundMethod;
|
||||||
|
|
||||||
@ApiModelProperty("材料编码")
|
@ApiModelProperty("材料编码")
|
||||||
@TableField("CODE")
|
@TableField("CODE")
|
||||||
private String code;
|
private String code;
|
||||||
@@ -172,6 +180,8 @@ public class Material extends Model<Material> {
|
|||||||
this.tax = params.getTax();
|
this.tax = params.getTax();
|
||||||
this.type = params.getType();
|
this.type = params.getType();
|
||||||
this.sort = params.getSort();
|
this.sort = params.getSort();
|
||||||
|
this.roundBit = params.getRoundBit();
|
||||||
|
this.roundMethod = params.getRoundMethod();
|
||||||
this.code = buildCode(category1, category2, category3, category4);
|
this.code = buildCode(category1, category2, category3, category4);
|
||||||
this.updateTime = LocalDateTime.now();
|
this.updateTime = LocalDateTime.now();
|
||||||
this.createTime = LocalDateTime.now();
|
this.createTime = LocalDateTime.now();
|
||||||
@@ -190,6 +200,8 @@ public class Material extends Model<Material> {
|
|||||||
this.tax = params.getTax();
|
this.tax = params.getTax();
|
||||||
this.type = params.getType();
|
this.type = params.getType();
|
||||||
this.sort = params.getSort();
|
this.sort = params.getSort();
|
||||||
|
this.roundBit = params.getRoundBit();
|
||||||
|
this.roundMethod = params.getRoundMethod();
|
||||||
this.code = buildCode(category1, category2, category3, category4);
|
this.code = buildCode(category1, category2, category3, category4);
|
||||||
this.updateTime = LocalDateTime.now();
|
this.updateTime = LocalDateTime.now();
|
||||||
this.updateUserName = user.getName();
|
this.updateUserName = user.getName();
|
||||||
|
@@ -39,6 +39,12 @@ public class MaterialCreateRequest {
|
|||||||
@ApiModelProperty("排序")
|
@ApiModelProperty("排序")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数位数")
|
||||||
|
private Integer roundBit;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数具体方法")
|
||||||
|
private String roundMethod;
|
||||||
|
|
||||||
public void check() throws Exception {
|
public void check() throws Exception {
|
||||||
if (ObjectUtil.isEmpty(category1) || category1.chars().count() != 2) {
|
if (ObjectUtil.isEmpty(category1) || category1.chars().count() != 2) {
|
||||||
throw new NcHttpException(HttpErrorResponseEnum.MATERIAL_CATEGORY_INVALID);
|
throw new NcHttpException(HttpErrorResponseEnum.MATERIAL_CATEGORY_INVALID);
|
||||||
|
@@ -36,6 +36,12 @@ public class MaterialEditRequest {
|
|||||||
@ApiModelProperty("排序")
|
@ApiModelProperty("排序")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数位数")
|
||||||
|
private Integer roundBit;
|
||||||
|
|
||||||
|
@ApiModelProperty("保留小数具体方法")
|
||||||
|
private String roundMethod;
|
||||||
|
|
||||||
public void check() throws Exception{
|
public void check() throws Exception{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
-- 添加材料表排序字段
|
-- 添加材料表排序字段
|
||||||
ALTER TABLE MATERIAL ADD COLUMN SORT INT DEFAULT 0 COMMENT '排序';
|
ALTER TABLE MATERIAL ADD COLUMN SORT INT DEFAULT 0 COMMENT '排序';
|
||||||
|
|
||||||
|
-- 添加材料表计算过程配置字段
|
||||||
|
ALTER TABLE MATERIAL ADD COLUMN ROUND_BIT INT COMMENT '保留小数位数';
|
||||||
|
ALTER TABLE MATERIAL ADD COLUMN ROUND_METHOD varchar(20) COMMENT '保留小数具体方法';
|
||||||
|
|
||||||
-- 添加材料表完整编码字段
|
-- 添加材料表完整编码字段
|
||||||
ALTER TABLE MATERIAL ADD COLUMN CODE varchar(20) COMMENT '材料编码';
|
ALTER TABLE MATERIAL ADD COLUMN CODE varchar(20) COMMENT '材料编码';
|
||||||
|
|
||||||
@@ -79,3 +83,8 @@ INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEG
|
|||||||
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6005009', '6005', '60', '05', '009', null, '钢绞线群锚(7孔)', '套', '包括夹片、锚垫板和螺旋筋', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6005009');
|
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6005009', '6005', '60', '05', '009', null, '钢绞线群锚(7孔)', '套', '包括夹片、锚垫板和螺旋筋', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6005009');
|
||||||
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6005015', '6005', '60', '05', '015', null, '钢绞线群锚(15孔)', '套', '包括夹片、锚垫板和螺旋筋', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6005015');
|
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6005015', '6005', '60', '05', '015', null, '钢绞线群锚(15孔)', '套', '包括夹片、锚垫板和螺旋筋', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6005015');
|
||||||
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6007002', '6007', '60', '07', '002', null, '铝合金标志', 't', '纯铝板1100', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6007002');
|
INSERT INTO material_manage.material (ID, PARENT_ID, CATEGORY1, CATEGORY2, CATEGORY3, CATEGORY4, NAME, UNIT, SPEC, TAX, IS_BUILTIN, TYPE, IS_TREE, update_user_id, update_user_name, update_time, create_user_id, create_user_name, create_time, delete_user_id, delete_user_name, delete_time, SORT, CODE) VALUES ('6007002', '6007', '60', '07', '002', null, '铝合金标志', 't', '纯铝板1100', null, 1, null, null, null, null, null, null, null, '2025-02-21 11:03:21', null, null, null, 0, '6007002');
|
||||||
|
|
||||||
|
-- 更新材料表计算过程配置数据
|
||||||
|
UPDATE MATERIAL SET ROUND_BIT = 0, ROUND_METHOD = 'normal' WHERE ID IN ('2001001', '2001002', '2001008', '2003004', '2003005', '2003005001', '3001001002', '3001001001', '3001002002', '3001002001', '5509001', '5509002', '5509003', '2001003', '2001006', '2001013', '2001019', '2001025', '2001026', '2003006', '2003007', '2003012', '2003008', '2003009', '2003015', '2003016', '2003017001', '2003017002', '2003021', '2003022', '2004004', '4003001001', '4003001002', '4003002001', '4003002002', '4005001', '6001059', '6001071', '6001080', '6001086', '6001089', '6001092', '6002001', '6002002', '6002003', '6002004', '6002005', '6002006', '6003001', '6003003', '6005005', '6005009', '6005015', '6007002');
|
||||||
|
UPDATE MATERIAL SET ROUND_BIT = 2, ROUND_METHOD = 'none' WHERE ID IN ('3003002001', '3003002002', '3003003', '5007003001');
|
||||||
|
UPDATE MATERIAL SET ROUND_BIT = 1, ROUND_METHOD = 'none' WHERE ID IN ('2005002', '2009028', '2009033', '5005001', '5005002', '5005003', '5005006', '5005007', '5005009', '5006001', '5006002', '5009002', '6001002', '6001003');
|
||||||
|
Reference in New Issue
Block a user