Commit 4f0b5efb authored by R10's avatar R10

单据识别初版提交

parent 6935d327
...@@ -11,12 +11,15 @@ public interface ContractConstants { ...@@ -11,12 +11,15 @@ public interface ContractConstants {
final static String extract = "extract"; //提取 final static String extract = "extract"; //提取
final static String textreview = "textreview"; //审查 final static String textreview = "textreview"; //审查
final static String textdiff = "textdiff"; //对比 final static String textdiff = "textdiff"; //对比
final static String docFlow = "docFlow"; //单据
} }
public interface ContractType{ public interface ContractType{
final static String contractExtract = "ContractExtract"; //审查 final static String contractExtract = "ContractExtract"; //审查
final static String contractReview = "ContractReview"; //对比 final static String contractReview = "ContractReview"; //对比
final static String contractTextdiff = "ContractTextdiff"; //对比 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; ...@@ -2,14 +2,18 @@ package cn.com.poc.covenant.rest;
import cn.com.poc.covenant.dto.ExtractionDto; import cn.com.poc.covenant.dto.ExtractionDto;
import cn.com.poc.covenant.dto.ReviewProgressDto; 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.dto.StartReviewDto;
import cn.com.poc.covenant.model.BizExtreactionContractTypeModel; 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.core.rest.BaseRest;
import cn.com.yict.framemax.web.permission.Access; import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission; import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
...@@ -31,6 +35,12 @@ public interface ExtractionRest extends BaseRest { ...@@ -31,6 +35,12 @@ public interface ExtractionRest extends BaseRest {
*/ */
String startReview(@RequestBody StartReviewDto startReviewDto) throws Exception; 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 { ...@@ -55,4 +65,6 @@ public interface ExtractionRest extends BaseRest {
* @return * @return
*/ */
String getReviewUrl(@RequestParam String taskId) throws Exception; 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; 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.constant.CommonConstant;
import cn.com.poc.common.model.BizFileUploadRecordModel; import cn.com.poc.common.model.BizFileUploadRecordModel;
...@@ -11,6 +15,7 @@ import cn.com.poc.common.utils.UUIDTool; ...@@ -11,6 +15,7 @@ import cn.com.poc.common.utils.UUIDTool;
import cn.com.poc.covenant.constants.ContractConstants; import cn.com.poc.covenant.constants.ContractConstants;
import cn.com.poc.covenant.dto.ExtractionDto; import cn.com.poc.covenant.dto.ExtractionDto;
import cn.com.poc.covenant.dto.ReviewProgressDto; 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.dto.StartReviewDto;
import cn.com.poc.covenant.model.BizExtractionKeyInfoConfigModel; import cn.com.poc.covenant.model.BizExtractionKeyInfoConfigModel;
import cn.com.poc.covenant.model.BizExtractionReviewTaskModel; import cn.com.poc.covenant.model.BizExtractionReviewTaskModel;
...@@ -25,6 +30,7 @@ import cn.com.poc.support.security.oauth.entity.UserBaseEntity; ...@@ -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.BaiduTokenAPI;
import cn.com.poc.thirdparty.resource.baidu.api.TextReviewApi; 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.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.baidu.entity.result.TextReviewRequest;
import cn.com.poc.thirdparty.resource.text_in.api.TextInClient; import cn.com.poc.thirdparty.resource.text_in.api.TextInClient;
import cn.com.poc.thirdparty.resource.text_in.entity.extraction.entity.ExtractionResult; import cn.com.poc.thirdparty.resource.text_in.entity.extraction.entity.ExtractionResult;
...@@ -39,7 +45,6 @@ import org.springframework.util.Assert; ...@@ -39,7 +45,6 @@ import org.springframework.util.Assert;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.*; import java.io.*;
import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -73,6 +78,10 @@ public class ExtractionRestImpl implements ExtractionRest { ...@@ -73,6 +78,10 @@ public class ExtractionRestImpl implements ExtractionRest {
@Resource @Resource
private BaiduTokenAPI baiduTokenAPI; private BaiduTokenAPI baiduTokenAPI;
@Resource
private BosConfigService ossservice;
@Override @Override
public String startExtract(StartReviewDto startReviewDto) throws Exception { public String startExtract(StartReviewDto startReviewDto) throws Exception {
...@@ -163,6 +172,60 @@ public class ExtractionRestImpl implements ExtractionRest { ...@@ -163,6 +172,60 @@ public class ExtractionRestImpl implements ExtractionRest {
return taskId; 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 { private TextReviewSubmitResponse createReviewTask(File file, String contractType) throws IOException {
TextReviewRequest textReviewRequest = new TextReviewRequest(); TextReviewRequest textReviewRequest = new TextReviewRequest();
textReviewRequest.setFile(file); textReviewRequest.setFile(file);
...@@ -188,7 +251,6 @@ public class ExtractionRestImpl implements ExtractionRest { ...@@ -188,7 +251,6 @@ public class ExtractionRestImpl implements ExtractionRest {
public List<ReviewProgressDto> reviewProgressList(String reviewTaskId, String search, String actionType) { public List<ReviewProgressDto> reviewProgressList(String reviewTaskId, String search, String actionType) {
Assert.notNull(reviewTaskId); Assert.notNull(reviewTaskId);
UserBaseEntity currentUser = BlContext.getCurrentUserNotException(); UserBaseEntity currentUser = BlContext.getCurrentUserNotException();
if (currentUser == null) { if (currentUser == null) {
...@@ -315,24 +377,13 @@ public class ExtractionRestImpl implements ExtractionRest { ...@@ -315,24 +377,13 @@ public class ExtractionRestImpl implements ExtractionRest {
return originUrl.replaceAll("\\{taskId}", bizExtractionReviewTaskModelList.get(0).getTextInTaskId()).replaceAll("\\{access_token}", accessToken); return originUrl.replaceAll("\\{taskId}", bizExtractionReviewTaskModelList.get(0).getTextInTaskId()).replaceAll("\\{access_token}", accessToken);
} }
@Override
public void inputstreamtofile(InputStream ins, File file) throws IOException { public FileUploadResponse createDocFlowTask(MultipartFile multipartFile, String workspaceid, String category) throws IOException {
OutputStream os = new FileOutputStream(file); FileUploadRequest fileUploadRequest = new FileUploadRequest();
int bytesRead; fileUploadRequest.setFile(multipartFile);
byte[] buffer = new byte[8192]; fileUploadRequest.setCategory(category);
while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { fileUploadRequest.setWorkspaceid(workspaceid);
os.write(buffer, 0, bytesRead); return textInClient.fileUpload(fileUploadRequest);
}
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 "";
} }
} }
\ No newline at end of file
package cn.com.poc.covenant.scheduler; 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.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.constants.ContractConstants;
import cn.com.poc.covenant.entity.BizExtractionDocFlowEntity;
import cn.com.poc.covenant.model.BizExtractionReviewTaskModel; 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.covenant.service.BizExtractionReviewTaskService;
import cn.com.poc.thirdparty.resource.baidu.api.BaiduTokenAPI; 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.api.TextReviewApi;
...@@ -11,9 +15,13 @@ import cn.com.poc.thirdparty.resource.baidu.entity.response.TextReviewResultQuer ...@@ -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.entity.response.text_diff.BaiduTextDiffQueryResult;
import cn.com.poc.thirdparty.resource.baidu.service.BaiduTextDiffService; 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.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.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 cn.com.yict.framemax.frame.service.FmxParamConfigService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -41,6 +49,9 @@ public class ExtractionReviewScheduler { ...@@ -41,6 +49,9 @@ public class ExtractionReviewScheduler {
@Resource @Resource
private BaiduTextDiffService baiduTextDiffService; private BaiduTextDiffService baiduTextDiffService;
@Resource
private BizExtractionDocFlowService bizExtractionDocFlowService;
@Scheduled(cron = "0 0/1 * * * ?") @Scheduled(cron = "0 0/1 * * * ?")
public void extraction() throws Exception { public void extraction() throws Exception {
// 执行任务 // 执行任务
...@@ -100,6 +111,52 @@ public class ExtractionReviewScheduler { ...@@ -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
...@@ -247,7 +247,6 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy { ...@@ -247,7 +247,6 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy {
ArrayList<Item> items = new ArrayList<>(); ArrayList<Item> items = new ArrayList<>();
bizAiLawyerWritingTemplateDownloadEntityList = getValue((MotorVehicleDrivingComplaintEntity)dto, bizAiLawyerWritingTemplateDownloadEntityList); bizAiLawyerWritingTemplateDownloadEntityList = getValue((MotorVehicleDrivingComplaintEntity)dto, bizAiLawyerWritingTemplateDownloadEntityList);
for (BizAiLawyerWritingTemplateDownloadEntity bizAiLawyerWritingTemplateDownloadEntity : bizAiLawyerWritingTemplateDownloadEntityList) { for (BizAiLawyerWritingTemplateDownloadEntity bizAiLawyerWritingTemplateDownloadEntity : bizAiLawyerWritingTemplateDownloadEntityList) {
...@@ -259,50 +258,17 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy { ...@@ -259,50 +258,17 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy {
String[] split = bizAiLawyerWritingTemplateDownloadEntity.getOption().split(","); String[] split = bizAiLawyerWritingTemplateDownloadEntity.getOption().split(",");
item.setOptions(Arrays.asList(split)); item.setOptions(Arrays.asList(split));
} }
items.add(item);
} }
LegalFileResponse response= new LegalFileResponse(); LegalFileResponse response= new LegalFileResponse();
response.setItems(Lists.newArrayList()); response.setItems(items);
response.setFilePath(templateFileUrl); response.setFilePath(templateFileUrl);
LegalFileResult legalFileResult = legalService.legalFile(response); LegalFileResult legalFileResult = legalService.legalFile(response);
return legalFileResult.getFilePath(); return legalFileResult.getFilePath();
} }
public static void main(String[] args) throws Exception {
String ss = "{\"agent\": {\"agentName\": null, \"agentUnit\": null, \"hasAgentN\": null, \"hasAgentY\": null, \"agentPhone\": null, \"agentTitle\": null, \"agentAuthority\": null}, \"claim\": {\"otherFees\": \"1300\", \"nursingFee\": \"9150\", \"nursingDays\": \"15\", \"downtimeLoss\": \"\", \"hospitalName\": \"石城县某某医院\", \"nutritionFee\": \"450\", \"mealAllowance\": \"900\", \"vehicleDamage\": \"300\", \"funeralExpenses\": \"\", \"hasNursingProof\": \"有\", \"lostWagesAmount\": \"13345\", \"lostWagesPeriod\": [\"1681228800000\", \"1691596800000\"], \"medicalExpenses\": \"14693.85\", \"treatmentPeriod\": [\"1681228800000\", \"1682524800000\"], \"disabilityAidFee\": \"\", \"nursingLostWages\": \"\", \"totalClaimAmount\": \"136487\", \"deathCompensation\": \"\", \"hasNutritionProof\": \"有\", \"transportationFee\": \"540\", \"hasMedicalReceipts\": \"有\", \"otherPropertyDamage\": \"\", \"shortTermNursingFee\": \"\", \"hasMealAllowanceProof\": \"有\", \"disabilityCompensation\": \"91108\", \"dependentLivingExpenses\": \"\", \"hasTransportationReceipts\": \"有\", \"mentalAnguishCompensation\": \"5000\"}, \"defendant\": {\"defendantDob\": \"389462400000\", \"defendantName\": \"汤某\", \"defendantPhone\": \"\", \"defendantTitle\": \"\", \"defendantGender\": \"男\", \"defendantIdType\": \"\", \"defendantDomicile\": \"湖南省桃江县\", \"defendantIdNumber\": \"\", \"defendantWorkUnit\": \"\", \"defendantEthnicity\": \"汉族\", \"defendantHabitualResidence\": \"\"}, \"plaintiff\": {\"plaintiffDob\": \"-70531200000\", \"plaintiffName\": \"何某梅\", \"plaintiffPhone\": \"\", \"plaintiffTitle\": \"\", \"plaintiffGender\": \"女\", \"plaintiffIdType\": \"身份证\", \"plaintiffDomicile\": \"江西省赣州市石城县屏山镇万盛村坳头组28号\", \"plaintiffIdNumber\": \"36213719********\", \"plaintiffWorkUnit\": \"\", \"plaintiffEthnicity\": \"汉族\", \"plaintiffHabitualResidence\": \"\"}, \"thirdParty\": {\"thirdPartyDob\": null, \"thirdPartyName\": null, \"thirdPartyPhone\": null, \"thirdPartyTitle\": null, \"thirdPartyGender\": null, \"thirdPartyIdType\": null, \"thirdPartyDomicile\": null, \"thirdPartyIdNumber\": null, \"thirdPartyWorkUnit\": null, \"thirdPartyEthnicity\": null, \"thirdPartyHabitualResidence\": null}, \"defendantOrg\": {\"defendantOrgName\": null, \"defendantOrgType\": null, \"defendantOrgPhone\": null, \"defendantOrgAddress\": null, \"defendantOrgLegalRep\": null, \"defendantOrgRepTitle\": null, \"defendantOrgOwnership\": null, \"defendantOrgCreditCode\": null, \"defendantOrgOwnershipCheck\": null, \"defendantOrgRegisteredAddress\": null}, \"plaintiffOrg\": {\"plaintiffOrgName\": \"\", \"plaintiffOrgType\": \"\", \"plaintiffOrgPhone\": \"\", \"plaintiffOrgAddress\": \"\", \"plaintiffOrgLegalRep\": \"\", \"plaintiffOrgRepTitle\": \"\", \"plaintiffOrgOwnership\": \"\", \"plaintiffOrgCreditCode\": \"\", \"plaintiffOrgOwnershipCheck\": null, \"plaintiffOrgRegisteredAddress\": \"\"}, \"preservation\": {\"appraisalItems\": \"伤残等级、交通事故参与度\", \"preservationTime\": null, \"preservationCourt\": null, \"isPreservationDoneN\": null, \"isPreservationDoneY\": null, \"isAppraisalRequestedN\": null, \"isAppraisalRequestedY\": null, \"preservationCaseNumber\": null}, \"thirdPartyOrg\": {\"thirdPartyOrgType\": null, \"thirdPartyDomicile\": null, \"thirdPartyOrgPhone\": null, \"thirdPartyOrgAddress\": null, \"thirdPartyOrgLegalRep\": null, \"thirdPartyOrgRepTitle\": null, \"thirdPartyOrgOwnership\": null, \"thirdPartyOrgCreditCode\": null, \"thirdPartyOrgOwnershipCheck\": null, \"thirdPartyOrgRegisteredAddress\": null}, \"factsAndReasons\": {\"claimBasis\": \"\", \"evidenceList\": \"身份证、交通事故认定书、机动车行驶证复印件、交强险保单、商业险保单、出院记录、用药清单、住院费用发票、门诊费用发票、赣莲乡中心[2023]临鉴字第180号《司法鉴定意见书》\", \"accidentDetails\": \"2023年4月12日5时56分许,被告汤某驾驶赣BU****牌小型客车途经石城县**镇**路电信局门口路段时,与驾驶电动自行车的原告发生碰撞,造成原告受伤及电动自行车受损的交通事故\", \"insuranceStatus\": \"被告汤某驾驶的赣BU****小客车所有人为被告龚某仁。该车在被告某某公司处投保了交强险和200万第三者责任险,事故发生在保险责任期限内\", \"liabilityDetermination\": \"被告汤某负事故全部责任,原告无责\"}, \"understandsMediationBenefit\": {\"considersMediation\": \"\", \"understandsMediation\": \"\", \"understandsMediationBenefit1\": \"\", \"understandsMediationBenefit2\": \"\", \"understandsMediationBenefit3\": \"\", \"understandsMediationBenefit4\": \"\", \"understandsMediationBenefit5\": \"\"}}";
MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity = JsonUtils.deSerialize(ss, MotorVehicleDrivingComplaintEntity.class);
// MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity = new MotorVehicleDrivingComplaintEntity();
Plaintiff plaintiff = new Plaintiff();
plaintiff.setPlaintiffName("张三");
plaintiff.setPlaintiffGender("男");
motorVehicleDrivingComplaintEntity.setPlaintiff(plaintiff);
motorVehicleDrivingComplaintEntity.setPlaintiffOrg(new PlaintiffOrg());
motorVehicleDrivingComplaintEntity.setDefendant(new Defendant());
motorVehicleDrivingComplaintEntity.setDefendantOrg(new DefendantOrg());
motorVehicleDrivingComplaintEntity.setAgent(new Agent());
motorVehicleDrivingComplaintEntity.setThirdParty(new ThirdParty());
motorVehicleDrivingComplaintEntity.setThirdPartyOrg(new ThirdPartyOrg());
motorVehicleDrivingComplaintEntity.setClaim(new Claim());
motorVehicleDrivingComplaintEntity.setFactsAndReasons(new FactsAndReasons());
motorVehicleDrivingComplaintEntity.setPreservation(new Preservation());
motorVehicleDrivingComplaintEntity.setUnderstandsMediationBenefit(new UnderstandsMediationBenefit());
System.out.println(JsonUtils.serialize(motorVehicleDrivingComplaintEntity));;
}
public static void main1(String[] args) {
String ss="{\"plaintiff\":{\"plaintiffName\":\"张三\",\"plaintiffGender\":\"男\",\"plaintiffDob\":null,\"plaintiffEthnicity\":null,\"plaintiffWorkUnit\":null,\"plaintiffTitle\":null,\"plaintiffPhone\":null,\"plaintiffDomicile\":null,\"plaintiffHabitualResidence\":null,\"plaintiffIdType\":null,\"plaintiffIdNumber\":null},\"plaintiffOrg\":{\"plaintiffOrgName\":null,\"plaintiffOrgAddress\":null,\"plaintiffOrgRegisteredAddress\":null,\"plaintiffOrgLegalRep\":null,\"plaintiffOrgRepTitle\":null,\"plaintiffOrgPhone\":null,\"plaintiffOrgCreditCode\":null,\"plaintiffOrgType\":null,\"plaintiffOrgOwnershipCheck\":null,\"plaintiffOrgOwnership\":null},\"defendant\":{\"defendantName\":null,\"defendantGender\":null,\"defendantDob\":null,\"defendantEthnicity\":null,\"defendantWorkUnit\":null,\"defendantTitle\":null,\"defendantPhone\":null,\"defendantDomicile\":null,\"defendantHabitualResidence\":null,\"defendantIdType\":null,\"defendantIdNumber\":null},\"defendantOrg\":{\"defendantOrgName\":null,\"defendantOrgAddress\":null,\"defendantOrgRegisteredAddress\":null,\"defendantOrgLegalRep\":null,\"defendantOrgRepTitle\":null,\"defendantOrgPhone\":null,\"defendantOrgCreditCode\":null,\"defendantOrgType\":null,\"defendantOrgOwnershipCheck\":null,\"defendantOrgOwnership\":null},\"agent\":{\"hasAgentY\":null,\"agentName\":null,\"agentUnit\":null,\"agentTitle\":null,\"agentPhone\":null,\"agentAuthority\":null,\"hasAgentN\":null},\"thirdParty\":{\"thirdPartyName\":null,\"thirdPartyGender\":null,\"thirdPartyDob\":null,\"thirdPartyEthnicity\":null,\"thirdPartyWorkUnit\":null,\"thirdPartyTitle\":null,\"thirdPartyPhone\":null,\"thirdPartyDomicile\":null,\"thirdPartyHabitualResidence\":null,\"thirdPartyIdType\":null,\"thirdPartyIdNumber\":null},\"thirdPartyOrg\":{\"thirdPartyOrgAddress\":null,\"thirdPartyOrgRegisteredAddress\":null,\"thirdPartyOrgLegalRep\":null,\"thirdPartyOrgRepTitle\":null,\"thirdPartyOrgPhone\":null,\"thirdPartyOrgCreditCode\":null,\"thirdPartyOrgType\":null,\"thirdPartyDomicile\":null,\"thirdPartyOrgOwnershipCheck\":null,\"thirdPartyOrgOwnership\":null},\"claim\":{\"treatmentPeriod\":null,\"hospitalName\":null,\"medicalExpenses\":null,\"hasMedicalReceipts\":null,\"nursingDays\":null,\"nursingFee\":null,\"nursingLostWages\":null,\"shortTermNursingFee\":null,\"hasNursingProof\":null,\"nutritionFee\":null,\"hasNutritionProof\":null,\"mealAllowance\":null,\"hasMealAllowanceProof\":null,\"lostWagesPeriod\":null,\"lostWagesAmount\":null,\"transportationFee\":null,\"hasTransportationReceipts\":null,\"disabilityCompensation\":null,\"dependentLivingExpenses\":null,\"disabilityAidFee\":null,\"deathCompensation\":null,\"funeralExpenses\":null,\"mentalAnguishCompensation\":null,\"vehicleDamage\":null,\"downtimeLoss\":null,\"otherPropertyDamage\":null,\"otherFees\":null,\"totalClaimAmount\":null},\"factsAndReasons\":{\"accidentDetails\":null,\"liabilityDetermination\":null,\"insuranceStatus\":null,\"claimBasis\":null,\"evidenceList\":null},\"preservation\":{\"isPreservationDoneY\":null,\"preservationCourt\":null,\"preservationTime\":null,\"preservationCaseNumber\":null,\"isPreservationDoneN\":null,\"isAppraisalRequestedY\":null,\"appraisalItems\":null,\"isAppraisalRequestedN\":null},\"understandsMediationBenefit\":{\"understandsMediation\":null,\"understandsMediationBenefit1\":null,\"understandsMediationBenefit2\":null,\"understandsMediationBenefit3\":null,\"understandsMediationBenefit4\":null,\"understandsMediationBenefit5\":null,\"considersMediation\":null}}";
MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity = JsonUtils.deSerialize(ss, MotorVehicleDrivingComplaintEntity.class);
}
public static List<BizAiLawyerWritingTemplateDownloadEntity> getValue( MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity, List<BizAiLawyerWritingTemplateDownloadEntity> bizAiLawyerWritingTemplateDownloadEntityList) throws Exception { public static List<BizAiLawyerWritingTemplateDownloadEntity> getValue( MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity, List<BizAiLawyerWritingTemplateDownloadEntity> bizAiLawyerWritingTemplateDownloadEntityList) throws Exception {
// MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity = (MotorVehicleDrivingComplaintEntity) dto; // MotorVehicleDrivingComplaintEntity motorVehicleDrivingComplaintEntity = (MotorVehicleDrivingComplaintEntity) dto;
...@@ -320,6 +286,7 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy { ...@@ -320,6 +286,7 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy {
} }
for (BizAiLawyerWritingTemplateDownloadEntity testEntity : bizAiLawyerWritingTemplateDownloadEntityList) { for (BizAiLawyerWritingTemplateDownloadEntity testEntity : bizAiLawyerWritingTemplateDownloadEntityList) {
if("checkbox".equals(testEntity.getType())){
try { try {
// 获取TestEntity中指定的类名 // 获取TestEntity中指定的类名
String targetEntityClass = testEntity.getEntityClass(); String targetEntityClass = testEntity.getEntityClass();
...@@ -334,21 +301,41 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy { ...@@ -334,21 +301,41 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy {
// 构造getter方法名 // 构造getter方法名
String getterName = "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); String getterName = "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
// 调用getter方法获取值 // 调用getter方法获取值
Method getterMethod = sourceClass.getMethod(getterName); Method getterMethod = sourceClass.getMethod(getterName);
Object fieldValue = getterMethod.invoke(sourceEntity); Object fieldValue = getterMethod.invoke(sourceEntity);
System.out.println("属性 " + fieldName + " 的值为: " + fieldValue); System.out.println("属性 " + fieldName + " 的值为: " + fieldValue);
testEntity.setValue((String)fieldValue); testEntity.setValue((String)fieldValue);
}
} catch (Exception e) {
e.printStackTrace();
}
}else if("text".equals(testEntity.getType())){
try {
// 获取TestEntity中指定的类名
String targetEntityClass = testEntity.getEntityClass();
// 根据entityClass找到对应的实体对象
Object sourceEntity = findEntityObject(targetEntityClass, entityMap);
if (sourceEntity != null) {
// 获取属性值
Class<?> sourceClass = sourceEntity.getClass();
String fieldName = testEntity.getName();
// return fieldValue.toString(); // 构造getter方法名
String getterName = "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
// 调用getter方法获取值
Method getterMethod = sourceClass.getMethod(getterName);
Object fieldValue = getterMethod.invoke(sourceEntity);
System.out.println("属性 " + fieldName + " 的值为: " + fieldValue);
testEntity.setValue(fieldValue==null?" ":(String)fieldValue);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
return bizAiLawyerWritingTemplateDownloadEntityList; return bizAiLawyerWritingTemplateDownloadEntityList;
} }
...@@ -362,16 +349,6 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy { ...@@ -362,16 +349,6 @@ public class MotorVehicleDrivingComplaintType implements ExtractEntityStrategy {
return entityMap.get(propertyName); return entityMap.get(propertyName);
} }
private MotorVehicleDrivingComplaintItem builderText(String boxName, String[] boxValue) {
MotorVehicleDrivingComplaintItem motorVehicleDrivingComplaintItem = new MotorVehicleDrivingComplaintItem();
motorVehicleDrivingComplaintItem.setKey(boxName);
motorVehicleDrivingComplaintItem.setValue(boxValue);
motorVehicleDrivingComplaintItem.setType("text");
motorVehicleDrivingComplaintItem.setOptions(null);
return motorVehicleDrivingComplaintItem;
}
private Plaintiff extractPlaintiff(String input) throws Exception { private Plaintiff extractPlaintiff(String input) throws Exception {
// 获取对话提示词 // 获取对话提示词
......
...@@ -9,6 +9,7 @@ import cn.com.poc.ai_dialogues.service.BizAiDialoguesService; ...@@ -9,6 +9,7 @@ import cn.com.poc.ai_dialogues.service.BizAiDialoguesService;
import cn.com.poc.common.constant.CommonConstant; import cn.com.poc.common.constant.CommonConstant;
import cn.com.poc.law.dto.TemplateCallDto; import cn.com.poc.law.dto.TemplateCallDto;
import cn.com.poc.law.dto.TemplateDataDetailDto; 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.ExtractEntityStrategy;
import cn.com.poc.law.extractEntityStrategy.LawyerExtractTypeConstants; import cn.com.poc.law.extractEntityStrategy.LawyerExtractTypeConstants;
import cn.com.poc.law.extractEntityStrategy.LawyerTemplateExtractServiceBuilder; import cn.com.poc.law.extractEntityStrategy.LawyerTemplateExtractServiceBuilder;
...@@ -154,9 +155,9 @@ public class BizAiLawyerWritingTemplateDataServiceImpl extends BaseServiceImpl ...@@ -154,9 +155,9 @@ public class BizAiLawyerWritingTemplateDataServiceImpl extends BaseServiceImpl
} }
ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(models.get(0).getBizAiLawyerWritingTemplateCode())); ExtractEntityStrategy extractEntityStrategy = LawyerTemplateExtractServiceBuilder.getService(LawyerExtractTypeConstants.LawyerExtractTypeEnum.get(models.get(0).getBizAiLawyerWritingTemplateCode()));
JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class); 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 "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(); return extractEntityStrategy.downloadFile(legalTemplateDto);
// return extractEntityStrategy.downloadFile(JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class)); // return extractEntityStrategy.downloadFile(JsonUtils.deSerialize(models.get(0).getBizAiLawyerWritingTemplateData(), LegalTemplateDto.class));
} }
......
package cn.com.poc.thirdparty.resource.demand.ai.entity.legal; package cn.com.poc.thirdparty.resource.demand.ai.entity.legal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -35,7 +36,7 @@ public class Item { ...@@ -35,7 +36,7 @@ public class Item {
* <p> * <p>
* 当替换值中存在 “是” 时,则在生成的合同中勾选 “是”,否则不勾选。 * 当替换值中存在 “是” 时,则在生成的合同中勾选 “是”,否则不勾选。
*/ */
private List<String> options; private List<String> options = new ArrayList<>();
public String getKey() { public String getKey() {
return key; return key;
......
...@@ -7,16 +7,28 @@ package cn.com.poc.thirdparty.resource.text_in.api; ...@@ -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.DocumentLoad;
import cn.com.poc.common.utils.JsonUtils; 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.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.extraction.entity.*;
import cn.com.poc.thirdparty.resource.text_in.entity.imageEdgeTriming.ImageEdgeTrimingResult; import cn.com.poc.thirdparty.resource.text_in.entity.imageEdgeTriming.ImageEdgeTrimingResult;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import cn.hutool.core.net.url.UrlBuilder;
import com.alibaba.fastjson.JSONObject; 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.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder; import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
...@@ -29,12 +41,15 @@ import java.util.Base64; ...@@ -29,12 +41,15 @@ import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
public class TextInClient { public class TextInClient {
private Logger logger = LoggerFactory.getLogger(TextInClient.class); private Logger logger = LoggerFactory.getLogger(TextInClient.class);
private final String appId = "145b4303badd1da2f1628cf28534967a"; private final String appId = "145b4303badd1da2f1628cf28534967a";
private final String secretCode = "5fe7d03b56714ec708f4ec6149d3a20c"; private final String secretCode = "5fe7d03b56714ec708f4ec6149d3a20c";
private final String appId_for_docFlow = "dafd04a574230c00ccba61132160de0c";
private final String secretCode_for_docFlow = "3bc03c7e6f9402963e6e71d16d786a9c";
public TextInClient() { public TextInClient() {
} }
...@@ -319,4 +334,82 @@ public class TextInClient { ...@@ -319,4 +334,82 @@ public class TextInClient {
return result; 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