From d6556b8120e84a84b216f252786f9a619de8b441 Mon Sep 17 00:00:00 2001 From: zengweihai Date: Tue, 5 Nov 2024 16:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formplugin/ReconPayreqFormPlugin.java | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/ReconPayreqFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ReconPayreqFormPlugin.java index 622012d..3a4ab2d 100644 --- a/main/java/shkd/repc/recon/formplugin/ReconPayreqFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ReconPayreqFormPlugin.java @@ -85,7 +85,7 @@ import java.util.stream.Collectors; * qeug_recon_payreqbill_ext && qeug_recon_connotextb_ext */ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF7SelectListener { -// + private static final Log logger = LogFactory.getLog(OAUtils.class); List fileExtendList = new ArrayList(Arrays.asList("png","jpg","jpeg","ofd","pdf","xml"));//发票文件后缀集合 @@ -96,7 +96,6 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF String billtype = this.getModel().getDataEntity().getDynamicObjectType().getName();//获取单据标识 if ("recon_connotextbill".equals(billtype)){//当单据为费用登记单时,对该控件进行过滤监听。 BasedataEdit edit = this.getView().getControl("qeug_personbank");//获取报销人控件 - System.out.println("123"); edit.addBeforeF7SelectListener(this); } @@ -196,6 +195,7 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF return; } // ToDo: 获取token;重新识别无需对现存的发票的数据操作,直接提示接口信息 + String oaToken = getOaToken(); //发票信息分录 DynamicObjectCollection invoiceentry = this.getView().getModel().getEntryEntity("invoiceentry"); @@ -731,8 +731,10 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF // if (bos_user != null){ // loginName = bos_user.getString("number"); // } - String linkUrl = "http://172.31.254.240:9090/seeyon/rest/token"; - + String oaUrl = System.getProperty("oaurl"); + logger.info("密钥接口:mc获取的oaUrl:\n{}", oaUrl); + String linkUrl =oaUrl+ "/seeyon/rest/token"; +// String linkUrl = "http://172.31.254.240:9090/seeyon/rest/token"; //接口请求体 JSONObject linkBody = new JSONObject(); linkBody.put("userName", userName); @@ -746,18 +748,22 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF if (StringUtils.isNotEmpty(linkPostjson)) { JSONObject jsonObject = JSONObject.parseObject(linkPostjson); token = jsonObject.getString("id"); + logger.info("获取OaToken接口返回id"+token); } return token; } catch (Exception e) { - logger.info(String.format("获取OaToken接口异常:%s", e.getMessage())); + logger.info(String.format("获取OaToken接口异常:%s", e.getMessage())+"接口地址:"+linkUrl); throw new RuntimeException(e); } } public JSONObject parseOCRData(String taxno,String fileExtend,String base64File,String token){ - - String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/parseOCRData"; + String oaUrl = System.getProperty("oaurl"); + logger.info("解析图片接口:mc获取的oaUrl:\n{}", oaUrl); + String linkUrl = oaUrl+"/seeyon/rest/lexmisciv/kekai/parseOCRData"; + System.out.println("test"); +// String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/parseOCRData"; //接口请求体 JSONObject linkBody = new JSONObject(); linkBody.put("taxno", taxno); @@ -775,14 +781,17 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF return jsonObject; } } catch (Exception e) { - logger.info(String.format("获取OaToken接口异常:%s", e.getMessage())); + logger.info(String.format("获取parseOCRData接口异常:%s", e.getMessage())); throw new RuntimeException(e); } return null; } public JSONObject saveCheck(String taxno,String fileId,JSONArray ocrDatas,String token) { - String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/saveOutInvoice"; + String oaUrl = System.getProperty("oaurl"); + logger.info("保存验真接口:mc获取的oaUrl:\n{}", oaUrl); + String linkUrl = oaUrl+"/seeyon/rest/lexmisciv/kekai/saveOutInvoice"; +// String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/saveOutInvoice"; //接口请求体 JSONObject linkBody = new JSONObject(); linkBody.put("taxno", taxno); @@ -808,7 +817,10 @@ public class ReconPayreqFormPlugin extends AbstractFormPlugin implements BeforeF return null; } public JSONObject deleteInvoice(String pi_keys,String token) { - String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/delInvoice"; + String oaUrl = System.getProperty("oaurl"); + logger.info("删除接口:mc获取的oaUrl:\n{}", oaUrl); + String linkUrl = oaUrl+"/seeyon/rest/lexmisciv/kekai/delInvoice"; +// String linkUrl = "http://172.31.254.240:9090/seeyon/rest/lexmisciv/kekai/delInvoice"; //接口请求体 Map saveCheckHeader = new HashMap<>(); saveCheckHeader.put("Content-Type", "application/json");