ocr扫描定时任务
This commit is contained in:
parent
8e14c4bf94
commit
5158602c79
@ -556,5 +556,100 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="INVOICE_ORC_RESULT" label="发票ocr识别结果" describe="发票ocr识别结果" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="CONTRACT_ID" label="合同ID" type="STRING" length="32"/>
|
||||
<attribute name="PROJECT_NO" label="项目编号" type="STRING" length="32"/>
|
||||
<attribute name="ERROR_CODE" label="错误码" type="STRING" length="32"/>
|
||||
<attribute name="RESULT" label="结果全文" type="STRING" length="32"/>
|
||||
<attribute name="DATEISSUED" label="开票日期" type="STRING" length="32"/>
|
||||
<attribute name="INVOICE_CODE" label="发票代码" type="STRING" length="32"/>
|
||||
<attribute name="INVOICE_NO" label="发票号码" type="STRING" length="32"/>
|
||||
<attribute name="PRINT_CODE" label="机打代码" type="STRING" length="32"/>
|
||||
<attribute name="PRINT_NO" label="机打号码" type="STRING" length="32"/>
|
||||
<attribute name="MACHINE_CODE" label="机器编号" type="STRING" length="32"/>
|
||||
<attribute name="FISCAL_CODE" label="税控码" type="STRING" length="32"/>
|
||||
<attribute name="ID_ORG_CODE" label="购买方名称及身份证号码/组织机构代码" type="STRING" length="32"/>
|
||||
<attribute name="TAX_ID" label="纳税人识别号" type="STRING" length="32"/>
|
||||
<attribute name="CAR_TYPE" label="车辆类型" type="STRING" length="32"/>
|
||||
<attribute name="CAR_MODEL" label="厂商型号" type="STRING" length="32"/>
|
||||
<attribute name="MADE_IN" label="产地" type="STRING" length="32"/>
|
||||
<attribute name="CERTIFICATE_NO" label="合格证号" type="STRING" length="32"/>
|
||||
<attribute name="IMPORT_CERTIFICATE_NO" label="进口证明书号" type="STRING" length="32"/>
|
||||
<attribute name="COMMODITY_CHECK_NO" label="商检单号" type="STRING" length="32"/>
|
||||
<attribute name="ENGINE_NO" label="发动机号码" type="STRING" length="32"/>
|
||||
<attribute name="VIN" label="车辆识别代码/车架号" type="STRING" length="32"/>
|
||||
<attribute name="TOTAL_IN_WORDS" label="税价合计(大写)" type="STRING" length="32"/>
|
||||
<attribute name="TOTAL_IN_NUMBERS" label="税价合计(小写)" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_NAME" label="销售方名称" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_TEL" label="销货单位电话" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_TAX_ID" label="销货单位纳税人识别号" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_ACCOUNT" label="销货单位账号" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_ADDR" label="销货单位地址" type="STRING" length="32"/>
|
||||
<attribute name="SELLER_ACCOUNT_NO" label="销货单位开户银行" type="STRING" length="32"/>
|
||||
<attribute name="VAT_RATE" label="增值税税率或征收税率" type="STRING" length="32"/>
|
||||
<attribute name="VAT_AMOUNT" label="增值税税额" type="STRING" length="32"/>
|
||||
<attribute name="TAX_OFFICE_CODE" label="主管税务机关及代码" type="STRING" length="32"/>
|
||||
<attribute name="EXCLUDING_TAX_AMOUNT" label="不含税价小写" type="STRING" length="32"/>
|
||||
<attribute name="TAX_PAYMENT_NO" label="完税凭证号码" type="STRING" length="32"/>
|
||||
<attribute name="TONNAGE" label="吨位" type="STRING" length="32"/>
|
||||
<attribute name="PERSON_LIMITED" label="限乘人数" type="STRING" length="32"/>
|
||||
<attribute name="OFFICIAL_SEAL" label="公章" type="STRING" length="32"/>
|
||||
<attribute name="INPUTTIME" label="创建时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="invoice_orc_result"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="ID_CARD_OCR_RESULT" label="身份证ocr识别结果" describe="身份证ocr识别结果" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="CONTRACT_ID" label="合同ID" type="STRING" length="32"/>
|
||||
<attribute name="PROJECT_NO" label="项目编号" type="STRING" length="32"/>
|
||||
<attribute name="ERROR_CODE" label="错误码" type="STRING" length="32"/>
|
||||
<attribute name="RESULT" label="结果全文" type="STRING" length="32"/>
|
||||
<attribute name="FULL_NAME" label="姓名" type="STRING" length="32"/>
|
||||
<attribute name="GENDER" label="性别" type="STRING" length="32"/>
|
||||
<attribute name="ETHNICITY" label="民族" type="STRING" length="32"/>
|
||||
<attribute name="BRITH" label="出生年月" type="STRING" length="32"/>
|
||||
<attribute name="ADDR" label="住址" type="STRING" length="32"/>
|
||||
<attribute name="ID_NO" label="公民身份号码" type="STRING" length="32"/>
|
||||
<attribute name="HEAD" label="头像" type="STRING" length="32"/>
|
||||
<attribute name="VERIFY" label="验证" type="STRING" length="32"/>
|
||||
<attribute name="HEAD_COPY" label="人像面复印件" type="STRING" length="32"/>
|
||||
<attribute name="ISSUED_OFFICE" label="签发机关" type="STRING" length="32"/>
|
||||
<attribute name="TERM_VALIDITY" label="有限期限" type="STRING" length="32"/>
|
||||
<attribute name="TYPE" label="类型" type="STRING" length="32"/>
|
||||
<attribute name="INPUTTIME" label="创建时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="id_card_ocr_result"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="BANK_CARD_ORC_RESULT" label="银行卡ocr识别结果" describe="银行卡ocr识别结果" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
|
||||
<attribute name="CONTRACT_ID" label="合同ID" type="STRING" length="32"/>
|
||||
<attribute name="PROJECT_NO" label="项目编号" type="STRING" length="32"/>
|
||||
<attribute name="ERROR_CODE" label="错误码" type="STRING" length="32"/>
|
||||
<attribute name="RESULT" label="结果全文" type="STRING" length="32"/>
|
||||
<attribute name="BANK_CARD_NO" label="银行卡号" type="STRING" length="32"/>
|
||||
<attribute name="PASS_CHECK" label="银行卡号校验" type="STRING" length="32"/>
|
||||
<attribute name="INPUTTIME" label="创建时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="bank_card_orc_result"/>
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
48
src_jbo/jbo/oti/BANK_CARD_ORC_RESULT.java
Normal file
48
src_jbo/jbo/oti/BANK_CARD_ORC_RESULT.java
Normal file
@ -0,0 +1,48 @@
|
||||
package jbo.oti;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* 银行卡ocr识别结果 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface BANK_CARD_ORC_RESULT{
|
||||
/**
|
||||
* 银行卡ocr识别结果<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.BANK_CARD_ORC_RESULT";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 合同ID STRING(32)<br>
|
||||
*/
|
||||
public static final String CONTRACT_ID = "CONTRACT_ID";
|
||||
/**
|
||||
* 项目编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String PROJECT_NO = "PROJECT_NO";
|
||||
/**
|
||||
* 错误码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ERROR_CODE = "ERROR_CODE";
|
||||
/**
|
||||
* 结果全文 STRING(32)<br>
|
||||
*/
|
||||
public static final String RESULT = "RESULT";
|
||||
/**
|
||||
* 银行卡号 STRING(32)<br>
|
||||
*/
|
||||
public static final String BANK_CARD_NO = "BANK_CARD_NO";
|
||||
/**
|
||||
* 银行卡号校验 STRING(32)<br>
|
||||
*/
|
||||
public static final String PASS_CHECK = "PASS_CHECK";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String INPUTTIME = "INPUTTIME";
|
||||
}
|
||||
88
src_jbo/jbo/oti/ID_CARD_OCR_RESULT.java
Normal file
88
src_jbo/jbo/oti/ID_CARD_OCR_RESULT.java
Normal file
@ -0,0 +1,88 @@
|
||||
package jbo.oti;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* 身份证ocr识别结果 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface ID_CARD_OCR_RESULT{
|
||||
/**
|
||||
* 身份证ocr识别结果<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.ID_CARD_OCR_RESULT";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 合同ID STRING(32)<br>
|
||||
*/
|
||||
public static final String CONTRACT_ID = "CONTRACT_ID";
|
||||
/**
|
||||
* 项目编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String PROJECT_NO = "PROJECT_NO";
|
||||
/**
|
||||
* 错误码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ERROR_CODE = "ERROR_CODE";
|
||||
/**
|
||||
* 结果全文 STRING(32)<br>
|
||||
*/
|
||||
public static final String RESULT = "RESULT";
|
||||
/**
|
||||
* 姓名 STRING(32)<br>
|
||||
*/
|
||||
public static final String FULL_NAME = "FULL_NAME";
|
||||
/**
|
||||
* 性别 STRING(32)<br>
|
||||
*/
|
||||
public static final String GENDER = "GENDER";
|
||||
/**
|
||||
* 民族 STRING(32)<br>
|
||||
*/
|
||||
public static final String ETHNICITY = "ETHNICITY";
|
||||
/**
|
||||
* 出生年月 STRING(32)<br>
|
||||
*/
|
||||
public static final String BRITH = "BRITH";
|
||||
/**
|
||||
* 住址 STRING(32)<br>
|
||||
*/
|
||||
public static final String ADDR = "ADDR";
|
||||
/**
|
||||
* 公民身份号码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID_NO = "ID_NO";
|
||||
/**
|
||||
* 头像 STRING(32)<br>
|
||||
*/
|
||||
public static final String HEAD = "HEAD";
|
||||
/**
|
||||
* 验证 STRING(32)<br>
|
||||
*/
|
||||
public static final String VERIFY = "VERIFY";
|
||||
/**
|
||||
* 人像面复印件 STRING(32)<br>
|
||||
*/
|
||||
public static final String HEAD_COPY = "HEAD_COPY";
|
||||
/**
|
||||
* 签发机关 STRING(32)<br>
|
||||
*/
|
||||
public static final String ISSUED_OFFICE = "ISSUED_OFFICE";
|
||||
/**
|
||||
* 有限期限 STRING(32)<br>
|
||||
*/
|
||||
public static final String TERM_VALIDITY = "TERM_VALIDITY";
|
||||
/**
|
||||
* 类型 STRING(32)<br>
|
||||
*/
|
||||
public static final String TYPE = "TYPE";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String INPUTTIME = "INPUTTIME";
|
||||
}
|
||||
172
src_jbo/jbo/oti/INVOICE_ORC_RESULT.java
Normal file
172
src_jbo/jbo/oti/INVOICE_ORC_RESULT.java
Normal file
@ -0,0 +1,172 @@
|
||||
package jbo.oti;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* 发票ocr识别结果 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface INVOICE_ORC_RESULT{
|
||||
/**
|
||||
* 发票ocr识别结果<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.oti.INVOICE_ORC_RESULT";
|
||||
/**
|
||||
* 唯一标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 合同ID STRING(32)<br>
|
||||
*/
|
||||
public static final String CONTRACT_ID = "CONTRACT_ID";
|
||||
/**
|
||||
* 项目编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String PROJECT_NO = "PROJECT_NO";
|
||||
/**
|
||||
* 错误码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ERROR_CODE = "ERROR_CODE";
|
||||
/**
|
||||
* 结果全文 STRING(32)<br>
|
||||
*/
|
||||
public static final String RESULT = "RESULT";
|
||||
/**
|
||||
* 开票日期 STRING(32)<br>
|
||||
*/
|
||||
public static final String DATEISSUED = "DATEISSUED";
|
||||
/**
|
||||
* 发票代码 STRING(32)<br>
|
||||
*/
|
||||
public static final String INVOICE_CODE = "INVOICE_CODE";
|
||||
/**
|
||||
* 发票号码 STRING(32)<br>
|
||||
*/
|
||||
public static final String INVOICE_NO = "INVOICE_NO";
|
||||
/**
|
||||
* 机打代码 STRING(32)<br>
|
||||
*/
|
||||
public static final String PRINT_CODE = "PRINT_CODE";
|
||||
/**
|
||||
* 机打号码 STRING(32)<br>
|
||||
*/
|
||||
public static final String PRINT_NO = "PRINT_NO";
|
||||
/**
|
||||
* 机器编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String MACHINE_CODE = "MACHINE_CODE";
|
||||
/**
|
||||
* 税控码 STRING(32)<br>
|
||||
*/
|
||||
public static final String FISCAL_CODE = "FISCAL_CODE";
|
||||
/**
|
||||
* 购买方名称及身份证号码/组织机构代码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID_ORG_CODE = "ID_ORG_CODE";
|
||||
/**
|
||||
* 纳税人识别号 STRING(32)<br>
|
||||
*/
|
||||
public static final String TAX_ID = "TAX_ID";
|
||||
/**
|
||||
* 车辆类型 STRING(32)<br>
|
||||
*/
|
||||
public static final String CAR_TYPE = "CAR_TYPE";
|
||||
/**
|
||||
* 厂商型号 STRING(32)<br>
|
||||
*/
|
||||
public static final String CAR_MODEL = "CAR_MODEL";
|
||||
/**
|
||||
* 产地 STRING(32)<br>
|
||||
*/
|
||||
public static final String MADE_IN = "MADE_IN";
|
||||
/**
|
||||
* 合格证号 STRING(32)<br>
|
||||
*/
|
||||
public static final String CERTIFICATE_NO = "CERTIFICATE_NO";
|
||||
/**
|
||||
* 进口证明书号 STRING(32)<br>
|
||||
*/
|
||||
public static final String IMPORT_CERTIFICATE_NO = "IMPORT_CERTIFICATE_NO";
|
||||
/**
|
||||
* 商检单号 STRING(32)<br>
|
||||
*/
|
||||
public static final String COMMODITY_CHECK_NO = "COMMODITY_CHECK_NO";
|
||||
/**
|
||||
* 发动机号码 STRING(32)<br>
|
||||
*/
|
||||
public static final String ENGINE_NO = "ENGINE_NO";
|
||||
/**
|
||||
* 车辆识别代码/车架号 STRING(32)<br>
|
||||
*/
|
||||
public static final String VIN = "VIN";
|
||||
/**
|
||||
* 税价合计(大写) STRING(32)<br>
|
||||
*/
|
||||
public static final String TOTAL_IN_WORDS = "TOTAL_IN_WORDS";
|
||||
/**
|
||||
* 税价合计(小写) STRING(32)<br>
|
||||
*/
|
||||
public static final String TOTAL_IN_NUMBERS = "TOTAL_IN_NUMBERS";
|
||||
/**
|
||||
* 销售方名称 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_NAME = "SELLER_NAME";
|
||||
/**
|
||||
* 销货单位电话 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_TEL = "SELLER_TEL";
|
||||
/**
|
||||
* 销货单位纳税人识别号 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_TAX_ID = "SELLER_TAX_ID";
|
||||
/**
|
||||
* 销货单位账号 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_ACCOUNT = "SELLER_ACCOUNT";
|
||||
/**
|
||||
* 销货单位地址 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_ADDR = "SELLER_ADDR";
|
||||
/**
|
||||
* 销货单位开户银行 STRING(32)<br>
|
||||
*/
|
||||
public static final String SELLER_ACCOUNT_NO = "SELLER_ACCOUNT_NO";
|
||||
/**
|
||||
* 增值税税率或征收税率 STRING(32)<br>
|
||||
*/
|
||||
public static final String VAT_RATE = "VAT_RATE";
|
||||
/**
|
||||
* 增值税税额 STRING(32)<br>
|
||||
*/
|
||||
public static final String VAT_AMOUNT = "VAT_AMOUNT";
|
||||
/**
|
||||
* 主管税务机关及代码 STRING(32)<br>
|
||||
*/
|
||||
public static final String TAX_OFFICE_CODE = "TAX_OFFICE_CODE";
|
||||
/**
|
||||
* 不含税价小写 STRING(32)<br>
|
||||
*/
|
||||
public static final String EXCLUDING_TAX_AMOUNT = "EXCLUDING_TAX_AMOUNT";
|
||||
/**
|
||||
* 完税凭证号码 STRING(32)<br>
|
||||
*/
|
||||
public static final String TAX_PAYMENT_NO = "TAX_PAYMENT_NO";
|
||||
/**
|
||||
* 吨位 STRING(32)<br>
|
||||
*/
|
||||
public static final String TONNAGE = "TONNAGE";
|
||||
/**
|
||||
* 限乘人数 STRING(32)<br>
|
||||
*/
|
||||
public static final String PERSON_LIMITED = "PERSON_LIMITED";
|
||||
/**
|
||||
* 公章 STRING(32)<br>
|
||||
*/
|
||||
public static final String OFFICIAL_SEAL = "OFFICIAL_SEAL";
|
||||
/**
|
||||
* 创建时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String INPUTTIME = "INPUTTIME";
|
||||
}
|
||||
168
src_tenwa/com/tenwa/lease/app/quartzmession/AutoOcr.java
Normal file
168
src_tenwa/com/tenwa/lease/app/quartzmession/AutoOcr.java
Normal file
@ -0,0 +1,168 @@
|
||||
package com.tenwa.lease.app.quartzmession;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amarsoft.are.jbo.*;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.ample.icms.scan.ImageOcr;
|
||||
import com.ample.icms.service.ImageOcrService;
|
||||
import com.ample.icms.util.GetInfoUtil;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
import jbo.oti.BANK_CARD_ORC_RESULT;
|
||||
import jbo.oti.ID_CARD_OCR_RESULT;
|
||||
import jbo.oti.INVOICE_ORC_RESULT;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutoOcr implements Job {
|
||||
|
||||
private JobInitUserName jboName;
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized void execute(JobExecutionContext arg0) throws JobExecutionException {
|
||||
JBOTransaction tx =null;
|
||||
|
||||
try {
|
||||
tx = JBOFactory.createJBOTransaction();
|
||||
ImageOcrService is = new ImageOcrService();
|
||||
GetInfoUtil giu = new GetInfoUtil();
|
||||
List<BizObject> lciBos = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx).createQuery("select id from O where BUSINESSTYPE=1 and CONTRACT_STATUS>=31 and project_date>'2022/01/01 00:00:00'").getResultList(false);
|
||||
for(int i=0;i<30;i++){
|
||||
BizObject bo = lciBos.get(i);
|
||||
String contractId = bo.getAttribute("ID").toString();
|
||||
String projectNo = giu.getProjectNoByContractId(contractId,tx);
|
||||
is.setContractId(contractId);
|
||||
is.setFlowNo("FundPaymentCarFlow");
|
||||
String incoveResult = is.invoiceOrc("APZLJJ000060", ImageOcr.ocrType.vehicle_invoice_ocr,tx);
|
||||
System.out.println("定时任务机动车发票返回结果:"+incoveResult);
|
||||
invoiceOrcResultSave(contractId,projectNo,incoveResult,tx);
|
||||
is.setFlowNo("BusinessApplyFlow");
|
||||
String idResult = is.invoiceOrc("APZLJJ000130", ImageOcr.ocrType.id_card,tx);
|
||||
System.out.println("定时任务身份证返回结果:"+idResult);
|
||||
idOrcResultSave(contractId,projectNo,idResult,tx);
|
||||
String bankResult = is.invoiceOrc("APZLJJ000260", ImageOcr.ocrType.bank_card_ocr,tx);
|
||||
System.out.println("定时任务银行卡返回结果:"+bankResult);
|
||||
banCardOrcResultSave(contractId,projectNo,bankResult,tx);
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
if (tx != null) {
|
||||
try {
|
||||
tx.rollback();
|
||||
tx=null;
|
||||
} catch (JBOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}finally{
|
||||
try {
|
||||
if(tx !=null){
|
||||
|
||||
tx.commit();
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
public void invoiceOrcResultSave(String contractId, String projectNo, String result,JBOTransaction tx) throws JBOException {
|
||||
BizObjectManager IORbom = JBOFactory.getBizObjectManager(INVOICE_ORC_RESULT.CLASS_NAME,tx);
|
||||
BizObject IORbo = IORbom.newObject();
|
||||
JSONObject resultJson= JSON.parseObject(result);
|
||||
String errorCode = resultJson.get("error_code").toString();
|
||||
JSONObject resultInfo = resultJson.getJSONObject("result");
|
||||
|
||||
IORbo.setAttributeValue("CONTRACT_ID",contractId);
|
||||
IORbo.setAttributeValue("PROJECT_NO",projectNo);
|
||||
IORbo.setAttributeValue("ERROR_CODE",errorCode);
|
||||
IORbo.setAttributeValue("RESULT",resultInfo.toString());
|
||||
IORbo.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());
|
||||
|
||||
if("0".equals(errorCode)){
|
||||
IORbo.setAttributeValue("DATEISSUED",resultInfo.getString("开票日期"));
|
||||
IORbo.setAttributeValue("INVOICE_CODE",resultInfo.getString("发票代码"));
|
||||
IORbo.setAttributeValue("INVOICE_NO",resultInfo.getString("发票号码"));
|
||||
IORbo.setAttributeValue("PRINT_CODE",resultInfo.getString("机打代码"));
|
||||
IORbo.setAttributeValue("PRINT_NO",resultInfo.getString("机打号码"));
|
||||
IORbo.setAttributeValue("MACHINE_CODE",resultInfo.getString("机器编号"));
|
||||
IORbo.setAttributeValue("FISCAL_CODE",resultInfo.getString("税控码"));
|
||||
IORbo.setAttributeValue("ID_ORG_CODE",resultInfo.getString("购买方名称及身份证号码/组织机构代码"));
|
||||
IORbo.setAttributeValue("TAX_ID",resultInfo.getString("纳税人识别号"));
|
||||
IORbo.setAttributeValue("CAR_TYPE",resultInfo.getString("车辆类型"));
|
||||
IORbo.setAttributeValue("CAR_MODEL",resultInfo.getString("厂牌型号"));
|
||||
IORbo.setAttributeValue("MADE_IN",resultInfo.getString("产地"));
|
||||
IORbo.setAttributeValue("CERTIFICATE_NO",resultInfo.getString("合格证号"));
|
||||
IORbo.setAttributeValue("IMPORT_CERTIFICATE_NO",resultInfo.getString("进口证明书号"));
|
||||
IORbo.setAttributeValue("COMMODITY_CHECK_NO",resultInfo.getString("商检单号"));
|
||||
IORbo.setAttributeValue("ENGINE_NO",resultInfo.getString("发动机号码"));
|
||||
IORbo.setAttributeValue("VIN",resultInfo.getString("车辆识别代号/车架号码"));
|
||||
IORbo.setAttributeValue("TOTAL_IN_WORDS",resultInfo.getString("价税合计大写"));
|
||||
IORbo.setAttributeValue("TOTAL_IN_NUMBERS",resultInfo.getString("价税合计小写"));
|
||||
IORbo.setAttributeValue("SELLER_NAME",resultInfo.getString("销货单位名称"));
|
||||
IORbo.setAttributeValue("SELLER_TEL",resultInfo.getString("销货单位电话"));
|
||||
IORbo.setAttributeValue("SELLER_TAX_ID",resultInfo.getString("销货单位纳税人识别号"));
|
||||
IORbo.setAttributeValue("SELLER_ACCOUNT",resultInfo.getString("销货单位账号"));
|
||||
IORbo.setAttributeValue("SELLER_ADDR",resultInfo.getString("销货单位地址"));
|
||||
IORbo.setAttributeValue("SELLER_ACCOUNT_NO",resultInfo.getString("销货单位开户银行"));
|
||||
IORbo.setAttributeValue("VAT_RATE",resultInfo.getString("增值税税率或征收税率"));
|
||||
IORbo.setAttributeValue("VAT_AMOUNT",resultInfo.getString("增值税税额"));
|
||||
IORbo.setAttributeValue("TAX_OFFICE_CODE",resultInfo.getString("主管税务机关及代码"));
|
||||
IORbo.setAttributeValue("EXCLUDING_TAX_AMOUNT",resultInfo.getString("不含税价小写"));
|
||||
IORbo.setAttributeValue("TAX_PAYMENT_NO",resultInfo.getString("完税凭证号码"));
|
||||
IORbo.setAttributeValue("TONNAGE",resultInfo.getString("吨位"));
|
||||
IORbo.setAttributeValue("PERSON_LIMITED",resultInfo.getString("限乘人数"));
|
||||
IORbo.setAttributeValue("OFFICIAL_SEAL",resultInfo.getString("公章"));
|
||||
}
|
||||
IORbom.saveObject(IORbo);
|
||||
}
|
||||
public void banCardOrcResultSave(String contractId, String projectNo, String result,JBOTransaction tx) throws JBOException {
|
||||
BizObjectManager BCRbom = JBOFactory.getBizObjectManager(BANK_CARD_ORC_RESULT.CLASS_NAME,tx);
|
||||
BizObject bo = BCRbom.newObject();
|
||||
JSONObject resultJson = JSON.parseObject(result);
|
||||
String errorCode = resultJson.get("error_code").toString();
|
||||
JSONObject resultInfo = resultJson.getJSONObject("result");
|
||||
|
||||
bo.setAttributeValue("CONTRACT_ID", contractId);
|
||||
bo.setAttributeValue("PROJECT_NO", projectNo);
|
||||
bo.setAttributeValue("ERROR_CODE", errorCode);
|
||||
bo.setAttributeValue("RESULT", resultInfo.toString());
|
||||
bo.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());
|
||||
if("0".equals(errorCode)){
|
||||
bo.setAttributeValue("BANK_CARD_NO", resultInfo.getString("bankCardNum"));
|
||||
bo.setAttributeValue("PASS_CHECK", resultInfo.getString("passCheck"));
|
||||
}
|
||||
BCRbom.saveObject(bo);
|
||||
}
|
||||
public void idOrcResultSave(String contractId, String projectNo, String result,JBOTransaction tx) throws JBOException {
|
||||
BizObjectManager ICRbom = JBOFactory.getBizObjectManager(ID_CARD_OCR_RESULT.CLASS_NAME,tx);
|
||||
BizObject bo = ICRbom.newObject();
|
||||
JSONObject resultJson = JSON.parseObject(result);
|
||||
String errorCode = resultJson.get("error_code").toString();
|
||||
JSONObject resultInfo = resultJson.getJSONObject("result");
|
||||
|
||||
bo.setAttributeValue("CONTRACT_ID", contractId);
|
||||
bo.setAttributeValue("PROJECT_NO", projectNo);
|
||||
bo.setAttributeValue("ERROR_CODE", errorCode);
|
||||
bo.setAttributeValue("RESULT", resultInfo.toString());
|
||||
bo.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());
|
||||
if("0".equals(errorCode)){
|
||||
bo.setAttributeValue("FULL_NAME", resultInfo.getString("姓名"));
|
||||
bo.setAttributeValue("GENDER", resultInfo.getString("性别"));
|
||||
bo.setAttributeValue("ETHNICITY", resultInfo.getString("民族"));
|
||||
bo.setAttributeValue("BRITH", resultInfo.getString("出生年月"));
|
||||
bo.setAttributeValue("ADDR", resultInfo.getString("住址"));
|
||||
bo.setAttributeValue("ID_NO", resultInfo.getString("公民身份号码"));
|
||||
bo.setAttributeValue("HEAD", resultInfo.getString("头像"));
|
||||
bo.setAttributeValue("VERIFY", resultInfo.getString("验证"));
|
||||
bo.setAttributeValue("HEAD_COPY", resultInfo.getString("人像面复印件"));
|
||||
bo.setAttributeValue("ISSUED_OFFICE", resultInfo.getString("签发机关"));
|
||||
bo.setAttributeValue("TERM_VALIDITY", resultInfo.getString("有效期限"));
|
||||
bo.setAttributeValue("TYPE", resultInfo.getString("类型"));
|
||||
}
|
||||
ICRbom.saveObject(bo);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user