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
d69a2b69
Commit
d69a2b69
authored
Nov 14, 2018
by
neo.wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_oracle_neo' into 'dev_oracle'
Dev oracle neo See merge request root/atms!187
parents
ef3d5130
a42f6e00
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
31 deletions
+101
-31
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+2
-2
PeriodJobDto.java
...c/main/java/pwc/taxtech/atms/dto/vatdto/PeriodJobDto.java
+58
-0
WrapPeriodJobDto.java
...in/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
+1
-0
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+1
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+1
-1
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+38
-28
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
d69a2b69
...
...
@@ -53,8 +53,8 @@ public class ReportController {
@RequestMapping
(
value
=
"getJobStatus/{projectId}//{period}/{jobId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ResponseBody
public
PeriodJob
getJobStatus
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@PathVariable
String
jobId
)
{
return
reportService
.
getJobStatus
(
projectId
,
period
,
jobId
);
public
PeriodJob
Dto
getJobStatus
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@PathVariable
String
jobId
)
{
return
new
PeriodJobDto
().
copyFromPeriodJob
(
reportService
.
getJobStatus
(
projectId
,
period
,
jobId
)
);
}
@RequestMapping
(
value
=
"templateReferences/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/PeriodJobDto.java
0 → 100644
View file @
d69a2b69
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
io.jsonwebtoken.lang.Collections
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.commons.lang3.StringUtils
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.vat.entity.PeriodJob
;
import
java.util.Date
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
dto
.
vatdto
.
WrapPeriodJobDto
.*;
@Getter
@Setter
public
class
PeriodJobDto
{
private
String
id
;
private
String
name
;
private
String
currentStep
;
private
String
projectId
;
private
Integer
period
;
private
String
stepsCode
;
private
Date
createTime
;
private
String
status
;
private
String
errorMsg
;
private
String
jobStatus
;
public
PeriodJobDto
copyFromPeriodJob
(
PeriodJob
job
)
{
this
.
id
=
job
.
getId
();
this
.
name
=
job
.
getName
();
this
.
currentStep
=
job
.
getCurrentStep
();
this
.
projectId
=
job
.
getProjectId
();
this
.
period
=
job
.
getPeriod
();
this
.
stepsCode
=
job
.
getStepsCode
();
this
.
createTime
=
job
.
getCreateTime
();
this
.
status
=
job
.
getStatus
();
this
.
errorMsg
=
job
.
getErrorMsg
();
MyAsserts
.
assertNotEmpty
(
stepsCode
,
Exceptions
.
SERVER_ERROR_EXCEPTION
);
if
(
StringUtils
.
isBlank
(
status
))
this
.
jobStatus
=
STATUS_BEGIN
;
else
{
List
<
WrapPeriodJobDto
.
Task
>
tasks
=
WrapPeriodJobDto
.
fromJson
(
status
);
if
(
Collections
.
isEmpty
(
tasks
))
this
.
jobStatus
=
STATUS_BEGIN
;
else
{
String
[]
codes
=
stepsCode
.
split
(
","
);
if
(
tasks
.
size
()
<
codes
.
length
)
this
.
jobStatus
=
STATUS_RUNNING
;
else
{
this
.
jobStatus
=
tasks
.
stream
().
anyMatch
(
m
->
m
.
status
.
equals
(
STATUS_ERROR
))
?
STATUS_ERROR
:
STATUS_END
;
}
}
}
return
this
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
View file @
d69a2b69
...
...
@@ -20,6 +20,7 @@ import java.util.UUID;
public
class
WrapPeriodJobDto
{
public
static
final
String
STATUS_BEGIN
=
"Begin"
;
public
static
final
String
STATUS_RUNNING
=
"Running"
;
public
static
final
String
STATUS_CANCEL
=
"Cancel"
;
public
static
final
String
STATUS_ERROR
=
"Error"
;
public
static
final
String
STATUS_END
=
"End"
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
d69a2b69
...
...
@@ -95,6 +95,7 @@ public class ReportGeneratorImpl {
String
code
=
sheet
.
getSheetName
();
logger
.
info
(
"-------------------------------------Begin Job [{}]------------------------------------------------------"
,
code
);
setStatus
(
job
,
code
,
STATUS_BEGIN
);
job
.
setCurrentStep
(
code
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
Optional
<
PeriodTemplate
>
periodTemplate
=
resources
.
getPeriodTemplates
().
stream
()
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
d69a2b69
...
...
@@ -516,7 +516,7 @@ public class ReportServiceImpl {
}
}
}).
start
();
operationResultDto
.
setData
(
genJob
);
operationResultDto
.
setData
(
new
PeriodJobDto
().
copyFromPeriodJob
(
genJob
)
);
operationResultDto
.
setResult
(
true
);
}
catch
(
Exception
ex
)
{
operationResultDto
.
setResult
(
false
);
...
...
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
d69a2b69
...
...
@@ -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,43 +557,47 @@
}
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'
){
items
.
forEach
(
function
(
item
,
index
){
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
.
jobStatus
==
'Running'
||
job
.
jobStatus
==
'Error'
){
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
);
}
})
});
});
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
);
});
if
(
job
.
jobStatus
==
'Error'
){
if
(
$scope
.
timer
)
$interval
.
cancel
(
$scope
.
timer
);
}
}
}
}
var
getInitTaskStatus
=
function
(){
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