fix: 金蝶附件同步失败转成功时显式置空失败原因,修复updateById忽略null字段导致历史失败原因残留

This commit is contained in:
刘泉佳
2026-09-27 22:38:14 +08:00
parent a3f1e07b2f
commit 4e2f565d2f
@@ -179,7 +179,10 @@ public class KingdeeAttachmentSyncSupport {
if (record.getId() == null) {
attachmentSyncMapper.insert(record);
} else {
attachmentSyncMapper.updateById(record);
// updateById 默认忽略 null 字段,失败转成功时 fail_reason 须显式置空,避免残留历史失败原因
attachmentSyncMapper.update(record, Wrappers.<KingdeeAttachmentSync>lambdaUpdate()
.eq(KingdeeAttachmentSync::getId, record.getId())
.set(KingdeeAttachmentSync::getFailReason, record.getFailReason()));
}
}
int total = success + failReasons.size();