From 52cce392d5bc2d9e27b68d9d872833b2b71f8052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=8D=A3=E7=90=B3?= Date: Thu, 2 Nov 2023 11:42:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature:=E7=BA=A2=E5=AD=97=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E3=80=81=E7=BA=A2=E5=AD=97=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../consumer/openapi/api/InvoiceRestApiV6.java | 16 ++++++++++++++++ .../service/impl/SpecialInvoiceServiceImpl.java | 3 ++- .../invoice/utils/HttpInvoiceRequestUtil.java | 3 +-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java index 326a7a13..f4ab378d 100644 --- a/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java +++ b/order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/api/InvoiceRestApiV6.java @@ -40,8 +40,11 @@ import com.dxhy.order.consumer.openapi.service.*; import com.dxhy.order.consumer.utils.BeanTransitionUtils; import com.dxhy.order.exception.OrderReceiveException; import com.dxhy.order.invoice.config.InvoiceConfig; +import com.dxhy.order.invoice.module.fangge.protocol.specialinvoice.FgRedInvoiceDownloadReqNew; import com.dxhy.order.utils.HttpUtils; import com.dxhy.order.utils.JsonUtils; +import com.dxyun.invoice.protocol.InterfaceData; +import com.dxyun.invoice.protocol.ProtocolUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -456,4 +459,17 @@ public class InvoiceRestApiV6 { } return returnJsonString; } + + public static void main(String[] args) { + String data = "{\"machineType\":\"A9\",\"key\":\"1758943343kKgvEzmGFNt9ZaXcVwNtDQ==\",\"taxpayerNo\":\"91370000MA3MN0LK5F\",\"terminalCode\":\"0\",\"machineNo\":\"0\",\"encryCode\":\"2\",\"returnCode\":\"0000\",\"returnMsg\":\"成功\",\"data\":\"H4sIAAAAAAAAAO3T5z8bCAPAcXu1FQ2KomeV4MSo3eOx0qRUiVKjBGmKS81oFakiQsLVzKMNrlpSm6NHJCQd1tXq2aM9MSJm2lpBUfK86pvn/fPu+Rd+n9+XgoDm1ReZ1mCehFv8KiayMPvOpnkDFWRZBpP7fhrLw49HJ26NF0i7VknDB+aUs9MHh70PltmSQm5KCSbCLomgt7f2f0keefjNrZnhlDMyCluVKeyQY/CGCc6GX1Wx00CaRH3vqbuWChdlaHbNpTSqQzhpMDxpx4FJLRdraGChuCfx5xwr1wt/m/1nQPne3lIYbaE629TQZBIf2pQNmbbX4k+qYlCWr55R7S4TDaSteQXzjZmxZf2zaPOOIqExC3yJcwZ427GA6rjgDr6Wpf12tiEFzIVV14ZIm9yt7++wyf2e13YV5dXznIJoGfrzPvlvaeIg9dwON4IO+Ct32BQe42+6f9MLsVtrfgC9Gl1PGqelv5MWvPe0XOnf1K0NpwSoDE/cr2c1OIzjuxDrGXk2v7RKd2M3fUXcNTKy+8wOpiDKGvqmE9VV8bBLrQznZWai81gU16F2vlwze/9LQEuTRTMbb+TKafHXr71RXiNVqVfKDQQ+0+6X7y14oRb06DrJTkbx0N2olRDFJlc/nsINg6xVfSO+qC8XsHQ8QAwxiPgCMfQsJvC2qIVfX74GBjIAML7yddfQyKAOcZ1xe9OQife2OM4LKI+aB+YkZf5h9LTGahQR4U2M30jUGppSDNMny0em+4wep7Xp8kcsO4Nt0zYzvJVgHv4jCTo0w2Sw3uTnn9nzA7lNtW1NNzWR91mtgrhdd1+csrYE5YOZUgkY4GefsQeVCk5pi80beDO4E40K9VKJC2FWrDyv9eu6fHpiaORREQgN1MuZSbniPtreOH5vZdruDnmsENtZDxMiVb5qTWVzFlNjjteW/LS0Wip2R8cYDi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x0HhLniN66zgZdVkX9/XckS097tjPQ040FqQ+BVEBP3yoSs7CW7bh9e2HBw9DT6hWXGkX99iJYvWPNINPPACeXfNTPmEHM8rl9+4AxSzwRIkTytsKN2kjAwrcMlZk2FBaaTNB7PwAKSvyXvuXyTlUgcqWhAtOopxP7OMVWn0LAKExKRnm0+koes80Gf46fHAguRj9eUXMv+A9u2g27ABwAA\",\"version\":\"1.3\",\"checkCode\":\"38AB\",\"dataExchangeId\":\"90752129809653204140311854213271\"}"; + try { + InterfaceData interfaceData = ProtocolUtil.decodeData(data); + System.out.println(interfaceData.getData()); + FgRedInvoiceDownloadReqNew fgRedInvoiceDownloadReqBO = JSONObject.parseObject(interfaceData.getData(), FgRedInvoiceDownloadReqNew.class); + System.out.println(interfaceData); + } catch (Exception e) { + e.printStackTrace(); + } + + } } diff --git a/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java b/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java index b94f19ac..56b20e71 100644 --- a/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java +++ b/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; +import com.alibaba.fastjson.JSONObject; import com.dxhy.base.file.common.ExcelReadContext; import com.dxhy.base.file.handle.ExcelReadHandle; import com.dxhy.order.baseservice.config.BaseServiceConfig; @@ -3172,7 +3173,7 @@ public class SpecialInvoiceServiceImpl implements SpecialInvoiceService { try { InterfaceData interfaceData = ProtocolUtil.decodeData(data); log.info("{}方格信息表下载结果,解密后数据为:{}", LOGGER_MSG, interfaceData.getData()); - FgRedInvoiceDownloadReqNew fgRedInvoiceDownloadReqBO = JsonUtils.getInstance().parseObject(interfaceData.getData(), FgRedInvoiceDownloadReqNew.class); + FgRedInvoiceDownloadReqNew fgRedInvoiceDownloadReqBO = JSONObject.parseObject(interfaceData.getData(), FgRedInvoiceDownloadReqNew.class); boolean success = false; if(ObjectUtil.isNotNull(fgRedInvoiceDownloadReqBO) && ObjectUtil.isNotEmpty(fgRedInvoiceDownloadReqBO.getRED_INVOICE_FORM_DOWNLOADS())){ diff --git a/order-management-invoice/src/main/java/com/dxhy/order/invoice/utils/HttpInvoiceRequestUtil.java b/order-management-invoice/src/main/java/com/dxhy/order/invoice/utils/HttpInvoiceRequestUtil.java index c63a18a8..9a18bcdf 100644 --- a/order-management-invoice/src/main/java/com/dxhy/order/invoice/utils/HttpInvoiceRequestUtil.java +++ b/order-management-invoice/src/main/java/com/dxhy/order/invoice/utils/HttpInvoiceRequestUtil.java @@ -597,7 +597,7 @@ public class HttpInvoiceRequestUtil { InvoiceRequestParam invoiceRequestParam = requestNewSk(url, reqData.getNSRSBH(), reqData.getKPJH(), terminalCode, JsonUtils.getInstance().toJsonString(redInfoDownloadRequest), "红字信息表下载的接口", ""); if (ConfigureConstant.STRING_0000.equals(invoiceRequestParam.getReturnCode())) { - RedInfoDownloadResponse redInfoDownloadResponse = JsonUtils.getInstance().parseObject(invoiceRequestParam.getData(), RedInfoDownloadResponse.class); + RedInfoDownloadResponse redInfoDownloadResponse = JSONObject.parseObject(invoiceRequestParam.getData(), RedInfoDownloadResponse.class); if(ObjectUtil.isNotNull(redInfoDownloadResponse)){ hpResponseExtend = getHpResponseBean(redInfoDownloadResponse); @@ -3006,7 +3006,6 @@ public class HttpInvoiceRequestUtil { } return response; } - private static InvoiceRequestParam requestNewSk(String url, String nsrsbh, String fjh, String terminalCode, String requestStr, String interfaceLog, String callChainId) throws Exception { if (StringUtils.isBlank(callChainId)) { From 70305cc1ed2da490f2fab66b6bb1392633ee463c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=8D=A3=E7=90=B3?= Date: Mon, 18 Dec 2023 13:31:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feature=EF=BC=9A=E7=BA=A2=E5=AD=97=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- order-management-consumer/pom.xml | 5 ----- order-management-invoice/pom.xml | 5 +++++ .../service/impl/SpecialInvoiceServiceImpl.java | 9 +++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/order-management-consumer/pom.xml b/order-management-consumer/pom.xml index 7b2e5f4d..fbde80ee 100644 --- a/order-management-consumer/pom.xml +++ b/order-management-consumer/pom.xml @@ -557,11 +557,6 @@ redis.clients jedis - - com.alibaba - fastjson - 1.2.33 - diff --git a/order-management-invoice/pom.xml b/order-management-invoice/pom.xml index c86bd38b..d3d414ba 100644 --- a/order-management-invoice/pom.xml +++ b/order-management-invoice/pom.xml @@ -378,6 +378,11 @@ org.springframework spring-test + + com.alibaba + fastjson + 1.2.33 + diff --git a/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java b/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java index 56b20e71..4f6075d7 100644 --- a/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java +++ b/order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java @@ -3442,4 +3442,13 @@ public class SpecialInvoiceServiceImpl implements SpecialInvoiceService { return hpResponseExtend; } + public static void main(String[] args) { + String data = "{\"bZSL\":\"1\",\"dQBS\":\"1\",\"rED_INVOICE_FORM_DOWNLOADS\":[{\"rED_INVOICE_FORM_DOWN_DETAIL\":[{\"dW\":\"\",\"fPHXZ\":\"\",\"gGXH\":\"\",\"hSBZ\":\"0\",\"lSLBS\":\"\",\"sE\":\"-186110.06\",\"sL\":\"0.090000\",\"sPBM\":\"3040502029902000000\",\"xMDJ\":\"0.000000\",\"xMJE\":\"-2067889.94\",\"xMMC\":\"*经营租赁*土地租赁费\",\"xMSL\":\"0.000000\",\"xMXH\":\"1\",\"yHZCBS\":\"0\",\"zXBM\":\"\",\"zZSTSGL\":\"\"}],\"rED_INVOICE_FORM_DOWN_HEAD\":{\"bMB_BBH\":\"51.0\",\"dSLBZ\":\"0\",\"fPZLDM\":\"\",\"gMF_MC\":\"山东新宝龙工业科技有限公司\",\"gMF_NSRSBH\":\"91370883MA3UQ8PK6W\",\"hJJE\":\"-2067889.94\",\"hJSE\":\"-186110.06\",\"sQBSCLSH\":\"667902776911231213094743\",\"sQDH\":\"667902776911231213094743\",\"sQSM\":\"Y\",\"tKSJ\":\"20231213\",\"xSF_MC\":\"兖矿集团唐村实业有限公司\",\"xSF_NSRSBH\":\"913708831661200960\",\"xXBBH\":\"3708832312005653\",\"xXBLX\":\"0\",\"xXBZT\":\"TZD0000\",\"yFP_DM\":\"0000000000\",\"yFP_HM\":\"00000000\",\"yYSBZ\":\"0000000000\",\"zTMS\":\"审核通过\"}}],\"sUCCESS_COUNT\":\"1\"}"; + FgRedInvoiceDownloadReqNew fgRedInvoiceDownloadReqBO = JSONObject.parseObject(data, FgRedInvoiceDownloadReqNew.class); + + boolean success = false; + if(ObjectUtil.isNotNull(fgRedInvoiceDownloadReqBO) && ObjectUtil.isNotEmpty(fgRedInvoiceDownloadReqBO.getRED_INVOICE_FORM_DOWNLOADS())){ + success = true; + } + } }