feat: 收款认领本地化,认领完成才推金蝶——A301-3定时+手动双入口按流水归集推送

- 认领只落本地:claim() 删除事务内同步推送,认领上限/认领完成口径改为公告未认领金额
- 推送闸门:认领完成且未推送过才可推;推送前重查A301-2最新公告对账,不一致拦截并提示差额
- 按流水归集:一条流水一张金蝶收款单,分录取全部有效分摊行;awrp_src_code 上移至流水、重试复用防重试双单
- 已推送终态闸门禁止二次推送;推送失败落 push_status/push_fail_reason 可重试,本地认领不回滚
- 定时任务 ReceiptClaimPushTask(thirdParty.bfi.receiptClaimPush.*,按认领人分组重查公告)+ 手动按钮 POST /receipt-flow/push-kingdee
- A301-1 回写轮询对象改流水并级联刷新认领主单冗余字段;作废仍不触发推送
- 认领链路批量化:结算单锁行/认领额聚合/汇总刷新改 IN 批量,候选单列表消除每页200次N+1,同步留痕 Db.saveBatch
This commit is contained in:
刘泉佳
2026-09-29 01:02:54 +08:00
parent 98614a25cc
commit 2e91e112ff
12 changed files with 645 additions and 151 deletions
@@ -0,0 +1,70 @@
/**
* 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
* is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for their own commercial purposes.
* <p>
* Using this software signifies agreement to this license agreement and terms of use,
* and you expressly agree to be bound by the terms of use of this software.
* <p>
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 收款认领推送金蝶结果(A301-3)
* <p>
* 推送失败不抛异常跨事务边界(保证失败状态落库不被回滚),以本结果对象向调用方报告成败与原因。
*
* @author Chill
*/
@Data
@Schema(description = "收款认领推送金蝶结果")
public class ReceiptClaimPushResult implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "是否推送成功")
private boolean success;
@Schema(description = "金蝶收款单号(成功时返回,可能为空:金蝶响应未返回单号)")
private String kingdeeBillNo;
@Schema(description = "失败原因(成功时为空)")
private String message;
public static ReceiptClaimPushResult success(String kingdeeBillNo) {
ReceiptClaimPushResult result = new ReceiptClaimPushResult();
result.setSuccess(true);
result.setKingdeeBillNo(kingdeeBillNo);
return result;
}
public static ReceiptClaimPushResult fail(String message) {
ReceiptClaimPushResult result = new ReceiptClaimPushResult();
result.setSuccess(false);
result.setMessage(message);
return result;
}
}
@@ -121,9 +121,33 @@ public class KingdeeReceiptFlow extends TenantEntity {
*/
private BigDecimal claimedAmount;
/**
* 认领状态(0未认领/1部分认领/2已认领,本地认领驱动)
* 认领状态(unclaimed未认领/partial部分认领/claimed认领完成,累计认领与公告未认领金额对表)
*/
private String claimStatus;
/**
* 推送状态(none未推送/pushed已推送/failed推送失败;已推送为终态闸门,不允许二次推送)
*/
private String pushStatus;
/**
* 最近一次推送失败原因(成功后清空)
*/
private String pushFailReason;
/**
* 首次推送金蝶成功时间
*/
private LocalDateTime pushedTime;
/**
* 金蝶推送来源单据编码(SKCL+时间戳+流水id尾号6位,按流水生成、重试复用,A301-1 回写匹配键)
*/
private String awrpSrcCode;
/**
* 金蝶收款单号(推送响应回填 / A301-1 回写推进)
*/
private String kingdeeBillNo;
/**
* 金蝶回写状态(none未推送/pushed已推送/approved审核通过/received已收款/failed失败)
*/
private String kingdeeBillStatus;
/**
* 来源更新时间(取交易日期,同步时刷新)
*/
@@ -66,10 +66,12 @@ public class ReceiptClaim extends TenantEntity {
private String remark;
private String claimStatus;
/**
* 金蝶认领结果推送来源单据编码(A301-3 awrp_src_code,A301-1 回写按此匹配)
* 金蝶收款单号(冗余展示:推送成功/A301-1 回写时由流水级联刷新)
*/
private String awrpSrcCode;
private String kingdeeBillNo;
/**
* 金蝶回写状态(冗余展示:与流水 kingdee_bill_status 同步刷新)
*/
private String kingdeeBillStatus;
@JsonSerialize(using = ToStringSerializer.class)
private Long voidedBy;
@@ -58,6 +58,10 @@ public class ReceiptFlowVO extends KingdeeReceiptFlow {
@TableField(exist = false)
private String kingdeeClaimStatusName;
@TableField(exist = false)
private String pushStatusName;
@TableField(exist = false)
private String kingdeeBillStatusName;
@TableField(exist = false)
private BigDecimal remainingAmount;
@TableField(exist = false)
private String createUserName;