From 1579018b6d089b7a9567707418aa06abee32377c Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Fri, 23 Feb 2024 17:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8D=95=E4=BB=B7=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E6=97=B6=E5=80=99=E6=9B=B4=E6=96=B0=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=9A=84=E4=BB=B7=E6=A0=BC=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jsh/erp/constants/BusinessConstants.java | 5 +++++ .../jsh/erp/service/depotItem/DepotItemService.java | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java index f6b4d016..340d0edf 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java @@ -96,6 +96,11 @@ public class BusinessConstants { public static final String SUB_TYPE_REPLAY = "盘点复盘"; public static final String SUB_TYPE_ASSEMBLE = "组装单"; public static final String SUB_TYPE_DISASSEMBLE = "拆卸单"; + /** + * 生产类型分类 + * 生产入库 + * */ + public static final String BILL_TYPE_PRODUCE_IN = "生产入库"; /** * 财务单据分类 * 收款、付款 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 5eee23f7..a577e1a1 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 @@ -666,7 +666,7 @@ public class DepotItemService { //更新当前库存 updateCurrentStock(depotItem); //更新商品的价格 - updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), rowObj); + updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), depotHead.getBillType(), rowObj); } //如果关联单据号非空则更新订单的状态,单据类型:采购入库单、销售出库单、盘点复盘单、其它入库单、其它出库单 if(BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType()) @@ -863,7 +863,7 @@ public class DepotItemService { * @param rowObj */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) - public void updateMaterialExtendPrice(Long meId, String subType, JSONObject rowObj) throws Exception { + public void updateMaterialExtendPrice(Long meId, String subType, String billType, JSONObject rowObj) throws Exception { if(systemConfigService.getUpdateUnitPriceFlag()) { if (StringUtil.isExist(rowObj.get("unitPrice"))) { BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice"); @@ -878,6 +878,12 @@ public class DepotItemService { if(BusinessConstants.SUB_TYPE_RETAIL.equals(subType)) { materialExtend.setCommodityDecimal(unitPrice); } + //其它入库-生产入库的情况更新采购单价 + if(BusinessConstants.SUB_TYPE_OTHER.equals(subType)) { + if(BusinessConstants.BILL_TYPE_PRODUCE_IN.equals(billType)) { + materialExtend.setPurchaseDecimal(unitPrice); + } + } materialExtendService.updateMaterialExtend(materialExtend); } }