fix: 修复中介导入成功条数计算错误

问题:
- 导入成功条数显示为负数
- 原因:成功数量计算使用 validRecords.size() - failures.size()
- 但没有使用实际的数据库操作返回值

修复:
- saveBatchWithUpsert 和 saveBatch 方法现在返回 int
- 累加实际的数据库影响行数
- 使用 actualSuccessCount 变量跟踪真实成功数量

影响范围:
- CcdiIntermediaryPersonImportServiceImpl
- CcdiIntermediaryEntityImportServiceImpl
This commit is contained in:
wkc
2026-02-08 17:18:18 +08:00
parent bb0d68c41d
commit 5ec5913759
2058 changed files with 234134 additions and 269 deletions

View File

@@ -0,0 +1,73 @@
"use strict";
var initBuffer = require("./init-buffer");
if (!Buffer.prototype.indexOf) {
Buffer.prototype.indexOf = function (value, offset) {
offset = offset || 0;
// Always wrap the input as a Buffer so that this method will support any
// data type such as array octet, string or buffer.
if (typeof value === "string" || value instanceof String) {
value = initBuffer(value);
} else if (typeof value === "number" || value instanceof Number) {
value = initBuffer([ value ]);
}
var len = value.length;
for (var i = offset; i <= this.length - len; i++) {
var mismatch = false;
for (var j = 0; j < len; j++) {
if (this[i + j] != value[j]) {
mismatch = true;
break;
}
}
if (!mismatch) {
return i;
}
}
return -1;
};
}
function bufferLastIndexOf (value, offset) {
// Always wrap the input as a Buffer so that this method will support any
// data type such as array octet, string or buffer.
if (typeof value === "string" || value instanceof String) {
value = initBuffer(value);
} else if (typeof value === "number" || value instanceof Number) {
value = initBuffer([ value ]);
}
var len = value.length;
offset = offset || this.length - len;
for (var i = offset; i >= 0; i--) {
var mismatch = false;
for (var j = 0; j < len; j++) {
if (this[i + j] != value[j]) {
mismatch = true;
break;
}
}
if (!mismatch) {
return i;
}
}
return -1;
}
if (Buffer.prototype.lastIndexOf) {
// check Buffer#lastIndexOf is usable: https://github.com/nodejs/node/issues/4604
if (initBuffer("ABC").lastIndexOf ("ABC") === -1)
Buffer.prototype.lastIndexOf = bufferLastIndexOf;
} else {
Buffer.prototype.lastIndexOf = bufferLastIndexOf;
}