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
fd95a467
Commit
fd95a467
authored
Mar 23, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CIT--Excel导入完善及bug修改
parent
7db8502a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
7 deletions
+35
-7
CitImportExcelServiceImpl.java
.../taxtech/atms/service/impl/CitImportExcelServiceImpl.java
+30
-5
CitJournalAdjustExtendsMapper.xml
...axtech/atms/dao/extends/CitJournalAdjustExtendsMapper.xml
+5
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CitImportExcelServiceImpl.java
View file @
fd95a467
...
...
@@ -152,6 +152,14 @@ public class CitImportExcelServiceImpl extends BaseService {
String
companyName
=
CitCommonUtil
.
getValue
(
sheet
.
getRow
(
1
).
getCell
(
19
)).
toString
();
String
companyCode
=
CitCommonUtil
.
getValue
(
sheet
.
getRow
(
1
).
getCell
(
9
)).
toString
();
if
(
companyCode
==
null
){
saveResult
.
setResult
(
false
);
saveResult
.
setResultMsg
(
ErrorMessageCN
.
NoCompanyError
);
return
saveResult
;
}
companyCode
=
companyCode
.
contains
(
"."
)?
companyCode
.
substring
(
0
,
companyCode
.
indexOf
(
"."
)):
companyCode
;
//根据code(主体)获取机构相关信息
List
<
Organization
>
organizations
=
getOrganizationByCode
(
companyCode
);
String
orgId
=
""
;
...
...
@@ -295,16 +303,16 @@ public class CitImportExcelServiceImpl extends BaseService {
//覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg
=
"覆盖导入成功"
;
CitJournalEntryAdjustExample
citJEAExample
=
new
CitJournalEntryAdjustExample
();
citJEAExample
.
createCriteria
().
andCreatedByEqualTo
(
currentUserName
).
andPeriodEqualTo
(
period
).
and
OrganizationIdIn
(
orgList
);
citJEAExample
.
createCriteria
().
andCreatedByEqualTo
(
currentUserName
).
andPeriodEqualTo
(
period
).
and
ProjectIdEqualTo
(
projectId
);
logger
.
info
(
"删除符合条件的日记账"
);
citJournalEntryAdjustMapper
.
deleteByExample
(
citJEAExample
);
//删除自动生成的试算平衡表相关数据
CitTrialBalanceExample
citTbExample
=
new
CitTrialBalanceExample
();
citTbExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andCreateByEqualTo
(
currentUserName
).
and
OrganizationIdIn
(
orgList
);
citTbExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andCreateByEqualTo
(
currentUserName
).
and
ProjectIdEqualTo
(
projectId
);
int
deleteByExample
=
citTrialBalanceMapper
.
deleteByExample
(
citTbExample
);
logger
.
info
(
"删除符合条件的试算平衡表数据"
);
CitTbamExample
citTbamExample
=
new
CitTbamExample
();
citTbamExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andCreateByEqualTo
(
currentUserName
).
and
OrganizationIdIn
(
orgList
);
citTbamExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andCreateByEqualTo
(
currentUserName
).
and
ProjectIdEqualTo
(
projectId
);
logger
.
info
(
"删除符合条件的试算平衡表Mapping数据"
);
citTbamMapper
.
deleteByExample
(
citTbamExample
);
updateImportLog
(
EnumCitImportType
.
JournalAdjust
.
getCode
());
...
...
@@ -320,7 +328,7 @@ public class CitImportExcelServiceImpl extends BaseService {
//导入日志录入到数据库
addDataImportLog
(
citDataImportLogList
);
//根据日记账自动生成试算平衡表,即试算平衡表生成版
autoGeneTB
(
period
,
orgId
,
orgList
);
autoGeneTB
(
period
,
orgId
,
orgList
,
projectId
);
saveResult
.
setResult
(
true
);
saveResult
.
setResultMsg
(
"导入成功"
);
return
saveResult
;
...
...
@@ -362,6 +370,7 @@ public class CitImportExcelServiceImpl extends BaseService {
Map
<
String
,
Integer
>
companyFailMap
=
new
HashMap
();
Map
<
String
,
Integer
>
noCompanyMap
=
new
HashMap
();
Map
<
String
,
Integer
>
noProjectMap
=
new
HashMap
<>();
List
<
String
>
projectIdList
=
new
ArrayList
<>();
String
currentUserName
=
authUserHelper
.
getCurrentAuditor
().
get
();
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for
(
int
rowNum
=
sheet
.
getFirstRowNum
()
+
8
;
rowNum
<=
sheet
.
getLastRowNum
();
rowNum
++)
{
...
...
@@ -417,6 +426,7 @@ public class CitImportExcelServiceImpl extends BaseService {
noProjectMap
.
put
(
sb
.
toString
(),
companyFailMap
.
containsKey
(
sb
.
toString
())?
companyFailMap
.
get
(
sb
.
toString
())+
1
:
1
);
continue
;
}
projectIdList
.
add
(
projectId
);
companySuccessMap
.
put
(
sb
.
toString
(),
companySuccessMap
.
containsKey
(
sb
.
toString
())?
companySuccessMap
.
get
(
sb
.
toString
())+
1
:
1
);
}
else
{
...
...
@@ -451,6 +461,7 @@ public class CitImportExcelServiceImpl extends BaseService {
CitTrialBalanceExample
.
Criteria
criteria
=
citTrialBalanceExample
.
createCriteria
();
criteria
.
andCreateByEqualTo
(
currentUserName
);
criteria
.
andPeriodEqualTo
(
period
);
criteria
.
andProjectIdIn
(
projectIdList
);
citTrialBalanceMapper
.
deleteByExample
(
citTrialBalanceExample
);
updateImportLog
(
EnumCitImportType
.
TrialBalance
.
getCode
());
}
...
...
@@ -627,6 +638,11 @@ public class CitImportExcelServiceImpl extends BaseService {
List
<
CitDataImportLog
>
citDataImportLogList
=
new
ArrayList
<>();
// Integer period = CitCommonUtil.getPeriod();
String
companyName
=
CitCommonUtil
.
getValue
(
sheet
.
getRow
(
5
).
getCell
(
1
)).
toString
();
if
(
companyName
==
null
){
saveResult
.
setResult
(
false
);
saveResult
.
setResultMsg
(
ErrorMessageCN
.
NoCompanyError
);
return
saveResult
;
}
List
<
Organization
>
organizations
=
getOrganizationByName
(
companyName
).
stream
().
filter
(
r
->
r
.
getCode
()!=
null
&&!(
""
.
equals
(
r
.
getCode
()))).
collect
(
Collectors
.
toList
());
String
companyCode
=
""
;
String
orgId
=
""
;
...
...
@@ -713,6 +729,7 @@ public class CitImportExcelServiceImpl extends BaseService {
CitBalanceSheetPrcAdjustExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andCreateByEqualTo
(
currentUserName
);
criteria
.
andPeriodEqualTo
(
period
);
criteria
.
andProjectIdEqualTo
(
projectId
);
citBSPrcAdjustMapper
.
deleteByExample
(
example
);
updateImportLog
(
EnumCitImportType
.
BalanceSheetPrcAdjust
.
getCode
());
}
...
...
@@ -762,6 +779,12 @@ public class CitImportExcelServiceImpl extends BaseService {
// Integer period = CitCommonUtil.getPeriod();
String
companyName
=
CitCommonUtil
.
getValue
(
sheet
.
getRow
(
4
).
getCell
(
1
)).
toString
();
String
companyCode
=
CitCommonUtil
.
getValue
(
sheet
.
getRow
(
5
).
getCell
(
1
)).
toString
();
if
(
companyCode
==
null
){
saveResult
.
setResult
(
false
);
saveResult
.
setResultMsg
(
ErrorMessageCN
.
NoCompanyError
);
return
saveResult
;
}
companyCode
=
companyCode
.
contains
(
"."
)?
companyCode
.
substring
(
0
,
companyCode
.
indexOf
(
"."
)):
companyCode
;
List
<
Organization
>
organizations
=
getOrganizationByCode
(
companyCode
);
String
orgId
=
""
;
String
projectId
=
""
;
...
...
@@ -842,6 +865,7 @@ public class CitImportExcelServiceImpl extends BaseService {
CitProfitPrcAdjustExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andCreateByEqualTo
(
currentUserName
);
criteria
.
andPeriodEqualTo
(
period
);
criteria
.
andProjectIdEqualTo
(
projectId
);
citProfitPrcAdjustMapper
.
deleteByExample
(
example
);
updateImportLog
(
EnumCitImportType
.
ProfitPrcAdjust
.
getCode
());
}
...
...
@@ -1268,7 +1292,7 @@ public class CitImportExcelServiceImpl extends BaseService {
* @param orgList
* @return
*/
public
OperationResultDto
autoGeneTB
(
Integer
period
,
String
orgId
,
List
<
String
>
orgList
){
public
OperationResultDto
autoGeneTB
(
Integer
period
,
String
orgId
,
List
<
String
>
orgList
,
String
projectId
){
OperationResultDto
autoGeneResult
=
new
OperationResultDto
();
//第一步,根据合并日记账计算出借方发生额,贷方发生额,科目代码等相关信息
...
...
@@ -1289,6 +1313,7 @@ public class CitImportExcelServiceImpl extends BaseService {
trialBalance
.
setPeriod
(
period
);
trialBalance
.
setCreateBy
(
currentUserName
);
trialBalance
.
setOrganizationId
(
orgId
);
trialBalance
.
setProjectId
(
projectId
);
trialBalance
.
setAccountCode
(
citJournal
.
getSubjectCode
());
trialBalance
.
setAccountDescription
(
citJournal
.
getSubjectName
());
//此期间默认为12
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/CitJournalAdjustExtendsMapper.xml
View file @
fd95a467
...
...
@@ -297,6 +297,7 @@
<select
id=
"sumAmountByCondition"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
subject_code as subject_code,
max(jfinal.subject_name) as subject_name,
sum(jfinal.accounted_dr) as accounted_dr,
sum(jfinal.accounted_cr) as accounted_cr
from
...
...
@@ -304,7 +305,8 @@
select
cj.accounted_dr as accounted_dr,
cj.accounted_cr as accounted_cr ,
cj.subject_code as subject_code
cj.subject_code as subject_code,
cj.subject_name as subject_name
from
cit_journal_entry_adjust cj
where
...
...
@@ -321,7 +323,8 @@
select
j.accounted_dr as accounted_dr,
j.accounted_cr as accounted_cr,
j.segment3 as subject_code
j.segment3 as subject_code,
j.segment3_name as subject_name
from
journal_entry j
where
...
...
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