From 7a0d0077059921ba1e72f265a74fabe2f5b24ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 2 Oct 2022 16:57:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=8D=95=E6=8D=AE=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=87=E8=B4=AD=E5=8D=95=E4=BB=B7=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-boot/docs/jsh_erp.sql | 39 ++++++------ .../docs/数据库更新记录-首次安装请勿使用.txt | 7 +++ .../erp/datasource/entities/DepotItem.java | 10 ++++ .../datasource/entities/DepotItemExample.java | 60 +++++++++++++++++++ .../service/depotItem/DepotItemService.java | 5 ++ .../resources/mapper_xml/DepotItemMapper.xml | 45 +++++++++----- 6 files changed, 132 insertions(+), 34 deletions(-) diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index 8c967ddb..b66b9a8a 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50704 File Encoding : 65001 -Date: 2022-08-26 00:10:15 +Date: 2022-10-02 16:27:25 */ SET FOREIGN_KEY_CHECKS=0; @@ -211,6 +211,7 @@ CREATE TABLE `jsh_depot_item` ( `oper_number` decimal(24,6) DEFAULT NULL COMMENT '数量', `basic_number` decimal(24,6) DEFAULT NULL COMMENT '基础数量,如kg、瓶', `unit_price` decimal(24,6) DEFAULT NULL COMMENT '单价', + `purchase_unit_price` decimal(24,6) DEFAULT NULL COMMENT '采购单价', `tax_unit_price` decimal(24,6) DEFAULT NULL COMMENT '含税单价', `all_price` decimal(24,6) DEFAULT NULL COMMENT '金额', `remark` varchar(200) DEFAULT NULL COMMENT '备注', @@ -236,24 +237,24 @@ CREATE TABLE `jsh_depot_item` ( -- ---------------------------- -- Records of jsh_depot_item -- ---------------------------- -INSERT INTO `jsh_depot_item` VALUES ('312', '258', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, '110.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('313', '259', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, '110.000000', null, '14', null, null, '0.000000', '110.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('314', '260', '588', '10', '个', null, '2.000000', '2.000000', '11.000000', '11.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('315', '261', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, '44.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('316', '262', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, '44.000000', null, '14', null, null, '0.000000', '44.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('317', '263', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', '22.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('318', '264', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('319', '265', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('320', '266', '568', '2', '个', null, '5.000000', '5.000000', '11.000000', null, '55.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('321', '267', '568', '2', '个', null, '2.000000', '2.000000', '15.000000', null, '30.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('322', '268', '568', '2', '个', null, '1.000000', '1.000000', '11.000000', null, '11.000000', null, '14', '15', null, null, null, null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('323', '269', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('324', '269', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('325', '270', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('326', '270', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('327', '271', '570', '4', '个', null, '10.000000', '10.000000', '8.000000', '8.000000', '80.000000', null, '14', null, '0.000000', '0.000000', '80.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('328', '272', '570', '4', '个', null, '2.000000', '2.000000', '14.000000', '14.000000', '28.000000', null, '14', null, '0.000000', '0.000000', '28.000000', null, null, null, null, null, '63', '0'); -INSERT INTO `jsh_depot_item` VALUES ('330', '273', '619', '37', '件', '橙色,L', '5.000000', '5.000000', '12.000000', '12.000000', '60.000000', null, '14', null, '0.000000', '0.000000', '60.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('312', '258', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, null, '110.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('313', '259', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, null, '110.000000', null, '14', null, null, '0.000000', '110.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('314', '260', '588', '10', '个', null, '2.000000', '2.000000', '11.000000', null, '11.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('315', '261', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, null, '44.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('316', '262', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, null, '44.000000', null, '14', null, null, '0.000000', '44.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('317', '263', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, '22.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('318', '264', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('319', '265', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('320', '266', '568', '2', '个', null, '5.000000', '5.000000', '11.000000', null, null, '55.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('321', '267', '568', '2', '个', null, '2.000000', '2.000000', '15.000000', null, null, '30.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('322', '268', '568', '2', '个', null, '1.000000', '1.000000', '11.000000', null, null, '11.000000', null, '14', '15', null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('323', '269', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('324', '269', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('325', '270', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('326', '270', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('327', '271', '570', '4', '个', null, '10.000000', '10.000000', '8.000000', null, '8.000000', '80.000000', null, '14', null, '0.000000', '0.000000', '80.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('328', '272', '570', '4', '个', null, '2.000000', '2.000000', '14.000000', null, '14.000000', '28.000000', null, '14', null, '0.000000', '0.000000', '28.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('330', '273', '619', '37', '件', '橙色,L', '5.000000', '5.000000', '12.000000', null, '12.000000', '60.000000', null, '14', null, '0.000000', '0.000000', '60.000000', null, null, null, null, null, '63', '0'); -- ---------------------------- -- Table structure for jsh_function diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt index e4bec332..68f1fd4e 100644 --- a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt +++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt @@ -1408,3 +1408,10 @@ alter table jsh_material_attribute drop column attribute_field; -- -------------------------------------------------------- alter table jsh_material change remark remark varchar(500) DEFAULT NULL COMMENT '备注'; alter table jsh_account_head change remark remark varchar(1000) DEFAULT NULL COMMENT '备注'; + +-- -------------------------------------------------------- +-- 时间 2022年10月2日 +-- by jishenghua +-- 给单据明细增加采购单价字段 +-- -------------------------------------------------------- +alter table jsh_depot_item add purchase_unit_price decimal(24,6) DEFAULT NULL COMMENT '采购单价' after unit_price; \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItem.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItem.java index 21cccfc2..a4d86d25 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItem.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItem.java @@ -22,6 +22,8 @@ public class DepotItem { private BigDecimal unitPrice; + private BigDecimal purchaseUnitPrice; + private BigDecimal taxUnitPrice; private BigDecimal allPrice; @@ -124,6 +126,14 @@ public class DepotItem { this.unitPrice = unitPrice; } + public BigDecimal getPurchaseUnitPrice() { + return purchaseUnitPrice; + } + + public void setPurchaseUnitPrice(BigDecimal purchaseUnitPrice) { + this.purchaseUnitPrice = purchaseUnitPrice; + } + public BigDecimal getTaxUnitPrice() { return taxUnitPrice; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemExample.java index 357c71a3..cda106ad 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemExample.java @@ -666,6 +666,66 @@ public class DepotItemExample { return (Criteria) this; } + public Criteria andPurchaseUnitPriceIsNull() { + addCriterion("purchase_unit_price is null"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceIsNotNull() { + addCriterion("purchase_unit_price is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price =", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price <>", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceGreaterThan(BigDecimal value) { + addCriterion("purchase_unit_price >", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price >=", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceLessThan(BigDecimal value) { + addCriterion("purchase_unit_price <", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price <=", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceIn(List values) { + addCriterion("purchase_unit_price in", values, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotIn(List values) { + addCriterion("purchase_unit_price not in", values, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_unit_price between", value1, value2, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_unit_price not between", value1, value2, "purchaseUnitPrice"); + return (Criteria) this; + } + public Criteria andTaxUnitPriceIsNull() { addCriterion("tax_unit_price is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index e8a96f01..b896096e 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -525,6 +525,11 @@ public class DepotItemService { } } } + //如果是销售出库单则给采购单价字段赋值 + if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) { + depotItem.setPurchaseUnitPrice(materialExtend.getPurchaseDecimal()); + } if (StringUtil.isExist(rowObj.get("taxUnitPrice"))) { depotItem.setTaxUnitPrice(rowObj.getBigDecimal("taxUnitPrice")); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml index 28748d35..a44a959e 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml @@ -11,6 +11,7 @@ + @@ -87,9 +88,9 @@ id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, - basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id, - tax_rate, tax_money, tax_last_money, material_type, sn_list, batch_number, expiration_date, - link_id, tenant_id, delete_flag + basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark, + depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list, + batch_number, expiration_date, link_id, tenant_id, delete_flag