owl-cli 6.171.0 → 6.173.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -64,6 +64,7 @@ function main(){
|
|
|
64
64
|
owl_process_job_logService.add(log);
|
|
65
65
|
|
|
66
66
|
var nImported = 0;
|
|
67
|
+
var nError = 0;
|
|
67
68
|
for(var i=0; i<rows.length; i++){
|
|
68
69
|
var row = rows[i];
|
|
69
70
|
try{
|
|
@@ -85,10 +86,10 @@ function main(){
|
|
|
85
86
|
|
|
86
87
|
//检查
|
|
87
88
|
var oldObj = @projectCodeService.get(rec.id);
|
|
88
|
-
if(oldObj && override!="true"){
|
|
89
|
+
if(oldObj && batchImport.override!="true"){
|
|
89
90
|
throw "记录已经存在,id=" + rec.id;
|
|
90
91
|
}
|
|
91
|
-
if(oldObj && override=="true" && oldObj._orgId!=rec._orgId){
|
|
92
|
+
if(oldObj && batchImport.override=="true" && oldObj._orgId!=rec._orgId){
|
|
92
93
|
throw "记录的_orgId不正确,不能覆盖其他人的数据,应该是" + rec._orgId + ",实际是" + oldObj._orgId;
|
|
93
94
|
}
|
|
94
95
|
@projectCodeService.add( rec);
|
|
@@ -107,15 +108,29 @@ function main(){
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
catch(e){
|
|
111
|
+
var msg = "";
|
|
112
|
+
if(typeof e === "string"){
|
|
113
|
+
msg = e;
|
|
114
|
+
}
|
|
115
|
+
else{
|
|
116
|
+
msg = e.msg;
|
|
117
|
+
if(!msg && e.getCause){
|
|
118
|
+
msg = e.getCause();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
110
121
|
var now = new Date().getTime();
|
|
111
122
|
var log = {
|
|
112
123
|
objId:batchImport.id,
|
|
113
124
|
startTime:now,
|
|
114
125
|
endTime:now,
|
|
115
126
|
name:"批量导入" + batchImport.id,
|
|
116
|
-
remark:"错误记录,行号" + i + ",内容:" + row
|
|
127
|
+
remark:"错误记录,行号" + i + ",内容:" + row + ",错误信息:" + msg
|
|
117
128
|
}
|
|
118
129
|
owl_process_job_logService.add(log);
|
|
130
|
+
nError++;
|
|
131
|
+
if(nError==50){
|
|
132
|
+
throw "错误记录超过50条,停止导入";
|
|
133
|
+
}
|
|
119
134
|
}
|
|
120
135
|
}
|
|
121
136
|
|