✨ 收票单推送金蝶全链路(A303-2保存+A302-6指定应付+A801-3回写)与金蝶票池实时游标分页重构,下线镜像分页与定时绑定任务

This commit is contained in:
刘泉佳
2026-09-23 10:15:36 +08:00
parent 4de9534eba
commit 562127232b
25 changed files with 1187 additions and 962 deletions
@@ -42,7 +42,6 @@ import java.util.List;
public class InvoiceReceiptSaveRequest implements Serializable {
@Serial private static final long serialVersionUID = 1L;
private Long id;
private Long kingdeeInvoicePoolId;
private String invoiceNo;
private LocalDate invoiceDate;
private String invoiceType;
@@ -32,12 +32,12 @@ import java.io.Serial;
import java.io.Serializable;
/**
* 金蝶票据池镜像统一查询条件(收票登记选票与正式结算单认领共用)
* 金蝶票池实时统一查询条件(收票登记选票与正式结算单认领共用)
*
* @author Chill
*/
@Data
@Schema(description = "金蝶票据池镜像统一查询条件")
@Schema(description = "金蝶票池实时统一查询条件")
public class KingdeeInvoicePoolQueryDTO implements Serializable {
@Serial
@@ -74,21 +74,9 @@ public class KingdeeInvoicePoolQueryDTO implements Serializable {
private String invoiceDateEnd;
/**
* 开票单位(销方名称),模糊
* 发票类型编码(票易通字典,如 26/27)
*/
@Schema(description = "开票单位(销方名称,模糊)")
private String salerName;
/**
* 受票单位(购方名称),模糊
*/
@Schema(description = "受票单位(购方名称,模糊)")
private String buyerName;
/**
* 发票类型名称,模糊(镜像存中文名)
*/
@Schema(description = "发票类型名称(模糊)")
@Schema(description = "发票类型编码(票易通字典,如 26/27)")
private String invoiceType;
/**
@@ -104,14 +92,8 @@ public class KingdeeInvoicePoolQueryDTO implements Serializable {
private String buyerTaxNo;
/**
* 认领过滤:true 仅已认领,false 仅未认领,null 不过滤(已认领=存在正式结算单发票行)
* 单据使用状态[1未用,30在用,60已用,65已入账],空不限(A801-1 原生条件)
*/
@Schema(description = "认领过滤:true已认领/false未认领/null不限")
private Boolean claimed;
/**
* 登记过滤:true 仅已登记,false 仅未登记,null 不过滤(已登记=存在非作废收票登记)
*/
@Schema(description = "登记过滤:true已登记/false未登记/null不限")
private Boolean registered;
@Schema(description = "单据使用状态[1未用,30在用,60已用,65已入账]")
private String expenseStatus;
}
@@ -36,6 +36,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 收票登记实体类
@@ -151,10 +152,26 @@ public class InvoiceReceipt extends TenantEntity {
* 金蝶单据号(绑定票池后取发票流水号 serialNo)
*/
private String kingdeeBillNo;
/**
* 金蝶收票单单据编号(A303-2 批量保存生成/幂等预检命中回填)
*/
private String kingdeeReceivedInvoiceNo;
/**
* 金蝶同步状态(unsynced 未同步 / synced 已同步 / failed 同步失败)
*/
private String kingdeeStatus;
/**
* 收票单推送状态(unsynced 未推送 / pushed 已保存收票单 / assigned 已指定应付 / failed 推送失败)
*/
private String kingdeePushStatus;
/**
* 收票单推送失败原因(金蝶侧删除/红冲/查验不通过等异常提示人工)
*/
private String kingdeePushMsg;
/**
* 最近一次收票单推送/回写时间
*/
private LocalDateTime kingdeePushTime;
/**
* 附件信息JSON
*/
@@ -63,6 +63,10 @@ public class KingdeeInvoicePool extends TenantEntity {
* 发票类型(票易通编码转名称后落库,如「数电发票(增值税专用发票)」)
*/
private String invoiceType;
/**
* 票易通原始发票类型编码(A801-1 invoiceType,如 26/27,A303-2 invoicetypef7_number 取数)
*/
private String invoiceTypeCode;
/**
* 税率(百分数,13 表示 13%)
*/
@@ -131,6 +135,10 @@ public class KingdeeInvoicePool extends TenantEntity {
* 附件信息JSON(结构 {"source":"piaozone","path":"A801-2下载path","name":"文件名"})
*/
private String attachmentsJson;
/**
* A801-1 发票明细行JSON(BfiInvoicePoolItemVO 列表,A303-2 收票单分录取数来源)
*/
private String itemsJson;
/**
* 票池数据更新时间(A801-1 billCreateTime,镜像排序字段)
*/
@@ -49,6 +49,7 @@ public class InvoiceReceiptVO extends InvoiceReceipt {
@TableField(exist = false) private String settlementNos;
@TableField(exist = false) private String approvalStatusName;
@TableField(exist = false) private String kingdeeStatusName;
@TableField(exist = false) private String kingdeePushStatusName;
@TableField(exist = false) private String createUserName;
@TableField(exist = false) private String updateUserName;
@TableField(exist = false) private List<InvoiceReceiptSettlement> settlements;
@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 金蝶票池实时查询游标分页返回体(A801-1 无总数:hasMore 驱动上一页/下一页)
*
* @author Chill
*/
@Data
@Schema(description = "金蝶票池游标分页返回体")
public class KingdeeInvoicePoolPageVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 本页数据(金蝶实时行 + 本地认领/登记装饰标记) */
@Schema(description = "本页数据")
private List<KingdeeInvoicePoolVO> records;
/** 当前页码,从 1 开始 */
@Schema(description = "当前页码")
private Long current;
/** 每页条数 */
@Schema(description = "每页条数")
private Long size;
/** 是否还有下一页(服务端多取 1 条探测) */
@Schema(description = "是否还有下一页")
private Boolean hasMore;
}
@@ -46,7 +46,7 @@ public class KingdeeInvoicePoolVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** 镜像主键,收票登记保存绑定用(kingdeeInvoicePoolId) */
/** 镜像主键,仅已入镜像(已登记)的票非空 */
@Schema(description = "镜像主键")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@@ -143,11 +143,11 @@ public class KingdeeInvoicePoolVO implements Serializable {
@Schema(description = "默认认领金额")
private BigDecimal matchedAmount;
/** 是否已被正式结算单认领 */
/** 是否已被正式结算单认领(实时查询返回行的本地装饰标记,仅展示不作过滤) */
@Schema(description = "是否已认领")
private Boolean claimed;
/** 是否已存在非作废收票登记 */
/** 是否已存在非作废收票登记(实时查询返回行的本地装饰标记,仅展示不作过滤) */
@Schema(description = "是否已登记")
private Boolean registered;
}