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
3706ccc0
Commit
3706ccc0
authored
Sep 29, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change to periodXXX table
parent
9022afd5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
56 additions
and
21 deletions
+56
-21
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+17
-4
ReportGenerator.java
...in/java/pwc/taxtech/atms/vat/service/ReportGenerator.java
+1
-1
ReportService.java
...main/java/pwc/taxtech/atms/vat/service/ReportService.java
+2
-2
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+5
-4
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+11
-7
VatAbstractService.java
...pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
+1
-0
FSJZ.java
.../taxtech/atms/vat/service/impl/report/functions/FSJZ.java
+1
-1
PeriodCellDataMapper.java
...n/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
+3
-1
PeriodEnterpriseAccountMapper.java
...c/taxtech/atms/vat/dao/PeriodEnterpriseAccountMapper.java
+2
-1
VatEnterpriseAccountMapper.xml
...s/pwc/taxtech/atms/vat/dao/VatEnterpriseAccountMapper.xml
+4
-0
PeriodEnterpriseAccountExtendsMapper.xml
.../vat/dao/extends/PeriodEnterpriseAccountExtendsMapper.xml
+9
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
3706ccc0
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.PathVariable
;
...
...
@@ -80,17 +81,29 @@ public class ReportController {
}
@RequestMapping
(
value
=
"getStdAccountByIndustry/{industryId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
@PathVariable
String
industryId
)
{
return
reportService
.
getStdAccountByIndustry
(
industryId
);
public
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
@PathVariable
String
industryId
,
@RequestHeader
String
from
)
{
String
projectId
=
StringUtils
.
EMPTY
;
if
(
StringUtils
.
isNotBlank
(
from
)
&&
from
.
split
(
"@"
).
length
>
0
)
{
projectId
=
from
.
split
(
"@"
)[
0
];
}
return
reportService
.
getStdAccountByIndustry
(
industryId
,
projectId
);
}
@RequestMapping
(
value
=
"getCellAccountRange/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
@PathVariable
Long
reportTemplateId
,
@PathVariable
Integer
period
,
@PathVariable
int
rowIndex
,
@PathVariable
int
columnIndex
)
{
return
reportService
.
getCellAccountRange
(
reportTemplateId
,
period
,
rowIndex
,
columnIndex
);
public
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
@PathVariable
Long
reportTemplateId
,
@PathVariable
Integer
period
,
@PathVariable
int
rowIndex
,
@PathVariable
int
columnIndex
,
@RequestHeader
String
from
)
{
String
projectId
=
StringUtils
.
EMPTY
;
if
(
StringUtils
.
isNotBlank
(
from
)
&&
from
.
split
(
"@"
).
length
>
0
)
{
projectId
=
from
.
split
(
"@"
)[
0
];
}
return
reportService
.
getCellAccountRange
(
reportTemplateId
,
period
,
rowIndex
,
columnIndex
,
projectId
);
}
@RequestMapping
(
value
=
"addCellManualData"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
addCellManualDataSource
(
@RequestBody
ManualDataSourceDto
data
,
@RequestHeader
String
from
)
{
String
projectId
=
StringUtils
.
EMPTY
;
if
(
StringUtils
.
isNotBlank
(
from
)
&&
from
.
split
(
"@"
).
length
>
0
)
{
projectId
=
from
.
split
(
"@"
)[
0
];
}
return
reportService
.
addCellManualDataSource
(
data
,
from
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/ReportGenerator.java
View file @
3706ccc0
...
...
@@ -9,5 +9,5 @@ public interface ReportGenerator {
String
generateData
(
String
projectId
,
List
<
Long
>
templateIds
,
Boolean
ifDeleteManualDataSource
,
List
<
String
>
exceptCellTemplates
,
Integer
periodParam
,
Optional
<
String
>
generator
);
List
<
CellCalcInfoDto
>
getCellCalcInfo
(
List
<
Long
>
templateIdList
,
Integer
periodParam
);
List
<
CellCalcInfoDto
>
getCellCalcInfo
(
List
<
Long
>
templateIdList
,
Integer
periodParam
,
String
projectId
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/ReportService.java
View file @
3706ccc0
...
...
@@ -30,9 +30,9 @@ public interface ReportService {
OperationResultDto
<
PeriodCellTemplateConfig
>
getCellTemplateConfig
(
Long
reportTemplateId
,
Integer
periodParam
,
int
rowIndex
,
int
columnIndex
);
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
String
industryId
);
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
String
industryId
,
String
projectId
);
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
Long
reportTemplateId
,
Integer
period
,
int
rowIndex
,
int
columnIndex
);
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
Long
reportTemplateId
,
Integer
period
,
int
rowIndex
,
int
columnIndex
,
String
projectId
);
/**
* 添加手工数据源方法接口
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
3706ccc0
...
...
@@ -398,6 +398,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData
.
setCreateTime
(
createTime
);
cellData
.
setUpdateBy
(
"Admin"
);
cellData
.
setUpdateTime
(
createTime
);
cellData
.
setProjectId
(
projectId
);
periodCellDataMapper
.
insertSelective
(
cellData
);
//after insert celldata, insert the celldatasource for link celldata and datasource
...
...
@@ -501,7 +502,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
workbook
.
addToolPack
(
udfToolpack
);
}
public
List
<
CellCalcInfoDto
>
getCellCalcInfo
(
List
<
Long
>
templateIdList
,
Integer
periodParam
)
{
public
List
<
CellCalcInfoDto
>
getCellCalcInfo
(
List
<
Long
>
templateIdList
,
Integer
periodParam
,
String
projectId
)
{
//already finished by 20180711
int
period
=
0
;
if
(
periodParam
!=
null
)
{
...
...
@@ -511,7 +512,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List
<
PeriodCellTemplateConfigExtendDto
>
periodCellTemplateConfigExtendDtos
=
periodCellTemplateConfigMapper
.
getPeriodCellTemplateConfigExtendDtos
(
templateIdList
,
period
);
fixedPCTParsedFormula
(
periodCellTemplateConfigExtendDtos
);
fixedPCTParsedFormula
(
periodCellTemplateConfigExtendDtos
,
projectId
);
List
<
CellCalcInfoDto
>
cellCalcInfoDtos
=
new
ArrayList
<>();
periodCellTemplateConfigExtendDtos
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
new
CellTemplateConfigGroupDto
(
a
.
getColumnIndex
(),
a
.
getRowIndex
()
...
...
@@ -543,7 +544,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
return
cellCalcInfoDtos
;
}
private
void
fixedPCTParsedFormula
(
List
<
PeriodCellTemplateConfigExtendDto
>
periodCellTemplateConfigExtendDtos
)
{
private
void
fixedPCTParsedFormula
(
List
<
PeriodCellTemplateConfigExtendDto
>
periodCellTemplateConfigExtendDtos
,
String
projectId
)
{
Map
<
String
,
List
<
PCTEntity
>>
formulaMapToPCT
=
new
HashMap
<>();
Map
<
PeriodCellTemplateConfig
,
List
<
String
>>
configMapToPCTs
=
new
HashMap
<>();
Set
<
PCTEntity
>
parameter
=
new
HashSet
<>();
...
...
@@ -590,7 +591,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
});
if
(!
parameter
.
isEmpty
())
{
List
<
PCTEntity
>
pctResults
=
periodCellDataMapper
.
queryByPCTs
(
parameter
);
List
<
PCTEntity
>
pctResults
=
periodCellDataMapper
.
queryByPCTs
(
parameter
,
projectId
);
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 @
3706ccc0
...
...
@@ -267,7 +267,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
// periodCellTemplateConfig.setVoucherKeyword(cellTemplateConfig.getVoucherKeyword());
periodCellTemplateConfig
.
setCellTemplateConfigId
(
cellTemplateConfig
.
getId
());
periodCellTemplateConfig
.
setKeyValueParsedFormula
(
StringUtils
.
EMPTY
);
periodCellTemplateConfig
.
setProjectId
(
projectId
);
if
(
cellTemplateConfig
.
getFormula
().
contains
(
"@"
))
{
String
regex
=
"@[0-9A-Z.]+"
;
Pattern
pp
=
Pattern
.
compile
(
regex
);
...
...
@@ -438,7 +438,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
List
<
Long
>
templateIds
=
new
ArrayList
<>();
templateIds
.
add
(
report
.
getTemplateId
());
List
<
CellCalcInfoDto
>
cellCfgList
=
reportGenerator
.
getCellCalcInfo
(
templateIds
,
report
.
getPeriod
());
List
<
CellCalcInfoDto
>
cellCfgList
=
reportGenerator
.
getCellCalcInfo
(
templateIds
,
report
.
getPeriod
()
,
project
.
getId
()
);
PeriodCellDataExample
cellDataExample
=
new
PeriodCellDataExample
();
cellDataExample
.
createCriteria
().
andReportIdEqualTo
(
reportId
);
...
...
@@ -663,11 +663,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
String
industryId
)
{
public
OperationResultDto
<
List
<
VatEnterpriseAccount
>>
getStdAccountByIndustry
(
String
industryId
,
String
projectId
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
try
{
PeriodEnterpriseAccountExample
example
=
new
PeriodEnterpriseAccountExample
();
example
.
createCriteria
().
andIsActiveEqualTo
(
true
);
example
.
createCriteria
().
andIsActiveEqualTo
(
true
)
.
andProjectIdEqualTo
(
projectId
)
;
periodEnterpriseAccountMapper
.
selectByExample
(
example
);
List
<
PeriodEnterpriseAccount
>
vatEnterpriseAccounts
=
periodEnterpriseAccountMapper
.
selectByExample
(
example
);
if
(
vatEnterpriseAccounts
==
null
)
{
...
...
@@ -687,7 +687,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
Long
reportTemplateId
,
Integer
periodParam
,
int
rowIndex
,
int
columnIndex
)
{
public
OperationResultDto
<
List
<
VatEnterpriseAccountResultDto
>>
getCellAccountRange
(
Long
reportTemplateId
,
Integer
periodParam
,
int
rowIndex
,
int
columnIndex
,
String
projectId
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
try
{
...
...
@@ -701,7 +701,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
PeriodEnterpriseAccountExample
example
=
new
PeriodEnterpriseAccountExample
();
example
.
createCriteria
().
andAcctCodeIn
(
Arrays
.
asList
(
periodCellTemplateConfig
.
getAccountCodes
().
split
(
","
)));
example
.
createCriteria
().
andAcctCodeIn
(
Arrays
.
asList
(
periodCellTemplateConfig
.
getAccountCodes
().
split
(
","
)))
.
andProjectIdEqualTo
(
projectId
)
;
List
<
PeriodEnterpriseAccount
>
vatEnterpriseAccounts
=
periodEnterpriseAccountMapper
.
selectByExample
(
example
);
List
<
VatEnterpriseAccountResultDto
>
vatEnterpriseAccountResultDtos
=
new
ArrayList
<>();
for
(
PeriodEnterpriseAccount
vatEnterpriseAccount
:
vatEnterpriseAccounts
)
{
...
...
@@ -740,6 +740,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
cellData
.
setCreateTime
(
new
Date
());
cellData
.
setUpdateBy
(
"admin"
);
cellData
.
setUpdateTime
(
new
Date
());
cellData
.
setProjectId
(
projectId
);
periodCellDataMapper
.
insertSelective
(
cellData
);
data
.
setCellId
(
cellData
.
getId
());
}
else
{
...
...
@@ -794,6 +795,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
cellDataSource
.
setCellTemplateId
(
Long
.
parseLong
(
data
.
getCellTemplateId
()));
cellDataSource
.
setCreateTime
(
new
Date
());
cellDataSource
.
setUpdateTime
(
new
Date
());
cellDataSource
.
setProjectId
(
projectId
);
cellDataSource
.
setPeriod
(
data
.
getPeriod
());
updateCellValueForDataSourceChange
(
cellDataSource
.
getCellDataId
(),
new
BigDecimal
(
"0"
),
data
.
getAmount
());
periodDataSourceMapper
.
insertSelective
(
dataSourceModel
);
periodCellDataSourceMapper
.
insertSelective
(
cellDataSource
);
...
...
@@ -893,7 +896,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
cellDataSource
.
setDataSourceId
(
dataSource
.
getId
());
cellDataSource
.
setCreateTime
(
new
Date
());
cellDataSource
.
setUpdateTime
(
new
Date
());
cellDataSource
.
setPeriod
(
dataSource
.
getPeriod
());
cellDataSource
.
setProjectId
(
dataSource
.
getProjectId
());
periodCellDataSourceMapper
.
insertSelective
(
cellDataSource
);
operationResultDto
.
setData
(
dataSource
.
getId
().
toString
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
View file @
3706ccc0
...
...
@@ -21,6 +21,7 @@ public class VatAbstractService {
public
VatEnterpriseAccountMapper
vatEnterpriseAccountMapper
;
@Autowired
public
PeriodStandardAccountMapper
periodStandardAccountMapper
;
@Autowired
public
PeriodEnterpriseAccountMapper
periodEnterpriseAccountMapper
;
@Autowired
public
InputVatInvoiceMapper
inputVATInvoiceMapper
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FSJZ.java
View file @
3706ccc0
...
...
@@ -92,7 +92,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if
(
balanceStdManual
!=
null
)
{
List
<
VatEnterpriseAccount
>
vatEnterpriseAccountList
=
SpringContextUtil
.
periodEnterpriseAccountMapper
.
getListWithAccountCode
(
accountCode
);
.
getListWithAccountCode
(
accountCode
,
formulaContext
.
getProjectId
(),
period
);
if
(
period
==
99
)
{
val
=
new
BigDecimal
(((
balanceStdManual
.
getYearDebitNet
()
!=
null
?
balanceStdManual
.
getYearDebitNet
()
:
0
).
doubleValue
()
-
(
balanceStdManual
.
getYearCreditNet
()
!=
null
?
balanceStdManual
.
getYearCreditNet
()
:
0
).
doubleValue
())
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
View file @
3706ccc0
...
...
@@ -118,11 +118,12 @@ public interface PeriodCellDataMapper extends MyVatMapper {
" PERIOD_REPORT R "
+
"WHERE "
+
" C.REPORT_ID = R.ID AND "
+
" and C.PROJECT_ID = #{projectId} "
+
" "
+
" <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
);
List
<
PCTEntity
>
queryByPCTs
(
@Param
(
"list"
)
Set
<
PCTEntity
>
parameter
,
@Param
(
"projectId"
)
String
projectId
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodEnterpriseAccountMapper.java
View file @
3706ccc0
...
...
@@ -107,6 +107,6 @@ public interface PeriodEnterpriseAccountMapper extends MyVatMapper {
*/
int
updateByPrimaryKey
(
PeriodEnterpriseAccount
record
);
List
<
VatEnterpriseAccount
>
getListWithAccountCode
(
@Param
(
"accountCode"
)
String
accountCode
);
List
<
VatEnterpriseAccount
>
getListWithAccountCode
(
@Param
(
"accountCode"
)
String
accountCode
,
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
int
period
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/VatEnterpriseAccountMapper.xml
View file @
3706ccc0
...
...
@@ -523,4 +523,7 @@
order by ${orderByClause}
</if>
</select>
<select
id=
"getListWithAccountCode"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
SELECT * FROM EnterpriseAccount WHERE StdCode IS NOT NULL AND StdCode LIKE '${accountCode}%' AND IsLeaf=1
</select>
</mapper>
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodEnterpriseAccountExtendsMapper.xml
0 → 100644
View file @
3706ccc0
<?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.PeriodEnterpriseAccountMapper"
>
<select
id=
"getListWithAccountCode"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
SELECT * FROM PERIOD_ENTERPRISE_ACCOUNT WHERE STD_CODE IS NOT NULL AND STD_CODE LIKE '${accountCode}%'
AND IS_LEAF=1 AND PROJECT_ID=#{projectId,jdbcType=VARCHAR} and PERIOD=#{period,jdbcType=INTEGER}
</select>
</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