fix: 修复中介导入成功条数计算错误
问题: - 导入成功条数显示为负数 - 原因:成功数量计算使用 validRecords.size() - failures.size() - 但没有使用实际的数据库操作返回值 修复: - saveBatchWithUpsert 和 saveBatch 方法现在返回 int - 累加实际的数据库影响行数 - 使用 actualSuccessCount 变量跟踪真实成功数量 影响范围: - CcdiIntermediaryPersonImportServiceImpl - CcdiIntermediaryEntityImportServiceImpl
This commit is contained in:
33
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/.eslintrc
generated
vendored
Normal file
33
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"rules": {
|
||||
"indent": [
|
||||
2,
|
||||
4,
|
||||
{ "SwitchCase": 1 }
|
||||
],
|
||||
"quotes": [
|
||||
2,
|
||||
"double"
|
||||
],
|
||||
"linebreak-style": [
|
||||
2,
|
||||
"unix"
|
||||
],
|
||||
"semi": [
|
||||
2,
|
||||
"always"
|
||||
],
|
||||
"no-console": [
|
||||
0
|
||||
],
|
||||
"no-trailing-spaces":
|
||||
[
|
||||
2
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"mocha": true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
||||
17
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/.travis.yml
generated
vendored
Normal file
17
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "1.0"
|
||||
- "1.8"
|
||||
- "2.0"
|
||||
- "2.5"
|
||||
- "3.0"
|
||||
- "3.3"
|
||||
- "4.0"
|
||||
- "4.2"
|
||||
- "5.0"
|
||||
- "6"
|
||||
sudo: false
|
||||
script:
|
||||
- "npm run lint && npm test"
|
||||
22
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/LICENSE
generated
vendored
Normal file
22
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Sarosia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
33
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/README.md
generated
vendored
Normal file
33
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/README.md
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# buffer-indexof-polyfill
|
||||
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
|
||||
This is a polyfill for [`Buffer#indexOf`](https://nodejs.org/api/buffer.html#buffer_buf_indexof_value_byteoffset) and Buffer#lastIndexOf introduced in NodeJS 4.0.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
require("buffer-indexof-polyfill");
|
||||
|
||||
new Buffer("buffer").indexOf("uff") // return 1
|
||||
new Buffer("buffer").indexOf("abc") // return -1
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install buffer-indexof-polyfill
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/buffer-indexof-polyfill.svg
|
||||
[npm-url]: https://npmjs.org/package/buffer-indexof-polyfill
|
||||
[downloads-image]: https://img.shields.io/npm/dm/buffer-indexof-polyfill.svg
|
||||
[downloads-url]: https://npmjs.org/package/buffer-indexof-polyfill
|
||||
[travis-image]: https://travis-ci.org/sarosia/buffer-indexof-polyfill.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/sarosia/buffer-indexof-polyfill
|
||||
73
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/index.js
generated
vendored
Normal file
73
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/index.js
generated
vendored
Normal 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;
|
||||
}
|
||||
8
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/init-buffer.js
generated
vendored
Normal file
8
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/init-buffer.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = function initBuffer(val) {
|
||||
// assume old version
|
||||
var nodeVersion = process && process.version ? process.version : "v5.0.0";
|
||||
var major = nodeVersion.split(".")[0].replace("v", "");
|
||||
return major < 6
|
||||
? new Buffer(val)
|
||||
: Buffer.from(val);
|
||||
};
|
||||
34
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/package.json
generated
vendored
Normal file
34
doc/test-data/purchase_transaction/node_modules/buffer-indexof-polyfill/package.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "buffer-indexof-polyfill",
|
||||
"version": "1.0.2",
|
||||
"description": "This is a polyfill for Buffer#indexOf introduced in NodeJS 4.0.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"lint": "eslint .",
|
||||
"fix": "eslint . --fix"
|
||||
},
|
||||
"author": "https://github.com/sarosia",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sarosia/buffer-indexof-polyfill.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.3.0",
|
||||
"eslint": "^1.10.3",
|
||||
"mocha": "^2.3.3"
|
||||
},
|
||||
"keywords": [
|
||||
"buffer",
|
||||
"indexof",
|
||||
"polyfill"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/sarosia/buffer-indexof-polyfill/issues"
|
||||
},
|
||||
"homepage": "https://github.com/sarosia/buffer-indexof-polyfill#readme"
|
||||
}
|
||||
Reference in New Issue
Block a user