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
efb95a66
Commit
efb95a66
authored
Nov 14, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] cacls job status from task status
parent
fd4a320a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
3 deletions
+59
-3
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+2
-2
PeriodJobDto.java
...c/main/java/pwc/taxtech/atms/dto/vatdto/PeriodJobDto.java
+54
-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
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
efb95a66
...
...
@@ -48,8 +48,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 @
efb95a66
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
io.jsonwebtoken.lang.Collections
;
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
.*;
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
jotStatus
;
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
.
jotStatus
=
STATUS_BEGIN
;
else
{
List
<
WrapPeriodJobDto
.
Task
>
tasks
=
WrapPeriodJobDto
.
fromJson
(
status
);
if
(
Collections
.
isEmpty
(
tasks
))
this
.
jotStatus
=
STATUS_BEGIN
;
else
{
String
[]
codes
=
stepsCode
.
split
(
","
);
if
(
tasks
.
size
()
<
codes
.
length
)
this
.
jotStatus
=
STATUS_RUNNING
;
else
{
this
.
jotStatus
=
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 @
efb95a66
...
...
@@ -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 @
efb95a66
...
...
@@ -94,6 +94,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 @
efb95a66
...
...
@@ -492,7 +492,7 @@ public class ReportServiceImpl {
}
}
}).
start
();
operationResultDto
.
setData
(
genJob
);
operationResultDto
.
setData
(
new
PeriodJobDto
().
copyFromPeriodJob
(
genJob
)
);
operationResultDto
.
setResult
(
true
);
}
catch
(
Exception
ex
)
{
operationResultDto
.
setResult
(
false
);
...
...
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