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
de0f6192
Commit
de0f6192
authored
Nov 13, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] fixed status
parent
eb762354
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
23 deletions
+16
-23
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+16
-23
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
de0f6192
...
...
@@ -248,21 +248,15 @@ public class ReportServiceImpl {
@Transactional
private
void
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
,
List
<
Template
>
templates
,
PeriodJob
job
)
{
try
{
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
,
isMergeManualData
);
setStatus
(
job
,
STATUS_BEGIN
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
copyTemplateAndConfigFromAdmin
(
projectId
,
templates
,
period
);
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
,
isMergeManualData
);
copyTemplateAndConfigFromAdmin
(
projectId
,
templates
,
period
);
}
catch
(
Exception
ex
)
{
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
job
.
setErrorMsg
(
"error update config with projectId "
+
projectId
+
" period"
+
period
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
}
finally
{
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
setStatus
(
job
,
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
private
List
<
Template
>
getTemplatesByProjectId
(
String
projectId
)
{
...
...
@@ -454,13 +448,13 @@ public class ReportServiceImpl {
public
OperationResultDto
generateData
(
String
projectId
,
EnumServiceType
serviceType
,
Boolean
isMergeManualData
,
Integer
periodParam
,
Integer
reportType
,
Optional
<
String
>
generator
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
MyAsserts
.
assertEq
(
serviceType
,
EnumServiceType
.
VAT
,
new
NotFoundException
());
PeriodJobExample
example
=
new
PeriodJobExample
();
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
periodParam
)
.
andStatusEqualTo
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
MyAsserts
.
assertEmpty
(
periodJobMapper
.
selectByExample
(
example
),
Exceptions
.
TASK_HAS_BEGINNING
);
String
status
=
periodApprovalMapper
.
getStatusByProjectIdAndPeriod
(
projectId
,
periodParam
);
MyAsserts
.
assertTrue
(
status
==
null
||
status
.
equals
(
Constant
.
APPROVAL_DISAGREED
),
Exceptions
.
REPORT_IN_PROCESS_OR_AGREED_EXCEPTION
);
MyAsserts
.
assertEq
(
serviceType
,
EnumServiceType
.
VAT
,
new
NotFoundException
());
PeriodJobExample
example
=
new
PeriodJobExample
();
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
periodParam
)
.
andStatusEqualTo
(
WrapPeriodJobDto
.
STATUS_BEGIN
);
MyAsserts
.
assertEmpty
(
periodJobMapper
.
selectByExample
(
example
),
Exceptions
.
TASK_HAS_BEGINNING
);
String
status
=
periodApprovalMapper
.
getStatusByProjectIdAndPeriod
(
projectId
,
periodParam
);
MyAsserts
.
assertTrue
(
status
==
null
||
status
.
equals
(
Constant
.
APPROVAL_DISAGREED
),
Exceptions
.
REPORT_IN_PROCESS_OR_AGREED_EXCEPTION
);
try
{
if
(
serviceType
.
equals
(
EnumServiceType
.
VAT
)
&&
(
periodParam
==
null
||
periodParam
<=
0
))
{
...
...
@@ -478,7 +472,6 @@ public class ReportServiceImpl {
try
{
updateConfig
(
projectId
,
periodParam
,
isMergeManualData
,
templates
,
genJob
);
setStatus
(
genJob
,
STEP_UPDATE_CONFIG
,
STATUS_END
);
PeriodResources
resources
=
reportGenerator
.
getPeriodResources
(
projectId
,
periodParam
,
templates
.
stream
().
map
(
Template:
:
getId
).
collect
(
Collectors
.
toList
()));
...
...
@@ -493,8 +486,8 @@ public class ReportServiceImpl {
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
}
catch
(
Exception
e
)
{
setStatus
(
genJob
,
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error "
+
e
.
getMessage
());
setStatus
(
genJob
,
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error "
+
e
.
getMessage
());
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
e
.
printStackTrace
();
}
...
...
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