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
2d9565ed
Commit
2d9565ed
authored
Apr 18, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1a9c6c4b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
14 deletions
+99
-14
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+5
-5
TrialBalanceFinalMapper.java
...ava/pwc/taxtech/atms/vat/dao/TrialBalanceFinalMapper.java
+4
-1
TrialBalanceFinalExtendsMapper.xml
...h/atms/vat/dao/extends/TrialBalanceFinalExtendsMapper.xml
+90
-8
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
2d9565ed
...
...
@@ -6,13 +6,10 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
com.grapecity.documents.excel.V
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.hssf.usermodel.HSSFCellStyle
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.util.CellRangeAddress
;
...
...
@@ -59,7 +56,6 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
...
...
@@ -335,7 +331,11 @@ public class ReportServiceImpl extends BaseService {
TrialBalanceFinalExample
example
=
new
TrialBalanceFinalExample
();
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
Integer
.
valueOf
(
queryPeriod
));
trialBalanceFinalMapper
.
deleteByExample
(
example
);
trialBalanceFinalMapper
.
generateFinalData
(
projectId
,
Integer
.
valueOf
(
queryPeriod
),
lastProject
==
null
?
"0"
:
lastProject
.
getId
(),
Integer
.
valueOf
(
lastPeriod
));
List
<
TrialBalanceFinal
>
dataList
=
trialBalanceFinalMapper
.
queryGenerateFinalData
(
projectId
,
Integer
.
valueOf
(
queryPeriod
),
lastProject
==
null
?
"0"
:
lastProject
.
getId
(),
Integer
.
valueOf
(
lastPeriod
));
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
List
<
List
<
TrialBalanceFinal
>>
batchList
=
CommonUtils
.
subListWithLen
(
dataList
,
CommonUtils
.
BATCH_NUM_2000
);
batchList
.
forEach
(
l
->
trialBalanceFinalMapper
.
batchInsert
(
l
));
}
}
public
void
assembleInvoiceRecord
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
)
{
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/TrialBalanceFinalMapper.java
View file @
2d9565ed
...
...
@@ -122,8 +122,10 @@ public interface TrialBalanceFinalMapper extends MyVatMapper {
@Param
(
"period"
)
Integer
period
,
@Param
(
"queryDate"
)
String
queryDate
);
int
g
enerateFinalData
(
@Param
(
"projectId"
)
String
projectId
,
List
<
TrialBalanceFinal
>
queryG
enerateFinalData
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
,
@Param
(
"lastProjectId"
)
String
lastProjectId
,
@Param
(
"lastPeriod"
)
Integer
lastPeriod
);
int
batchInsert
(
List
<
TrialBalanceFinal
>
list
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/TrialBalanceFinalExtendsMapper.xml
View file @
2d9565ed
...
...
@@ -74,10 +74,9 @@
order by detail.emptyCode
</select>
<insert
id=
"generateFinalData"
>
insert
into trial_balance_final
select balance.id,
<select
id=
"queryGenerateFinalData"
resultMap=
"BaseResultMap"
>
select
balance.id,
balance.organization_id,
balance.project_id,
balance.date,
...
...
@@ -124,11 +123,11 @@ select balance.id,
balance.ytd_cr,
balance.beg_bal_beq,
balance.period_dr_beq + if(adjustment.period_dr_beq is null, 0, adjustment.period_dr_beq) -
if(last_adjustment.period_dr_beq is null, 0, last_adjustment.period_dr_beq),
if(last_adjustment.period_dr_beq is null, 0, last_adjustment.period_dr_beq)
as period_dr_beq
,
balance.period_cr_beq + if(adjustment.period_cr_beq is null, 0, adjustment.period_cr_beq) -
if(last_adjustment.period_cr_beq is null, 0, last_adjustment.period_cr_beq),
if(last_adjustment.period_cr_beq is null, 0, last_adjustment.period_cr_beq)
as period_cr_beq
,
balance.end_bal_beq + if(adjustment.end_bal_beq is null, 0, adjustment.end_bal_beq) -
if(last_adjustment.end_bal_beq is null, 0, last_adjustment.end_bal_beq),
if(last_adjustment.end_bal_beq is null, 0, last_adjustment.end_bal_beq)
as end_bal_beq
,
balance.qtd_dr_beq,
balance.qtd_cr_beq,
balance.ytd_dr_beq,
...
...
@@ -194,5 +193,87 @@ where balance.project_id = #{projectId}
</insert>
</select>
<insert
id=
"batchInsert"
>
insert into trial_balance_final
(id, organization_id, project_id,
`date`, `source`, tms_period,
period, ledger_id, ledger_name,
currency_code, `status`, category,
account_category, acct_code1, acct_name1,
acct_name2, acct_name3, segment1,
segment2, segment3, segment4,
segment5, segment6, segment7,
segment8, segment9, segment10,
segment1_name, segment2_name, segment3_name,
segment4_name, segment5_name, segment6_name,
segment7_name, segment8_name, segment9_name,
segment10_name, beg_bal, period_dr,
period_cr, end_bal, qtd_dr,
qtd_cr, ytd_dr, ytd_cr,
beg_bal_beq, period_dr_beq, period_cr_beq,
end_bal_beq, qtd_dr_beq, qtd_cr_beq,
ytd_dr_beq, ytd_cr_beq, create_time,
update_time)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.id,jdbcType=BIGINT},
#{item.organizationId,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR},
#{item.date,jdbcType=TIMESTAMP},
#{item.source,jdbcType=VARCHAR},
#{item.tmsPeriod,jdbcType=INTEGER},
#{item.period,jdbcType=INTEGER},
#{item.ledgerId,jdbcType=VARCHAR},
#{item.ledgerName,jdbcType=VARCHAR},
#{item.currencyCode,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
#{item.category,jdbcType=VARCHAR},
#{item.accountCategory,jdbcType=VARCHAR},
#{item.acctCode1,jdbcType=VARCHAR},
#{item.acctName1,jdbcType=VARCHAR},
#{item.acctName2,jdbcType=VARCHAR},
#{item.acctName3,jdbcType=VARCHAR},
#{item.segment1,jdbcType=VARCHAR},
#{item.segment2,jdbcType=VARCHAR},
#{item.segment3,jdbcType=VARCHAR},
#{item.segment4,jdbcType=VARCHAR},
#{item.segment5,jdbcType=VARCHAR},
#{item.segment6,jdbcType=VARCHAR},
#{item.segment7,jdbcType=VARCHAR},
#{item.segment8,jdbcType=VARCHAR},
#{item.segment9,jdbcType=VARCHAR},
#{item.segment10,jdbcType=VARCHAR},
#{item.segment1Name,jdbcType=VARCHAR},
#{item.segment2Name,jdbcType=VARCHAR},
#{item.segment3Name,jdbcType=VARCHAR},
#{item.segment4Name,jdbcType=VARCHAR},
#{item.segment5Name,jdbcType=VARCHAR},
#{item.segment6Name,jdbcType=VARCHAR},
#{item.segment7Name,jdbcType=VARCHAR},
#{item.segment8Name,jdbcType=VARCHAR},
#{item.segment9Name,jdbcType=VARCHAR},
#{item.segment10Name,jdbcType=VARCHAR},
#{item.begBal,jdbcType=DECIMAL},
#{item.periodDr,jdbcType=DECIMAL},
#{item.periodCr,jdbcType=DECIMAL},
#{item.endBal,jdbcType=DECIMAL},
#{item.qtdDr,jdbcType=DECIMAL},
#{item.qtdCr,jdbcType=DECIMAL},
#{item.ytdDr,jdbcType=DECIMAL},
#{item.ytdCr,jdbcType=DECIMAL},
#{item.begBalBeq,jdbcType=DECIMAL},
#{item.periodDrBeq,jdbcType=DECIMAL},
#{item.periodCrBeq,jdbcType=DECIMAL},
#{item.endBalBeq,jdbcType=DECIMAL},
#{item.qtdDrBeq,jdbcType=DECIMAL},
#{item.qtdCrBeq,jdbcType=DECIMAL},
#{item.ytdDrBeq,jdbcType=DECIMAL},
#{item.ytdCrBeq,jdbcType=DECIMAL},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
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