Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
Scott
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scott Sun
Scott
Commits
2c610ac5
Commit
2c610ac5
authored
May 18, 2020
by
Scott Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
c41be807
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
ATS_AIM_data_input.js
ats/input/ATS_AIM_data_input.js
+33
-21
ATS_AIM_input_data.js
ats/input/ATS_AIM_input_data.js
+6
-5
scott_test.js
test/scott_test.js
+0
-1
No files found.
ats/input/ATS_AIM_data_input.js
View file @
2c610ac5
...
...
@@ -165,30 +165,42 @@ try {
if
(
err
){
throw
err
}
return
tmp_job_name
})
var
steps
=
[];
// 分析arr_job 和 pcs_job
jobs
=
jobs
.
map
(
function
(
jobname
){
jobs
.
forEach
(
function
(
jobname
){
GEN
.
openJob
({
job
:
jobname
});
var
step_tmp
=
GEN
.
getStepList
({
job
:
jobname
})[
0
]
var
type
=
getStepType
(
step_tmp
)
return
{
jobname
:
jobname
,
stepname
:
step_tmp
,
type
:
type
}
var
steps
=
GEN
.
getStepList
({
job
:
jobname
})
steps
.
forEach
(
function
(
stepname
){
var
type
=
getStepType
(
stepname
)
// pcs arr
if
(
type
==
"pcs"
){
steps
.
unshift
({
jobname
:
jobname
,
stepname
:
stepname
,
type
:
type
})
}
if
(
type
==
"arr"
){
steps
.
push
({
jobname
:
jobname
,
stepname
:
stepname
,
type
:
type
})
}
})
})
GEN
.
createJob
({
name
:
job
,
db
:
custCfg
.
db
})
steps
.
forEach
(
function
(
item
){
GEN
.
copyStep
({
// 合并
source_job
:
item
.
jobname
,
source_name
:
item
.
stepname
,
dest_job
:
job
,
dest_name
:
item
.
stepname
,
});
})
jobs
.
forEach
(
function
(
v
){
GEN
.
closeJob
({
job
:
v
});
GEN
.
deleteJob
({
job
:
v
});
// 合并后 删除array的料号
})
var
pcs_job
=
jobs
.
filter
(
function
(
v
){
return
v
.
type
==
"pcs"
})[
0
]
var
arr_job
=
jobs
.
filter
(
function
(
v
){
return
v
.
type
==
"arr"
})[
0
]
GEN
.
copyStep
({
// 合并
source_job
:
arr_job
.
jobname
,
source_name
:
arr_job
.
stepname
,
dest_job
:
pcs_job
.
jobname
,
dest_name
:
arr_job
.
stepname
,
});
GEN
.
closeJob
({
job
:
arr_job
.
jobname
});
GEN
.
deleteJob
({
job
:
arr_job
.
jobname
});
// 合并后 删除array的料号
// 修改pcs料号名称
GEN
.
COM
(
"rename_entity,job=,is_fw=no,type=job,fw_type=form,name="
+
pcs_job
.
jobname
+
",new_name="
+
job
)
}
importOk
=
true
}
...
...
ats/input/ATS_AIM_input_data.js
View file @
2c610ac5
...
...
@@ -138,9 +138,9 @@ try {
})
});
var
job_file_baseName
=
job
if
(
vc_position
&&
vc_position
!=
""
&&
!
(
/null/ig
.
test
(
vc_position
))){
job_file_baseName
=
job_file_baseName
+
"_"
+
vc_position
}
//
if(vc_position && vc_position != "" && !(/null/ig.test(vc_position))){
//
job_file_baseName = job_file_baseName + "_" + vc_position
//
}
var
jobFile
=
pathInfo
.
filter
(
function
(
v
){
return
v
.
baseName
.
toLowerCase
()
==
job_file_baseName
})
if
(
jobFile
.
length
==
0
){
throw
"job file is not exist"
}
var
jobFiles
=
[]
// 记录要分析的文件
...
...
@@ -160,9 +160,10 @@ try {
}
else
{
// 多个tgz文件 说明需要合并
console
.
log
(
"==========合并的情况"
);
var
jobs
=
jobInfo
.
data
.
map
(
function
(
item
,
i
){
var
err
=
importJob
({
name
:
job
+
"_tmp_"
+
i
,
db
:
custCfg
.
db
,
path
:
item
.
file
.
path
},
config
.
delSameJob
)
var
tmp_job_name
=
job
+
"_tmp_"
+
i
var
err
=
importJob
({
name
:
tmp_job_name
,
db
:
custCfg
.
db
,
path
:
item
.
file
.
path
},
config
.
delSameJob
)
if
(
err
){
throw
err
}
return
job
+
"_tmp_"
+
i
return
tmp_job_name
})
// 分析arr_job 和 pcs_job
jobs
=
jobs
.
map
(
function
(
jobname
){
...
...
test/scott_test.js
View file @
2c610ac5
...
...
@@ -54,7 +54,6 @@ if ($.hasOwnProperty('script_parameter')){
}
try
{
QDfm
.
updateRow
({
table
:
"pdm_aimdfm_task"
,
data
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment