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
d96c5d2c
Commit
d96c5d2c
authored
Nov 07, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] fixed async report control js
parent
619d8073
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
vatReportService.js
...rc/main/webapp/app/common/vatservices/vatReportService.js
+1
-1
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+23
-9
No files found.
atms-web/src/main/webapp/app/common/vatservices/vatReportService.js
View file @
d96c5d2c
...
...
@@ -55,7 +55,7 @@
return
$http
.
get
(
'/Report/getRunningJob/'
+
projectId
+
'/'
+
period
,
apiConfig
.
createVat
());
},
getJobStatus
:
function
(
projectId
,
period
,
jobId
)
{
return
$http
.
get
(
'/Report/getJobStatus/'
+
projectId
+
'/'
+
period
+
'/'
+
jobId
,
apiConfig
.
createVat
());
return
$http
.
get
(
'/Report/getJobStatus/'
+
projectId
+
'/'
+
period
+
'/'
+
jobId
,
apiConfig
.
createVat
(
{
ignoreLoadingBar
:
true
}
));
},
getReportData
:
function
(
reportId
)
{
return
$http
.
get
(
'/Report/reportData/'
+
reportId
,
apiConfig
.
createVat
());
...
...
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
d96c5d2c
...
...
@@ -279,11 +279,23 @@
function
doStartCaculate2
(
isMergeManualDataSource
)
{
vatReportService
.
generateAll
(
vatSessionService
.
project
.
id
,
isMergeManualDataSource
,
vatSessionService
.
month
,
vatSessionService
.
logUser
.
id
?
vatSessionService
.
logUser
.
id
:
""
).
success
(
function
(
data
)
{
if
(
data
&&
data
.
result
)
{
updateTasksStatus
(
data
.
result
.
data
);
if
(
data
&&
data
.
result
)
updateTasksStatus
(
data
.
data
);
if
(
data
.
data
.
status
==
'Begin'
){
$scope
.
timer
=
$interval
(
function
(){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
data
.
data
.
id
).
then
(
function
(
result
){
if
(
result
.
data
&&
result
.
status
==
200
){
updateTasksStatus
(
result
.
data
);
}
});
},
1000
);
}
}).
error
(
function
()
{
taskError
(
_this
);
$log
.
debug
(
"generate all report may be some error"
);
// taskError(_this);
});
}
var
startCaculate
=
function
()
{
...
...
@@ -529,10 +541,12 @@
var
updateTasksStatus
=
function
(
job
){
if
(
(
job
)
.
currentStep
==
'UpdateConfig'
){
if
(
job
.
currentStep
==
'UpdateConfig'
){
$scope
.
tasks
[
0
].
items
[
0
].
status
=
'processing'
;
$scope
.
tasks
[
0
].
items
[
0
].
text
=
$translate
.
instant
(
'processing'
);
}
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
){
...
...
@@ -546,17 +560,18 @@
if
(
index
<
currentIndex
){
item
.
status
=
'completed'
;
}
else
if
(
index
==
currentIndex
){
if
(
(
job
)
.
status
==
'Error'
){
if
(
job
.
status
==
'Error'
){
item
.
status
=
'error'
;
}
else
if
(
result
.
data
.
status
==
'End'
){
}
else
if
(
job
.
status
==
'End'
){
item
.
status
=
'completed'
;
if
(
$scope
.
timer
){
$interval
.
cancel
(
$scope
.
timer
);
}
}
else
if
(
result
.
data
.
status
==
'Begin'
){
}
else
if
(
job
.
status
==
'Begin'
){
item
.
status
=
'processing'
;
}
}
item
.
text
=
$translate
.
instant
(
item
.
status
);
});
}
...
...
@@ -568,7 +583,7 @@
updateTasksStatus
(
result
.
data
);
if
(
result
.
data
.
status
==
'Begin'
){
$scope
.
timer
=
$interval
(
function
(){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
jobId
,
id
).
then
(
function
(
result
){
vatReportService
.
getJobStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
result
.
data
.
id
).
then
(
function
(
result
){
if
(
result
.
data
&&
result
.
status
==
200
){
updateTasksStatus
(
result
.
data
);
}
...
...
@@ -583,7 +598,6 @@
});
}
var
var
sendMessage
=
function
(
task
)
{
var
msgDto
=
{};
...
...
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