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
5b3df9e0
Commit
5b3df9e0
authored
Nov 14, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
c4501047
fd4a320a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
33 deletions
+83
-33
WrapPeriodJobDto.java
...in/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
+57
-2
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+0
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+19
-28
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+3
-3
vat-report-view.ctrl.js
...p/common/controls/vat-report-view/vat-report-view.ctrl.js
+2
-0
vat-caculate-data.ctrl.js
...vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
+2
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
View file @
5b3df9e0
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Select
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.Template
;
...
...
@@ -27,9 +34,8 @@ public class WrapPeriodJobDto {
job
.
setProjectId
(
projectId
);
job
.
setPeriod
(
period
);
job
.
setId
(
UUID
.
randomUUID
().
toString
());
job
.
setStatus
(
STATUS_BEGIN
);
job
.
setCurrentStep
(
STEP_UPDATE_CONFIG
);
setStatus
(
job
,
STEP_UPDATE_CONFIG
,
STATUS_BEGIN
);
StringBuilder
builder
=
new
StringBuilder
(
STEP_UPDATE_CONFIG
);
templates
.
forEach
(
m
->
{
builder
.
append
(
","
).
append
(
m
.
getCode
());
...
...
@@ -38,4 +44,53 @@ public class WrapPeriodJobDto {
job
.
setStepsCode
(
builder
.
toString
());
return
job
;
}
@Getter
@Setter
public
static
class
Task
{
String
code
;
String
status
;
}
public
static
List
<
Task
>
fromJson
(
String
taskJson
)
{
return
JSON
.
parseObject
(
taskJson
,
new
TypeReference
<
List
<
Task
>>()
{});
}
public
static
String
toJson
(
List
<
Task
>
tasks
)
{
return
JSON
.
toJSONString
(
tasks
);
}
public
static
void
setStatus
(
PeriodJob
periodJob
,
String
code
,
String
status
)
{
List
<
Task
>
list
;
if
(
StringUtils
.
isBlank
(
periodJob
.
getStatus
()))
{
list
=
new
ArrayList
<>();
}
else
{
list
=
fromJson
(
periodJob
.
getStatus
());
}
Task
t
=
new
Task
();
t
.
code
=
code
;
t
.
status
=
status
;
boolean
contains
=
false
;
for
(
Task
m
:
list
)
{
if
(
m
.
code
.
equals
(
t
.
code
))
{
m
.
status
=
status
;
contains
=
true
;
break
;
}
}
if
(!
contains
)
list
.
add
(
t
);
periodJob
.
setStatus
(
toJson
(
list
));
}
public
static
void
setStatus
(
PeriodJob
periodJob
,
String
status
)
{
List
<
Task
>
list
;
if
(
StringUtils
.
isBlank
(
periodJob
.
getStatus
()))
{
list
=
new
ArrayList
<>();
}
else
{
list
=
fromJson
(
periodJob
.
getStatus
());
}
list
.
get
(
list
.
size
()-
1
).
status
=
status
;
periodJob
.
setStatus
(
toJson
(
list
));
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
5b3df9e0
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
5b3df9e0
...
...
@@ -42,6 +42,8 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
dto
.
vatdto
.
WrapPeriodJobDto
.*;
@Component
public
class
ReportServiceImpl
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ReportServiceImpl
.
class
);
...
...
@@ -244,23 +246,16 @@ public class ReportServiceImpl {
}
@Transactional
public
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
);
private
void
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
,
List
<
Template
>
templates
,
PeriodJob
job
)
{
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
)
{
...
...
@@ -452,13 +447,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
))
{
...
...
@@ -489,13 +484,9 @@ public class ReportServiceImpl {
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
catch
(
Exception
e
)
{
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error "
+
e
.
getMessage
());
setStatus
(
genJob
,
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Sever error "
+
e
.
getMessage
());
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
e
.
printStackTrace
();
}
...
...
atms-api/src/main/resources/conf/conf_profile_dev.properties
View file @
5b3df9e0
jdbc_url
=
jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc_user
=
TAX_ADMIN
jdbc_password
=
tax
admin2018
jdbc_user
=
tax_admin_longi
jdbc_password
=
tax
_admin_longi
#jdbc_password=111111
jdbc_admin_db
=
tax_admin
jdbc_admin_db
=
tax_admin
_longi
#jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
#jdbc_user=tax_admin_longi
...
...
atms-web/src/main/webapp/app/common/controls/vat-report-view/vat-report-view.ctrl.js
View file @
5b3df9e0
...
...
@@ -2579,6 +2579,8 @@
$scope
.
agreeApproval
=
function
(){
vatApproveService
.
checkTask
(
vatSessionService
.
approvalInfo
.
instanceId
,
'agreed'
,
$scope
.
comment
).
success
(
function
(){
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Completed
,
constant
.
DictionaryDictKey
.
WFDataProcess
,
enums
.
FinishStatusEnum
.
Finished
);
$
(
"#ApprovalComment"
).
modal
(
'hide'
);
});
}
...
...
atms-web/src/main/webapp/app/vat/reduction/vat-caculate-data/vat-caculate-data.ctrl.js
View file @
5b3df9e0
...
...
@@ -570,6 +570,8 @@
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'
;
...
...
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