From 898c1c16ccd4060820663ea1781f8ddfd1810fde Mon Sep 17 00:00:00 2001 From: zhengyf Date: Sun, 9 Feb 2025 12:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E7=9F=A5=EF=BC=9A=E8=B0=83=E6=8B=A8?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=96=B0=E5=A2=9E=E6=9C=9F=E5=88=9D=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transfer/TransferOutPluginInitializer.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java index 81c70a5e..f78922db 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java @@ -373,7 +373,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { //nprice 单价(含税单价),取上一次结账的单价 nmny金额 nnotaxmny无税金额 nnotaxprice 无税单价 //202411091719:妮妮姐说:优先取结存价,没有的话取采购价,如果都没有就报错!!! - String nabprice = queryIaMonthledger(ofsDetail, ofsTranseferOrder.getHeader().getCompanyCode()); + String nabprice = queryIaMonthledger(ofsDetail, ofsTranseferOrder.getHeader().getCompanyCode(), ofsTranseferOrder.getHeader().getFacilityCode()); if (nabprice == null) { Assert.state(false, "公司:{},货品:{},SKU编码:{},无结存价、起初价、采购价,请维护!", ofsTranseferOrder.getHeader().getCompanyCode(), ofsDetail.getSkuName(), ofsDetail.getSkuCode()); } else { @@ -393,7 +393,8 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { billVO.setChildrenvo(childrenvo); String jsonStr = JSONUtil.toJsonStr(billVO); mapStr = "{\"billvo\":" + jsonStr + "}"; - ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveqzCode"), mapStr); +// ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("approveqzCode"), mapStr); + ZTResult ztResult = pushU8CByApiCode.pushByCode(null, mapStr); //两层判断,一层中台转发,一层u8c返回 if ("false".equals(ztResult.getFlag())) { //转发失败 @@ -589,7 +590,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { * 202502071359:妮妮姐电话:取值顺序 结存->期初->采购 * eg:1月 如果结存价取结存价,如果没有取期初,如果没有再去最后一次采购 */ - public String queryIaMonthledger(OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB sku, String companyCode) throws Exception { + public String queryIaMonthledger(OFSTranseferOrderSearchResponse.OFSTranseferOrder.OFSTranseferB sku, String companyCode, String facilityCode) throws Exception { String totalPayAmount = null; //查询公司 BdCorpEntity bdCorpEntity = queryU8CEntityUtil.queryBdCorpByUnitCode(companyCode); @@ -608,6 +609,11 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { if (bdInvmandocEntity == null) { Assert.state(false, "根据U8C存货基本档案主键:{},U8C公司主键:{},查询U8C存货管理档案不存在。请检查U8C档案", bdInvbasdocEntity.getPkInvbasdoc(), bdCorpEntity.getPkCorp()); } + //查询仓库 + BdStordocEntity bdStordocEntity = queryU8CEntityUtil.queryBdStordocByCode(facilityCode); + if (bdStordocEntity == null) { + Assert.state(false, "根据OFS仓库编码:{},查询U8C仓库不存在。请检查U8C档案", facilityCode); + } //结存价(月份) IaMonthledgerEntity iaMonthledgerEntity = new IaMonthledgerEntity(); @@ -627,9 +633,10 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { } - //取期初价格,需要总价nabmny/数量nabnum,保留四位小数 + //取期初价格,需要总价nabmny/数量nabnum,保留四位小数 因为存在多个仓库 IaPeriodaccountEntity iaPeriodaccountEntity = new IaPeriodaccountEntity(); iaPeriodaccountEntity.setCinventoryid(bdInvmandocEntity.getPkInvmandoc()); + iaPeriodaccountEntity.setCwarehouseid(bdStordocEntity.getPkStordoc()); iaPeriodaccountEntity.setCaccountmonth("00"); iaPeriodaccountEntity.setDr("0"); iaPeriodaccountEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);