Commit 6f787924 authored by Scott Sun's avatar Scott Sun

scott

parent 149f666c
This diff is collapsed.
...@@ -130,18 +130,12 @@ try { ...@@ -130,18 +130,12 @@ try {
if(!fs.exists(path)){throw "path error"} if(!fs.exists(path)){throw "path error"}
var pathInfo = fs.listDir(path + "/" + db_customer.toLowerCase(), 1) var pathInfo = fs.listDir(path + "/" + db_customer.toLowerCase(), 1)
// 判断存不存在料号文件 // 判断存不存在料号文件
var vc_position = db.query("",function(q){
return q.selectValue({
table:'pdm_job',
field:'version',
where:{id : JobId}
})
});
var job_file_baseName = job var job_file_baseName = job
// if(vc_position && vc_position != "" && !(/null/ig.test(vc_position))){ // if(vc_position && vc_position != "" && !(/null/ig.test(vc_position))){
// job_file_baseName = job_file_baseName + "_" + vc_position // job_file_baseName = job_file_baseName + "_" + vc_position
// } // }
var jobFile = pathInfo.filter(function(v){return v.baseName.toLowerCase() == job_file_baseName}) var jobFile = pathInfo.filter(function(v){return v.baseName.toLowerCase() == job_file_baseName})
if(jobFile.length == 0){throw "job file is not exist"} if(jobFile.length == 0){throw "job file is not exist"}
var jobFiles = [] // 记录要分析的文件 var jobFiles = [] // 记录要分析的文件
if (!jobFile[0].isDir) { if (!jobFile[0].isDir) {
...@@ -155,6 +149,7 @@ try { ...@@ -155,6 +149,7 @@ try {
var importOk = false; // 是否成功导入 var importOk = false; // 是否成功导入
if(/odb/ig.test(jobInfo.type)){ // odb导入 if(/odb/ig.test(jobInfo.type)){ // odb导入
if(jobInfo.data.length == 1){ // 只分析到一个tgz文件 直接导入 if(jobInfo.data.length == 1){ // 只分析到一个tgz文件 直接导入
console.log("========= import one ====>path:"+ _.toString(jobInfo.data)) // ? tmp
var err = importJob({name:job,db:custCfg.db,path:jobInfo.data[0].file.path},config.delSameJob) var err = importJob({name:job,db:custCfg.db,path:jobInfo.data[0].file.path},config.delSameJob)
if(err){throw err} if(err){throw err}
} else { // 多个tgz文件 说明需要合并 } else { // 多个tgz文件 说明需要合并
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment