Browse Source

ocr识别按钮优化功能

zthwr 1 year ago
parent
commit
9e9c06de7a

+ 42 - 2
pu/pu/src/client/nc/pub/filesystem/newui/ThFileContentPanel.java

@@ -1,6 +1,6 @@
 package nc.pub.filesystem.newui;
 import nc.vo.arap.utils.StringUtil;
-
+import nc.vo.bd.defdoc.DefdocVO;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -30,7 +30,7 @@ import java.util.EventObject;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
+import nc.itf.uap.IUAPQueryBS;
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.BorderFactory;
@@ -103,6 +103,9 @@ import nc.vo.pub.filesystem.ItemObj;
 import nc.vo.pub.filesystem.NCFileNode;
 import nc.vo.pub.filesystem.NCFileVO;
 import nc.vo.uap.rbac.FuncSubInfo;
+import nc.itf.bd.defdoc.IDefdocService;
+import nc.bs.framework.common.InvocationInfoProxy;
+import nc.jdbc.framework.processor.BeanListProcessor;
 
 public class ThFileContentPanel extends JPanel {
 	/**
@@ -1789,6 +1792,22 @@ public class ThFileContentPanel extends JPanel {
 					      } else {
 					    	  MessageDialog.showErrorDlg(ThFileContentPanel.this, "提示","删除操作失败。");
 					      }
+						 
+						 //由于删除太慢,改成自定义档案数据停用
+						 String[] filname=filepath.split("/");
+						 DefdocVO[] deletevos=QryDefdocvoInfo(filname[1]);
+						 IDefdocService idefservice = NCLocator.getInstance().lookup(IDefdocService.class);
+						 try {
+					//		idefservice.deleteDefdocs(InvocationInfoProxy.getInstance().getGroupId(),deletevos);
+							 DefdocVO defvo =deletevos[0];
+							 defvo.setAttributeValue("enablestate", 3);//停用
+							 idefservice.updateDefdocs(InvocationInfoProxy.getInstance().getGroupId(),deletevos);
+						} catch (BusinessException e1) {
+							// TODO 自动生成的 catch 块
+							e1.printStackTrace();
+							MessageDialog.showErrorDlg(ThFileContentPanel.this, "提示","删除OCR档案【"+filname[1]+"】:\n"+e1.getMessage());
+						}
+						 
 					}
 				}
 			});
@@ -1806,6 +1825,27 @@ public class ThFileContentPanel extends JPanel {
 		}
 
 	}
+	
+	
+	private DefdocVO[]  QryDefdocvoInfo(String name){
+    	String sql = "select * from  bd_defdoc where  nvl(dr, 0) = 0 and pk_defdoclist="
+    			+ "(select pk_defdoclist from bd_defdoclist where code='OCRTHNC' and nvl(dr,0)=0) and name='" + name + "' ";
+    	ArrayList<Object> arrayvos=null;
+    	try {
+    		IUAPQueryBS iuap= (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
+			arrayvos=(ArrayList<Object>) iuap.executeQuery(sql, new BeanListProcessor(DefdocVO.class));
+		} catch (BusinessException e) {
+			// TODO 自动生成的 catch 块
+			e.printStackTrace();
+		}
+    	
+    	if (arrayvos==null) {
+  			return new DefdocVO[0];
+  		}else {
+  			return arrayvos.toArray(new DefdocVO[0]);
+  		}
+    	
+    } 
 
 	private class BtnTableCellRender implements TableCellRenderer {
 		public BtnTableCellRender() {

+ 1 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThOCRAction.java

@@ -163,6 +163,7 @@ public class ThOCRAction extends AbstractNCAction{
 					defvo.setAttributeValue("name3", name3);
 					defvo.setAttributeValue("name4", name4);
 					defvo.setAttributeValue("name6", vdef17);
+					defvo.setAttributeValue("enablestate", 2);
 					try {
 						idefservice.updateDefdocs(pk_group,updatevos);
 					} catch (BusinessException e1) {