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
88c65e7b
Commit
88c65e7b
authored
Mar 12, 2019
by
Ken you
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add prc taskId ---Ken
parent
7bfe5b38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
23 deletions
+46
-23
EbsApiController.java
...in/java/pwc/taxtech/atms/controller/EbsApiController.java
+0
-1
EbsApiServiceImpl.java
...java/pwc/taxtech/atms/service/impl/EbsApiServiceImpl.java
+46
-22
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/EbsApiController.java
View file @
88c65e7b
...
...
@@ -4,7 +4,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.constant.CodeErrorConstant
;
import
pwc.taxtech.atms.constant.enums.EnumErrorCodeMsg
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
pwc.taxtech.atms.dto.ebsdto.*
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/EbsApiServiceImpl.java
View file @
88c65e7b
...
...
@@ -37,12 +37,20 @@ public class EbsApiServiceImpl implements EbsApiService {
@Resource
private
BalanceSheetMapper
balanceSheetMapper
;
@Resource
private
BalanceSheetPrcMapper
balanceSheetPrcMapper
;
@Resource
private
BalanceSheetFinalMapper
balanceSheetFinalMapper
;
@Resource
private
BalanceSheetPrcFinalMapper
balanceSheetPrcFinalMapper
;
@Resource
private
ProfitLossStatementMapper
profitLossStatementMapper
;
@Resource
private
ProfitLossStatementPrcMapper
profitLossStatementPrcMapper
;
@Resource
private
ProfitLossStatementFinalMapper
profitLossStatementFinalMapper
;
@Resource
private
ProfitLossStatementPrcFinalMapper
profitLossStatementPrcFinalMapper
;
@Resource
private
OrganizationAccountingRateMapper
organizationAccountingRateMapper
;
@Resource
private
OrganizationMapper
organizationMapper
;
...
...
@@ -233,7 +241,7 @@ public class EbsApiServiceImpl implements EbsApiService {
private
void
processJE
(
JournalEntryQueryDto
item
)
{
JournalEntryExample
journalEntryExample
=
new
JournalEntryExample
();
//日记账头ID和日记账行号
journalEntryExample
.
createCriteria
().
andHeaderIdEqualTo
(
item
.
getHeaderId
()).
andLineNumEqualTo
(
item
.
getLineNum
()).
andTaskIdEqualTo
(
item
.
getTaskId
());
journalEntryExample
.
createCriteria
().
andHeaderIdEqualTo
(
item
.
getHeaderId
()).
andLineNumEqualTo
(
item
.
getLineNum
()).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
JournalEntry
>
journalEntryList
=
journalEntryMapper
.
selectByExample
(
journalEntryExample
);
//唯一则更新否则插入
JournalEntry
journalEntry
=
new
JournalEntry
();
...
...
@@ -257,7 +265,7 @@ public class EbsApiServiceImpl implements EbsApiService {
private
void
processTB
(
Long
id
,
TrialBalanceQueryDto
item
)
{
TrialBalanceExample
example
=
new
TrialBalanceExample
();
//机构编码和期间
example
.
createCriteria
().
andSegment1EqualTo
(
item
.
getSegment1
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
example
.
createCriteria
().
andSegment1EqualTo
(
item
.
getSegment1
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
TrialBalance
>
itemList
=
trialBalanceMapper
.
selectByExample
(
example
);
//唯一则更新否则插入
TrialBalance
result
=
new
TrialBalance
();
...
...
@@ -276,7 +284,7 @@ public class EbsApiServiceImpl implements EbsApiService {
private
void
processCF
(
Long
id
,
CashFlowQueryDto
item
)
{
CashFlowExample
example
=
new
CashFlowExample
();
//机构编码和期间
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
CashFlow
>
itemList
=
cashFlowMapper
.
selectByExample
(
example
);
//唯一则更新否则插入
CashFlow
result
=
new
CashFlow
();
...
...
@@ -296,7 +304,7 @@ public class EbsApiServiceImpl implements EbsApiService {
private
void
processBS
(
Long
id
,
BalanceSheetQueryDto
item
)
{
BalanceSheetExample
example
=
new
BalanceSheetExample
();
//机构编码和期间
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
BalanceSheet
>
itemList
=
balanceSheetMapper
.
selectByExample
(
example
);
//唯一则更新否则插入
BalanceSheet
result
=
new
BalanceSheet
();
...
...
@@ -313,7 +321,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger
.
debug
(
"start to insert balanceSheetFinal "
);
// 1、写入最终表
BalanceSheetExample
balanceSheetExample
=
new
BalanceSheetExample
();
balanceSheetExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
());
balanceSheetExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
())
.
andTaskIdNotEqualTo
(
item
.
getTaskId
())
;
if
(
balanceSheetFinalMapper
.
countByExample
(
balanceSheetExample
)
>
0
)
{
balanceSheetFinalMapper
.
deleteByExample
(
balanceSheetExample
);
}
...
...
@@ -322,28 +330,36 @@ public class EbsApiServiceImpl implements EbsApiService {
private
void
processBSprc
(
Long
id
,
BalanceSheetPrcQueryDto
item
)
{
BalanceSheet
Example
example
=
new
BalanceSheet
Example
();
BalanceSheet
PrcExample
example
=
new
BalanceSheetPrc
Example
();
//机构编码和期间
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
List
<
BalanceSheet
>
itemList
=
balanceSheet
Mapper
.
selectByExample
(
example
);
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
BalanceSheet
Prc
>
itemList
=
balanceSheetPrc
Mapper
.
selectByExample
(
example
);
//唯一则更新否则插入
BalanceSheet
result
=
new
BalanceSheet
();
BalanceSheet
Prc
result
=
new
BalanceSheetPrc
();
if
(
itemList
.
size
()
>
0
)
{
logger
.
debug
(
"exit and delete BalanceSheetPrc EntityCode:{},Period:{},taskId:{}"
,
item
.
getEntityCode
(),
item
.
getPeriod
(),
item
.
getTaskId
());
balanceSheetMapper
.
deleteByExample
(
example
);
balanceSheet
Prc
Mapper
.
deleteByExample
(
example
);
}
logger
.
debug
(
"insert BalanceSheetPrc EntityCode:{},Period:{},taskId:{}"
,
item
.
getEntityCode
(),
item
.
getPeriod
(),
item
.
getTaskId
());
populateFieldsBSprc
(
item
,
result
);
result
.
setId
(
distributedIdService
.
nextId
());
result
.
setCreateBy
(
getCurrentOperatorName
(
id
));
result
.
setCreateTime
(
new
Date
());
balanceSheetMapper
.
insertSelective
(
result
);
balanceSheetPrcMapper
.
insertSelective
(
result
);
// 1、写入最终表
logger
.
debug
(
"start to insert BalanceSheetPrcFinal "
);
BalanceSheetPrcExample
balanceSheetPrcExample
=
new
BalanceSheetPrcExample
();
balanceSheetPrcExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
()).
andTaskIdNotEqualTo
(
item
.
getTaskId
());
if
(
balanceSheetPrcFinalMapper
.
countByExample
(
balanceSheetPrcExample
)
>
0
)
{
balanceSheetPrcFinalMapper
.
deleteByExample
(
balanceSheetPrcExample
);
}
balanceSheetPrcFinalMapper
.
insertSelective
(
result
);
}
private
void
processPL
(
Long
id
,
ProfitLossStatementQueryDto
item
)
{
ProfitLossStatementExample
example
=
new
ProfitLossStatementExample
();
//机构编码和期间
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
ProfitLossStatement
>
itemList
=
profitLossStatementMapper
.
selectByExample
(
example
);
//唯一则更新否则插入
ProfitLossStatement
result
=
new
ProfitLossStatement
();
...
...
@@ -360,7 +376,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger
.
debug
(
"start to insert profitLossStatementFinal "
);
// 1、写入最终表
ProfitLossStatementExample
profitLossStatementExample
=
new
ProfitLossStatementExample
();
profitLossStatementExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
());
profitLossStatementExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
())
.
andTaskIdNotEqualTo
(
item
.
getTaskId
())
;
if
(
profitLossStatementFinalMapper
.
countByExample
(
profitLossStatementExample
)
>
0
)
{
profitLossStatementFinalMapper
.
deleteByExample
(
profitLossStatementExample
);
}
...
...
@@ -368,28 +384,36 @@ public class EbsApiServiceImpl implements EbsApiService {
}
private
void
processPLprc
(
Long
id
,
ProfitLossStatementPrcQueryDto
item
)
{
ProfitLossStatement
Example
example
=
new
ProfitLossStatement
Example
();
ProfitLossStatement
PrcExample
example
=
new
ProfitLossStatementPrc
Example
();
//机构编码和期间
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
List
<
ProfitLossStatement
>
itemList
=
profitLossStatement
Mapper
.
selectByExample
(
example
);
example
.
createCriteria
().
andEntityCodeEqualTo
(
item
.
getEntityCode
()).
andPeriodEqualTo
(
convertPeriodStr2Int
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
ProfitLossStatement
Prc
>
itemList
=
profitLossStatementPrc
Mapper
.
selectByExample
(
example
);
//唯一则更新否则插入
ProfitLossStatement
result
=
new
ProfitLossStatement
();
ProfitLossStatement
Prc
result
=
new
ProfitLossStatementPrc
();
if
(
itemList
.
size
()
>
0
)
{
logger
.
debug
(
"exit and delete ProfitLossStatementPrc EntityCode:{},Period:{},taskId:{}"
,
item
.
getEntityCode
(),
item
.
getPeriod
(),
item
.
getTaskId
());
profitLossStatementMapper
.
deleteByExample
(
example
);
profitLossStatement
Prc
Mapper
.
deleteByExample
(
example
);
}
logger
.
debug
(
"insert ProfitLossStatementPrc EntityCode:{},Period:{},taskId:{}"
,
item
.
getEntityCode
(),
item
.
getPeriod
(),
item
.
getTaskId
());
populateFieldsPLSprc
(
item
,
result
);
result
.
setId
(
distributedIdService
.
nextId
());
result
.
setCreateTime
(
new
Date
());
result
.
setCreateBy
(
getCurrentOperatorName
(
id
));
profitLossStatementMapper
.
insertSelective
(
result
);
profitLossStatementPrcMapper
.
insertSelective
(
result
);
logger
.
debug
(
"start to insert profitLossStatementPrcFinal "
);
// 1、写入最终表
ProfitLossStatementPrcExample
profitLossStatementPrcExample
=
new
ProfitLossStatementPrcExample
();
profitLossStatementPrcExample
.
createCriteria
().
andOrganizationIdEqualTo
(
result
.
getOrganizationId
()).
andPeriodEqualTo
(
result
.
getPeriod
()).
andTaskIdNotEqualTo
(
item
.
getTaskId
());
if
(
profitLossStatementPrcFinalMapper
.
countByExample
(
profitLossStatementPrcExample
)
>
0
)
{
profitLossStatementPrcFinalMapper
.
deleteByExample
(
profitLossStatementPrcExample
);
}
profitLossStatementPrcFinalMapper
.
insertSelective
(
result
);
}
private
void
processOAR
(
Long
id
,
OrganizationAccountingRateQueryDto
item
)
{
OrganizationAccountingRateExample
example
=
new
OrganizationAccountingRateExample
();
//期间
example
.
createCriteria
().
andPeriodEqualTo
(
convertPeriod12
(
item
.
getPeriod
())).
andTaskIdEqualTo
(
item
.
getTaskId
());
example
.
createCriteria
().
andPeriodEqualTo
(
convertPeriod12
(
item
.
getPeriod
())).
andTaskId
Not
EqualTo
(
item
.
getTaskId
());
List
<
OrganizationAccountingRate
>
itemList
=
organizationAccountingRateMapper
.
selectByExample
(
example
);
//唯一则更新否则插入
OrganizationAccountingRate
result
=
new
OrganizationAccountingRate
();
...
...
@@ -640,7 +664,7 @@ public class EbsApiServiceImpl implements EbsApiService {
result
.
setTmsPeriod
(
convertPeriod
);
}
private
void
populateFieldsBSprc
(
BalanceSheetPrcQueryDto
item
,
BalanceSheet
result
)
{
private
void
populateFieldsBSprc
(
BalanceSheetPrcQueryDto
item
,
BalanceSheet
Prc
result
)
{
Integer
originPeriod
=
convertPeriodStr2Int
(
item
.
getPeriod
());
Integer
convertPeriod
=
convertPeriod12
(
item
.
getPeriod
());
result
.
setOrganizationId
(
getOrganizationByEbsCode
(
item
.
getEntityCode
()).
getId
());
...
...
@@ -696,7 +720,7 @@ public class EbsApiServiceImpl implements EbsApiService {
result
.
setUpdateTime
(
new
Date
());
}
private
void
populateFieldsPLSprc
(
ProfitLossStatementPrcQueryDto
item
,
ProfitLossStatement
result
)
{
private
void
populateFieldsPLSprc
(
ProfitLossStatementPrcQueryDto
item
,
ProfitLossStatement
Prc
result
)
{
Integer
originPeriod
=
convertPeriodStr2Int
(
item
.
getPeriod
());
Integer
convertPeriod
=
convertPeriod12
(
item
.
getPeriod
());
result
.
setOrganizationId
(
getOrganizationByEbsCode
(
item
.
getEntityCode
()).
getId
());
...
...
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