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
8234757b
Commit
8234757b
authored
Sep 29, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change to periodXXX table
parent
698f9c26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
139 additions
and
52 deletions
+139
-52
SpringContextUtil.java
.../java/pwc/taxtech/atms/common/util/SpringContextUtil.java
+10
-0
CellCommentController.java
...va/pwc/taxtech/atms/controller/CellCommentController.java
+8
-6
ReportCellDataSourceDto.java
.../pwc/taxtech/atms/dto/vatdto/ReportCellDataSourceDto.java
+2
-1
VatEnterpriseAccountDao.java
...ava/pwc/taxtech/atms/vat/dao/VatEnterpriseAccountDao.java
+6
-4
CellCommentServiceImpl.java
...taxtech/atms/vat/service/impl/CellCommentServiceImpl.java
+2
-1
FormulaAgent.java
.../java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
+9
-9
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+10
-10
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+0
-0
VatAbstractService.java
...pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
+10
-1
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+2
-1
FSJZ.java
.../taxtech/atms/vat/service/impl/report/functions/FSJZ.java
+3
-6
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+7
-9
PeriodCellDataMapper.java
...n/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
+21
-0
PeriodDataSourceMapper.java
...java/pwc/taxtech/atms/vat/dao/PeriodDataSourceMapper.java
+33
-0
PeriodEnterpriseAccountMapper.java
...c/taxtech/atms/vat/dao/PeriodEnterpriseAccountMapper.java
+5
-0
DataSourceExtendDto.java
...in/java/pwc/taxtech/atms/vat/dpo/DataSourceExtendDto.java
+5
-4
PeriodCellDataExtendsMapper.xml
...tech/atms/vat/dao/extends/PeriodCellDataExtendsMapper.xml
+6
-0
PeriodDataSourceExtendsMapper.xml
...ch/atms/vat/dao/extends/PeriodDataSourceExtendsMapper.xml
+0
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/SpringContextUtil.java
View file @
8234757b
...
...
@@ -21,6 +21,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public
static
FormulaAdminMapper
formulaAdminMapper
;
public
static
ReportMapper
reportMapper
;
public
static
CellDataMapper
cellDataMapper
;
public
static
PeriodCellDataMapper
periodCellDataMapper
;
public
static
DistributedIdService
distributedIdService
;
public
static
PeriodFormulaBlockMapper
formulaBlockMapper
;
public
static
PeriodCellTemplateMapper
periodCellTemplateMapper
;
...
...
@@ -31,10 +32,13 @@ public class SpringContextUtil implements ApplicationContextAware {
public
static
ProjectDao
projectDao
;
public
static
BalanceMapper
balanceMapper
;
public
static
DataSourceMapper
dataSourceMapper
;
public
static
PeriodDataSourceMapper
periodDataSourceMapper
;
public
static
DataSourceDetailMapper
dataSourceDetailMapper
;
public
static
PeriodDataSourceDetailMapper
periodDataSourceDetailMapper
;
public
static
PeriodFormulaBlockMapper
periodFormulaBlockMapper
;
public
static
VatEnterpriseAccountDao
vatEnterpriseAccountDao
;
public
static
VatEnterpriseAccountMapper
vatEnterpriseAccountMapper
;
public
static
PeriodEnterpriseAccountMapper
periodEnterpriseAccountMapper
;
public
static
BalanceStdManualMapper
balanceStdManualMapper
;
public
static
OutputVatInvoiceMapper
outputVATInvoiceMapper
;
public
static
PeriodTaxRuleSettingMapper
periodTaxRuleSettingMapper
;
...
...
@@ -43,6 +47,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public
static
AssetsListMapper
assetsListMapper
;
public
static
ProjectMapper
projectMapper
;
public
static
CellDataSourceMapper
cellDataSourceMapper
;
public
static
PeriodCellDataSourceMapper
periodCellDataSourceMapper
;
public
static
OrganizationMapper
organizationMapper
;
/**
...
...
@@ -62,6 +67,7 @@ public class SpringContextUtil implements ApplicationContextAware {
formulaAdminMapper
=
webApplicationContext
.
getBean
(
FormulaAdminMapper
.
class
);
reportMapper
=
webApplicationContext
.
getBean
(
ReportMapper
.
class
);
cellDataMapper
=
webApplicationContext
.
getBean
(
CellDataMapper
.
class
);
periodCellDataMapper
=
webApplicationContext
.
getBean
(
PeriodCellDataMapper
.
class
);
distributedIdService
=
webApplicationContext
.
getBean
(
DistributedIdService
.
class
);
formulaBlockMapper
=
webApplicationContext
.
getBean
(
PeriodFormulaBlockMapper
.
class
);
periodCellTemplateMapper
=
webApplicationContext
.
getBean
(
PeriodCellTemplateMapper
.
class
);
...
...
@@ -72,10 +78,13 @@ public class SpringContextUtil implements ApplicationContextAware {
projectDao
=
webApplicationContext
.
getBean
(
ProjectDao
.
class
);
balanceMapper
=
webApplicationContext
.
getBean
(
BalanceMapper
.
class
);
dataSourceMapper
=
webApplicationContext
.
getBean
(
DataSourceMapper
.
class
);
periodDataSourceMapper
=
webApplicationContext
.
getBean
(
PeriodDataSourceMapper
.
class
);
dataSourceDetailMapper
=
webApplicationContext
.
getBean
(
DataSourceDetailMapper
.
class
);
periodDataSourceDetailMapper
=
webApplicationContext
.
getBean
(
PeriodDataSourceDetailMapper
.
class
);
periodFormulaBlockMapper
=
webApplicationContext
.
getBean
(
PeriodFormulaBlockMapper
.
class
);
vatEnterpriseAccountDao
=
webApplicationContext
.
getBean
(
VatEnterpriseAccountDao
.
class
);
vatEnterpriseAccountMapper
=
webApplicationContext
.
getBean
(
VatEnterpriseAccountMapper
.
class
);
periodEnterpriseAccountMapper
=
webApplicationContext
.
getBean
(
PeriodEnterpriseAccountMapper
.
class
);
balanceStdManualMapper
=
webApplicationContext
.
getBean
(
BalanceStdManualMapper
.
class
);
outputVATInvoiceMapper
=
webApplicationContext
.
getBean
(
OutputVatInvoiceMapper
.
class
);
periodTaxRuleSettingMapper
=
webApplicationContext
.
getBean
(
PeriodTaxRuleSettingMapper
.
class
);
...
...
@@ -84,6 +93,7 @@ public class SpringContextUtil implements ApplicationContextAware {
assetsListMapper
=
webApplicationContext
.
getBean
(
AssetsListMapper
.
class
);
projectMapper
=
webApplicationContext
.
getBean
(
ProjectMapper
.
class
);
cellDataSourceMapper
=
webApplicationContext
.
getBean
(
CellDataSourceMapper
.
class
);
periodCellDataSourceMapper
=
webApplicationContext
.
getBean
(
PeriodCellDataSourceMapper
.
class
);
organizationMapper
=
webApplicationContext
.
getBean
(
OrganizationMapper
.
class
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/CellCommentController.java
View file @
8234757b
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.vat.entity.CellComment
;
import
pwc.taxtech.atms.vat.entity.PeriodCellComment
;
...
...
@@ -21,7 +19,11 @@ public class CellCommentController {
CellCommentServiceImpl
cellCommentService
;
@RequestMapping
(
value
=
"List"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
List
<
PeriodCellComment
>>
getCellComments
(
@RequestParam
(
"cellDataId"
)
Optional
<
Long
>
cellDataId
)
{
return
cellCommentService
.
getCellComments
(
cellDataId
);
public
OperationResultDto
<
List
<
PeriodCellComment
>>
getCellComments
(
@RequestParam
(
"cellDataId"
)
Optional
<
Long
>
cellDataId
,
@RequestHeader
(
"from"
)
String
form
)
{
String
projectId
=
StringUtils
.
EMPTY
;
if
(
StringUtils
.
isNotBlank
(
form
)
&&
form
.
split
(
"@"
).
length
>
0
)
{
projectId
=
form
.
split
(
"@"
)[
0
];
}
return
cellCommentService
.
getCellComments
(
cellDataId
,
projectId
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/ReportCellDataSourceDto.java
View file @
8234757b
...
...
@@ -6,6 +6,7 @@ import pwc.taxtech.atms.constant.DataSourceName;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.dpo.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
pwc.taxtech.atms.vat.entity.PeriodCellData
;
import
java.math.BigDecimal
;
...
...
@@ -47,7 +48,7 @@ public class ReportCellDataSourceDto extends DataSourceDto {
}
public
void
extractFromGroup
(
BBParasBo
bbParasBo
,
CurrentPeriodBo
currentPeriodBo
,
CellData
cellData
,
CellTemplatePerGroupDto
cellTemplateData
)
{
Period
CellData
cellData
,
CellTemplatePerGroupDto
cellTemplateData
)
{
this
.
name
=
DataSourceName
.
ReportDataSource
;
this
.
year
=
currentPeriodBo
.
curYear
;
this
.
period
=
currentPeriodBo
.
curPeriod
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/dao/VatEnterpriseAccountDao.java
View file @
8234757b
...
...
@@ -3,6 +3,8 @@ package pwc.taxtech.atms.vat.dao;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.vat.dao.VatEnterpriseAccountMapper
;
import
pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount
;
import
pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample
;
import
pwc.taxtech.atms.vat.entity.VatEnterpriseAccount
;
import
pwc.taxtech.atms.vat.entity.VatEnterpriseAccountExample
;
...
...
@@ -11,11 +13,11 @@ import java.util.List;
@Service
public
class
VatEnterpriseAccountDao
{
@Autowired
VatEnterpriseAccountMapper
vat
EnterpriseAccountMapper
;
PeriodEnterpriseAccountMapper
period
EnterpriseAccountMapper
;
public
List
<
Vat
EnterpriseAccount
>
getListByAccountCode
(
String
accountCode
)
{
VatEnterpriseAccountExample
example
=
new
Vat
EnterpriseAccountExample
();
public
List
<
Period
EnterpriseAccount
>
getListByAccountCode
(
String
accountCode
)
{
PeriodEnterpriseAccountExample
example
=
new
Period
EnterpriseAccountExample
();
example
.
createCriteria
().
andAcctCodeEqualTo
(
accountCode
);
return
vat
EnterpriseAccountMapper
.
selectByExample
(
example
);
return
period
EnterpriseAccountMapper
.
selectByExample
(
example
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/CellCommentServiceImpl.java
View file @
8234757b
...
...
@@ -9,7 +9,7 @@ import java.util.Optional;
@Service
public
class
CellCommentServiceImpl
extends
VatAbstractService
{
public
OperationResultDto
<
List
<
PeriodCellComment
>>
getCellComments
(
Optional
<
Long
>
cellDataId
)
{
public
OperationResultDto
<
List
<
PeriodCellComment
>>
getCellComments
(
Optional
<
Long
>
cellDataId
,
String
projectId
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
try
{
if
(!
cellDataId
.
isPresent
()
||
cellDataId
.
get
()
==
0L
)
{
...
...
@@ -20,6 +20,7 @@ public class CellCommentServiceImpl extends VatAbstractService {
PeriodCellCommentExample
example
=
new
PeriodCellCommentExample
();
example
.
createCriteria
().
andCellDataIdEqualTo
(
cellDataId
.
get
());
example
.
createCriteria
().
andProjectIdEqualTo
(
projectId
);
List
<
PeriodCellComment
>
cellComments
=
periodCellCommentMapper
.
selectByExample
(
example
);
resultDto
.
setResult
(
true
);
resultDto
.
setData
(
cellComments
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
View file @
8234757b
...
...
@@ -11,11 +11,9 @@ import pwc.taxtech.atms.entity.ProjectServiceType;
import
pwc.taxtech.atms.entity.ProjectServiceTypeExample
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.vat.dao.CellDataMapper
;
import
pwc.taxtech.atms.vat.dao.PeriodCellDataMapper
;
import
pwc.taxtech.atms.vat.dao.ReportMapper
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
pwc.taxtech.atms.vat.entity.CellDataExample
;
import
pwc.taxtech.atms.vat.entity.Report
;
import
pwc.taxtech.atms.vat.entity.ReportExample
;
import
pwc.taxtech.atms.vat.entity.*
;
import
java.util.List
;
...
...
@@ -29,6 +27,8 @@ public class FormulaAgent extends VatAbstractService {
public
ReportMapper
reportMapper
;
@Autowired
public
CellDataMapper
cellDataMapper
;
@Autowired
public
PeriodCellDataMapper
periodCellDataMapper
;
public
List
<
CellTemplatePerGroupDto
>
getCellTemplateGroupDto
(
Long
templateGroupId
,
String
projectId
)
{
ProjectServiceTypeExample
pst
=
new
ProjectServiceTypeExample
();
...
...
@@ -60,10 +60,10 @@ public class FormulaAgent extends VatAbstractService {
return
null
;
}
private
CellData
getCellDataListByTemplate
(
String
templateId
,
Long
reportId
)
{
CellDataExample
dataExample
=
new
CellDataExample
();
private
Period
CellData
getCellDataListByTemplate
(
String
templateId
,
Long
reportId
)
{
PeriodCellDataExample
dataExample
=
new
Period
CellDataExample
();
dataExample
.
createCriteria
().
andCellTemplateIdEqualTo
(
Long
.
valueOf
(
templateId
)).
andReportIdEqualTo
(
reportId
);
List
<
CellData
>
cellDataList
=
c
ellDataMapper
.
selectByExample
(
dataExample
);
List
<
PeriodCellData
>
cellDataList
=
periodC
ellDataMapper
.
selectByExample
(
dataExample
);
if
(
cellDataList
!=
null
&&
!
cellDataList
.
isEmpty
())
return
cellDataList
.
get
(
FIRST_OR_DEFAULT
);
return
null
;
...
...
@@ -73,11 +73,11 @@ public class FormulaAgent extends VatAbstractService {
return
adminMp
.
getPastProjectId
(
year
,
orgId
);
}
public
CellData
getCellData
(
String
templateId
,
String
cellId
,
int
periodId
)
{
public
Period
CellData
getCellData
(
String
templateId
,
String
cellId
,
int
periodId
)
{
Report
report
=
getReportByTemplate
(
templateId
,
periodId
);
MyAsserts
.
assertNotNull
(
report
,
Exceptions
.
BB_REPORT_NULL
);
CellData
cellData
=
getCellDataListByTemplate
(
cellId
,
report
.
getId
());
Period
CellData
cellData
=
getCellDataListByTemplate
(
cellId
,
report
.
getId
());
MyAsserts
.
assertNotNull
(
cellData
,
Exceptions
.
BB_CELL_DATA_NULL
);
return
cellData
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
8234757b
...
...
@@ -306,7 +306,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Cell
cell
=
row
.
getCell
(
colNum
-
1
);
if
(
cell
!=
null
)
{
//开始取值然后存放到DataSource
DataSource
dataSource
=
new
DataSource
();
PeriodDataSource
dataSource
=
new
Period
DataSource
();
dataSource
.
setId
(
distributedIdService
.
nextId
());
dataSource
.
setColumnIndex
(
colNum
-
1
);
dataSource
.
setRowIndex
(
rowNum
-
1
);
...
...
@@ -329,7 +329,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
dataSource
.
setPeriod
(
period
);
dataSource
.
setCellTemplateId
(
periodCellTemplateConfig
.
getCellTemplateId
());
dataSource
.
setType
(
FormulaDataSourceType
.
Report
.
getCode
());
d
ataSourceMapper
.
insertSelective
(
dataSource
);
periodD
ataSourceMapper
.
insertSelective
(
dataSource
);
//这里有个问题就是DataSource的数据有了,但是celldatasource的数据没有,后面无法关联celldata和DataSource
//解决办法就是 在存DataSource的时候就先把celldata的数据加好
//然后把celldatasource的数据也加好
...
...
@@ -344,7 +344,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
.
filter
(
a
->
a
.
getCellTemplateId
().
equals
(
periodCellTemplateConfig
.
getCellTemplateId
()))
.
findFirst
();
if
(
tempPeriodCellTemplate
.
isPresent
())
{
CellData
cellData
=
new
CellData
();
PeriodCellData
cellData
=
new
Period
CellData
();
Long
cellDataId
=
distributedIdService
.
nextId
();
cellData
.
setId
(
cellDataId
);
cellData
.
setReportId
(
reportId
);
...
...
@@ -395,23 +395,23 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData
.
setCreateTime
(
createTime
);
cellData
.
setUpdateBy
(
"Admin"
);
cellData
.
setUpdateTime
(
createTime
);
c
ellDataMapper
.
insertSelective
(
cellData
);
periodC
ellDataMapper
.
insertSelective
(
cellData
);
//after insert celldata, insert the celldatasource for link celldata and datasource
DataSourceExample
dataSourceExample
=
new
DataSourceExample
();
PeriodDataSourceExample
dataSourceExample
=
new
Period
DataSourceExample
();
dataSourceExample
.
createCriteria
().
andPeriodEqualTo
(
period
)
.
andCellTemplateIdEqualTo
(
tempPeriodCellTemplate
.
get
().
getCellTemplateId
());
List
<
DataSource
>
dataSourceList
=
SpringContextUtil
.
d
ataSourceMapper
.
selectByExample
(
dataSourceExample
);
List
<
PeriodDataSource
>
dataSourceList
=
SpringContextUtil
.
periodD
ataSourceMapper
.
selectByExample
(
dataSourceExample
);
for
(
int
ii
=
0
;
ii
<
dataSourceList
.
size
();
ii
++)
{
DataSource
dataSource
=
dataSourceList
.
get
(
ii
);
CellDataSource
cellDataSource
=
new
CellDataSource
();
Period
DataSource
dataSource
=
dataSourceList
.
get
(
ii
);
PeriodCellDataSource
cellDataSource
=
new
Period
CellDataSource
();
cellDataSource
.
setId
(
distributedIdService
.
nextId
());
cellDataSource
.
setCellTemplateId
(
tempPeriodCellTemplate
.
get
().
getCellTemplateId
());
cellDataSource
.
setCellDataId
(
cellDataId
);
cellDataSource
.
setDataSourceId
(
dataSource
.
getId
());
cellDataSource
.
setCreateTime
(
createTime
);
cellDataSource
.
setUpdateTime
(
createTime
);
SpringContextUtil
.
c
ellDataSourceMapper
.
insertSelective
(
cellDataSource
);
SpringContextUtil
.
periodC
ellDataSourceMapper
.
insertSelective
(
cellDataSource
);
}
}
}
...
...
@@ -587,7 +587,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
});
if
(!
parameter
.
isEmpty
())
{
List
<
PCTEntity
>
pctResults
=
c
ellDataMapper
.
queryByPCTs
(
parameter
);
List
<
PCTEntity
>
pctResults
=
periodC
ellDataMapper
.
queryByPCTs
(
parameter
);
Map
<
PCTEntity
,
BigDecimal
>
pctCache
=
new
HashMap
<>();
pctResults
.
forEach
(
m
->
{
BigDecimal
data
=
null
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
8234757b
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
View file @
8234757b
...
...
@@ -20,6 +20,8 @@ public class VatAbstractService {
@Autowired
public
VatEnterpriseAccountMapper
vatEnterpriseAccountMapper
;
@Autowired
public
PeriodEnterpriseAccountMapper
periodEnterpriseAccountMapper
;
@Autowired
public
VatStandardAccountMapper
vatStandardAccountMapper
;
@Autowired
public
InputVatInvoiceMapper
inputVATInvoiceMapper
;
...
...
@@ -48,8 +50,12 @@ public class VatAbstractService {
@Autowired
public
DataSourceMapper
dataSourceMapper
;
@Autowired
public
PeriodDataSourceMapper
periodDataSourceMapper
;
@Autowired
public
DataSourceDetailMapper
dataSourceDetailMapper
;
@Autowired
public
PeriodDataSourceDetailMapper
periodDataSourceDetailMapper
;
@Autowired
public
TemplateGroupMapper
templateGroupMapper
;
@Autowired
public
DistributedIdService
distributedIdService
;
...
...
@@ -76,6 +82,8 @@ public class VatAbstractService {
@Autowired
public
CellDataMapper
cellDataMapper
;
@Autowired
public
PeriodCellDataMapper
periodCellDataMapper
;
@Autowired
public
ModifiedReportCellMapper
modifiedReportCellMapper
;
@Autowired
public
PeriodCellCommentMapper
periodCellCommentMapper
;
...
...
@@ -85,5 +93,6 @@ public class VatAbstractService {
public
FtpService
ftpService
;
@Autowired
public
CellDataSourceMapper
cellDataSourceMapper
;
@Autowired
public
PeriodCellDataSourceMapper
periodCellDataSourceMapper
;
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
8234757b
...
...
@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.exception.FormulaException
;
import
pwc.taxtech.atms.vat.entity.CellData
;
import
pwc.taxtech.atms.vat.entity.PeriodCellData
;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
...
...
@@ -107,7 +108,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
// bo.disCount();
CellData
cellData
=
null
;
Period
CellData
cellData
=
null
;
String
projectId
=
agent
.
getPastProjectId
(
curPeriod
.
getCurYear
(),
formulaContext
.
getOrganizationId
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FSJZ.java
View file @
8234757b
...
...
@@ -8,10 +8,7 @@ import pwc.taxtech.atms.common.util.SpringContextUtil;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.KeyValueConfigResultType
;
import
pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto
;
import
pwc.taxtech.atms.vat.entity.Balance
;
import
pwc.taxtech.atms.vat.entity.BalanceStdManual
;
import
pwc.taxtech.atms.vat.entity.VatEnterpriseAccount
;
import
pwc.taxtech.atms.vat.entity.VatStandardAccount
;
import
pwc.taxtech.atms.vat.entity.*
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
...
...
@@ -94,7 +91,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
List
<
Object
>
formulaDataSourceDtoList
=
new
ArrayList
<>();
if
(
balanceStdManual
!=
null
)
{
List
<
VatEnterpriseAccount
>
vatEnterpriseAccountList
=
SpringContextUtil
.
vat
EnterpriseAccountMapper
.
period
EnterpriseAccountMapper
.
getListWithAccountCode
(
accountCode
);
if
(
period
==
99
)
{
val
=
new
BigDecimal
(((
balanceStdManual
.
getYearDebitNet
()
!=
null
?
balanceStdManual
.
getYearDebitNet
()
:
0
).
doubleValue
()
...
...
@@ -140,7 +137,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
return
new
NumberEval
(
val
.
doubleValue
());
}
else
{
//企业账套
List
<
Vat
EnterpriseAccount
>
vatEnterpriseAccountList
=
SpringContextUtil
List
<
Period
EnterpriseAccount
>
vatEnterpriseAccountList
=
SpringContextUtil
.
vatEnterpriseAccountDao
.
getListByAccountCode
(
accountCode
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
8234757b
...
...
@@ -10,9 +10,7 @@ import org.slf4j.LoggerFactory;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.vat.entity.DataSource
;
import
pwc.taxtech.atms.vat.entity.DataSourceDetail
;
import
pwc.taxtech.atms.vat.entity.PeriodFormulaBlock
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.FormulaAgent
;
import
javax.tools.JavaCompiler
;
...
...
@@ -111,7 +109,7 @@ public class FunctionBase {
Long
periodCellTemplateId
=
SpringContextUtil
.
periodCellTemplateMapper
.
getCellTemplateIdWithMap
(
map
);
Date
creatime
=
new
Date
();
DataSource
dataSource
=
new
DataSource
();
PeriodDataSource
dataSource
=
new
Period
DataSource
();
Long
dataSourceId
=
SpringContextUtil
.
distributedIdService
.
nextId
();
dataSource
.
setId
(
dataSourceId
);
dataSource
.
setType
(
FormulaDataSourceType
.
Report
.
getCode
());
...
...
@@ -128,24 +126,24 @@ public class FunctionBase {
dataSource
.
setColumnName
(
""
);
dataSource
.
setCellTemplateId
(
periodCellTemplateId
);
dataSource
.
setPeriod
(
period
);
SpringContextUtil
.
d
ataSourceMapper
.
insertSelective
(
dataSource
);
SpringContextUtil
.
periodD
ataSourceMapper
.
insertSelective
(
dataSource
);
for
(
Object
obj
:
dataSourceList
)
{
if
(
obj
.
getClass
()==
java
.
util
.
ArrayList
.
class
)
{
for
(
Object
obj2
:
(
ArrayList
<
Object
>)
obj
)
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
PeriodDataSourceDetail
dataSourceDetail
=
new
Period
DataSourceDetail
();
dataSourceDetail
.
setId
(
SpringContextUtil
.
distributedIdService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
dataSourceId
);
dataSourceDetail
.
setDataSourceType
(
formulaDataSourceDetailType
.
getCode
());
dataSourceDetail
.
setItemValue
(
JSON
.
toJSONString
(
obj2
));
SpringContextUtil
.
d
ataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
SpringContextUtil
.
periodD
ataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
}
}
else
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
PeriodDataSourceDetail
dataSourceDetail
=
new
Period
DataSourceDetail
();
dataSourceDetail
.
setId
(
SpringContextUtil
.
distributedIdService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
dataSourceId
);
dataSourceDetail
.
setDataSourceType
(
formulaDataSourceDetailType
.
getCode
());
dataSourceDetail
.
setItemValue
(
JSON
.
toJSONString
(
obj
));
SpringContextUtil
.
d
ataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
SpringContextUtil
.
periodD
ataSourceDetailMapper
.
insertSelective
(
dataSourceDetail
);
}
}
return
dataSourceId
;
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
View file @
8234757b
package
pwc
.
taxtech
.
atms
.
vat
.
dao
;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.session.RowBounds
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.entity.PCTEntity
;
import
pwc.taxtech.atms.vat.entity.PeriodCellData
;
import
pwc.taxtech.atms.vat.entity.PeriodCellDataExample
;
...
...
@@ -105,4 +109,20 @@ public interface PeriodCellDataMapper extends MyVatMapper {
* @mbg.generated
*/
int
updateByPrimaryKey
(
PeriodCellData
record
);
@Select
(
"<script>"
+
"SELECT "
+
" R.PERIOD, C.CELL_TEMPLATE_ID AS CELLTEMPLATEID, DATA "
+
"FROM "
+
" PERIOD_CELL_DATA C, "
+
" PERIOD_REPORT R "
+
"WHERE "
+
" C.REPORT_ID = R.ID AND "
+
" "
+
" <foreach item=\"item\" index=\"index\" collection=\"list\""
+
" open=\"(\" separator=\"OR\" close=\")\">"
+
" ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )"
+
" </foreach>"
+
"</script>"
)
List
<
PCTEntity
>
queryByPCTs
(
@Param
(
"list"
)
Set
<
PCTEntity
>
parameter
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodDataSourceMapper.java
View file @
8234757b
...
...
@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.dpo.DataSourceCellDataDto
;
import
pwc.taxtech.atms.vat.dpo.DataSourceExtendDto
;
import
pwc.taxtech.atms.vat.entity.PeriodDataSource
;
import
pwc.taxtech.atms.vat.entity.PeriodDataSourceExample
;
...
...
@@ -105,4 +107,34 @@ public interface PeriodDataSourceMapper extends MyVatMapper {
* @mbg.generated
*/
int
updateByPrimaryKey
(
PeriodDataSource
record
);
void
clearFormulaBlockWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearTaxRuleSettingWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearCellTemplateWithPeriod
(
@Param
(
"period"
)
Integer
period
,
@Param
(
"exceptReportTemplateIDs"
)
String
exceptReportTemplateIDs
);
void
clearCellTemplateConfigWithPeriod
(
@Param
(
"period"
)
Integer
period
,
@Param
(
"exceptReportTemplateIDs"
)
String
exceptReportTemplateIDs
);
void
clearTemplateWithPeriod
(
@Param
(
"period"
)
Integer
period
,
@Param
(
"exceptReportTemplateIDs"
)
String
exceptReportTemplateIDs
);
void
clearTaxPayerReportWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearDataSourceWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearDataSourceDetailWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearCellDataSourceDataWithPeriod
(
@Param
(
"period"
)
Integer
period
);
void
clearCellDataWithPeriod
(
@Param
(
"exceptReportTemplateIDs"
)
String
exceptReportTemplateIDs
,
@Param
(
"period"
)
Integer
period
);
void
clearReportWithPeriod
(
Integer
period
);
void
clearDataWithPeriod
(
@Param
(
"exceptReportTemplateIDs"
)
String
exceptReportTemplateIDs
,
@Param
(
"period"
)
Integer
period
);
List
<
DataSourceExtendDto
>
getFormulaDataSource
(
Long
reportID
);
List
<
DataSourceExtendDto
>
getManualDataSource
(
Long
cellDataID
);
DataSourceCellDataDto
getManualDataSource2
(
Long
dataSourceID
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodEnterpriseAccountMapper.java
View file @
8234757b
...
...
@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount
;
import
pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample
;
import
pwc.taxtech.atms.vat.entity.VatEnterpriseAccount
;
@Mapper
public
interface
PeriodEnterpriseAccountMapper
extends
MyVatMapper
{
...
...
@@ -105,4 +106,7 @@ public interface PeriodEnterpriseAccountMapper extends MyVatMapper {
* @mbg.generated
*/
int
updateByPrimaryKey
(
PeriodEnterpriseAccount
record
);
List
<
VatEnterpriseAccount
>
getListWithAccountCode
(
@Param
(
"accountCode"
)
String
accountCode
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dpo/DataSourceExtendDto.java
View file @
8234757b
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.dpo;
import
pwc.taxtech.atms.CommonUtils
;
import
pwc.taxtech.atms.vat.entity.DataSource
;
import
pwc.taxtech.atms.vat.entity.PeriodDataSource
;
import
java.util.List
;
...
...
@@ -10,12 +11,12 @@ public class DataSourceExtendDto extends DataSource {
private
Long
cellTemplateId
;
private
Long
cellDataId
;
private
List
<
String
>
items
;
private
DataSource
dataSource
;
private
Period
DataSource
dataSource
;
private
Long
reportTemplateId
;
private
Integer
dataSourceType
;
public
DataSource
getDataSource
()
{
this
.
dataSource
=
new
DataSource
();
public
Period
DataSource
getDataSource
()
{
this
.
dataSource
=
new
Period
DataSource
();
CommonUtils
.
copyProperties
(
this
,
dataSource
);
return
this
.
dataSource
;
}
...
...
@@ -52,7 +53,7 @@ public class DataSourceExtendDto extends DataSource {
this
.
items
=
items
;
}
public
void
setDataSource
(
DataSource
dataSource
)
{
public
void
setDataSource
(
Period
DataSource
dataSource
)
{
this
.
dataSource
=
dataSource
;
}
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodCellDataExtendsMapper.xml
0 → 100644
View file @
8234757b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"pwc.taxtech.atms.vat.dao.PeriodCellTemplateMapper"
>
</mapper>
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodDataSourceExtendsMapper.xml
0 → 100644
View file @
8234757b
This diff is collapsed.
Click to expand it.
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