|
@@ -42,7 +42,8 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
* OCR识别
|
|
|
*/
|
|
|
private static final long serialVersionUID = -5178574564280732585L;
|
|
|
-
|
|
|
+
|
|
|
+ private String noauth = "https://api.mypiaojia.com/api/invoiceApi/file/download?id=";
|
|
|
|
|
|
private IUAPQueryBS iuap= (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
|
private ThFileContentPanel parentpanel ;
|
|
@@ -125,7 +126,7 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
,"ocr返回数据校验:\n"+e.getMessage());
|
|
|
}
|
|
|
|
|
|
- String url = JSONObject.parseObject(idjson).getJSONObject("data").getString("url");
|
|
|
+
|
|
|
JSONObject data = json.getJSONObject("data");
|
|
|
JSONArray infos = data.getJSONArray("infos");
|
|
|
for(int j = 0;j < infos.size();j++){
|
|
@@ -158,6 +159,7 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
newvo.setFiledesc(message);
|
|
|
|
|
@@ -207,6 +209,11 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
String ext = info.getString("ext");
|
|
|
JSONObject extobj = JSONObject.parseObject(ext);
|
|
|
String trate = extobj.getString("trate");
|
|
|
+
|
|
|
+ if(trate == null || "".equals(trate)) {
|
|
|
+ JSONArray products = extobj.getJSONArray("products");
|
|
|
+ trate = products.getJSONObject(0).getString("trate");
|
|
|
+ }
|
|
|
JSONObject comm_info = info.getJSONObject("comm_info");
|
|
|
JSONObject pro = comm_info.getJSONObject("pro");
|
|
|
String date = pro.getString("date");
|
|
@@ -234,7 +241,13 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
JSONObject payer = comm_info.getJSONObject("payer");
|
|
|
String name3 = payer.getString("tcode");
|
|
|
String name4 = payer.getString("company");
|
|
|
-
|
|
|
+ JSONObject modify_info = info.getJSONObject("modify_info");
|
|
|
+ String furl = modify_info.getString("furl");
|
|
|
+ if (furl == null) {
|
|
|
+ String pdf = modify_info.getString("pdf");
|
|
|
+ String pi = pro.getString("pi");
|
|
|
+ furl = pdf != null ? pdf : pi;
|
|
|
+ }
|
|
|
IDefdocService idefservice = NCLocator.getInstance().lookup(IDefdocService.class);
|
|
|
DefdocVO[] vos = new DefdocVO[1];
|
|
|
DefdocVO defvo = new DefdocVO();
|
|
@@ -268,10 +281,10 @@ public class ThOCRAction extends AbstractNCAction{
|
|
|
idefservice.insertDefdocs(pk_group, vos);
|
|
|
|
|
|
Map<String,String> map = new HashMap<String,String>();
|
|
|
- map.put("KYHSJE", "~");
|
|
|
- map.put("KYWSJE", "~");
|
|
|
- map.put("JYSE", "~");
|
|
|
- map.put("FPXZ", url);
|
|
|
+ map.put("KYHSJE", total);
|
|
|
+ map.put("KYWSJE", amount);
|
|
|
+ map.put("JYSE", ttax);
|
|
|
+ map.put("FPXZ", noauth+furl);
|
|
|
map.put("VDEF17",vdef17);
|
|
|
map.put("NUMBERID",code);
|
|
|
ocrservice.addORC(map);
|