From e2d896c510c74f56c29c679133dc8d92cb97fb30 Mon Sep 17 00:00:00 2001 From: kk <1910333201@qq.com> Date: Wed, 11 Oct 2023 14:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E7=94=B5=E5=8F=91=E7=A5=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/ElephantInvoiceApiV6ServiceImpl.java | 70 ++++++++++++++++++- .../impl/api/JcskInvoiceApiServiceImpl.java | 25 ------- .../system/domain/InvoiceAllApiLog.java | 3 + .../mapper/system/InvoiceAllApiLogMapper.xml | 7 +- 4 files changed, 78 insertions(+), 27 deletions(-) diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java index 3fb5ff2..22d1940 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dxhy.order.protocol.invoke.DxhyInterfaceResponse; import com.google.gson.Gson; import com.jianshui.common.constant.Constants; +import com.jianshui.common.constant.WebServiceConstant; import com.jianshui.common.core.domain.AjaxResult; import com.jianshui.common.core.domain.entity.Companyservice; import com.jianshui.common.enums.ErrorCode; @@ -46,7 +47,9 @@ import com.jianshui.queue.utils.RedisQueueUtil; import com.jianshui.storage.domain.StorageUrlDTO; import com.jianshui.storage.factory.StorageFactory; import com.jianshui.storage.service.IStorageService; +import com.jianshui.system.domain.InvoiceAllApiLog; import com.jianshui.system.mapper.CompanyserviceMapper; +import com.jianshui.system.mapper.InvoiceAllApiLogMapper; import com.jianshui.system.service.ISysConfigService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; @@ -91,6 +94,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { @Autowired private IBillInfoService billInfoService; + @Autowired + private InvoiceAllApiLogMapper allApiLogMapper; + /** * 发票开具 * @@ -266,6 +272,18 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { // 定时拉取保存发票, TODO 处理开票中的问题 AsyncManager.me().execute(new QueryInvoiceTask(billInfo, companyservice, this)); + // 数电的加入金财表 + InvoiceAllApiLog allApiLog = new InvoiceAllApiLog(); + allApiLog.setUrl(WebServiceConstant.LZFPKJ); + allApiLog.setSendMsg(""); + allApiLog.setResultMsg(""); + allApiLog.setCompany(companyservice.getSellertax()); + allApiLog.setIdentityId(companyservice.getIdentity()); + allApiLog.setRequestId(billInfo.getSystemOrderno()); + allApiLog.setCreateTime(new Date()); + allApiLog.setCompanyName("大象V6"); + allApiLogMapper.insertInvoiceAllApiLog(allApiLog); + HXResponse response = new HXResponse("0000", "同步成功"); response.put("fpqqlsh", billInfo.getSystemOrderno()); return response; @@ -1851,9 +1869,59 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { return null; } + /** + * @author kk + * 通用查询接口 + */ @Override public HXResponse queryResultInfo(InvoiceAllQueryTWODTO invoiceAllYhdjDTO, Companyservice companyservice) { - return null; + + //存入金财的调用接口表里去 + String requestId = invoiceAllYhdjDTO.getRequestId() != null ? invoiceAllYhdjDTO.getRequestId() : ""; + if(StrUtil.isEmpty(requestId)){ + return new HXResponse("requestId不能为空!"); + } + + // 查询调用记录 + QueryWrapper apiLogQueryWrapper = new QueryWrapper<>(); + apiLogQueryWrapper.eq("request_id", requestId); + InvoiceAllApiLog allApiLog = allApiLogMapper.selectOne(apiLogQueryWrapper); + + if (BeanUtil.isEmpty(allApiLog) || StrUtil.isEmpty(allApiLog.getRequestId())) { + return new HXResponse("serviceId异常!"); + } + + String finalServiceId = allApiLog.getUrl(); + + HXResponse response = new HXResponse("0000", "查询成功"); + + // 蓝字发票开具 + if (WebServiceConstant.LZFPKJ.equals(finalServiceId)) { + + // 先执行获取 + QueryBillInfoDTO queryBillInfoDTO = new QueryBillInfoDTO(); + queryBillInfoDTO.setFpqqlsh(requestId); + HXResponse hxResponseTemp = queryInvoice(queryBillInfoDTO, companyservice); + + // 查询同金财数科返回一样 + /* QueryWrapper invoiceQueryWrapper = new QueryWrapper<>(); + invoiceQueryWrapper.eq("fpqqlsh", requestId); + Invoice invoice = invoiceMapper.selectOne(invoiceQueryWrapper); + + response.put("data", invoice);*/ + + return hxResponseTemp; + }else{ + return new HXResponse("功能升级中~请稍等~"); + } + +// return response; + + } + + + + } diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java index ee498ae..948ed56 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java @@ -1306,31 +1306,6 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService { try { result = ApiHttp.request(WebServiceConstant.TYCXJK, WebServiceConstant.URL, queryDTO, companyservice); - // TODO: 2023/5/11 测试 -// result = new cn.hutool.json.JSONObject(); -// result.set("code", "0000"); -// result.set("msg", "123"); -// result.set("data", "{\n" + -// " \"hzfpxxqrdbh\": \"37021423051000203148\",\n" + -// " \"hzfpxxqrdid\": \"953bf4ef7ac74c24ae9a056262939f96\",\n" + -// " \"hzfpxxqrdZtdm\": \"01\",\n" + -// " \"lrrq\": \"2023-05-09 09:47:53\",\n" + -// " \"hzfpxx\": {\n" + -// " \"fpqqlsh\": \"c817769da5c27e3fbda4fe5ce72857f7\",\n" + -// " \"gmfnsrsbh\": \"91370102MA3UD2FG21\",\n" + -// " \"gmfmc\": \"山东慧永信息科技有限公司\",\n" + -// " \"xsfmc\": \"城阳区兴顺通制冷设备维修服务部\",\n" + -// " \"xsfnsrsbh\": \"92370214MACAAEK16E\",\n" + -// " \"kprq\": \"2023-05-09 09:47:54\",\n" + -// " \"fphm\": \"23922000000005190521\",\n" + -// " \"ewmUrl\": \"https://dppt.qingdao.chinatax.gov.cn:8443/v/2_23922000000005190521_202305090947549016EF6F4\",\n" + -// " \"pdfUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_pdf\",\n" + -// " \"ofdUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_ofd\",\n" + -// " \"xmlUrl\": \"https://rocgw.jcsk100.com/external/d/v/qingdao_23922000000005190521_202305090947549016EF6F4_cde295cba75225c66fe9902c88fc4d03_xml\"\n" + -// " }\n" + -// "}"); - - String code = result.get("code") != null ? result.get("code").toString() : ""; String msg = result.get("msg") != null ? result.get("msg").toString() : ""; String data = result.get("data") != null ? result.get("data").toString() : ""; diff --git a/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllApiLog.java b/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllApiLog.java index 82ca7b4..c0200b7 100644 --- a/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllApiLog.java +++ b/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllApiLog.java @@ -48,6 +48,9 @@ public class InvoiceAllApiLog implements Serializable @Excel(name = "请求id") private String requestId; + /** 公司名称*/ + private String companyName; + /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; diff --git a/jianshui-system/src/main/resources/mapper/system/InvoiceAllApiLogMapper.xml b/jianshui-system/src/main/resources/mapper/system/InvoiceAllApiLogMapper.xml index 23f87d6..b349fb0 100644 --- a/jianshui-system/src/main/resources/mapper/system/InvoiceAllApiLogMapper.xml +++ b/jianshui-system/src/main/resources/mapper/system/InvoiceAllApiLogMapper.xml @@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, url, send_msg, result_msg, company, identity_id, create_time, request_id from invoice_all_api_log + select id, url, send_msg, result_msg, company, identity_id, create_time, request_id,company_name from invoice_all_api_log @@ -46,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" identity_id, create_time, request_id, + company_name, #{url}, @@ -55,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{identityId}, #{createTime}, #{requestId}, + #{companyName}, @@ -68,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" identity_id = #{identityId}, create_time = #{createTime}, request_id = #{requestId}, + company_name = #{companyName}, where id = #{id}