fix: 付款申请批量同步失败提示改用付款申请单号
批量同步失败提示原为付款申请雪花id,用户无法对应单据;改为从同步上下文取付款申请单号(doSyncKingdee 已加载实体,无额外查库),取不到时退回id。
This commit is contained in:
+2
-2
@@ -46,11 +46,11 @@ public record KingdeeSyncContext(Map<Long, ContractManage> contractCache,
|
||||
Map<Long, List<FormalSettlementDetail>> settlementDetailCache,
|
||||
Map<Long, FormalSettlement> settlementCache,
|
||||
Map<Long, CustomerReceiptAccount> receiptAccountCache,
|
||||
Map<String, String> feeCategoryByName) {
|
||||
Map<String, String> feeCategoryByName, Map<Long, String> paymentNoCache) {
|
||||
|
||||
/** 空上下文:缓存可写但初始为空,首条记录命中后全批复用 */
|
||||
public static KingdeeSyncContext empty() {
|
||||
return new KingdeeSyncContext(new HashMap<>(), new HashMap<>(), new HashMap<>(),
|
||||
new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>());
|
||||
new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>());
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -548,6 +548,8 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String doSyncKingdee(Long id, KingdeeSyncContext context) {
|
||||
PaymentApplication entity = lockedPayment(id);
|
||||
// 单据号入上下文:批量同步失败提示用单号定位单据(雪花id用户无法对应),不再额外查库
|
||||
context.paymentNoCache().put(id, entity.getPaymentNo());
|
||||
if (!TransportBusiConstant.APPROVED.equals(entity.getApprovalStatus())) throw new ServiceException("仅审批通过的付款申请允许生成金蝶单据");
|
||||
if (KingdeeBfiConstant.KINGDEE_STATUS_SYNCED.equals(entity.getKingdeeStatus())
|
||||
|| KingdeeBfiConstant.KINGDEE_STATUS_PAYING.equals(entity.getKingdeeStatus())
|
||||
@@ -750,7 +752,10 @@ public class PaymentApplicationServiceImpl extends BaseServiceImpl<PaymentApplic
|
||||
// 经自代理逐条调用:单据级事务,单条失败仅回滚自身且不中断整批
|
||||
result.add(self.syncKingdee(id, context));
|
||||
} catch (Exception exception) {
|
||||
result.add("付款申请[" + id + "]同步失败:" + exception.getMessage());
|
||||
// 失败提示用付款申请单号定位单据:单号已在推送时随上下文缓存,无需回查
|
||||
String paymentNo = context.paymentNoCache().get(id);
|
||||
String billNo = Func.isBlank(paymentNo) ? String.valueOf(id) : paymentNo;
|
||||
result.add("付款申请[" + billNo + "]同步失败:" + exception.getMessage());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user