From 0d81aa63d7f554d67d400ccbbb382236c69e60d1 Mon Sep 17 00:00:00 2001 From: zhengyf Date: Tue, 27 Aug 2024 13:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E7=9F=A5=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E4=BF=AE=E6=94=B9=E3=80=82=EF=BC=88?= =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E7=B1=BB=E5=88=AB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adjust/AdjustInPluginInitializer.java | 51 ++++++++++++++----- .../adjust/AdjustOutPluginInitializer.java | 36 ++++++++----- .../lets/plugin/transfer/TransferTest.java | 4 +- .../OFSAdjustOrderSearchResponse.java | 8 +++ 4 files changed, 71 insertions(+), 28 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java index 94ee9a12..5847c3ca 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustInPluginInitializer.java @@ -11,6 +11,7 @@ import com.hzya.frame.plugin.lets.constant.OverallConstant; import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; import com.hzya.frame.plugin.lets.dao.IBdRdclDao; import com.hzya.frame.plugin.lets.entity.BdRdclEntity; +import com.hzya.frame.plugin.lets.ofsvo.QueryOfsAdjustOrderRequestVO; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsStockinOrderRequestVO; import com.hzya.frame.plugin.lets.u8cdto.BillVO; import com.hzya.frame.plugin.lets.u8cdto.GeneralBillVO_4ADto; @@ -24,6 +25,7 @@ import com.hzya.frame.plugin.lets.util.pushData.ZTResult; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.ttxofs.dto.InterfaceParamDto; +import com.hzya.frame.ttxofs.dto.ofsTransferOrderSearch.OFSAdjustOrderSearchResponse; import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse; import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.web.entity.JsonResultEntity; @@ -301,17 +303,22 @@ public class AdjustInPluginInitializer extends PluginBaseEntity { //审核时间dauditdate parentvo.setDauditdate(StringUtils.substring(format, 0, 10)); - //cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库 - BdRdclEntity bdRdclEntity = new BdRdclEntity(); - bdRdclEntity.setRdname("调整入库"); - bdRdclEntity.setDr(0); - bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); - List BdRdclEntityList = iBdRdclDao.query(bdRdclEntity); - if (BdRdclEntityList.size() == 0) { - Assert.state(false, "查询U8C收发类型:调整入库失败。未查询到U8C收发类型。"); + //cdispatcherid--收发类别 + List ofsAdjustOrders = queryOfsAdjustOrders(ofsHeader.getRefOrderCode()); + if(ofsAdjustOrders.size()!=1){ + Assert.state(false,"根据调整入库单号:{},查询调整单:{},失败。不存在或不唯一。",ofsCode,ofsHeader.getRefOrderCode()); } - String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码 - parentvo.setCdispatcherid(RdclCode); + String u8ReceiptType = ofsAdjustOrders.get(0).getHeader().getU8ReceiptType(); +// BdRdclEntity bdRdclEntity = new BdRdclEntity(); +// bdRdclEntity.setRdname("调整入库"); +// bdRdclEntity.setDr(0); +// bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); +// List BdRdclEntityList = iBdRdclDao.query(bdRdclEntity); +// if (BdRdclEntityList.size() == 0) { +// Assert.state(false, "查询U8C收发类型:调整入库失败。未查询到U8C收发类型。"); +// } +// String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码 + parentvo.setCdispatcherid(u8ReceiptType); //子表 List childrenvo = new ArrayList<>(); @@ -339,13 +346,13 @@ public class AdjustInPluginInitializer extends PluginBaseEntity { mapStr = "{\"GeneralBillVO_4A\":[" + dataJson + "]}"; //推送 -// response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("otherinqz"), mapStr); ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("otherinqzCode"), mapStr); //两层判断,一层中台转发,一层u8c返回 if ("false".equals(ztResult.getFlag())) { //转发失败 - Assert.state(false, "丽知:OFS调整入库--->U8C其它入库.中台转发失败,失败原因:{}", ztResult.getMsg()); + response=JSONUtil.toJsonStr(ztResult.getAttribute()); + Assert.state(false, "丽知:OFS调整入库--->U8C其它入库.中台转发失败,失败原因:{}", ztResult.getAttribute()); } Attribute attribute = ztResult.getAttribute(); System.out.println(attribute); @@ -430,4 +437,24 @@ public class AdjustInPluginInitializer extends PluginBaseEntity { } return null; } + + /** + * ofs调整单查询 + * ofs. adjustOrder.search + */ + public List queryOfsAdjustOrders(String ofsAdjustCode) throws Exception { + QueryOfsAdjustOrderRequestVO queryOfsAdjustOrderRequestVO = new QueryOfsAdjustOrderRequestVO(); + queryOfsAdjustOrderRequestVO.setClientCode("LETS"); + queryOfsAdjustOrderRequestVO.setCode(ofsAdjustCode); + queryOfsAdjustOrderRequestVO.setPageNo(1L); + queryOfsAdjustOrderRequestVO.setPageSize(500L); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.adjustOrder.search"); + interfaceParamDto.setData(JSON.toJSONString(queryOfsAdjustOrderRequestVO)); + OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse =(OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); + System.out.println(ofsAdjustOrderSearchResponse); + List data = ofsAdjustOrderSearchResponse.getData(); + return data; + } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustOutPluginInitializer.java index cbff6813..9c3e1aaf 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustOutPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/AdjustOutPluginInitializer.java @@ -306,17 +306,24 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity { //审核时间dauditdate parentvo.setDauditdate(StringUtils.substring(format, 0, 10)); - //cdispatcherid--收发类别,ofs过来的写死,20240813(妮姐+万万),就是调整出库,调整入库 - BdRdclEntity bdRdclEntity = new BdRdclEntity(); - bdRdclEntity.setRdname("调整出库"); - bdRdclEntity.setDr(0); - bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); - List BdRdclEntityList = iBdRdclDao.query(bdRdclEntity); - if (BdRdclEntityList.size() == 0) { - Assert.state(false, "查询U8C收发类型:调整出库失败。未查询到U8C收发类型。"); + //cdispatcherid--收发类别 + List ofsAdjustOrders = queryOfsAdjustOrders(ofsHeader.getRefOrderCode()); + if(ofsAdjustOrders.size()!=1){ + Assert.state(false,"根据调整出库单号:{},查询调整单:{},失败。不存在或不唯一。",ofsCode,ofsHeader.getRefOrderCode()); } - String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码 - parentvo.setCdispatcherid(RdclCode); + String u8ShipmentType = ofsAdjustOrders.get(0).getHeader().getU8ShipmentType();//出库类型 + +// BdRdclEntity bdRdclEntity = new BdRdclEntity(); +//// bdRdclEntity.setRdname("调整出库"); +// bdRdclEntity.setRdcode(u8ShipmentType); +// bdRdclEntity.setDr(0); +// bdRdclEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); +// List BdRdclEntityList = iBdRdclDao.query(bdRdclEntity); +// if (BdRdclEntityList.size() == 0) { +// Assert.state(false, "查询U8C收发类型:调整出库失败。未查询到U8C收发类型。"); +// } +// String RdclCode = BdRdclEntityList.get(0).getRdcode();//收发类别编码 + parentvo.setCdispatcherid(u8ShipmentType); //设置自动拣货 // parentvo.setIsautopick("Y"); @@ -353,7 +360,8 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity { //两层判断,一层中台转发,一层u8c返回 if ("false".equals(ztResult.getFlag())) { //转发失败 - Assert.state(false, "丽知:OFS调整出库--->U8C其它出库.中台转发失败,失败原因:{}", ztResult.getMsg()); + response=JSONUtil.toJsonStr(ztResult.getAttribute()); + Assert.state(false, "丽知:OFS调整出库--->U8C其它出库.中台转发失败,失败原因:{}", ztResult.getAttribute()); } Attribute attribute = ztResult.getAttribute(); System.out.println(attribute); @@ -482,7 +490,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity { * ofs调整单查询 * ofs. adjustOrder.search */ - public void queryOfsAdjustOrders(String ofsAdjustCode) throws Exception { + public List queryOfsAdjustOrders(String ofsAdjustCode) throws Exception { QueryOfsAdjustOrderRequestVO queryOfsAdjustOrderRequestVO = new QueryOfsAdjustOrderRequestVO(); queryOfsAdjustOrderRequestVO.setClientCode("LETS"); queryOfsAdjustOrderRequestVO.setCode(ofsAdjustCode); @@ -494,7 +502,7 @@ public class AdjustOutPluginInitializer extends PluginBaseEntity { interfaceParamDto.setData(JSON.toJSONString(queryOfsAdjustOrderRequestVO)); OFSAdjustOrderSearchResponse ofsAdjustOrderSearchResponse =(OFSAdjustOrderSearchResponse) ofsUnifiedService.unified(interfaceParamDto); System.out.println(ofsAdjustOrderSearchResponse); - - + List data = ofsAdjustOrderSearchResponse.getData(); + return data; } } diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java index b32b3917..b30bc747 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java @@ -68,7 +68,7 @@ public class TransferTest { } @Test public void t31(){ - adjustInPluginInitializer.start("LETS-RE2024081900000003"); + adjustInPluginInitializer.start("LETS-RE2024082700000002"); } @Test public void t32(){ @@ -82,7 +82,7 @@ public class TransferTest { } @Test public void t41(){ - adjustOutPluginInitializer.start("LETS-SH2024082200000008"); + adjustOutPluginInitializer.start("LETS-SH2024082700000001"); } @Test public void t42(){ diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSAdjustOrderSearchResponse.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSAdjustOrderSearchResponse.java index 67cdbc83..7e17a02f 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSAdjustOrderSearchResponse.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/ofsTransferOrderSearch/OFSAdjustOrderSearchResponse.java @@ -41,6 +41,14 @@ public class OFSAdjustOrderSearchResponse extends ReturnMessageBasics { private String lastUpdatedBy; private String remark; private String sourcePlatformCode; + /** + * 出库单类型 0201材料领用 0202销售出库 0203其他出库 0204盘盈出库 0205调拨出库 + */ + private String u8ShipmentType; + /** + * 入库单类型 0101采购入库 0102生产入库 0103其他入库 0104盘盈入库 0105调拨入库 + */ + private String u8ReceiptType; } @Data public class OFSAdjustB{