diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index 121f538c..deac498e 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -497,6 +497,7 @@ CREATE TABLE `jsh_material_current_stock` ( `material_id` bigint(20) DEFAULT NULL COMMENT '产品id', `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id', `current_number` decimal(24,6) DEFAULT NULL COMMENT '当前库存数量', + `current_unit_price` decimal(24,6) DEFAULT NULL COMMENT '当前单价', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) @@ -505,13 +506,13 @@ CREATE TABLE `jsh_material_current_stock` ( -- ---------------------------- -- Records of jsh_material_current_stock -- ---------------------------- -INSERT INTO `jsh_material_current_stock` VALUES ('19', '588', '14', '7.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('20', '568', '14', '2.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('21', '568', '15', '1.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('22', '570', '14', '8.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('23', '619', '14', '5.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('24', '619', '15', '0.000000', '63', '0'); -INSERT INTO `jsh_material_current_stock` VALUES ('25', '619', '17', '0.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('19', '588', '14', '7.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('20', '568', '14', '2.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('21', '568', '15', '1.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('22', '570', '14', '8.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('23', '619', '14', '5.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('24', '619', '15', '0.000000', null, '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('25', '619', '17', '0.000000', null, '63', '0'); -- ---------------------------- -- Table structure for jsh_material_extend @@ -870,6 +871,7 @@ CREATE TABLE `jsh_system_config` ( `over_link_bill_flag` varchar(1) DEFAULT '0' COMMENT '超出关联单据启用标记,0未启用,1启用', `in_out_manage_flag` varchar(1) DEFAULT '0' COMMENT '出入库管理启用标记,0未启用,1启用', `multi_account_flag` varchar(1) DEFAULT '0' COMMENT '多账户启用标记,0未启用,1启用', + `move_avg_price_flag` varchar(1) DEFAULT '0' COMMENT '移动平均价启用标记,0未启用,1启用', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) @@ -878,7 +880,7 @@ CREATE TABLE `jsh_system_config` ( -- ---------------------------- -- Records of jsh_system_config -- ---------------------------- -INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '1', '0', '0', '0', '63', '0'); +INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '1', '0', '0', '0', '0', '63', '0'); -- ---------------------------- -- Table structure for jsh_tenant diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt index d876eedf..f8423de0 100644 --- a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt +++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt @@ -1586,4 +1586,13 @@ alter table jsh_account_item change remark remark varchar(500) DEFAULT NULL COMM -- 给系统参数表增加多账户启用标记,开启后,采购订单、采购入库等单据可以进行多账户选择,升级的时候最好给老的租户进行批量设置为启用 -- -------------------------------------------------------- alter table jsh_system_config add multi_account_flag varchar(1) DEFAULT '0' COMMENT '多账户启用标记,0未启用,1启用' after in_out_manage_flag; -update jsh_system_config set multi_account_flag='1' where multi_account_flag='0'; \ No newline at end of file +update jsh_system_config set multi_account_flag='1' where multi_account_flag='0'; + +-- -------------------------------------------------------- +-- 时间 2024年5月21日 +-- by jishenghua +-- 给系统参数表增加移动平均价标记,默认关闭,开启之后将通过移动平均来计算成本价 +-- 给实时库存表增加当前单价字段 +-- -------------------------------------------------------- +alter table jsh_system_config add move_avg_price_flag varchar(1) DEFAULT '0' COMMENT '移动平均价启用标记,0未启用,1启用' after multi_account_flag; +alter table jsh_material_current_stock add current_unit_price decimal(24,6) DEFAULT NULL COMMENT '当前单价' after current_number; \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStock.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStock.java index 3402d516..98b887d5 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStock.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStock.java @@ -11,6 +11,8 @@ public class MaterialCurrentStock { private BigDecimal currentNumber; + private BigDecimal currentUnitPrice; + private Long tenantId; private String deleteFlag; @@ -47,6 +49,14 @@ public class MaterialCurrentStock { this.currentNumber = currentNumber; } + public BigDecimal getCurrentUnitPrice() { + return currentUnitPrice; + } + + public void setCurrentUnitPrice(BigDecimal currentUnitPrice) { + this.currentUnitPrice = currentUnitPrice; + } + public Long getTenantId() { return tenantId; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStockExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStockExample.java index 6ad310e2..86eaf874 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStockExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/MaterialCurrentStockExample.java @@ -345,6 +345,66 @@ public class MaterialCurrentStockExample { return (Criteria) this; } + public Criteria andCurrentUnitPriceIsNull() { + addCriterion("current_unit_price is null"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceIsNotNull() { + addCriterion("current_unit_price is not null"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceEqualTo(BigDecimal value) { + addCriterion("current_unit_price =", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("current_unit_price <>", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceGreaterThan(BigDecimal value) { + addCriterion("current_unit_price >", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("current_unit_price >=", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceLessThan(BigDecimal value) { + addCriterion("current_unit_price <", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("current_unit_price <=", value, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceIn(List values) { + addCriterion("current_unit_price in", values, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceNotIn(List values) { + addCriterion("current_unit_price not in", values, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_unit_price between", value1, value2, "currentUnitPrice"); + return (Criteria) this; + } + + public Criteria andCurrentUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_unit_price not between", value1, value2, "currentUnitPrice"); + return (Criteria) this; + } + public Criteria andTenantIdIsNull() { addCriterion("tenant_id is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfig.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfig.java index 5d2c8afe..09f23972 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfig.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfig.java @@ -39,6 +39,8 @@ public class SystemConfig { private String multiAccountFlag; + private String moveAvgPriceFlag; + private Long tenantId; private String deleteFlag; @@ -195,6 +197,14 @@ public class SystemConfig { this.multiAccountFlag = multiAccountFlag == null ? null : multiAccountFlag.trim(); } + public String getMoveAvgPriceFlag() { + return moveAvgPriceFlag; + } + + public void setMoveAvgPriceFlag(String moveAvgPriceFlag) { + this.moveAvgPriceFlag = moveAvgPriceFlag == null ? null : moveAvgPriceFlag.trim(); + } + public Long getTenantId() { return tenantId; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfigExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfigExample.java index 51bad1d9..61e2d995 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfigExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/SystemConfigExample.java @@ -1424,6 +1424,76 @@ public class SystemConfigExample { return (Criteria) this; } + public Criteria andMoveAvgPriceFlagIsNull() { + addCriterion("move_avg_price_flag is null"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagIsNotNull() { + addCriterion("move_avg_price_flag is not null"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagEqualTo(String value) { + addCriterion("move_avg_price_flag =", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagNotEqualTo(String value) { + addCriterion("move_avg_price_flag <>", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagGreaterThan(String value) { + addCriterion("move_avg_price_flag >", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagGreaterThanOrEqualTo(String value) { + addCriterion("move_avg_price_flag >=", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagLessThan(String value) { + addCriterion("move_avg_price_flag <", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagLessThanOrEqualTo(String value) { + addCriterion("move_avg_price_flag <=", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagLike(String value) { + addCriterion("move_avg_price_flag like", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagNotLike(String value) { + addCriterion("move_avg_price_flag not like", value, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagIn(List values) { + addCriterion("move_avg_price_flag in", values, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagNotIn(List values) { + addCriterion("move_avg_price_flag not in", values, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagBetween(String value1, String value2) { + addCriterion("move_avg_price_flag between", value1, value2, "moveAvgPriceFlag"); + return (Criteria) this; + } + + public Criteria andMoveAvgPriceFlagNotBetween(String value1, String value2) { + addCriterion("move_avg_price_flag not between", value1, value2, "moveAvgPriceFlag"); + return (Criteria) this; + } + public Criteria andTenantIdIsNull() { addCriterion("tenant_id is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml index 9d3ca693..1119afb1 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml @@ -6,6 +6,7 @@ + @@ -68,7 +69,7 @@ - id, material_id, depot_id, current_number, tenant_id, delete_flag + id, material_id, depot_id, current_number, current_unit_price, tenant_id, delete_flag select @@ -126,7 +128,8 @@ multi_level_approval_flag, multi_bill_type, force_approval_flag, update_unit_price_flag, over_link_bill_flag, in_out_manage_flag, multi_account_flag, - tenant_id, delete_flag) + move_avg_price_flag, tenant_id, delete_flag + ) values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR}, #{companyPostCode,jdbcType=VARCHAR}, #{saleAgreement,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, @@ -134,7 +137,8 @@ #{multiLevelApprovalFlag,jdbcType=VARCHAR}, #{multiBillType,jdbcType=VARCHAR}, #{forceApprovalFlag,jdbcType=VARCHAR}, #{updateUnitPriceFlag,jdbcType=VARCHAR}, #{overLinkBillFlag,jdbcType=VARCHAR}, #{inOutManageFlag,jdbcType=VARCHAR}, #{multiAccountFlag,jdbcType=VARCHAR}, - #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + #{moveAvgPriceFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) insert into jsh_system_config @@ -196,6 +200,9 @@ multi_account_flag, + + move_avg_price_flag, + tenant_id, @@ -261,6 +268,9 @@ #{multiAccountFlag,jdbcType=VARCHAR}, + + #{moveAvgPriceFlag,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, @@ -335,6 +345,9 @@ multi_account_flag = #{record.multiAccountFlag,jdbcType=VARCHAR}, + + move_avg_price_flag = #{record.moveAvgPriceFlag,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, @@ -367,6 +380,7 @@ over_link_bill_flag = #{record.overLinkBillFlag,jdbcType=VARCHAR}, in_out_manage_flag = #{record.inOutManageFlag,jdbcType=VARCHAR}, multi_account_flag = #{record.multiAccountFlag,jdbcType=VARCHAR}, + move_avg_price_flag = #{record.moveAvgPriceFlag,jdbcType=VARCHAR}, tenant_id = #{record.tenantId,jdbcType=BIGINT}, delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} @@ -430,6 +444,9 @@ multi_account_flag = #{multiAccountFlag,jdbcType=VARCHAR}, + + move_avg_price_flag = #{moveAvgPriceFlag,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, @@ -459,6 +476,7 @@ over_link_bill_flag = #{overLinkBillFlag,jdbcType=VARCHAR}, in_out_manage_flag = #{inOutManageFlag,jdbcType=VARCHAR}, multi_account_flag = #{multiAccountFlag,jdbcType=VARCHAR}, + move_avg_price_flag = #{moveAvgPriceFlag,jdbcType=VARCHAR}, tenant_id = #{tenantId,jdbcType=BIGINT}, delete_flag = #{deleteFlag,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}