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
1467071b
Commit
1467071b
authored
Sep 30, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] user mapper examole clear period cell data
parent
7243be85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
3 deletions
+59
-3
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+59
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
1467071b
...
...
@@ -25,6 +25,8 @@ import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountResultDto;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.exception.NotSupportedException
;
import
pwc.taxtech.atms.service.impl.CellConfigTranslater
;
import
pwc.taxtech.atms.vat.dao.PeriodTaxPayerReportRuleMapper
;
import
pwc.taxtech.atms.vat.dao.PeriodTaxRuleSettingMapper
;
import
pwc.taxtech.atms.vat.dpo.DataSourceCellDataDto
;
import
pwc.taxtech.atms.vat.dpo.DataSourceExtendDto
;
import
pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto
;
...
...
@@ -44,10 +46,11 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
SpringContextUtil
.
periodEnterpriseAccountMapper
;
@Component
public
class
ReportServiceImpl
extends
VatAbstractService
implements
ReportService
{
private
PeriodTaxRuleSettingMapper
periodTaxRuleSettingMapper
;
private
PeriodTaxPayerReportRuleMapper
periodTaxPayerReportRuleMapper
;
@Override
public
OperationResultDto
<
List
<
ReportDto
>>
getReportTemplate
(
String
projectId
,
EnumServiceType
serviceType
,
Integer
periodParam
)
{
int
period
=
periodParam
!=
null
?
periodParam
:
0
;
...
...
@@ -116,6 +119,58 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
return
operationResult
;
}
private
void
clearPeriodData
(
String
projectId
,
Integer
period
,
List
<
Long
>
templateIds
)
{
PeriodFormulaBlockExample
periodFormulaBlockExample
=
new
PeriodFormulaBlockExample
();
periodFormulaBlockExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodFormulaBlockMapper
.
deleteByExample
(
periodFormulaBlockExample
);
PeriodTaxRuleSettingExample
periodTaxRuleSettingExample
=
new
PeriodTaxRuleSettingExample
();
periodTaxRuleSettingExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodTaxRuleSettingMapper
.
deleteByExample
(
periodTaxRuleSettingExample
);
PeriodCellTemplateExample
periodCellTemplateExample
=
new
PeriodCellTemplateExample
();
periodCellTemplateExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
).
andReportTemplateIdIn
(
templateIds
);
periodCellTemplateMapper
.
deleteByExample
(
periodCellTemplateExample
);
PeriodCellTemplateConfigExample
periodCellTemplateConfigExample
=
new
PeriodCellTemplateConfigExample
();
periodCellTemplateConfigExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
).
andReportTemplateIdIn
(
templateIds
);
periodCellTemplateConfigMapper
.
deleteByExample
(
periodCellTemplateConfigExample
);
PeriodTemplateExample
periodTemplateExample
=
new
PeriodTemplateExample
();
periodTemplateExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
).
andTemplateIdIn
(
templateIds
)
periodTemplateMapper
.
deleteByExample
(
periodTemplateExample
);
PeriodTaxPayerReportRuleExample
periodTaxPayerReportRuleExample
=
new
PeriodTaxPayerReportRuleExample
();
periodTaxPayerReportRuleExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodTaxPayerReportRuleMapper
.
deleteByExample
(
periodTaxPayerReportRuleExample
);
PeriodDataSourceExample
periodDataSourceExample
=
new
PeriodDataSourceExample
();
periodDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
List
<
PeriodDataSource
>
periodDataSources
=
periodDataSourceMapper
.
selectByExample
(
periodDataSourceExample
);
PeriodDataSourceDetailExample
periodDataSourceDetailExample
=
new
PeriodDataSourceDetailExample
();
periodDataSourceDetailExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodDataSources
.
stream
().
map
(
m
->
m
.
getId
()).
collect
(
Collectors
.
toList
()));
periodDataSourceDetailMapper
.
deleteByExample
(
periodDataSourceDetailExample
);
PeriodCellDataSourceExample
periodCellDataSourceExample
=
new
PeriodCellDataSourceExample
();
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodDataSources
.
stream
().
map
(
m
->
m
.
getId
()).
collect
(
Collectors
.
toList
()));
periodCellDataSourceMapper
.
deleteByExample
(
periodCellDataSourceExample
);
periodDataSourceMapper
.
deleteByExample
(
periodDataSourceExample
);
PeriodReportExample
periodReportExample
=
new
PeriodReportExample
();
periodReportExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
List
<
PeriodReport
>
reports
=
periodReportMapper
.
selectByExample
(
periodReportExample
);
PeriodCellDataExample
periodCellDataExample
=
new
PeriodCellDataExample
();
periodCellDataExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
).
andReportIdIn
(
reports
.
stream
().
map
(
m
->
m
.
getId
()).
collect
(
Collectors
.
toList
()));
periodCellDataMapper
.
deleteByExample
(
periodCellDataExample
);
periodReportMapper
.
deleteByExample
(
periodReportExample
);
}
@Override
public
OperationResultDto
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
ifDeleteManualDataSource
,
String
generator
)
{
OperationResultDto
result
=
new
OperationResultDto
();
...
...
@@ -157,7 +212,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
// dataSourceMapper.clearDataSourceWithPeriod(period);
// dataSourceMapper.clearCellDataWithPeriod(strExceptTemplateIds, period);
// dataSourceMapper.clearReportWithPeriod(period);
periodDataSourceMapper
.
clearDataWithPeriod
(
strExceptTemplateIds
,
period
);
clearPeriodData
(
projectId
,
period
,
exceptTemplateIds
);
// 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample
example
=
new
TemplateExample
();
example
.
createCriteria
().
andTemplateGroupIdEqualTo
(
templateGroupId
);
...
...
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