Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wangxiaoming
traffic-front
Commits
8db79f5a
Commit
8db79f5a
authored
Nov 14, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] fixed items status by jobstatus and step status
parent
329a29b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
29 deletions
+33
-29
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+33
-29
No files found.
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
8db79f5a
...
...
@@ -283,7 +283,7 @@
$scope
.
readonly
=
true
;
if
(
data
&&
data
.
result
)
updateTasksStatus
(
data
.
data
);
if
(
data
.
data
.
status
==
'Begin
'
){
if
(
data
.
data
.
jobStatus
==
'Begin'
||
data
.
data
.
jobStatus
==
'Running
'
){
$scope
.
timer
=
$interval
(
function
(){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
data
.
data
.
id
).
then
(
function
(
result
){
if
(
result
.
data
&&
result
.
status
==
200
){
...
...
@@ -299,6 +299,12 @@
}
});
}
function
isAllEnd
(
stepCode
,
status
){
var
statusList
=
JSON
.
parse
(
status
);
var
stepCodes
=
stepCode
.
split
(
","
);
}
var
startCaculate
=
function
()
{
...
...
@@ -551,35 +557,33 @@
}
else
{
$scope
.
tasks
[
0
].
items
[
0
].
status
=
'completed'
;
$scope
.
tasks
[
0
].
items
[
0
].
text
=
$translate
.
instant
(
'completed'
);
var
items
=
$scope
.
tasks
[
1
].
items
;
var
currentIndex
=
0
;
items
.
forEach
(
function
(
item
,
index
){
if
((
job
).
currentStep
==
item
.
code
){
currentIndex
=
index
;
if
(
job
.
jobStatus
==
'End'
){
if
(
$scope
.
timer
){
$interval
.
cancel
(
$scope
.
timer
);
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Generated
,
constant
.
DictionaryDictKey
.
WFDataProcess
,
enums
.
FinishStatusEnum
.
Finished
);
}
});
items
.
forEach
(
function
(
item
,
index
){
if
(
index
<
currentIndex
){
item
.
status
=
'completed'
;
}
else
if
(
index
==
currentIndex
){
if
(
job
.
status
==
'Error'
){
item
.
status
=
'error'
;
}
else
if
(
job
.
status
==
'End'
){
item
.
status
=
'completed'
;
if
(
$scope
.
timer
){
$interval
.
cancel
(
$scope
.
timer
);
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Generated
,
constant
.
DictionaryDictKey
.
WFDataProcess
,
enums
.
FinishStatusEnum
.
Finished
);
}
}
else
if
(
job
.
status
==
'Begin'
){
item
.
status
=
'processing'
;
}
}
item
.
text
=
$translate
.
instant
(
item
.
status
);
});
}
else
if
(
job
.
jobStatus
==
'Running'
){
var
tasks
=
JSON
.
parse
(
job
)
items
.
forEach
(
function
(
item
,
index
){
tasks
.
forEach
(
function
(
task
){
if
(
task
.
code
==
item
.
code
){
if
(
task
.
status
==
'Error'
){
item
.
status
=
'error'
;
}
else
if
(
task
.
status
==
'End'
){
item
.
status
=
'completed'
;
}
else
if
(
task
.
status
==
'Begin'
){
item
.
status
=
'processing'
;
}
item
.
text
=
$translate
.
instant
(
item
.
status
);
}
})
});
}
else
if
(
job
.
jobStatus
==
'Error'
){
if
(
$scope
.
timer
)
$interval
.
cancel
(
$scope
.
timer
);
}
}
}
...
...
@@ -587,7 +591,7 @@
vatReportService
.
getRunningJob
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
).
then
(
function
(
result
)
{
if
(
result
.
data
&&
result
.
status
==
200
){
updateTasksStatus
(
result
.
data
);
if
(
result
.
data
.
status
==
'Begin
'
){
if
(
result
.
data
.
jobStatus
==
'Begin'
||
result
.
data
.
jobStatus
==
'Running
'
){
$scope
.
timer
=
$interval
(
function
(){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
result
.
data
.
id
)
.
success
(
function
(
result
){
...
...
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