yaoyu 1 年間 前
コミット
27a05010d5

+ 5 - 1
arap/arap/src/client/nc/ui/arap/bill/LinkHyperListener.java

@@ -1,5 +1,7 @@
 package nc.ui.arap.bill;
 
+import java.awt.Desktop;
+import java.net.URI;
 import java.net.URL;
 
 import nc.bs.framework.common.InvocationInfoProxy;
@@ -35,7 +37,9 @@ public class LinkHyperListener implements BillItemHyperlinkListener{
 						IThOcrService  ocrservice = (IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
 						val += "&token="+ocrservice.getToken(billmaker);
 					}
-					ClientToolKit.showDocument(new URL(val), "_blank");
+					//¸Ä³ÉʹÓÃĬÈÏä¯ÀÀÆ÷
+					//ClientToolKit.showDocument(new URL(val), "_blank");
+					Desktop.getDesktop().browse(new URI(val));
 				}
 			} catch (Exception e) {
 				ExceptionUtils.wrappBusinessException(e.getMessage());

+ 20 - 7
pu/pu/src/client/nc/pub/filesystem/newui/ThOCRAction.java

@@ -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());
 			}
 			//发票的url地址
-			String url = JSONObject.parseObject(idjson).getJSONObject("data").getString("url");
+			//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");//发票图片id 或者链接
+				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);

+ 5 - 1
pu/pu/src/client/nc/ui/pub/bill/LinkHyperListener.java

@@ -1,4 +1,6 @@
 package nc.ui.pub.bill;
+import java.awt.Desktop;
+import java.net.URI;
 import java.net.URL;
 
 import nc.bs.framework.common.InvocationInfoProxy;
@@ -24,7 +26,9 @@ public class LinkHyperListener implements BillItemHyperlinkListener{
 					IThOcrService  ocrservice = (IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
 					val += "&token="+ocrservice.getToken(billmaker);
 				}
-				ClientToolKit.showDocument(new URL(val), "_blank");
+				//¸Ä³ÉʹÓÃĬÈÏä¯ÀÀÆ÷
+				//ClientToolKit.showDocument(new URL(val), "_blank");
+				Desktop.getDesktop().browse(new URI(val));
 			}
 		} catch (Exception e) {
 			ExceptionUtils.wrappBusinessException(e.getMessage());

ファイルの差分が大きいため隠しています
+ 0 - 0
pu/pu/src/client/nc/ui/pubapp/uif2app/actions/MultiSelectDialog.java


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません