发票代码提交

This commit is contained in:
zengweihai 2024-11-05 16:37:20 +08:00
parent e5605a074c
commit d6556b8120
1 changed files with 22 additions and 10 deletions

View File

@ -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<String> fileExtendList = new ArrayList<String>(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<String, String> saveCheckHeader = new HashMap<>();
saveCheckHeader.put("Content-Type", "application/json");