From a4aa182861fb9aaa110ba5949c9c254e9daee277 Mon Sep 17 00:00:00 2001 From: wangrangrang Date: Fri, 28 Jul 2023 15:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=BD=B1=E5=83=8F=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PushInvoiceServiceImpl.java | 2 +- .../service/impl/InvoicePushServiceImpl.java | 48 ++++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java index 25d06e17..c87fb7c6 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java @@ -475,7 +475,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService { PushInfo pushInfo1 = new PushInfo(); pushInfo1.setId(pushInfo.getId()); pushInfo1.setByzd1("YXXT"); - failPush(null,JsonUtils.getInstance().toJsonString(fpTsMqData),error,e.getMessage(),pushInfo1,fpTsMqData.getPushType()); + failPush(null,content,error,e.getMessage(),pushInfo1,fpTsMqData.getPushType()); e.printStackTrace(); } OrderProcessInfo orderProcessInfo = null; diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/InvoicePushServiceImpl.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/InvoicePushServiceImpl.java index 9217a0e7..e41e4768 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/InvoicePushServiceImpl.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/InvoicePushServiceImpl.java @@ -87,6 +87,31 @@ public class InvoicePushServiceImpl implements InvoicePushService { r.put(OrderManagementConstant.ALL_MESSAGE, "推送内容为空"); return r; } + + PushInfo pushInfo = new PushInfo(); + //查询推送地址 + pushInfo.setId(pushInfoRecord.getPushInfoId()); + pushInfo = pushInfoMapper.selectByPushInfo(pushInfo); + log.info("查询到的推送地址信息:{}", JsonUtils.getInstance().toJsonString(pushInfo)); + //判断是不是影像的推送 + if ("YXXT".equals(pushInfoRecord.getQyType())) { + String pushType = pushInfoRecord.getInterfacePushType(); + try { + //推送影像系统 + pushInvoiceService.sendImageSys(pushInfoRecord.getPushContent(), pushType, pushInfo); + return r; + } catch (Exception e) { + String error = String.format("影像推送出现异常%s,推送类型%s", e.getMessage(), pushType); + log.error(error); + pushInfo.setByzd1("YXXT"); + pushInvoiceService.failPush(pushInfoRecordId, pushInfoRecord.getPushContent(), error, e.getMessage(), pushInfo, pushType); + e.printStackTrace(); + r.put(OrderManagementConstant.CODE, "9999"); + r.put(OrderManagementConstant.ALL_MESSAGE, error); + return r; + } + } + CommonTsMqData fpTsMqData = JSONObject.parseObject(pushInfoRecord.getPushContent(), CommonTsMqData.class); List shList = new ArrayList<>(); shList.add(fpTsMqData.getNsrsbh()); @@ -94,13 +119,7 @@ public class InvoicePushServiceImpl implements InvoicePushService { String pushUrl = ""; String errorMsg = ""; String xtly = "SAP"; - PushInfo pushInfo = new PushInfo(); try { - //查询推送地址 - pushInfo.setId(pushInfoRecord.getPushInfoId()); - pushInfo = pushInfoMapper.selectByPushInfo(pushInfo); - log.info("查询到的推送地址信息:{}", JsonUtils.getInstance().toJsonString(pushInfo)); - if (pushInfo == null) { log.warn("{}税号:{},推送地址没有配置", LOGGER_MSG, fpTsMqData.getNsrsbh()); String error = "税号:" + fpTsMqData.getNsrsbh() + ",推送地址没有配置"; @@ -129,23 +148,6 @@ public class InvoicePushServiceImpl implements InvoicePushService { r.put(OrderManagementConstant.ALL_MESSAGE, error); return r; } - //判断是不是影像的推送 - if ("YXXT".equals(pushInfoRecord.getQyType())) { - try { - //推送影像系统 - pushInvoiceService.sendImageSys(content, fpTsMqData.getPushType(), pushInfo); - return r; - } catch (Exception e) { - String error = String.format("影像推送出现异常%s,推送类型%s", e.getMessage(), fpTsMqData.getPushType()); - log.error(error); - pushInfo.setByzd1("YXXT"); - pushInvoiceService.failPush(pushInfoRecordId, JsonUtils.getInstance().toJsonString(fpTsMqData), error, e.getMessage(), pushInfo, fpTsMqData.getPushType()); - e.printStackTrace(); - r.put(OrderManagementConstant.CODE, "9999"); - r.put(OrderManagementConstant.ALL_MESSAGE, error); - return r; - } - } OrderProcessInfo orderProcessInfo = null; Map requestMap = commonDisposeService.getRequestParameter(pushInfo.getNsrsbh(), pushInfo.getZipCode(), pushInfo.getEncryptCode(), content, pushInfo.getPushUrl(), pushInfo.getInterfaceType(), pushInfo.getVersionIdent());