fix: 修正金蝶解锁回调单号定位并新增解锁终态页面标识

- 回调方向与锁定相反:按金蝶单号+我方单号双条件反查最新locked锁记录(targetBillType回调为空不参与匹配)
- 回调处理批量化:一次IN查询+updateBatchById批量落库,消除逐张查询/更新N+1
- 新增KingdeeUnlockMark展示契约与fillUnlockMarks通用填充,付款申请/结算单/开票申请VO回填解锁时间、操作人、动作名称
- 更新金蝶单据锁定与解锁业务流程文档(回调方向、解锁后数据变化、事务语义、联调实测结论)
This commit is contained in:
刘泉佳
2026-10-15 11:29:11 +08:00
parent f5a7b76205
commit f23e24e808
10 changed files with 233 additions and 47 deletions
@@ -24,6 +24,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -33,7 +34,7 @@ import java.util.List;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class FormalSettlementVO extends FormalSettlement {
public class FormalSettlementVO extends FormalSettlement implements KingdeeUnlockMark {
@Serial private static final long serialVersionUID = 1L;
@TableField(exist = false) @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate createStartDate;
@TableField(exist = false) @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate createEndDate;
@@ -50,6 +51,12 @@ public class FormalSettlementVO extends FormalSettlement {
private String kingdeeLockFailReason;
@TableField(exist = false) @Schema(description = "金蝶锁重试次数(达上限5后不再自动补偿,需重推同步金蝶)")
private Integer kingdeeTryCount;
@TableField(exist = false) @Schema(description = "金蝶解锁时间(非空代表该单曾被金蝶解锁/删单)")
private LocalDateTime kingdeeUnlockTime;
@TableField(exist = false) @Schema(description = "金蝶侧解锁操作人(回调报文 operator)")
private String kingdeeUnlockOperator;
@TableField(exist = false) @Schema(description = "解锁动作名称:金蝶删单/金蝶解锁")
private String kingdeeUnlockOperationName;
@TableField(exist = false) private String preSettlementNos;
@TableField(exist = false) private String preSettlementNo;
@TableField(exist = false) private List<FormalSettlementSource> sources;
@@ -35,6 +35,7 @@ import org.springblade.transport.pojo.entity.InvoiceApplicationRecord;
import org.springblade.transport.pojo.entity.InvoiceApplicationSettlement;
import java.io.Serial;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -44,7 +45,7 @@ import java.util.List;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class InvoiceApplicationVO extends InvoiceApplication {
public class InvoiceApplicationVO extends InvoiceApplication implements KingdeeUnlockMark {
@Serial private static final long serialVersionUID = 1L;
@TableField(exist = false) private String settlementNos;
@TableField(exist = false) private String approvalStatusName;
@@ -55,6 +56,12 @@ public class InvoiceApplicationVO extends InvoiceApplication {
@TableField(exist = false) private String kingdeeLockStatus;
@TableField(exist = false) private String kingdeeLockFailReason;
@TableField(exist = false) private Integer kingdeeTryCount;
/** 金蝶解锁终态标识(unlocked 锁记录回填):解锁时间非空即代表该单曾被金蝶解锁/删单 */
@TableField(exist = false) private LocalDateTime kingdeeUnlockTime;
/** 金蝶侧解锁操作人(回调报文 operator) */
@TableField(exist = false) private String kingdeeUnlockOperator;
/** 解锁动作名称:金蝶删单/金蝶解锁 */
@TableField(exist = false) private String kingdeeUnlockOperationName;
@TableField(exist = false) private String createUserName;
@TableField(exist = false) private List<InvoiceApplicationSettlement> settlements;
@TableField(exist = false) private List<InvoiceApplicationSheetVO> sheets;
@@ -0,0 +1,36 @@
/**
* 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>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import java.time.LocalDateTime;
/**
* 金蝶解锁终态标识展示契约:需在页面展示「金蝶删单/解锁」标识的 VO 实现之,
* 由 {@code KingdeeBillLockService#fillUnlockMarks} 统一回填(列表/详情共用)
*
* @author Chill
*/
public interface KingdeeUnlockMark {
/**
* 金蝶解锁时间(unlocked 锁记录回填),非空即代表该单曾被金蝶解锁/删单
*/
void setKingdeeUnlockTime(LocalDateTime kingdeeUnlockTime);
/**
* 金蝶侧解锁操作人(回调报文 operator)
*/
void setKingdeeUnlockOperator(String kingdeeUnlockOperator);
/**
* 解锁动作名称:金蝶删单/金蝶解锁
*/
void setKingdeeUnlockOperationName(String kingdeeUnlockOperationName);
}
@@ -29,12 +29,13 @@ import org.springblade.transport.pojo.entity.PaymentApplicationSettlement;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/** 付款申请视图。 @author Chill */
@Data
@EqualsAndHashCode(callSuper = true)
public class PaymentApplicationVO extends PaymentApplication {
public class PaymentApplicationVO extends PaymentApplication implements KingdeeUnlockMark {
@Serial private static final long serialVersionUID = 1L;
@TableField(exist = false) private LocalDate applyStartDate;
@TableField(exist = false) private LocalDate applyEndDate;
@@ -49,6 +50,12 @@ public class PaymentApplicationVO extends PaymentApplication {
@TableField(exist = false) private String kingdeeLockStatus;
@TableField(exist = false) private String kingdeeLockFailReason;
@TableField(exist = false) private Integer kingdeeTryCount;
/** 金蝶解锁终态标识(unlocked 锁记录回填):解锁时间非空即代表该单曾被金蝶解锁/删单,供页面展示明显标识 */
@TableField(exist = false) private LocalDateTime kingdeeUnlockTime;
/** 金蝶侧解锁操作人(回调报文 operator) */
@TableField(exist = false) private String kingdeeUnlockOperator;
/** 解锁动作名称:金蝶删单/金蝶解锁 */
@TableField(exist = false) private String kingdeeUnlockOperationName;
@TableField(exist = false) private List<PaymentApplicationInvoice> invoices;
@TableField(exist = false) private List<PaymentApplicationRecord> paymentRecords;
@TableField(exist = false) private List<PaymentApplicationSettlement> settlements;