Commit 0b956001 authored by Scott Sun's avatar Scott Sun

s

parent 1142d287
...@@ -1093,10 +1093,10 @@ try { ...@@ -1093,10 +1093,10 @@ try {
// } // }
// 邮件触发 // 邮件触发
sendEmail({ // sendEmail({
subject:db_customer + ' / '+job+' reading is ready!', // subject:db_customer + ' / '+job+' reading is ready!',
content: db_customer + ' / '+job+' reading is ready!' // content: db_customer + ' / '+job+' reading is ready!'
}) // })
if (mode === "aimdfm") { if (mode === "aimdfm") {
$.QDfm.updateRow({ $.QDfm.updateRow({
...@@ -1146,6 +1146,9 @@ catch (e) { ...@@ -1146,6 +1146,9 @@ catch (e) {
// content:_.toString(e) // content:_.toString(e)
// }) // })
} }
if(global._ERRORMAG){
script_info({ msg: global._ERRORMAG })
}
IKM.msg(_.join(GEN.STATUS, "\n")) IKM.msg(_.join(GEN.STATUS, "\n"))
IKM.msg(e) IKM.msg(e)
Status = 'error'; Status = 'error';
...@@ -2198,9 +2201,8 @@ function analysisDrill(par, step){ ...@@ -2198,9 +2201,8 @@ function analysisDrill(par, step){
if(GEN.isLayerExists({job:job,layer:"temp+++"})){GEN.deleteLayer({job:job,layer:["temp+++"]})} if(GEN.isLayerExists({job:job,layer:"temp+++"})){GEN.deleteLayer({job:job,layer:["temp+++"]})}
GEN.selCopyOther({dest:'layer_name',target_layer:'temp',invert:'no',dx:0,dy:0,size:0}) GEN.selCopyOther({dest:'layer_name',target_layer:'temp',invert:'no',dx:0,dy:0,size:0})
GEN.workLayer({name:"temp",display_number:1,clear_before:"yes"}) GEN.workLayer({name:"temp",display_number:1,clear_before:"yes"})
GEN.COM("sel_ref_feat,layers="+item+",use=filter,mode=touch,pads_as=shape,f_types=surface,polarity=positive\;negative,include_syms=,exclude_syms=") // GEN.COM("sel_ref_feat,layers="+item+",use=filter,mode=touch,pads_as=shape,f_types=surface,polarity=positive\;negative,include_syms=,exclude_syms=")
if(GEN.getSelectCount()>0){GEN.selDelete()} // if(GEN.getSelectCount()>0){GEN.selDelete()}
GEN.COM("chklist_single,action=valor_dfm_nfpr,show=yes") GEN.COM("chklist_single,action=valor_dfm_nfpr,show=yes")
GEN.COM("chklist_cupd,chklist=valor_dfm_nfpr,nact=1,params=((pp_layer=temp)(pp_delete=Duplicate)(pp_work=Features)(pp_drill=PTH\;NPTH\;Via)(pp_non_drilled=Yes)(pp_in_selected=All)(pp_remove_mark=Remove)),mode=regular") GEN.COM("chklist_cupd,chklist=valor_dfm_nfpr,nact=1,params=((pp_layer=temp)(pp_delete=Duplicate)(pp_work=Features)(pp_drill=PTH\;NPTH\;Via)(pp_non_drilled=Yes)(pp_in_selected=All)(pp_remove_mark=Remove)),mode=regular")
GEN.COM("chklist_run,chklist=valor_dfm_nfpr,nact=1,area=profile") GEN.COM("chklist_run,chklist=valor_dfm_nfpr,nact=1,area=profile")
...@@ -2236,7 +2238,7 @@ function analysisDrill(par, step){ ...@@ -2236,7 +2238,7 @@ function analysisDrill(par, step){
if(GEN.getSelectCount() > 0){GEN.selDelete()} if(GEN.getSelectCount() > 0){GEN.selDelete()}
}) })
} }
// exportInfo({drill:drill, item:item});
var pads = GEN.getFeatures({job:job,step:step,layer:"temp"}) var pads = GEN.getFeatures({job:job,step:step,layer:"temp"})
pads = pads.filter(function(v){v.size=v.symbol.slice(1)-0 ;return /^r\d/.test(v.symbol)}) pads = pads.filter(function(v){v.size=v.symbol.slice(1)-0 ;return /^r\d/.test(v.symbol)})
......
...@@ -585,7 +585,9 @@ catch (e) { ...@@ -585,7 +585,9 @@ catch (e) {
script_info({ result_severity: "error" }) script_info({ result_severity: "error" })
IKM.msg(_.join(GEN.STATUS, "\n")) IKM.msg(_.join(GEN.STATUS, "\n"))
IKM.msg(e) IKM.msg(e)
console.log("=======save cam workflow info"); if(global._ERRORMAG){
script_info({ msg: global._ERRORMAG })
}
IKM.crud("deleteRow", { IKM.crud("deleteRow", {
table: "pdm_job_jobattr", table: "pdm_job_jobattr",
where:{job_id:JobId, attr_name:"cam_workflow_info"}, where:{job_id:JobId, attr_name:"cam_workflow_info"},
......
...@@ -98,7 +98,7 @@ if(cam_workflow_info){ ...@@ -98,7 +98,7 @@ if(cam_workflow_info){
IKM.save_job_info({jobid:JobId, jobinfohash:{cam_workflow_info:""}}) IKM.save_job_info({jobid:JobId, jobinfohash:{cam_workflow_info:""}})
} }
try { try {
script_info({ msg: "Failed to unzip the file", result_severity:"info" }) global._ERRORMAG = null;
var par = PAR; var par = PAR;
// var db_path = db.query("",function(q){ // var db_path = db.query("",function(q){
// return q.selectValue({ // return q.selectValue({
...@@ -109,7 +109,8 @@ try { ...@@ -109,7 +109,8 @@ try {
// }); // });
// if(_.isEmpty(db_path)){throw "quote-data-upload error"} // if(_.isEmpty(db_path)){throw "quote-data-upload error"}
if(!par.path || par.path == "") { if(!par.path || par.path == "") {
script_info({ msg: "The data path does not exist", result_severity:"error" }); script_info({ msg: "Find data path", result_severity:"error" });
global._ERRORMAG = "The data path does not exist";
throw "path error"} throw "path error"}
if(!par.hasOwnProperty("config_path") || par.config_path==""){ if(!par.hasOwnProperty("config_path") || par.config_path==""){
console.log("===================cfg"); console.log("===================cfg");
...@@ -127,7 +128,8 @@ try { ...@@ -127,7 +128,8 @@ try {
}) })
}); });
if(_.isEmpty(db_customer)){ if(_.isEmpty(db_customer)){
script_info({ msg: "No customer was found", result_severity:"error" }); script_info({ msg: "Find customer", result_severity:"error" });
global._ERRORMAG = "No customer was found";
throw "customer error"} throw "customer error"}
if(db_customer && !(/^done$/ig.test(db_customer)) && db_customer != "" ){ if(db_customer && !(/^done$/ig.test(db_customer)) && db_customer != "" ){
par.customer = db_customer par.customer = db_customer
...@@ -141,11 +143,13 @@ try { ...@@ -141,11 +143,13 @@ try {
}) })
}); });
if (!cfg || cfg == ""){ if (!cfg || cfg == ""){
script_info({ msg: "No customer config was found", result_severity:"error" }); script_info({ msg: "Find customer config", result_severity:"error" });
global._ERRORMAG = "No customer config was found";
throw "cfg can not find"} throw "cfg can not find"}
var config = eval(cfg); var config = eval(cfg);
if(!config.hasOwnProperty("customer")){ if(!config.hasOwnProperty("customer")){
script_info({ msg: "No customer config was found", result_severity:"error" }); script_info({ msg: "Find customer config", result_severity:"error" });
global._ERRORMAG = "No customer config was found";
throw "config error"} throw "config error"}
var job = Job; var job = Job;
if(_.isEmpty(job)) throw "没有传入料号名!"; if(_.isEmpty(job)) throw "没有传入料号名!";
...@@ -159,7 +163,8 @@ try { ...@@ -159,7 +163,8 @@ try {
// 获取路径下文件信息 // 获取路径下文件信息
var path = par.path var path = par.path
if(!fs.exists(path)){ if(!fs.exists(path)){
script_info({ msg: "No PN file was found in folder", result_severity:"error" }); script_info({ msg: "Find PN folder", result_severity:"error" });
global._ERRORMAG = "No PN file was found in folder";
throw "path error"} throw "path error"}
var pathInfo = fs.listDir(path + "/" + db_customer.toLowerCase(), 1) var pathInfo = fs.listDir(path + "/" + db_customer.toLowerCase(), 1)
// 判断存不存在料号文件 // 判断存不存在料号文件
...@@ -176,7 +181,8 @@ try { ...@@ -176,7 +181,8 @@ try {
// } // }
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){ if(jobFile.length == 0){
script_info({ msg: "No PN file was found in folder", result_severity:"error" }); script_info({ msg: "Find PN folder", result_severity:"error" });
global._ERRORMAG = "No PN file was found in folder";
throw "job file is not exist"} throw "job file is not exist"}
var jobFiles = [] // 记录要分析的文件 var jobFiles = [] // 记录要分析的文件
if (!jobFile[0].isDir) { if (!jobFile[0].isDir) {
...@@ -188,6 +194,8 @@ try { ...@@ -188,6 +194,8 @@ try {
// GEN.COM("config_edit,name=iol_fix_ill_polygon,value=yes,mode=user") // GEN.COM("config_edit,name=iol_fix_ill_polygon,value=yes,mode=user")
// 将jobFile下的zip解压 // 将jobFile下的zip解压
script_info({ msg: "unzip the file", result_severity:"info" })
global._ERRORMAG = "Failed to unzip the file";
decompression(jobFile[0].path, []) decompression(jobFile[0].path, [])
var job_attrs = db.query("",function(q){ var job_attrs = db.query("",function(q){
return q.selectValue({ return q.selectValue({
...@@ -213,7 +221,8 @@ try { ...@@ -213,7 +221,8 @@ try {
// 分析料号文件 得到料号导入信息 导入类型 // 分析料号文件 得到料号导入信息 导入类型
var jobInfo = analyJobFiles({jobFiles:jobFiles.filter(function(v){return v.isFile}),custCfg:custCfg,config:config,job:job }) var jobInfo = analyJobFiles({jobFiles:jobFiles.filter(function(v){return v.isFile}),custCfg:custCfg,config:config,job:job })
if(jobInfo.data.length == 0){ if(jobInfo.data.length == 0){
script_info({ msg: "No PN file was found in folder", result_severity:"error" }); script_info({ msg: "Find PN folder", result_severity:"error" });
global._ERRORMAG = "No PN file was found in folder";
throw "file error"} throw "file error"}
var importOk = false; // 是否成功导入 var importOk = false; // 是否成功导入
...@@ -382,7 +391,7 @@ try { ...@@ -382,7 +391,7 @@ try {
import_html += "</table>" import_html += "</table>"
// name type date user // name type date user
resultData.push({type: "info",title:"导入资料列表",detail: [{ desc: import_html }] }) resultData.push({type: "info",title:"导入资料列表",detail: [{ desc: import_html }] })
script_info({ msg: "导入资料成功" }) script_info({ msg: "Data Readin" })
if (mode === "aimdfm") { if (mode === "aimdfm") {
$.QDfm.updateRow({ $.QDfm.updateRow({
table: "pdm_aimdfm_task", table: "pdm_aimdfm_task",
...@@ -411,7 +420,9 @@ try { ...@@ -411,7 +420,9 @@ try {
} }
catch (e) { catch (e) {
script_info({ result_severity: "error" }) script_info({ result_severity: "error" })
if(global._ERRORMAG){
script_info({ msg: global._ERRORMAG })
}
IKM.crud("deleteRow", { IKM.crud("deleteRow", {
table: "pdm_job_jobattr", table: "pdm_job_jobattr",
where:{job_id:JobId, attr_name:"cam_workflow_info"}, where:{job_id:JobId, attr_name:"cam_workflow_info"},
......
...@@ -1057,7 +1057,30 @@ ...@@ -1057,7 +1057,30 @@
}) })
GEN.COM("tools_set,layer="+layer+",thickness=0,user_params=,slots=by_length") GEN.COM("tools_set,layer="+layer+",thickness=0,user_params=,slots=by_length")
} }
}) });
// 特殊名称
var _matrix = GEN.getMatrix({job:job})
var _layers = Object.keys(_matrix)
var specialLayers = _layers.filter(function(v){return /^gnd.*\.art$|^in.?\.art$|^vcc\.art$/.test(v)})
if(specialLayers.length && specialLayers.indexOf("vcc.art") >= 0){
var _tmpdata = specialLayers.map(function(v) {
if(v == "gnd.art"){return {ori:v, newname:"gnd0.art"}}
if(/in/.test(v)){
return {ori:v, newname:"gnd" + (/in(\d+)\.art/.exec(v)[1]-0.5) + ".art"}
}
if(/vcc/.test(v)){
return {ori:v, newname:"gnd" + specialLayers.length + ".art"}
}
return {ori:v, newname:v}
})
_tmpdata.sort(function(a,b){return (/^gnd(.+)\.art$/.exec(a.newname)[1]) - (/gnd(.+)\.art/.exec(b.newname)[1])})
_tmpdata.forEach(function(item,v){
console.log(_.toString({job:job,layer:item.ori,new_name:'gnd' + (v+2) + ".art"}));
GEN.renameLayer({job:job,layer:item.ori,new_name:'pgp' + (v+2) + ".art"})
})
}
} }
} }
] ]
......
11
{"current_process_id":6451,"id":2623,"job_id":231,"msg":"No PN file was found in folder","task_title":"13520012_112:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:52:34\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2021-01-06 15:01:53","start_time":"2021-01-06 15:01:53"}}
{"current_process_id":6447,"id":2622,"job_id":230,"msg":"No PN file was found in folder","task_title":"13520011_111:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:52:22\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2021-01-06 15:01:43","start_time":"2021-01-06 15:01:43"}}
{"current_process_id":6443,"id":2621,"job_id":229,"msg":"No PN file was found in folder","task_title":"13520010_110:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:52:12\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2021-01-06 15:01:33","start_time":"2021-01-06 15:01:33"}}
{"current_process_id":5954,"id":2484,"job_id":233,"msg":"Data format is done","progress":60,"task_title":"13520014_114:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:52:49\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-12-23 15:16:07","start_time":"2020-12-23 15:16:02"}}
{"current_process_id":4947,"id":2214,"job_id":222,"msg":"Failed to change name(Name clashes)","progress":50,"task_title":"13520003_103:topcam","user_name":"Danphyer Yuan","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:08:46\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-12-03 21:17:33","start_time":"2020-12-03 21:17:33"}}
{"current_process_id":4927,"id":2209,"job_id":234,"msg":"Failed to change name(Name clashes)","progress":50,"task_title":"13520015_115:topcam","user_name":"Danphyer Yuan","job_info":{"action_data":"{\"create_time\": \"2020-09-17 09:52:56\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-12-03 20:50:32","start_time":"2020-12-03 20:50:32"}}
{"current_process_id":4669,"id":2143,"job_id":601,"msg":"分析线路","progress":85,"task_title":"20443343_1500:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-12-02 13:00:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-12-02 15:03:21","start_time":"2020-12-02 15:03:21"}}
{"current_process_id":4200,"id":1994,"job_id":519,"msg":"format start","progress":35,"task_title":"20438472_800:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-11-24 10:15:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-11-24 15:07:58","start_time":"2020-11-24 15:07:58"}}
{"current_process_id":873,"id":658,"job_id":99,"progress":0,"task_title":"20438797_1000:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-28 14:27:59\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-08-28 14:29:27","start_time":"2020-08-28 14:28:34"}}
{"current_process_id":852,"id":651,"job_id":95,"progress":0,"task_title":"20208888_100:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-26 14:50:29\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-08-26 14:51:17","start_time":"2020-08-26 14:51:17"}}
{"current_process_id":835,"id":644,"job_id":92,"progress":0,"task_title":"20438188_1200:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-26 10:30:47\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"1352"},"task_workflow":{"end_time":"2020-08-26 10:34:17","start_time":"2020-08-26 10:34:17"}}
\ No newline at end of file
This diff is collapsed.
19
{"current_process_id":6416,"id":2615,"job_id":157,"msg":"Failed to unzip the file","progress":10,"task_title":"21710046_146:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-14 09:56:32\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":6404,"id":2612,"job_id":108,"msg":"Failed to unzip the file","progress":10,"task_title":"21710001_101:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-04 14:14:45\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":6381,"id":2604,"job_id":76,"msg":"No PN file was found in folder","task_title":"20438188_1000:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-08-18 15:52:43\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":6379,"id":2603,"job_id":498,"msg":"Error-Signal layer analysis","progress":85,"task_title":"20444218_200:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-09 08:45:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"2171"},"task_workflow":{"end_time":"2021-01-05 11:27:10","start_time":"2021-01-05 11:27:10"}}
{"current_process_id":6375,"id":2602,"job_id":611,"msg":"Error-Signal layer analysis","progress":85,"task_title":"21710053_153:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-12-22 13:11:04\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{"end_time":"2021-01-05 11:23:47","start_time":"2021-01-05 11:23:47"}}
{"current_process_id":6367,"id":2600,"job_id":614,"msg":"Error-Signal layer analysis","progress":85,"task_title":"20442426_300:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2021-01-04 10:00:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"2171"},"task_workflow":{"end_time":"2021-01-05 11:21:07","start_time":"2021-01-05 11:21:07"}}
{"current_process_id":6363,"id":2599,"job_id":512,"msg":"Error-Signal layer analysis","progress":85,"task_title":"20439650_600:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-19 13:00:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"2171"},"task_workflow":{"end_time":"2021-01-05 11:20:49","start_time":"2021-01-05 11:20:49"}}
{"current_process_id":5648,"id":2393,"job_id":132,"msg":"Failed to unzip the file","progress":10,"task_title":"21710021_121:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-14 09:42:33\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":5632,"id":2389,"job_id":139,"msg":"Failed to unzip the file","progress":10,"task_title":"21710027_127:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-14 09:44:26\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":5628,"id":2388,"job_id":141,"msg":"Failed to unzip the file","progress":10,"task_title":"21710029_129:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-14 09:44:44\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":5624,"id":2387,"job_id":149,"msg":"Failed to unzip the file","progress":10,"task_title":"21710038_138:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-14 09:47:05\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":5604,"id":2382,"job_id":122,"msg":"Failed to unzip the file","progress":10,"task_title":"21710016_116:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-04 16:03:41\", \"create_user_id\": 1, \"create_user_name\": \"Admin\"}","customer_code":"2171"},"task_workflow":{}}
{"current_process_id":3219,"id":1474,"job_id":427,"msg":"format start","progress":35,"task_title":"20438188_2222:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-10-22 12:45:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-10-22 13:10:48","start_time":"2020-10-22 13:10:48"}}
{"current_process_id":2429,"id":1192,"job_id":388,"progress":35,"task_title":"99009900_100:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-10-10 09:55:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-10-10 09:55:05","start_time":"2020-10-10 09:55:05"}}
{"current_process_id":876,"id":659,"job_id":100,"progress":0,"task_title":"20436001_600:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-31 13:12:50\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-08-31 13:14:31","start_time":"2020-08-31 13:13:19"}}
{"current_process_id":847,"id":648,"job_id":94,"progress":0,"task_title":"20435468_320:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-26 10:40:43\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-08-26 13:16:29","start_time":"2020-08-26 13:10:30"}}
{"current_process_id":826,"id":641,"job_id":88,"progress":0,"task_title":"20444218_100:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-24 15:23:23\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-08-24 15:34:12","start_time":"2020-08-24 15:24:51"}}
{"current_process_id":810,"id":633,"job_id":82,"progress":0,"task_title":"20443806_300:导入","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-21 10:29:58\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-08-24 12:58:18","start_time":"2020-08-24 12:58:17"}}
{"current_process_id":750,"id":609,"job_id":84,"progress":0,"task_title":"20438188_100:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-21 15:25:58\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"2171"},"task_workflow":{"end_time":"2020-08-21 15:38:04","start_time":"2020-08-21 15:35:30"}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
var db = require('topsin.database');
var _ = require("lodash")
var fs = require("fs");
db.addConnection({
databse_type:'pg',
database_host:'10.90.2.100:5432',
database_name:'TOPSTQ_ATS_V6',
database_user:'toplinker',
database_pwd:'TopLinker0510'
}, "MES_DB");
var result = db.query("MES_DB", function(query) {
return query.selectArrayMap({
table:'pdm_aimdfm_task',
field:['id','job_id','user_name',"current_process_id",'progress',"msg","task_title"],
order:'id DESC',
})
});
var jobid = {}
var okData = []
result.forEach(function(item){
// 过滤条件 jobid里面没有这个id job_id查询表pdm_job发现是正常料号// 顺便获取时间 task_title是topcam或者分析
if(!jobid[item.job_id]){
var job_info = db.query("MES_DB", function(query) {
return query.selectMap({
table:'pdm_job',
field:['customer_code','del_flag','action_data'],
where:{id:item.job_id}
});
});
if(job_info && job_info.del_flag!=1){
item.job_info = job_info;
var task_workflow = db.query("MES_DB", function(query) {
return query.selectMap({
table:'pdm_aimdfm_task_workprocess',
field:['start_time','end_time','action_data'],
where:{id:item.current_process_id}
});
});
item.task_workflow = task_workflow
okData.push(item)
jobid[item.job_id] = true;
}
}
})
console.log(result.length);
console.log(okData.length);
fs.writeFile("./test.js", _.toString(okData))
\ No newline at end of file
21
{"current_process_id":6465,"id":2627,"job_id":463,"msg":"Data format is done","progress":60,"task_title":"99990021_121:导入","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2021-01-06 15:56:18","start_time":"2021-01-06 15:56:16"}}
{"current_process_id":5940,"id":2480,"job_id":486,"msg":"Data format is done","progress":60,"task_title":"99990044_144:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 14:08:28","start_time":"2020-12-23 14:08:27"}}
{"current_process_id":5936,"id":2478,"job_id":475,"msg":"Data format is done","progress":60,"task_title":"99990033_133:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 12:56:18","start_time":"2020-12-23 12:56:17"}}
{"current_process_id":5930,"id":2475,"job_id":481,"msg":"Data format is done","progress":60,"task_title":"99990039_139:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:40:23","start_time":"2020-12-23 11:40:21"}}
{"current_process_id":5926,"id":2473,"job_id":483,"msg":"Data format is done","progress":60,"task_title":"99990041_141:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:38:14","start_time":"2020-12-23 11:38:12"}}
{"current_process_id":5924,"id":2472,"job_id":484,"msg":"Data format is done","progress":60,"task_title":"99990042_142:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:37:42","start_time":"2020-12-23 11:37:40"}}
{"current_process_id":5922,"id":2471,"job_id":489,"msg":"Data format is done","progress":60,"task_title":"99990047_147:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:36:37","start_time":"2020-12-23 11:36:36"}}
{"current_process_id":5920,"id":2470,"job_id":492,"msg":"Data format is done","progress":60,"task_title":"99990050_150:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:35:38","start_time":"2020-12-23 11:35:37"}}
{"current_process_id":5918,"id":2469,"job_id":599,"msg":"Data format is done","progress":60,"task_title":"99991001_1001:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-30 10:15:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:33:00","start_time":"2020-12-23 11:32:59"}}
{"current_process_id":5916,"id":2468,"job_id":605,"msg":"Data format is done","progress":60,"task_title":"99990006_120:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-12-03 13:00:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:30:15","start_time":"2020-12-23 11:30:14"}}
{"current_process_id":5914,"id":2467,"job_id":511,"msg":"Data format is done","progress":60,"task_title":"99990005_1051:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-12 10:45:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:27:54","start_time":"2020-12-23 11:27:53"}}
{"current_process_id":5912,"id":2466,"job_id":496,"msg":"Data format is done","progress":60,"task_title":"99990005_1050:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-05 13:48:14\", \"create_user_id\": 3, \"create_user_name\": \"Hedy Sun\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-12-23 11:26:45","start_time":"2020-12-23 11:26:43"}}
{"current_process_id":4861,"id":2192,"job_id":473,"msg":"No PN file was found in folder","task_title":"99990031_131:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4857,"id":2191,"job_id":470,"msg":"No PN file was found in folder","task_title":"99990028_128:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4849,"id":2189,"job_id":460,"msg":"No PN file was found in folder","task_title":"99990018_118:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4845,"id":2188,"job_id":459,"msg":"No PN file was found in folder","task_title":"99990017_117:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4841,"id":2187,"job_id":456,"msg":"No PN file was found in folder","task_title":"99990014_114:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4837,"id":2186,"job_id":449,"msg":"No PN file was found in folder","task_title":"99990007_107:topcam","user_name":"Hedy Sun","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":4650,"id":2138,"job_id":598,"msg":"开始导入","task_title":"99991000_1000:topcam","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-30 10:15:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{}}
{"current_process_id":3591,"id":1748,"job_id":446,"msg":"创建profile失败","progress":55,"task_title":"99990005_120:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-11-04 09:45:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-11-04 10:03:01","start_time":"2020-11-04 10:03:01"}}
{"current_process_id":879,"id":660,"job_id":101,"progress":0,"task_title":"20444372_100:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-09-01 16:19:59\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"vivo"},"task_workflow":{"end_time":"2020-09-01 16:27:07","start_time":"2020-09-01 16:27:07"}}
\ No newline at end of file
This diff is collapsed.
17
{"current_process_id":6395,"id":2609,"job_id":507,"msg":"Data format is done","progress":60,"task_title":"20438188_4004:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-11 14:30:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2021-01-05 11:33:47","start_time":"2021-01-05 11:33:45"}}
{"current_process_id":6392,"id":2608,"job_id":499,"msg":"Failed to unzip the file","task_title":"20421762_500:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-10 13:45:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{}}
{"current_process_id":6391,"id":2607,"job_id":506,"msg":"Data format is done","progress":60,"task_title":"20438188_4003:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-11 14:30:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2021-01-05 11:33:18","start_time":"2021-01-05 11:33:17"}}
{"current_process_id":6389,"id":2606,"job_id":504,"msg":"Data format is done","progress":60,"task_title":"20438188_4001:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-11 14:30:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2021-01-05 11:33:02","start_time":"2021-01-05 11:33:00"}}
{"current_process_id":5994,"id":2501,"job_id":508,"msg":"Data format is done","progress":60,"task_title":"20438188_4005:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-11 14:30:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:48:10","start_time":"2020-12-23 16:48:09"}}
{"current_process_id":5992,"id":2500,"job_id":552,"msg":"Data format is done","progress":60,"task_title":"66660031_1311:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:47:21","start_time":"2020-12-23 16:47:19"}}
{"current_process_id":5990,"id":2499,"job_id":557,"msg":"Data format is done","progress":60,"task_title":"66660036_136:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:46:57","start_time":"2020-12-23 16:46:56"}}
{"current_process_id":5988,"id":2498,"job_id":570,"msg":"Data format is done","progress":60,"task_title":"66660050_150:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:45:49","start_time":"2020-12-23 16:45:47"}}
{"current_process_id":5986,"id":2497,"job_id":550,"msg":"Data format is done","progress":60,"task_title":"66660030_130:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:45:24","start_time":"2020-12-23 16:45:23"}}
{"current_process_id":5984,"id":2496,"job_id":546,"msg":"Data format is done","progress":60,"task_title":"66660026_126:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:43:13","start_time":"2020-12-23 16:43:12"}}
{"current_process_id":5982,"id":2495,"job_id":500,"msg":"Data format is done","progress":60,"task_title":"20421762_510:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-10 14:45:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:40:30","start_time":"2020-12-23 16:40:29"}}
{"current_process_id":5970,"id":2491,"job_id":529,"msg":"Data format is done","progress":60,"task_title":"66660008_108:导入","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-12-23 16:37:15","start_time":"2020-12-23 16:37:14"}}
{"current_process_id":4343,"id":2042,"job_id":567,"msg":"format start","progress":35,"task_title":"66660047_147:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{}}
{"current_process_id":4329,"id":2037,"job_id":562,"msg":"format start","progress":35,"task_title":"66660041_141:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-11-24 16:30:02\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-11-24 16:44:58","start_time":"2020-11-24 16:44:58"}}
{"current_process_id":4203,"id":1995,"job_id":520,"msg":"format start","progress":35,"task_title":"20440196_300:topcam","user_name":"Sys","job_info":{"action_data":"{\"create_time\": \"2020-11-24 10:15:01\", \"create_user_id\": 1, \"create_user_name\": \"Sys\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-11-24 15:08:08","start_time":"2020-11-24 15:08:08"}}
{"current_process_id":3920,"id":1864,"job_id":104,"task_title":"20440383_700:ats_test","user_name":"Admin","job_info":{"action_data":"{\"create_time\": \"2020-09-04 11:00:39\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-11-10 10:23:36","start_time":"2020-11-10 10:23:36"}}
{"current_process_id":688,"id":588,"job_id":81,"progress":0,"task_title":"20160816195828_16h13-sa:topcam","user_name":"管理员","job_info":{"action_data":"{\"create_time\": \"2020-08-20 13:52:44\", \"create_user_id\": 1, \"create_user_name\": \"管理员\"}","customer_code":"wistron"},"task_workflow":{"end_time":"2020-08-20 14:47:55","start_time":"2020-08-20 14:47:55"}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -30,7 +30,7 @@ PARAMETER: ...@@ -30,7 +30,7 @@ PARAMETER:
HELP: HELP:
<html><body bgcolor="#DDECFE"> <html><body bgcolor="#DDECFE">
<font size="3" color="#003DB2"><p>功能简介</p></font> <font size="3" color="#003DB2"><p>功能简介</p></font>
<p> 标题 </p> <p> 标题 </ p>
<br> <br>
<font size="3" color="#003DB2"><p>参数配置</p></font> <font size="3" color="#003DB2"><p>参数配置</p></font>
<p> step信息 </p> <p> step信息 </p>
...@@ -70,7 +70,7 @@ var Status = 'ok'; ...@@ -70,7 +70,7 @@ var Status = 'ok';
var resultData = []; var resultData = [];
var par = PAR; var par = PAR;
var default_par = { var default_par = {
step: "orig", step: "cad",
auto_save: "No", auto_save: "No",
units:"mm" units:"mm"
} }
...@@ -86,11 +86,20 @@ try { ...@@ -86,11 +86,20 @@ try {
var reg = new RegExp(par.step,"ig") var reg = new RegExp(par.step,"ig")
return reg.test(step) return reg.test(step)
}) })
stepList.forEach(function(step){
GEN.openStep({job:job,name:step})
// var tool = GEN.getTool({job:job,step:step,layer:"ftdrill",units:"mm"},true); // {"1":{"count":"01156","num":"1","type":"plated","min_tol":"0","max_tol":"0","finish_size":"100.31","drill_size":"100.31","slot_len":"0","type2":"standard","shape":"hole","bit":0}}
// fs.writeFile("/home/toplinker/samba/scott_test/tmp", _.toString(tool))
GEN.PAUSE("Ok")
IKM.msg("Ok")
})
// 保存 // 保存
if(/yes/ig.test(par.auto_save)){GEN.checkInout({job:job,mode:"out"}); GEN.saveJob({ job: job });GEN.checkInout({job:job,mode:"in"});GEN.closeJob({job:job});} else {GEN.checkInout({job:job,mode:"in"})} if(/yes/ig.test(par.auto_save)){GEN.checkInout({job:job,mode:"out"}); GEN.saveJob({ job: job });GEN.checkInout({job:job,mode:"in"});GEN.closeJob({job:job});} else {GEN.checkInout({job:job,mode:"in"})}
if (mode === "aimdfm") { if (mode === "aimdfm") {
......
...@@ -11,6 +11,17 @@ var JobId = $.job_id; ...@@ -11,6 +11,17 @@ var JobId = $.job_id;
try { try {
var _matrix = GEN.getMatrix({job:job})
var _layers = Object.keys(_matrix)
var specialLayers = _layers.filter(function(v){return /^gnd\d?\\.art$|^in\d?\\.art$|^vcc\\.art$/.test(v)})
var _tmpdata = tmp(specialLayers)
_tmpdata.forEach(function(item,v){
GEN.renameLayer({job:job,layer:item.layer,new_name:'gnd' + (v+2) + ".art"})
})
return "Done" return "Done"
} catch (e) { } catch (e) {
return "Error" return "Error"
......
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