package nc.itf.th;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.httpclient.HttpException;

import com.alibaba.fastjson.JSONObject;

import nc.vo.bd.defdoc.DefdocVO;
import nc.vo.pu.m25.entity.InvoiceVO;
import nc.vo.pub.BusinessException;
import nc.vo.th.ocr.OCRInvoiceVO;
import net.sf.json.JSONString;

/**
 * OCR接口
 * @author Administrator
 *
 */

public interface IThOcrService {
	/**
	 * 
	 * 获取token
	 */
	public String getToken(String billmaker) throws Exception;
	
	/**
	 * 上传发票
	 */
	public String uploadInvoice(String token,String vdef17,String invoicename) throws Exception;
	
	/**
	 * OCR识别
	 */
	public String ocrIdentification(String token,String data) throws Exception;
	
	
	/**
	 * OCR识别数据保存数据库
	 */
	public void insertOCRdataInfo(ArrayList<OCRInvoiceVO> vos) throws BusinessException;
	

	
	/**
	 * 发票保存到文件夹里
	 */
	public String saveUploadFile(String vdef17,String fileName,byte[] bytes) throws Exception;
	
	
	/**
	 * 删除home里对应的发票
	 */
	public Boolean deleteFile(String filepath) ;
	
	
	
	/**
	 * 由于删除太慢，改成自定义档案数据停用
	 */
	public  DefdocVO[]  enablestateDate(String filepath,String[] filname)  throws BusinessException;
	
	
	
	/**
	 * 获取home路径
	 */
	public  String  getNCHomePath();
	
	
	/**
	 * 获取"+vdef17+"文件夹下所有发票名
	 */
	
	public  List<String>  getInvoiceInfo(String vdef17);
	
	/**
	 * 修改发票云发票状态
	 * @param status  发票状态
	 * @param vos  发票aggvo
	 */
	public void UpdateInvoiceStatus(String status,InvoiceVO[] vos) throws Exception;
	
	/**
	 * 发票验伪
	 */
	public void InvoiceCheck(String token,String fid) throws Exception;
	
	
	/**
	 * 从发票云获取发票
	 */
	public JSONObject SelectORCInvoice(String token) throws Exception;
	
	
	/**
	 * 将发票数据存储关联表
	 * @param object
	 * @throws Exception
	 */
	public void addORC(Map<String,String> map) throws Exception;
	
	
	public void deleteORC(String number,String vdef17,int type)throws Exception;
	
}
