Commit 4f0b5efb authored by R10's avatar R10

单据识别初版提交

parent 6935d327
......@@ -11,12 +11,15 @@ public interface ContractConstants {
final static String extract = "extract"; //提取
final static String textreview = "textreview"; //审查
final static String textdiff = "textdiff"; //对比
final static String docFlow = "docFlow"; //单据
}
public interface ContractType{
final static String contractExtract = "ContractExtract"; //审查
final static String contractReview = "ContractReview"; //对比
final static String contractTextdiff = "ContractTextdiff"; //对比
final static String docFlow = "DocFlow"; //单据
}
......
package cn.com.poc.covenant.convert;
import cn.com.poc.covenant.model.BizExtractionDocFlowModel;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.poc.covenant.dto.BizExtractionDocFlowDto;
public class BizExtractionDocFlowConvert {
public static BizExtractionDocFlowEntity modelToEntity(BizExtractionDocFlowModel model){
BizExtractionDocFlowEntity entity = new BizExtractionDocFlowEntity();
entity.setBizExtractionDocFlowId(model.getBizExtractionDocFlowId());
entity.setBizTextInTaskId(model.getBizTextInTaskId());
entity.setBizDocFlowStamps(model.getBizDocFlowStamps());
entity.setBizDocFlowTables(model.getBizDocFlowTables());
entity.setBizDocFlowFields(model.getBizDocFlowFields());
entity.setBizDocFlowHandwritings(model.getBizDocFlowHandwritings());
entity.setBizDocFlowItems(model.getBizDocFlowItems());
entity.setIsDeleted(model.getIsDeleted());
entity.setCreator(model.getCreator());
entity.setCreatedTime(model.getCreatedTime());
entity.setModifier(model.getModifier());
entity.setModifiedTime(model.getModifiedTime());
entity.setSysVersion(model.getSysVersion());
return entity;
}
public static BizExtractionDocFlowModel entityToModel(BizExtractionDocFlowEntity entity){
BizExtractionDocFlowModel model = new BizExtractionDocFlowModel();
model.setBizExtractionDocFlowId(entity.getBizExtractionDocFlowId());
model.setBizTextInTaskId(entity.getBizTextInTaskId());
model.setBizDocFlowStamps(entity.getBizDocFlowStamps());
model.setBizDocFlowTables(entity.getBizDocFlowTables());
model.setBizDocFlowFields(entity.getBizDocFlowFields());
model.setBizDocFlowHandwritings(entity.getBizDocFlowHandwritings());
model.setBizDocFlowItems(entity.getBizDocFlowItems());
model.setIsDeleted(entity.getIsDeleted());
model.setCreator(entity.getCreator());
model.setCreatedTime(entity.getCreatedTime());
model.setModifier(entity.getModifier());
model.setModifiedTime(entity.getModifiedTime());
model.setSysVersion(entity.getSysVersion());
return model;
}
public static BizExtractionDocFlowDto entityToDto(BizExtractionDocFlowEntity entity){
BizExtractionDocFlowDto dto = new BizExtractionDocFlowDto();
dto.setBizExtractionDocFlowId(entity.getBizExtractionDocFlowId());
dto.setBizTextInTaskId(entity.getBizTextInTaskId());
dto.setBizDocFlowStamps(entity.getBizDocFlowStamps());
dto.setBizDocFlowTables(entity.getBizDocFlowTables());
dto.setBizDocFlowFields(entity.getBizDocFlowFields());
dto.setBizDocFlowHandwritings(entity.getBizDocFlowHandwritings());
dto.setBizDocFlowItems(entity.getBizDocFlowItems());
dto.setIsDeleted(entity.getIsDeleted());
dto.setCreator(entity.getCreator());
dto.setCreatedTime(entity.getCreatedTime());
dto.setModifier(entity.getModifier());
dto.setModifiedTime(entity.getModifiedTime());
dto.setSysVersion(entity.getSysVersion());
return dto;
}
public static BizExtractionDocFlowEntity dtoToEntity(BizExtractionDocFlowDto dto){
BizExtractionDocFlowEntity entity = new BizExtractionDocFlowEntity();
entity.setBizExtractionDocFlowId(dto.getBizExtractionDocFlowId());
entity.setBizTextInTaskId(dto.getBizTextInTaskId());
entity.setBizDocFlowStamps(dto.getBizDocFlowStamps());
entity.setBizDocFlowTables(dto.getBizDocFlowTables());
entity.setBizDocFlowFields(dto.getBizDocFlowFields());
entity.setBizDocFlowHandwritings(dto.getBizDocFlowHandwritings());
entity.setBizDocFlowItems(dto.getBizDocFlowItems());
entity.setIsDeleted(dto.getIsDeleted());
entity.setCreator(dto.getCreator());
entity.setCreatedTime(dto.getCreatedTime());
entity.setModifier(dto.getModifier());
entity.setModifiedTime(dto.getModifiedTime());
entity.setSysVersion(dto.getSysVersion());
return entity;
}
}
\ No newline at end of file
package cn.com.poc.covenant.dto;
public class BizExtractionDocFlowDto {
private static final long serialVersionUID = 1L;
/** biz_extraction_doc_flow_id
*
*/
private java.lang.Integer bizExtractionDocFlowId;
public java.lang.Integer getBizExtractionDocFlowId(){
return this.bizExtractionDocFlowId;
}
public void setBizExtractionDocFlowId(java.lang.Integer bizExtractionDocFlowId){
this.bizExtractionDocFlowId = bizExtractionDocFlowId;
}
/** biz_text_in_task_id
*
*/
private java.lang.String bizTextInTaskId;
public java.lang.String getBizTextInTaskId(){
return this.bizTextInTaskId;
}
public void setBizTextInTaskId(java.lang.String bizTextInTaskId){
this.bizTextInTaskId = bizTextInTaskId;
}
/** biz_doc_flow_stamps
*印章
*/
private java.lang.String bizDocFlowStamps;
public java.lang.String getBizDocFlowStamps(){
return this.bizDocFlowStamps;
}
public void setBizDocFlowStamps(java.lang.String bizDocFlowStamps){
this.bizDocFlowStamps = bizDocFlowStamps;
}
/** biz_doc_flow_tables
*全部表格数据列表
*/
private java.lang.String bizDocFlowTables;
public java.lang.String getBizDocFlowTables(){
return this.bizDocFlowTables;
}
public void setBizDocFlowTables(java.lang.String bizDocFlowTables){
this.bizDocFlowTables = bizDocFlowTables;
}
/** biz_doc_flow_fields
*字段列表
*/
private java.lang.String bizDocFlowFields;
public java.lang.String getBizDocFlowFields(){
return this.bizDocFlowFields;
}
public void setBizDocFlowFields(java.lang.String bizDocFlowFields){
this.bizDocFlowFields = bizDocFlowFields;
}
/** biz_doc_flow_handwritings
*手写
*/
private java.lang.String bizDocFlowHandwritings;
public java.lang.String getBizDocFlowHandwritings(){
return this.bizDocFlowHandwritings;
}
public void setBizDocFlowHandwritings(java.lang.String bizDocFlowHandwritings){
this.bizDocFlowHandwritings = bizDocFlowHandwritings;
}
/** biz_doc_flow_items
*表格数据列表
*/
private java.lang.String bizDocFlowItems;
public java.lang.String getBizDocFlowItems(){
return this.bizDocFlowItems;
}
public void setBizDocFlowItems(java.lang.String bizDocFlowItems){
this.bizDocFlowItems = bizDocFlowItems;
}
/** is_deleted
*是否删除 1、Y 是 2、N 否
*/
private java.lang.String isDeleted;
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
}
}
\ No newline at end of file
package cn.com.poc.covenant.dto;
import org.springframework.web.multipart.MultipartFile;
/**
* @Author:Roger Wu
* @name:StartDocFlowDto
* @Date:2025-08-28 17:10
*/
public class StartDocFlowDto {
/**
* 文件
*/
private MultipartFile file;
/**
* 文件地址
*/
private String fileUrl;
/**
* 文件地址
*/
private String category;
/**
* 文件地址
*/
private String workspaceid;
/**
* 合同类型
*/
private String contractType;
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getWorkspaceid() {
return workspaceid;
}
public void setWorkspaceid(String workspaceid) {
this.workspaceid = workspaceid;
}
public String getContractType() {
return contractType;
}
public void setContractType(String contractType) {
this.contractType = contractType;
}
}
package cn.com.poc.covenant.entity;
public class BizExtractionDocFlowEntity {
private static final long serialVersionUID = 1L;
/** biz_extraction_doc_flow_id
*
*/
private java.lang.Integer bizExtractionDocFlowId;
public java.lang.Integer getBizExtractionDocFlowId(){
return this.bizExtractionDocFlowId;
}
public void setBizExtractionDocFlowId(java.lang.Integer bizExtractionDocFlowId){
this.bizExtractionDocFlowId = bizExtractionDocFlowId;
}
/** biz_text_in_task_id
*
*/
private java.lang.String bizTextInTaskId;
public java.lang.String getBizTextInTaskId(){
return this.bizTextInTaskId;
}
public void setBizTextInTaskId(java.lang.String bizTextInTaskId){
this.bizTextInTaskId = bizTextInTaskId;
}
/** biz_doc_flow_stamps
*印章
*/
private java.lang.String bizDocFlowStamps;
public java.lang.String getBizDocFlowStamps(){
return this.bizDocFlowStamps;
}
public void setBizDocFlowStamps(java.lang.String bizDocFlowStamps){
this.bizDocFlowStamps = bizDocFlowStamps;
}
/** biz_doc_flow_tables
*全部表格数据列表
*/
private java.lang.String bizDocFlowTables;
public java.lang.String getBizDocFlowTables(){
return this.bizDocFlowTables;
}
public void setBizDocFlowTables(java.lang.String bizDocFlowTables){
this.bizDocFlowTables = bizDocFlowTables;
}
/** biz_doc_flow_fields
*字段列表
*/
private java.lang.String bizDocFlowFields;
public java.lang.String getBizDocFlowFields(){
return this.bizDocFlowFields;
}
public void setBizDocFlowFields(java.lang.String bizDocFlowFields){
this.bizDocFlowFields = bizDocFlowFields;
}
/** biz_doc_flow_handwritings
*手写
*/
private java.lang.String bizDocFlowHandwritings;
public java.lang.String getBizDocFlowHandwritings(){
return this.bizDocFlowHandwritings;
}
public void setBizDocFlowHandwritings(java.lang.String bizDocFlowHandwritings){
this.bizDocFlowHandwritings = bizDocFlowHandwritings;
}
/** biz_doc_flow_items
*表格数据列表
*/
private java.lang.String bizDocFlowItems;
public java.lang.String getBizDocFlowItems(){
return this.bizDocFlowItems;
}
public void setBizDocFlowItems(java.lang.String bizDocFlowItems){
this.bizDocFlowItems = bizDocFlowItems;
}
/** is_deleted
*是否删除 1、Y 是 2、N 否
*/
private java.lang.String isDeleted;
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
}
}
\ No newline at end of file
package cn.com.poc.covenant.model;
import java.io.Serializable;
import cn.com.yict.framemax.data.model.BaseModelClass;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Version;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
/**
* Model class for biz_extraction_doc_flow
*
*/
@Entity
@Table(name = "biz_extraction_doc_flow")
@DynamicInsert
@DynamicUpdate
public class BizExtractionDocFlowModel extends BaseModelClass implements Serializable {
private static final long serialVersionUID = 1L;
/** biz_extraction_doc_flow_id
*
*/
private java.lang.Integer bizExtractionDocFlowId;
@Column(name = "biz_extraction_doc_flow_id",length = 10)
@Id @GeneratedValue(strategy = GenerationType.AUTO)
public java.lang.Integer getBizExtractionDocFlowId(){
return this.bizExtractionDocFlowId;
}
public void setBizExtractionDocFlowId(java.lang.Integer bizExtractionDocFlowId){
this.bizExtractionDocFlowId = bizExtractionDocFlowId;
super.addValidField("bizExtractionDocFlowId");
}
/** biz_text_in_task_id
*
*/
private java.lang.String bizTextInTaskId;
@Column(name = "biz_text_in_task_id",length = 255)
public java.lang.String getBizTextInTaskId(){
return this.bizTextInTaskId;
}
public void setBizTextInTaskId(java.lang.String bizTextInTaskId){
this.bizTextInTaskId = bizTextInTaskId;
super.addValidField("bizTextInTaskId");
}
/** biz_doc_flow_stamps
*印章
*/
private java.lang.String bizDocFlowStamps;
@Column(name = "biz_doc_flow_stamps",length = 1073741824)
public java.lang.String getBizDocFlowStamps(){
return this.bizDocFlowStamps;
}
public void setBizDocFlowStamps(java.lang.String bizDocFlowStamps){
this.bizDocFlowStamps = bizDocFlowStamps;
super.addValidField("bizDocFlowStamps");
}
/** biz_doc_flow_tables
*全部表格数据列表
*/
private java.lang.String bizDocFlowTables;
@Column(name = "biz_doc_flow_tables",length = 1073741824)
public java.lang.String getBizDocFlowTables(){
return this.bizDocFlowTables;
}
public void setBizDocFlowTables(java.lang.String bizDocFlowTables){
this.bizDocFlowTables = bizDocFlowTables;
super.addValidField("bizDocFlowTables");
}
/** biz_doc_flow_fields
*字段列表
*/
private java.lang.String bizDocFlowFields;
@Column(name = "biz_doc_flow_fields",length = 1073741824)
public java.lang.String getBizDocFlowFields(){
return this.bizDocFlowFields;
}
public void setBizDocFlowFields(java.lang.String bizDocFlowFields){
this.bizDocFlowFields = bizDocFlowFields;
super.addValidField("bizDocFlowFields");
}
/** biz_doc_flow_handwritings
*手写
*/
private java.lang.String bizDocFlowHandwritings;
@Column(name = "biz_doc_flow_handwritings",length = 1073741824)
public java.lang.String getBizDocFlowHandwritings(){
return this.bizDocFlowHandwritings;
}
public void setBizDocFlowHandwritings(java.lang.String bizDocFlowHandwritings){
this.bizDocFlowHandwritings = bizDocFlowHandwritings;
super.addValidField("bizDocFlowHandwritings");
}
/** biz_doc_flow_items
*表格数据列表
*/
private java.lang.String bizDocFlowItems;
@Column(name = "biz_doc_flow_items",length = 1073741824)
public java.lang.String getBizDocFlowItems(){
return this.bizDocFlowItems;
}
public void setBizDocFlowItems(java.lang.String bizDocFlowItems){
this.bizDocFlowItems = bizDocFlowItems;
super.addValidField("bizDocFlowItems");
}
/** is_deleted
*是否删除 1、Y 是 2、N 否
*/
private java.lang.String isDeleted;
@Column(name = "is_deleted",length = 1)
public java.lang.String getIsDeleted(){
return this.isDeleted;
}
public void setIsDeleted(java.lang.String isDeleted){
this.isDeleted = isDeleted;
super.addValidField("isDeleted");
}
/** CREATOR
*创建人
*/
private java.lang.String creator;
@Column(name = "CREATOR",length = 225)
public java.lang.String getCreator(){
return this.creator;
}
public void setCreator(java.lang.String creator){
this.creator = creator;
super.addValidField("creator");
}
/** CREATED_TIME
*创建时间
*/
private java.util.Date createdTime;
@Column(name = "CREATED_TIME",length = 19)
public java.util.Date getCreatedTime(){
return this.createdTime;
}
public void setCreatedTime(java.util.Date createdTime){
this.createdTime = createdTime;
super.addValidField("createdTime");
}
/** MODIFIER
*修改人
*/
private java.lang.String modifier;
@Column(name = "MODIFIER",length = 225)
public java.lang.String getModifier(){
return this.modifier;
}
public void setModifier(java.lang.String modifier){
this.modifier = modifier;
super.addValidField("modifier");
}
/** MODIFIED_TIME
*修改时间
*/
private java.util.Date modifiedTime;
@Column(name = "MODIFIED_TIME",length = 19)
public java.util.Date getModifiedTime(){
return this.modifiedTime;
}
public void setModifiedTime(java.util.Date modifiedTime){
this.modifiedTime = modifiedTime;
super.addValidField("modifiedTime");
}
/** SYS_VERSION
*乐观锁,版本号
*/
private java.lang.Integer sysVersion;
@Column(name = "SYS_VERSION",length = 10)
@Version
public java.lang.Integer getSysVersion(){
return this.sysVersion;
}
public void setSysVersion(java.lang.Integer sysVersion){
this.sysVersion = sysVersion;
super.addValidField("sysVersion");
}
}
\ No newline at end of file
package cn.com.poc.covenant.repository;
import cn.com.yict.framemax.data.repository.Repository;
import cn.com.poc.covenant.model.BizExtractionDocFlowModel;
public interface BizExtractionDocFlowRepository extends Repository<BizExtractionDocFlowModel,java.lang.Integer> {
}
\ No newline at end of file
package cn.com.poc.covenant.rest;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.poc.covenant.dto.BizExtractionDocFlowDto;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.Collection;
import java.util.List;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@Permission(Access.Safety)
public interface BizExtractionDocFlowRest extends BaseRest {
/**
* 根据任务输入ID获取业务提取文档流程数据传输对象
*
* @param taskInId 任务输入ID,用于唯一标识一个任务输入
* @return BizExtractionDocFlowDto 业务提取文档流程数据传输对象
* @throws Exception 当获取过程中发生异常时抛出
*/
BizExtractionDocFlowDto getByTaskInId(@RequestParam String taskInId) throws Exception;
}
\ No newline at end of file
......@@ -2,14 +2,18 @@ package cn.com.poc.covenant.rest;
import cn.com.poc.covenant.dto.ExtractionDto;
import cn.com.poc.covenant.dto.ReviewProgressDto;
import cn.com.poc.covenant.dto.StartDocFlowDto;
import cn.com.poc.covenant.dto.StartReviewDto;
import cn.com.poc.covenant.model.BizExtreactionContractTypeModel;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileUploadResponse;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
/**
......@@ -31,6 +35,12 @@ public interface ExtractionRest extends BaseRest {
*/
String startReview(@RequestBody StartReviewDto startReviewDto) throws Exception;
/**
* 开始单据提取-textin docflow
* https://docflow.apifox.cn/
*/
String startDocFlow(@RequestBody StartDocFlowDto startDocFlowDto) throws Exception;
/**
* 获取合同类型列表
*/
......@@ -55,4 +65,6 @@ public interface ExtractionRest extends BaseRest {
* @return
*/
String getReviewUrl(@RequestParam String taskId) throws Exception;
FileUploadResponse createDocFlowTask(MultipartFile multipartFile, String workspaceid, String category) throws IOException;
}
package cn.com.poc.covenant.rest.impl;
import cn.com.poc.covenant.convert.BizExtractionDocFlowConvert;
import cn.com.poc.covenant.dto.BizExtractionDocFlowDto;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.poc.covenant.rest.BizExtractionDocFlowRest;
import cn.com.poc.covenant.service.BizExtractionDocFlowService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.util.List;
@Component
public class BizExtractionDocFlowRestImpl implements BizExtractionDocFlowRest {
@Resource
private BizExtractionDocFlowService service;
@Override
public BizExtractionDocFlowDto getByTaskInId(String taskInId) throws Exception {
Assert.notNull(taskInId);
BizExtractionDocFlowEntity example = new BizExtractionDocFlowEntity();
example.setBizTextInTaskId(taskInId);
example.setIsDeleted("N");
List<BizExtractionDocFlowEntity> bizExtractionDocFlowEntityList = service.findByExample(example, null);
if (CollectionUtils.isEmpty(bizExtractionDocFlowEntityList)) {
throw new Exception("未找到任务");
}
return BizExtractionDocFlowConvert.entityToDto(bizExtractionDocFlowEntityList.get(0));
}
}
\ No newline at end of file
package cn.com.poc.covenant.rest.impl;
import cn.com.poc.common.service.BosConfigService;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileUploadResponse;
import org.springframework.web.multipart.MultipartFile;
import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.model.BizFileUploadRecordModel;
......@@ -11,6 +15,7 @@ import cn.com.poc.common.utils.UUIDTool;
import cn.com.poc.covenant.constants.ContractConstants;
import cn.com.poc.covenant.dto.ExtractionDto;
import cn.com.poc.covenant.dto.ReviewProgressDto;
import cn.com.poc.covenant.dto.StartDocFlowDto;
import cn.com.poc.covenant.dto.StartReviewDto;
import cn.com.poc.covenant.model.BizExtractionKeyInfoConfigModel;
import cn.com.poc.covenant.model.BizExtractionReviewTaskModel;
......@@ -25,6 +30,7 @@ import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.poc.thirdparty.resource.baidu.api.BaiduTokenAPI;
import cn.com.poc.thirdparty.resource.baidu.api.TextReviewApi;
import cn.com.poc.thirdparty.resource.baidu.entity.response.TextReviewSubmitResponse;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileUploadRequest;
import cn.com.poc.thirdparty.resource.baidu.entity.result.TextReviewRequest;
import cn.com.poc.thirdparty.resource.text_in.api.TextInClient;
import cn.com.poc.thirdparty.resource.text_in.entity.extraction.entity.ExtractionResult;
......@@ -39,7 +45,6 @@ import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.io.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
......@@ -73,6 +78,10 @@ public class ExtractionRestImpl implements ExtractionRest {
@Resource
private BaiduTokenAPI baiduTokenAPI;
@Resource
private BosConfigService ossservice;
@Override
public String startExtract(StartReviewDto startReviewDto) throws Exception {
......@@ -163,6 +172,60 @@ public class ExtractionRestImpl implements ExtractionRest {
return taskId;
}
/**
* 开始单据提取-textin docflow
* https://docflow.apifox.cn/
*
* @param startDocFlowDto
*/
@Override
public String startDocFlow(StartDocFlowDto startDocFlowDto) throws Exception {
Assert.notNull(startDocFlowDto.getContractType());
String taskId = UUIDTool.getUUID();
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
// 保存任务信息
MultipartFile file = startDocFlowDto.getFile();
if (file == null) {
throw new BusinessException("请上传文件");
}
String type = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1, file.getOriginalFilename().length());
String fileUrl = ossservice.upload(file.getInputStream(), type, file.getContentType());
String workspaceId = fmxConfigService.getParam("textin.docflow.workspaceId");
if(StringUtils.isBlank(workspaceId)){
throw new BusinessException("请配置workspaceId");
}
//下载文件
List<BizExtractionReviewTaskModel> bizExtractionReviewTaskModels = new ArrayList<>();
FileUploadResponse fileUploadResponse = createDocFlowTask(file, workspaceId, startDocFlowDto.getCategory());
if (fileUploadResponse == null || !"200".equals(fileUploadResponse.getCode())) {
throw new BusinessException("上传异常,请稍后重试");
}
BizExtractionReviewTaskModel bizExtractionReviewTaskModel = new BizExtractionReviewTaskModel();
bizExtractionReviewTaskModel.setFileName(file.getOriginalFilename());
bizExtractionReviewTaskModel.setTaskId(taskId);
bizExtractionReviewTaskModel.setFileUrl(fileUrl);
bizExtractionReviewTaskModel.setActionType(ContractConstants.ActionType.docFlow);
bizExtractionReviewTaskModel.setReviewStatus("RUN");
bizExtractionReviewTaskModel.setUserId(userBaseEntity.getUserId());
bizExtractionReviewTaskModel.setReviewErrorMsg(null);
bizExtractionReviewTaskModel.setTextInTaskId(fileUploadResponse.getResult().getFiles().get(0).getid());
bizExtractionReviewTaskModel.setContractType(startDocFlowDto.getContractType());
bizExtractionReviewTaskModels.add(bizExtractionReviewTaskModel);
bizExtractionReviewTaskService.saveAll(bizExtractionReviewTaskModels);
return taskId;
}
private TextReviewSubmitResponse createReviewTask(File file, String contractType) throws IOException {
TextReviewRequest textReviewRequest = new TextReviewRequest();
textReviewRequest.setFile(file);
......@@ -188,7 +251,6 @@ public class ExtractionRestImpl implements ExtractionRest {
public List<ReviewProgressDto> reviewProgressList(String reviewTaskId, String search, String actionType) {
Assert.notNull(reviewTaskId);
UserBaseEntity currentUser = BlContext.getCurrentUserNotException();
if (currentUser == null) {
......@@ -315,24 +377,13 @@ public class ExtractionRestImpl implements ExtractionRest {
return originUrl.replaceAll("\\{taskId}", bizExtractionReviewTaskModelList.get(0).getTextInTaskId()).replaceAll("\\{access_token}", accessToken);
}
public void inputstreamtofile(InputStream ins, File file) throws IOException {
OutputStream os = new FileOutputStream(file);
int bytesRead;
byte[] buffer = new byte[8192];
while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
ins.close();
}
// 提取文件后缀名
private static String getFileSuffix(String fileName) {
if (fileName.lastIndexOf('.') != -1 && fileName.lastIndexOf('/') != fileName.length() - 1) {
return fileName.substring(fileName.lastIndexOf('.') + 1);
}
return "";
@Override
public FileUploadResponse createDocFlowTask(MultipartFile multipartFile, String workspaceid, String category) throws IOException {
FileUploadRequest fileUploadRequest = new FileUploadRequest();
fileUploadRequest.setFile(multipartFile);
fileUploadRequest.setCategory(category);
fileUploadRequest.setWorkspaceid(workspaceid);
return textInClient.fileUpload(fileUploadRequest);
}
}
\ No newline at end of file
package cn.com.poc.covenant.scheduler;
import java.util.Date;
import java.time.OffsetDateTime;
import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.common.utils.StringUtils;
import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.covenant.constants.ContractConstants;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.poc.covenant.model.BizExtractionReviewTaskModel;
import cn.com.poc.covenant.service.BizExtractionDocFlowService;
import cn.com.poc.covenant.service.BizExtractionReviewTaskService;
import cn.com.poc.thirdparty.resource.baidu.api.BaiduTokenAPI;
import cn.com.poc.thirdparty.resource.baidu.api.TextReviewApi;
......@@ -11,9 +15,13 @@ import cn.com.poc.thirdparty.resource.baidu.entity.response.TextReviewResultQuer
import cn.com.poc.thirdparty.resource.baidu.entity.response.text_diff.BaiduTextDiffQueryResult;
import cn.com.poc.thirdparty.resource.baidu.service.BaiduTextDiffService;
import cn.com.poc.thirdparty.resource.text_in.api.TextInClient;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileFetchRequest;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse.FileFetchResponse;
import cn.com.poc.thirdparty.resource.text_in.entity.extraction.entity.ExtractionResult;
import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.frame.service.FmxParamConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -41,6 +49,9 @@ public class ExtractionReviewScheduler {
@Resource
private BaiduTextDiffService baiduTextDiffService;
@Resource
private BizExtractionDocFlowService bizExtractionDocFlowService;
@Scheduled(cron = "0 0/1 * * * ?")
public void extraction() throws Exception {
// 执行任务
......@@ -100,6 +111,52 @@ public class ExtractionReviewScheduler {
}
}
@Scheduled(cron = "0 0/1 * * * ?")
public void docFlowTaskQuery() throws Exception {
// 执行任务
BizExtractionReviewTaskModel bizExtractionReviewTaskModel = new BizExtractionReviewTaskModel();
bizExtractionReviewTaskModel.setReviewStatus("RUN");
bizExtractionReviewTaskModel.setActionType(ContractConstants.ActionType.docFlow);
bizExtractionReviewTaskModel.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizExtractionReviewTaskModel> models = bizExtractionReviewTaskService.findByExample(bizExtractionReviewTaskModel, null);
if (CollectionUtils.isNotEmpty(models)) {
//获取workspaceId
String workspaceId = fmxConfigService.getParam("textin.docflow.workspaceId");
if(StringUtils.isBlank(workspaceId)){
throw new BusinessException("请配置workspaceId");
}
for (BizExtractionReviewTaskModel model : models) {
FileFetchRequest fileFetchRequest = new FileFetchRequest();
fileFetchRequest.setCategory(model.getContractType());
fileFetchRequest.setFileid(model.getTextInTaskId());
fileFetchRequest.setWorkspaceid(workspaceId);
FileFetchResponse fileFetchResponse = textInClient.fileFetch(fileFetchRequest);
if (fileFetchResponse == null ) {
model.setReviewStatus("ERROR");
} else if (fileFetchResponse.getCode() == 200L) {
if (fileFetchResponse.getResult() != null) {
model.setReviewStatus("END");
BizExtractionDocFlowEntity bizExtractionDocFlowEntity = new BizExtractionDocFlowEntity();
bizExtractionDocFlowEntity.setBizTextInTaskId(model.getTextInTaskId());
bizExtractionDocFlowEntity.setBizDocFlowStamps(JsonUtils.serialize(fileFetchResponse.getResult().getFiles().get(0).getData().getStamps()));
bizExtractionDocFlowEntity.setBizDocFlowTables(JsonUtils.serialize(fileFetchResponse.getResult().getFiles().get(0).getData().getTables()));
bizExtractionDocFlowEntity.setBizDocFlowFields(JsonUtils.serialize(fileFetchResponse.getResult().getFiles().get(0).getData().getFields()));
bizExtractionDocFlowEntity.setBizDocFlowHandwritings(JsonUtils.serialize(fileFetchResponse.getResult().getFiles().get(0).getData().getHandwritings()));
bizExtractionDocFlowEntity.setBizDocFlowItems(JsonUtils.serialize(fileFetchResponse.getResult().getFiles().get(0).getData().getItems()));
bizExtractionDocFlowService.save(bizExtractionDocFlowEntity);
}
} else {
model.setReviewStatus("ERROR");
}
}
bizExtractionReviewTaskService.saveAll(models);
}
}
/**
* 文本对比任务查询
......
package cn.com.poc.covenant.service;
import cn.com.yict.framemax.core.service.BaseService;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.yict.framemax.data.model.PagingInfo;
import java.util.Collection;
import java.util.List;
public interface BizExtractionDocFlowService extends BaseService {
BizExtractionDocFlowEntity get(java.lang.Integer id) throws Exception;
List<BizExtractionDocFlowEntity> findByExample(BizExtractionDocFlowEntity example,PagingInfo pagingInfo) throws Exception;
BizExtractionDocFlowEntity save(BizExtractionDocFlowEntity entity) throws Exception;
BizExtractionDocFlowEntity update(BizExtractionDocFlowEntity entity) throws Exception;
void deletedById(java.lang.Integer id) throws Exception;
}
\ No newline at end of file
package cn.com.poc.covenant.service.impl;
import cn.com.yict.framemax.core.service.impl.BaseServiceImpl;
import cn.com.poc.covenant.service.BizExtractionDocFlowService;
import cn.com.poc.covenant.model.BizExtractionDocFlowModel;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.poc.covenant.convert.BizExtractionDocFlowConvert;
import cn.com.poc.covenant.repository.BizExtractionDocFlowRepository;
import cn.com.yict.framemax.data.model.PagingInfo;
import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.util.Assert;
@Service
public class BizExtractionDocFlowServiceImpl extends BaseServiceImpl
implements BizExtractionDocFlowService {
@Resource
private BizExtractionDocFlowRepository repository;
public BizExtractionDocFlowEntity get(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizExtractionDocFlowModel model = this.repository.get(id);
if (model == null){
return null;
}
if ("Y".equals(model.getIsDeleted())){
return null;
}
return BizExtractionDocFlowConvert.modelToEntity(model);
}
public List<BizExtractionDocFlowEntity> findByExample(BizExtractionDocFlowEntity example,PagingInfo pagingInfo) throws Exception{
List<BizExtractionDocFlowEntity> result = new ArrayList<BizExtractionDocFlowEntity>();
BizExtractionDocFlowModel model = new BizExtractionDocFlowModel();
if (example != null){
model = BizExtractionDocFlowConvert.entityToModel(example);
}
model.setIsDeleted("N");
List<BizExtractionDocFlowModel> models = this.repository.findByExample(model,pagingInfo);
if (CollectionUtils.isNotEmpty(models)) {
result = models.stream().map(BizExtractionDocFlowConvert::modelToEntity).collect(Collectors.toList());
}
return result;
}
public BizExtractionDocFlowEntity save(BizExtractionDocFlowEntity entity) throws Exception{
Assert.notNull(entity);
entity.setBizExtractionDocFlowId(null);
entity.setIsDeleted("N");
BizExtractionDocFlowModel model = BizExtractionDocFlowConvert.entityToModel(entity);
BizExtractionDocFlowModel saveModel = this.repository.save(model);
return BizExtractionDocFlowConvert.modelToEntity(saveModel);
}
public BizExtractionDocFlowEntity update(BizExtractionDocFlowEntity entity) throws Exception{
Assert.notNull(entity);
Assert.notNull(entity.getBizExtractionDocFlowId(),"update pk can not be null");
BizExtractionDocFlowModel model = this.repository.get(entity.getBizExtractionDocFlowId());
if (entity.getBizTextInTaskId() != null){
model.setBizTextInTaskId(entity.getBizTextInTaskId());
}
if (entity.getBizDocFlowStamps() != null){
model.setBizDocFlowStamps(entity.getBizDocFlowStamps());
}
if (entity.getBizDocFlowTables() != null){
model.setBizDocFlowTables(entity.getBizDocFlowTables());
}
if (entity.getBizDocFlowFields() != null){
model.setBizDocFlowFields(entity.getBizDocFlowFields());
}
if (entity.getBizDocFlowHandwritings() != null){
model.setBizDocFlowHandwritings(entity.getBizDocFlowHandwritings());
}
if (entity.getBizDocFlowItems() != null){
model.setBizDocFlowItems(entity.getBizDocFlowItems());
}
if (entity.getIsDeleted() != null){
model.setIsDeleted(entity.getIsDeleted());
}
if (entity.getCreator() != null){
model.setCreator(entity.getCreator());
}
if (entity.getCreatedTime() != null){
model.setCreatedTime(entity.getCreatedTime());
}
if (entity.getModifier() != null){
model.setModifier(entity.getModifier());
}
if (entity.getModifiedTime() != null){
model.setModifiedTime(entity.getModifiedTime());
}
if (entity.getSysVersion() != null){
model.setSysVersion(entity.getSysVersion());
}
BizExtractionDocFlowModel saveModel = this.repository.save(model);
return BizExtractionDocFlowConvert.modelToEntity(saveModel);
}
public void deletedById(java.lang.Integer id) throws Exception{
Assert.notNull(id);
BizExtractionDocFlowModel model = this.repository.get(id);
if (model != null){
if ("N".equals(model.getIsDeleted())){
model.setIsDeleted("Y");
this.repository.save(model);
}
}
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import cn.com.poc.ai_dialogues.service.BizAiDialoguesService;
import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.law.dto.TemplateCallDto;
import cn.com.poc.law.dto.TemplateDataDetailDto;
import cn.com.poc.law.entity.motorVehicleDrivingComplaint.MotorVehicleDrivingComplaintEntity;
import cn.com.poc.law.extractEntityStrategy.ExtractEntityStrategy;
import cn.com.poc.law.extractEntityStrategy.LawyerExtractTypeConstants;
import cn.com.poc.law.extractEntityStrategy.LawyerTemplateExtractServiceBuilder;
......@@ -154,9 +155,9 @@ public class BizAiLawyerWritingTemplateDataServiceImpl extends BaseServiceImpl
}
ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(models.get(0).getBizAiLawyerWritingTemplateCode()));
JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class);
return "https://gsst-poe-sit.gz.bcebos.com/v1/%E6%B0%91%E9%97%B4%E5%80%9F%E8%B4%B7%E7%BA%A0%E7%BA%B7%E6%B0%91%E4%BA%8B%E8%B5%B7%E8%AF%89%E7%8A%B6.docx";
// return extractEntityStrategy.downloadFile();
LegalTemplateDto legalTemplateDto = JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), MotorVehicleDrivingComplaintEntity.class);
// return "https://gsst-poe-sit.gz.bcebos.com/v1/%E6%B0%91%E9%97%B4%E5%80%9F%E8%B4%B7%E7%BA%A0%E7%BA%B7%E6%B0%91%E4%BA%8B%E8%B5%B7%E8%AF%89%E7%8A%B6.docx";
return extractEntityStrategy.downloadFile(legalTemplateDto);
// return extractEntityStrategy.downloadFile(JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class));
}
......
package cn.com.poc.thirdparty.resource.demand.ai.entity.legal;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -35,7 +36,7 @@ public class Item {
* <p>
* 当替换值中存在 “是” 时,则在生成的合同中勾选 “是”,否则不勾选。
*/
private List<String> options;
private List<String> options = new ArrayList<>();
public String getKey() {
return key;
......
......@@ -7,16 +7,28 @@ package cn.com.poc.thirdparty.resource.text_in.api;
import cn.com.poc.common.utils.DocumentLoad;
import cn.com.poc.common.utils.JsonUtils;
import cn.com.poc.common.utils.StringUtils;
import cn.com.poc.common.utils.http.LocalHttpClient;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileFetchRequest;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileUploadRequest;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.FileUploadResponse;
import cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse.FileFetchResponse;
import cn.com.poc.thirdparty.resource.text_in.entity.extraction.entity.*;
import cn.com.poc.thirdparty.resource.text_in.entity.imageEdgeTriming.ImageEdgeTrimingResult;
import cn.com.yict.framemax.core.exception.BusinessException;
import cn.hutool.core.net.url.UrlBuilder;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.entity.StringEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.net.HttpURLConnection;
......@@ -29,12 +41,15 @@ import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public class TextInClient {
private Logger logger = LoggerFactory.getLogger(TextInClient.class);
private final String appId = "145b4303badd1da2f1628cf28534967a";
private final String secretCode = "5fe7d03b56714ec708f4ec6149d3a20c";
private final String appId_for_docFlow = "dafd04a574230c00ccba61132160de0c";
private final String secretCode_for_docFlow = "3bc03c7e6f9402963e6e71d16d786a9c";
public TextInClient() {
}
......@@ -319,4 +334,82 @@ public class TextInClient {
return result;
}
}
// https://docflow.apifox.cn/fetch
public static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().readTimeout(300, TimeUnit.SECONDS).build();
public FileUploadResponse fileUpload(FileUploadRequest fileUploadRequest) throws IOException {
MultipartFile multipartFile = fileUploadRequest.getFile();
File file = File.createTempFile("temp", "." + getFileExtension(multipartFile.getOriginalFilename()));
// 将MultipartFile内容传输到临时文件
multipartFile.transferTo(file);
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file", file.getName(), RequestBody.create(null, file))
.build();
UrlBuilder urlBuilder = UrlBuilder.of("https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload");
if (StringUtils.isNotBlank(fileUploadRequest.getWorkspaceid())) {
urlBuilder.addQuery("workspace_id", fileUploadRequest.getWorkspaceid());
}
if (StringUtils.isNotBlank(fileUploadRequest.getCategory())) {
urlBuilder.addQuery("category", fileUploadRequest.getCategory());
}
Request request = new Request.Builder()
.url(urlBuilder.toURL())
.method("POST", body)
.addHeader("Content-Type", "multipart/form-data")
.addHeader("x-ti-app-id", appId_for_docFlow)
.addHeader("x-ti-secret-code", secretCode_for_docFlow)
.addHeader("Content-Type", "application/json;charset=utf-8")
.build();
String response = HTTP_CLIENT.newCall(request).execute().body().string();
Gson gson = new Gson();
return gson.fromJson(response, FileUploadResponse.class);
}
// public static void main(String[] args) throws IOException {
// FileFetchRequest fileFetchRequest = new FileFetchRequest();
// fileFetchRequest.setWorkspaceid("1960977364788809728");
// fileFetchRequest.setFileid("1961336933658497024");
// FileFetchResponse fileFetchResponse = fileFetch(fileFetchRequest);
// System.out.println(JsonUtils.serialize(fileFetchResponse));
// }
public FileFetchResponse fileFetch(FileFetchRequest fileFetchRequest) throws IOException {
UrlBuilder urlBuilder = UrlBuilder.of("https://docflow.textin.com/api/app-api/sip/platform/v2/file/fetch");
if (StringUtils.isNotBlank(fileFetchRequest.getWorkspaceid())) {
urlBuilder.addQuery("workspace_id", fileFetchRequest.getWorkspaceid());
}
if (StringUtils.isNotBlank(fileFetchRequest.getFileid())) {
urlBuilder.addQuery("file_id", fileFetchRequest.getFileid());
}
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(urlBuilder.toURI())
// .addHeader("x-ti-app-id", appId_for_docFlow)
// .addHeader("x-ti-secret-code", secretCode_for_docFlow)
.addHeader("x-ti-app-id", "dafd04a574230c00ccba61132160de0c")
.addHeader("x-ti-secret-code", "3bc03c7e6f9402963e6e71d16d786a9c")
.addHeader("Content-Type", "application/json;charset=utf-8")
.build();
FileFetchResponse result = LocalHttpClient.executeJsonResult(httpUriRequest, FileFetchResponse.class);
return result;
}
private String getFileExtension(String fileName) {
if (fileName == null || fileName.lastIndexOf(".") == -1) {
return "";
}
return fileName.substring(fileName.lastIndexOf(".") + 1);
}
}
\ No newline at end of file
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow;
import java.time.OffsetDateTime;
/**
* @Author:Roger Wu
* @name:FileFetch
* @Date:2025-08-29 15:20
*/
public class FileFetchRequest {
/**
* 批次编号
*/
private String batchNumber;
/**
* 文件类别
*/
private String category;
/**
* 以更新时间搜索的结束时间, RFC3339格式(YYYY-MM-DDTHH:MM:SSZ)
*/
private OffsetDateTime endTime;
/**
* 文件ID
*/
private String fileid;
/**
* 页码,默认1
*/
private Long page;
/**
* 每页数量,默认1000
*/
private Long pageSize;
/**
* 文件识别状态 0: 待识别 1: 识别成功 2: 识别失败
*/
private Long recognitionStatus;
/**
* 以更新时间搜索的开始时间, RFC3339格式(YYYY-MM-DDTHH:MM:SSZ)
*/
private OffsetDateTime startTime;
/**
* 文件核对状态 0: 待核对 2: 已确认 3: 已拒绝 4: 已删除 5: 推迟处理
*/
private Long verificationStatus;
/**
* 是否返回文档的全部文字识别结果
*/
private Boolean withDocument;
/**
* 空间ID
*/
private String workspaceid;
public String getBatchNumber() { return batchNumber; }
public void setBatchNumber(String value) { this.batchNumber = value; }
public String getCategory() { return category; }
public void setCategory(String value) { this.category = value; }
public OffsetDateTime getEndTime() { return endTime; }
public void setEndTime(OffsetDateTime value) { this.endTime = value; }
public String getFileid() { return fileid; }
public void setFileid(String value) { this.fileid = value; }
public Long getPage() { return page; }
public void setPage(Long value) { this.page = value; }
public Long getPageSize() { return pageSize; }
public void setPageSize(Long value) { this.pageSize = value; }
public Long getRecognitionStatus() { return recognitionStatus; }
public void setRecognitionStatus(Long value) { this.recognitionStatus = value; }
public OffsetDateTime getStartTime() { return startTime; }
public void setStartTime(OffsetDateTime value) { this.startTime = value; }
public Long getVerificationStatus() { return verificationStatus; }
public void setVerificationStatus(Long value) { this.verificationStatus = value; }
public Boolean getWithDocument() { return withDocument; }
public void setWithDocument(Boolean value) { this.withDocument = value; }
public String getWorkspaceid() { return workspaceid; }
public void setWorkspaceid(String value) { this.workspaceid = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow;
/**
* @Author:Roger Wu
* @name:FileUpload
* @Date:2025-08-28 19:05
*/
public class FileUpload {
/**
* 文件格式
*/
private String format;
/**
* 文件ID
*/
private String id;
/**
* 文件名
*/
private String name;
public String getFormat() { return format; }
public void setFormat(String value) { this.format = value; }
public String getid() { return id; }
public void setid(String value) { this.id = value; }
public String getName() { return name; }
public void setName(String value) { this.name = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow;
import org.springframework.web.multipart.MultipartFile;
/**
* @Author:Roger Wu
* @name:FileUploadRequest
* @Date:2025-08-28 17:32
*/
public class FileUploadRequest {
/**
*
*/
private MultipartFile file;
/**
* 是否自动进行发票验真
*/
private Boolean autoVerifyVat;
/**
* 批次编号。
* 可以用同一个批次编号上传多次,后续可以用批次编号获取该批次多个文件处理结果。
* 如果值为空,则系统自动生成最长20位字符串
*/
private String batchNumber;
/**
* 文件类别
*/
private String category;
/**
* 是否进行多图切分
*/
private Boolean cropFlag;
/**
* 是否进行文件拆分
*/
private Boolean splitFlag;
// /**
// * 目标处理类型。
// * 可选值:
// * - `classify`: 分类
// * - `extract`: 抽取
// */
// private TargetProcess targetProcess;
/**
* 空间ID
*/
private String workspaceid;
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
public Boolean getAutoVerifyVat() { return autoVerifyVat; }
public void setAutoVerifyVat(Boolean value) { this.autoVerifyVat = value; }
public String getBatchNumber() { return batchNumber; }
public void setBatchNumber(String value) { this.batchNumber = value; }
public String getCategory() { return category; }
public void setCategory(String value) { this.category = value; }
public Boolean getCropFlag() { return cropFlag; }
public void setCropFlag(Boolean value) { this.cropFlag = value; }
public Boolean getSplitFlag() { return splitFlag; }
public void setSplitFlag(Boolean value) { this.splitFlag = value; }
// public TargetProcess getTargetProcess() { return targetProcess; }
// public void setTargetProcess(TargetProcess value) { this.targetProcess = value; }
public String getWorkspaceid() { return workspaceid; }
public void setWorkspaceid(String value) { this.workspaceid = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow;
/**
* @Author:Roger Wu
* @name:FileUploadResponse
* @Date:2025-08-28 19:04
*/
public class FileUploadResponse {
private String message;
private String code;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
private FileUploadResult result;
public FileUploadResult getResult() {
return result;
}
public void setResult(FileUploadResult result) {
this.result = result;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow;
import java.util.List;
/**
* @Author:Roger Wu
* @name:FileUploadResponse
* @Date:2025-08-28 19:04
*/
public class FileUploadResult {
private String batch_number;
private List<FileUpload> files;
public String getBatch_number() {
return batch_number;
}
public void setBatch_number(String batch_number) {
this.batch_number = batch_number;
}
public List<FileUpload> getFiles() {
return files;
}
public void setFiles(List<FileUpload> files) {
this.files = files;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class ChildFileData {
/**
* 字段列表
*/
private List<KeyValue> fields;
/**
* 手写体信息
*/
private List<HandWritingValue> handwritings;
/**
* 发票验真结果
*/
private PurpleInvoiceVerifyResult invoiceVerifyResult;
/**
* 表格数据列表
*/
private List<List<KeyValue>> items;
/**
* 印章信息
*/
private List<StampValue> stamps;
/**
* 全部表格数据列表(含系统表格和手动配置表格)
*/
private List<PurpleTable> tables;
public List<KeyValue> getFields() { return fields; }
public void setFields(List<KeyValue> value) { this.fields = value; }
public List<HandWritingValue> getHandwritings() { return handwritings; }
public void setHandwritings(List<HandWritingValue> value) { this.handwritings = value; }
public PurpleInvoiceVerifyResult getInvoiceVerifyResult() { return invoiceVerifyResult; }
public void setInvoiceVerifyResult(PurpleInvoiceVerifyResult value) { this.invoiceVerifyResult = value; }
public List<List<KeyValue>> getItems() { return items; }
public void setItems(List<List<KeyValue>> value) { this.items = value; }
public List<StampValue> getStamps() { return stamps; }
public void setStamps(List<StampValue> value) { this.stamps = value; }
public List<PurpleTable> getTables() { return tables; }
public void setTables(List<PurpleTable> value) { this.tables = value; }
}
\ No newline at end of file
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
/**
* @Author:Roger Wu
* @name:ChildFilePage
* @Date:2025-08-29 15:31
*/
public class ChildFilePage {
/**
* 旋转角度
*/
private Long angle;
/**
* PDF转图片时的分辨率。非PDF文件该值为`0`.
*/
private Long dpi;
/**
* 转正后的页高
*/
private Long height;
/**
* 转正后的页宽
*/
private Long width;
public Long getAngle() {
return angle;
}
public void setAngle(Long value) {
this.angle = value;
}
public Long getdpi() {
return dpi;
}
public void setdpi(Long value) {
this.dpi = value;
}
public Long getHeight() {
return height;
}
public void setHeight(Long value) {
this.height = value;
}
public Long getWidth() {
return width;
}
public void setWidth(Long value) {
this.width = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* CommonFieldDetailRespVO
*/
public class CommonFieldDetailRespVO {
/**
* 索引
*/
private Long index;
/**
* 字段key
*/
private String key;
/**
* 字段坐标
*/
private List<TextInLines> textInLines;
/**
* 字段值
*/
private String value;
public Long getIndex() {
return index;
}
public void setIndex(Long value) {
this.index = value;
}
public String getKey() {
return key;
}
public void setKey(String value) {
this.key = value;
}
public List<TextInLines> getTextInLines() {
return textInLines;
}
public void setTextInLines(List<TextInLines> value) {
this.textInLines = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* Document
*/
public class Document {
private List<DocumentPage> pages;
public List<DocumentPage> getPages() {
return pages;
}
public void setPages(List<DocumentPage> value) {
this.pages = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* @Author:Roger Wu
* @name:DocumentPage
* @Date:2025-08-29 15:31
*/
public class DocumentPage {
/**
* 页面的旋转角度
*/
private Long angle;
/**
* 页面的高度
*/
private Long height;
/**
* 页面的文本行数组
*/
private List<Line> lines;
/**
* 页面的宽度
*/
private Long width;
public Long getAngle() {
return angle;
}
public void setAngle(Long value) {
this.angle = value;
}
public Long getHeight() {
return height;
}
public void setHeight(Long value) {
this.height = value;
}
public List<Line> getLines() {
return lines;
}
public void setLines(List<Line> value) {
this.lines = value;
}
public Long getWidth() {
return width;
}
public void setWidth(Long value) {
this.width = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class FieldPosition {
/**
* 字段所在页。是`pages`数组的索引
*/
private Long page;
/**
* 字段值的外接四边形坐标。图像以左上为原点,数组值为 [左上角x, 左上角y, 右上角x, 右上角y, 右下角x, 右下角y, 左下角x, 左下角y]
*/
private List<Long> vertices;
public Long getPage() { return page; }
public void setPage(Long value) { this.page = value; }
public List<Long> getVertices() { return vertices; }
public void setVertices(List<Long> value) { this.vertices = value; }
}
\ No newline at end of file
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class File {
/**
* 批次编号
*/
private String batchNumber;
/**
* 文件类别
*/
private String category;
/**
* 子任务信息
*/
private List<SubFileDetailInfo> childFiles;
/**
* 处理结果
*/
private FileData data;
private Document document;
/**
* 文件格式
*/
private String format;
/**
* 文件ID
*/
private String id;
/**
* 文件名
*/
private String name;
/**
* 文件每页用于渲染的数据。
* 配合`data.fields`中的`page`和`position`字段,可以准确画出字段在页面上的位置。
*/
private List<FilePage> pages;
private long recognitionStatus;
/**
* 任务ID
*/
private String taskid;
/**
* 任务类型(0:文件拆分子任务、1:普通任务、2:父任务、3:切图子任务)
*/
private Long taskType;
private long verificationStatus;
public String getBatchNumber() { return batchNumber; }
public void setBatchNumber(String value) { this.batchNumber = value; }
public String getCategory() { return category; }
public void setCategory(String value) { this.category = value; }
public List<SubFileDetailInfo> getChildFiles() { return childFiles; }
public void setChildFiles(List<SubFileDetailInfo> value) { this.childFiles = value; }
public FileData getData() { return data; }
public void setData(FileData value) { this.data = value; }
public Document getDocument() { return document; }
public void setDocument(Document value) { this.document = value; }
public String getFormat() { return format; }
public void setFormat(String value) { this.format = value; }
public String getid() { return id; }
public void setid(String value) { this.id = value; }
public String getName() { return name; }
public void setName(String value) { this.name = value; }
public List<FilePage> getPages() { return pages; }
public void setPages(List<FilePage> value) { this.pages = value; }
public long getRecognitionStatus() { return recognitionStatus; }
public void setRecognitionStatus(long value) { this.recognitionStatus = value; }
public String getTaskid() { return taskid; }
public void setTaskid(String value) { this.taskid = value; }
public Long getTaskType() { return taskType; }
public void setTaskType(Long value) { this.taskType = value; }
public long getVerificationStatus() { return verificationStatus; }
public void setVerificationStatus(long value) { this.verificationStatus = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* 处理结果
*/
public class FileData {
/**
* 字段列表
*/
private List<KeyValue> fields;
/**
* 手写体信息
*/
private List<HandWritingValue> handwritings;
/**
* 发票验真结果
*/
private FluffyInvoiceVerifyResult invoiceVerifyResult;
/**
* 表格数据列表
*/
private List<List<KeyValue>> items;
/**
* 印章信息
*/
private List<StampValue> stamps;
/**
* 全部表格数据列表(含系统表格和手动配置表格)
*/
private List<FluffyTable> tables;
public List<KeyValue> getFields() {
return fields;
}
public void setFields(List<KeyValue> value) {
this.fields = value;
}
public List<HandWritingValue> getHandwritings() {
return handwritings;
}
public void setHandwritings(List<HandWritingValue> value) {
this.handwritings = value;
}
public FluffyInvoiceVerifyResult getInvoiceVerifyResult() {
return invoiceVerifyResult;
}
public void setInvoiceVerifyResult(FluffyInvoiceVerifyResult value) {
this.invoiceVerifyResult = value;
}
public List<List<KeyValue>> getItems() {
return items;
}
public void setItems(List<List<KeyValue>> value) {
this.items = value;
}
public List<StampValue> getStamps() {
return stamps;
}
public void setStamps(List<StampValue> value) {
this.stamps = value;
}
public List<FluffyTable> getTables() {
return tables;
}
public void setTables(List<FluffyTable> value) {
this.tables = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
/**
* @Author:Roger Wu
* @name:FileFetchResponese
* @Date:2025-08-29 15:24
*/
public class FileFetchResponse {
/**
* 状态码
*/
private long code;
/**
* 状态描述
*/
private String message;
private Result result;
public long getCode() {
return code;
}
public void setCode(long value) {
this.code = value;
}
public String getMessage() {
return message;
}
public void setMessage(String value) {
this.message = value;
}
public Result getResult() {
return result;
}
public void setResult(Result value) {
this.result = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
/**
* @Author:Roger Wu
* @name:FilePage
* @Date:2025-08-29 15:31
*/
public class FilePage {
/**
* 旋转角度
*/
private Long angle;
/**
* PDF转图片时的分辨率。非PDF文件该值为`0`.
*/
private Long dpi;
/**
* 转正后的页高
*/
private Long height;
/**
* 转正后的页宽
*/
private Long width;
public Long getAngle() {
return angle;
}
public void setAngle(Long value) {
this.angle = value;
}
public Long getdpi() {
return dpi;
}
public void setdpi(Long value) {
this.dpi = value;
}
public Long getHeight() {
return height;
}
public void setHeight(Long value) {
this.height = value;
}
public Long getWidth() {
return width;
}
public void setWidth(Long value) {
this.width = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
/**
* 发票验真结果
*/
public class FluffyInvoiceVerifyResult {
/**
* 发票验真是否可以重试/发起(0:否,1:是)
*/
private Long invoiceVerifyCanRetry;
/**
* 发票验真错误码
*/
private Long invoiceVerifyErrorCode;
/**
* 发票验真失败原因
*/
private String invoiceVerifyFailMsg;
/**
* 发票验真是否成功(0:否,1:是, null:未验真)
*/
private Long invoiceVerifyStatus;
public Long getInvoiceVerifyCanRetry() {
return invoiceVerifyCanRetry;
}
public void setInvoiceVerifyCanRetry(Long value) {
this.invoiceVerifyCanRetry = value;
}
public Long getInvoiceVerifyErrorCode() {
return invoiceVerifyErrorCode;
}
public void setInvoiceVerifyErrorCode(Long value) {
this.invoiceVerifyErrorCode = value;
}
public String getInvoiceVerifyFailMsg() {
return invoiceVerifyFailMsg;
}
public void setInvoiceVerifyFailMsg(String value) {
this.invoiceVerifyFailMsg = value;
}
public Long getInvoiceVerifyStatus() {
return invoiceVerifyStatus;
}
public void setInvoiceVerifyStatus(Long value) {
this.invoiceVerifyStatus = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* @Author:Roger Wu
* @name:FluffyTable
* @Date:2025-08-29 15:31
*/
public class FluffyTable {
private List<List<CommonFieldDetailRespVO>> items;
/**
* 表格名称
*/
private String tableName;
/**
* 表格类型, 0, 系统配置, 1 手动添加。
*/
private String tableType;
public List<List<CommonFieldDetailRespVO>> getItems() {
return items;
}
public void setItems(List<List<CommonFieldDetailRespVO>> value) {
this.items = value;
}
public String getTableName() {
return tableName;
}
public void setTableName(String value) {
this.tableName = value;
}
public String getTableType() {
return tableType;
}
public void setTableType(String value) {
this.tableType = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* HandWritingValue
*/
public class HandWritingValue {
/**
* 角度
*/
private Long angel;
/**
* 页码
*/
private Long page;
/**
* 字段值的位置。字段值可能跨页或跨行,因此用数组展示。
*/
private List<HandwritingPosition> position;
/**
* 印章文本内容
*/
private String text;
public Long getAngel() {
return angel;
}
public void setAngel(Long value) {
this.angel = value;
}
public Long getPage() {
return page;
}
public void setPage(Long value) {
this.page = value;
}
public List<HandwritingPosition> getPosition() {
return position;
}
public void setPosition(List<HandwritingPosition> value) {
this.position = value;
}
public String getText() {
return text;
}
public void setText(String value) {
this.text = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class HandwritingPosition {
/**
* 字段所在页。是`pages`数组的索引
*/
private Long page;
/**
* 字段值的外接四边形坐标。图像以左上为原点,数组值为 [左上角x, 左上角y, 右上角x, 右上角y, 右下角x, 右下角y, 左下角x, 左下角y]
*/
private List<Long> vertices;
public Long getPage() { return page; }
public void setPage(Long value) { this.page = value; }
public List<Long> getVertices() { return vertices; }
public void setVertices(List<Long> value) { this.vertices = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class KeyValue {
/**
* 字段名
*/
private String key;
/**
* 字段值的位置。字段值可能跨页或跨行,因此用数组展示。
*/
private List<FieldPosition> position;
/**
* 字段值
*/
private String value;
public String getKey() { return key; }
public void setKey(String value) { this.key = value; }
public List<FieldPosition> getPosition() { return position; }
public void setPosition(List<FieldPosition> value) { this.position = value; }
public String getValue() { return value; }
public void setValue(String value) { this.value = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* @Author:Roger Wu
* @name:Line
* @Date:2025-08-29 15:31
*/
public class Line {
private List<List<Long>> charPositions;
private List<Long> position;
/**
* 行文本
*/
private String text;
public List<List<Long>> getCharPositions() {
return charPositions;
}
public void setCharPositions(List<List<Long>> value) {
this.charPositions = value;
}
public List<Long> getPosition() {
return position;
}
public void setPosition(List<Long> value) {
this.position = value;
}
public String getText() {
return text;
}
public void setText(String value) {
this.text = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
public class PurpleInvoiceVerifyResult {
/**
* 发票验真是否可以重试/发起(0:否,1:是)
*/
private Long invoiceVerifyCanRetry;
/**
* 发票验真错误码
*/
private Long invoiceVerifyErrorCode;
/**
* 发票验真失败原因
*/
private String invoiceVerifyFailMsg;
/**
* 发票验真是否成功(0:否,1:是, null:未验真)
*/
private Long invoiceVerifyStatus;
public Long getInvoiceVerifyCanRetry() { return invoiceVerifyCanRetry; }
public void setInvoiceVerifyCanRetry(Long value) { this.invoiceVerifyCanRetry = value; }
public Long getInvoiceVerifyErrorCode() { return invoiceVerifyErrorCode; }
public void setInvoiceVerifyErrorCode(Long value) { this.invoiceVerifyErrorCode = value; }
public String getInvoiceVerifyFailMsg() { return invoiceVerifyFailMsg; }
public void setInvoiceVerifyFailMsg(String value) { this.invoiceVerifyFailMsg = value; }
public Long getInvoiceVerifyStatus() { return invoiceVerifyStatus; }
public void setInvoiceVerifyStatus(Long value) { this.invoiceVerifyStatus = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class PurpleTable {
private List<List<CommonFieldDetailRespVO>> items;
/**
* 表格名称
*/
private String tableName;
/**
* 表格类型, 0, 系统配置, 1 手动添加。
*/
private String tableType;
public List<List<CommonFieldDetailRespVO>> getItems() {
return items;
}
public void setItems(List<List<CommonFieldDetailRespVO>> value) {
this.items = value;
}
public String getTableName() {
return tableName;
}
public void setTableName(String value) {
this.tableName = value;
}
public String getTableType() {
return tableType;
}
public void setTableType(String value) {
this.tableType = value;
}
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class Result {
private List<File> files;
/**
* 当前页码
*/
private Long page;
/**
* 每页数量
*/
private Long pageSize;
/**
* 文件总数
*/
private Long total;
public List<File> getFiles() { return files; }
public void setFiles(List<File> value) { this.files = value; }
public Long getPage() { return page; }
public void setPage(Long value) { this.page = value; }
public Long getPageSize() { return pageSize; }
public void setPageSize(Long value) { this.pageSize = value; }
public Long getTotal() { return total; }
public void setTotal(Long value) { this.total = value; }
}
\ No newline at end of file
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class StampValue {
/**
* 角度
*/
private Long angel;
/**
* 印章颜色
*/
private String color;
/**
* 页码
*/
private Long page;
/**
* 位置信息
*/
private List<Long> position;
/**
* 印章形状
*/
private String shape;
/**
* 印章文本内容
*/
private String text;
/**
* 印章类型
*/
private String type;
public Long getAngel() { return angel; }
public void setAngel(Long value) { this.angel = value; }
public String getColor() { return color; }
public void setColor(String value) { this.color = value; }
public Long getPage() { return page; }
public void setPage(Long value) { this.page = value; }
public List<Long> getPosition() { return position; }
public void setPosition(List<Long> value) { this.position = value; }
public String getShape() { return shape; }
public void setShape(String value) { this.shape = value; }
public String getText() { return text; }
public void setText(String value) { this.text = value; }
public String getType() { return type; }
public void setType(String value) { this.type = value; }
}
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
public class SubFileDetailInfo {
/**
* 批次编号
*/
private String batchNumber;
/**
* 文件类别
*/
private String category;
/**
* 处理结果
*/
private ChildFileData data;
private Document document;
/**
* 文件格式
*/
private String format;
/**
* 切图结果在原文件中的坐标位置
*/
private List<Long> fromParentPositionList;
/**
* 文件ID
*/
private String id;
/**
* 文件名
*/
private String name;
/**
* 文件每页用于渲染的数据。
* 配合`data.fields`中的`page`和`position`字段,可以准确画出字段在页面上的位置。
*/
private List<ChildFilePage> pages;
/**
* 父任务ID(不为0时有意义)
*/
private String parentTaskid;
private Long recognitionStatus;
/**
* 任务ID
*/
private String taskid;
/**
* 任务类型(0:文件拆分子任务、1:普通任务、2:父任务、3:切图子任务)
*/
private Long taskType;
private Long verificationStatus;
public String getBatchNumber() { return batchNumber; }
public void setBatchNumber(String value) { this.batchNumber = value; }
public String getCategory() { return category; }
public void setCategory(String value) { this.category = value; }
public ChildFileData getData() { return data; }
public void setData(ChildFileData value) { this.data = value; }
public Document getDocument() { return document; }
public void setDocument(Document value) { this.document = value; }
public String getFormat() { return format; }
public void setFormat(String value) { this.format = value; }
public List<Long> getFromParentPositionList() { return fromParentPositionList; }
public void setFromParentPositionList(List<Long> value) { this.fromParentPositionList = value; }
public String getid() { return id; }
public void setid(String value) { this.id = value; }
public String getName() { return name; }
public void setName(String value) { this.name = value; }
public List<ChildFilePage> getPages() { return pages; }
public void setPages(List<ChildFilePage> value) { this.pages = value; }
public String getParentTaskid() { return parentTaskid; }
public void setParentTaskid(String value) { this.parentTaskid = value; }
public Long getRecognitionStatus() { return recognitionStatus; }
public void setRecognitionStatus(Long value) { this.recognitionStatus = value; }
public String getTaskid() { return taskid; }
public void setTaskid(String value) { this.taskid = value; }
public Long getTaskType() { return taskType; }
public void setTaskType(Long value) { this.taskType = value; }
public Long getVerificationStatus() { return verificationStatus; }
public void setVerificationStatus(Long value) { this.verificationStatus = value; }
}
\ No newline at end of file
package cn.com.poc.thirdparty.resource.text_in.entity.doc_flow.fileFetchResponse;
import java.util.List;
/**
* TextInLines,字段坐标
*/
public class TextInLines {
/**
* 角度
*/
private String angle;
/**
* 字符坐标
*/
private List<List<Long>> charPos;
/**
* 页码
*/
private Long page;
/**
* 坐标
*/
private List<Long> pos;
/**
* 文本
*/
private String text;
public String getAngle() {
return angle;
}
public void setAngle(String value) {
this.angle = value;
}
public List<List<Long>> getCharPos() {
return charPos;
}
public void setCharPos(List<List<Long>> value) {
this.charPos = value;
}
public Long getPage() {
return page;
}
public void setPage(Long value) {
this.page = value;
}
public List<Long> getPos() {
return pos;
}
public void setPos(List<Long> value) {
this.pos = value;
}
public String getText() {
return text;
}
public void setText(String value) {
this.text = value;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment