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
dd9daf6f
Commit
dd9daf6f
authored
Apr 20, 2019
by
Memorydoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分析模块初始化
parent
c12993fb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
171 deletions
+126
-171
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+2
-0
AnalysisJobServiceImpl.java
...pwc/taxtech/atms/service/impl/AnalysisJobServiceImpl.java
+13
-5
AnalysisServiceImpl.java
...va/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
+9
-3
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+101
-163
AnalysisTest.java
...test/java/pwc/taxtech/atms/service/impl/AnalysisTest.java
+1
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
dd9daf6f
...
...
@@ -179,4 +179,5 @@ public final class Constant {
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AnalysisJobServiceImpl.java
View file @
dd9daf6f
...
...
@@ -203,12 +203,19 @@ public class AnalysisJobServiceImpl extends BaseService {
String
regionMeg
=
regionMap
.
get
(
o
.
getRegionId
());
List
<
String
>
regionMs
=
Lists
.
newArrayList
();
if
(
StringUtils
.
isNotEmpty
(
regionMeg
))
{
regionMs
=
Arrays
.
asList
(
regionMeg
.
split
(
"
.
"
));
regionMs
=
Arrays
.
asList
(
regionMeg
.
split
(
"
,
"
));
}
if
(!
regionMs
.
isEmpty
())
{
am
.
setProvince
(
regionMs
.
get
(
1
)
!=
null
?
regionMs
.
get
(
1
)
:
""
);
am
.
setCity
(
regionMs
.
get
(
2
)
!=
null
?
regionMs
.
get
(
2
)
:
""
);
am
.
setDistrict
(
regionMs
.
get
(
3
)
!=
null
?
regionMs
.
get
(
4
)
:
""
);
if
(
regionMs
.
size
()
==
4
){
am
.
setProvince
(
regionMs
.
get
(
1
)
!=
null
?
regionMs
.
get
(
1
)
:
""
);
am
.
setCity
(
regionMs
.
get
(
2
)
!=
null
?
regionMs
.
get
(
2
)
:
""
);
am
.
setDistrict
(
regionMs
.
get
(
3
)
!=
null
?
regionMs
.
get
(
3
)
:
""
);
}
else
if
(
regionMs
.
size
()
==
3
){
am
.
setProvince
(
regionMs
.
get
(
1
)
!=
null
?
regionMs
.
get
(
1
)
:
""
);
am
.
setCity
(
regionMs
.
get
(
2
)
!=
null
?
regionMs
.
get
(
2
)
:
""
);
}
else
if
(
regionMs
.
size
()
==
2
){
am
.
setProvince
(
regionMs
.
get
(
1
)
!=
null
?
regionMs
.
get
(
1
)
:
""
);
}
}
am
.
setBusinessLine
(
buMap
.
get
(
o
.
getBusinessUnitId
()));
am
.
setCode
(
o
.
getCode
());
...
...
@@ -223,7 +230,8 @@ public class AnalysisJobServiceImpl extends BaseService {
}
analysisMasterMapper
.
insertSelective
(
am
);
}
catch
(
Exception
e
)
{
logger
.
error
(
String
.
format
(
"公司:[%s]生成机构分析数据失败!"
,
o
.
getName
()),
e
);
e
.
printStackTrace
();
logger
.
error
(
String
.
format
(
"生成机构分析数据失败!"
,
e
.
getMessage
()));
}
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
View file @
dd9daf6f
...
...
@@ -932,7 +932,7 @@ public class AnalysisServiceImpl extends BaseService {
.
andCompanyNameEqualTo
(
getCellValue
(
sheetAt
.
getRow
(
i
).
getCell
(
3
),
false
).
toString
())
.
andPeriodEqualTo
(
period
);
List
<
AnalysisMaster
>
analysisMasters
=
analysisMasterMapper
.
selectByExample
(
example
);
if
(
breakFlag
>
3
)
{
if
(
breakFlag
>
20
)
{
logger
.
info
(
"大于三条数据不匹配,直接停止进程"
);
break
;
}
...
...
@@ -962,8 +962,14 @@ public class AnalysisServiceImpl extends BaseService {
salesList
.
add
(
sales
);
}
}
int
salesInt
=
analysisSalesMapper
.
insertBatch
(
salesList
);
int
taxInt
=
analysisTaxMapper
.
insertBatch
(
taxList
);
int
salesInt
=
0
;
if
(
salesList
.
size
()
!=
0
)
{
salesInt
=
analysisSalesMapper
.
insertBatch
(
salesList
);
}
int
taxInt
=
0
;
if
(
taxList
.
size
()
!=
0
)
{
taxInt
=
analysisTaxMapper
.
insertBatch
(
taxList
);
}
logger
.
info
(
"analysis_salesInt 更新数据条数"
+
salesInt
);
logger
.
info
(
"analysis_tax 更新数据条数"
+
taxInt
);
System
.
out
.
println
(
"数据初始化消耗: "
+
(
System
.
currentTimeMillis
()
-
now
));
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
dd9daf6f
...
...
@@ -1332,62 +1332,76 @@ public class ReportServiceImpl extends BaseService {
ebit
=
new
EbitCellData
();
switch
(
profitLossStatement
.
getItemName
().
trim
())
{
case
"一、营业收入"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
11
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"减:营业成本"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
12
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"营业税金及附加"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
13
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"销售费用"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
14
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"管理费用"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
15
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"研发费用"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
16
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"财务费用"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
17
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"资产减值损失"
:
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setCol
(
2
);
ebit
.
setRow
(
18
);
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
break
;
case
"加:公允价值变动收益(损失以“-”号填列)"
:
ebit
.
setRow
(
19
);
break
;
case
"投资收益(损失以“-”号填列)"
:
ebit
.
setRow
(
20
);
break
;
case
"其他收益"
:
ebit
.
setRow
(
21
);
break
;
case
"资产处置收益(损失以“-”号填列)"
:
ebit
.
setRow
(
22
);
break
;
case
"二、营业利润(亏损以“-”号填列)"
:
ebit
.
setRow
(
23
);
break
;
case
"加:营业外收入"
:
ebit
.
setRow
(
24
);
break
;
case
"减:营业外支出"
:
ebit
.
setRow
(
25
);
break
;
case
"三、利润总额(亏损总额以“-”号填列)"
:
ebit
.
setRow
(
27
);
break
;
case
"减:所得税费用"
:
ebit
.
setRow
(
28
);
break
;
case
"四、净利润(净亏损以“-”号填列)"
:
ebit
.
setRow
(
29
);
break
;
case
"少数股东损益"
:
ebit
.
setRow
(
30
);
break
;
case
"五、每股收益:"
:
ebit
.
setRow
(
31
);
break
;
case
"(一)基本每股收益"
:
ebit
.
setRow
(
32
);
break
;
case
"(二)稀释每股收益"
:
ebit
.
setRow
(
33
);
break
;
}
///ebit.setCol(2);
ebit
.
setData
(
profitLossStatement
.
getYtdAmt
().
toString
());
ebit
.
setOrganizationId
(
profitLossStatement
.
getOrganizationId
());
ebit
.
setPeriod
(
profitLossStatement
.
getPeriod
());
list1
.
add
(
ebit
);
}
return
list1
;
...
...
@@ -1700,27 +1714,28 @@ public class ReportServiceImpl extends BaseService {
BigDecimal
yffy
=
new
BigDecimal
(
0
);
//研发费用
BigDecimal
zcjzss
=
new
BigDecimal
(
0
);
//资产减值损失
for
(
CellDataDto
cellDataDto
:
cellDataDtoList
)
{
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
11
)
{
//一、营业收入
yysr
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
continue
;
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
12
)
{
//减:营业成本
yycb
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
13
)
{
//营业税金及附加
yysjfj
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
14
)
{
//销售费用
xsfy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
15
)
{
//管理费用
glfy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
16
)
{
//研发费用
yffy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
}
if
(
cellDataDto
.
getColumnIndex
()
==
2
&&
cellDataDto
.
getRowIndex
()
==
18
)
{
//资产减值损失
zcjzss
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
switch
(
cellDataDto
.
getColumnIndex
()
+
":"
+
cellDataDto
.
getRowIndex
())
{
case
"2:11"
:
yysr
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:12"
:
yycb
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:13"
:
yysjfj
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:14"
:
xsfy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:15"
:
glfy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:16"
:
yffy
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
case
"2:18"
:
zcjzss
=
new
BigDecimal
(
cellDataDto
.
getCellValue
());
break
;
}
}
BigDecimal
subtract
=
yysr
.
subtract
(
yycb
).
add
(
yysjfj
).
add
(
xsfy
).
add
(
glfy
).
add
(
yffy
).
add
(
zcjzss
);
...
...
@@ -1778,6 +1793,7 @@ public class ReportServiceImpl extends BaseService {
return
ebitDataDto
;
}
public
EbitDataDto
calculateEbitDataByEbit
(
List
<
EbitCellData
>
ebitCellData
,
String
specialConsiderations
,
String
ebitRate
)
{
EbitDataDto
ebitDataDto
=
new
EbitDataDto
();
try
{
...
...
@@ -1803,6 +1819,8 @@ public class ReportServiceImpl extends BaseService {
BigDecimal
yffy
=
new
BigDecimal
(
0
);
//研发费用
BigDecimal
zcjzss
=
new
BigDecimal
(
0
);
//资产减值损失
for
(
EbitCellData
ebitCellData1
:
ebitCellData
)
{
if
(
ebitCellData1
.
getRow
()
==
null
)
continue
;
if
(
ebitCellData1
.
getCol
()
==
2
&&
ebitCellData1
.
getRow
()
==
11
)
{
//一、营业收入
if
(
StringUtils
.
isNotEmpty
(
ebitCellData1
.
getData
()))
yysr
=
new
BigDecimal
(
ebitCellData1
.
getData
());
continue
;
...
...
@@ -2704,9 +2722,9 @@ public class ReportServiceImpl extends BaseService {
Map
<
String
,
List
<
ProfitLossStatementPrc
>>
newMap
=
new
HashMap
<>();
///如果ebitCellData 中已经存在当前机构的数,将取 ebit中,否则取利润表中
if
(
collect1
.
isEmpty
())
{
if
(
collect1
.
isEmpty
())
{
newMap
=
collect2
;
}
else
{
}
else
{
for
(
Map
.
Entry
<
String
,
List
<
EbitCellData
>>
entry1
:
collect1
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
ProfitLossStatementPrc
>>
entry2
:
collect2
.
entrySet
())
{
/*System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());*/
...
...
@@ -2728,7 +2746,6 @@ public class ReportServiceImpl extends BaseService {
sheetAt
=
workbook1
.
getSheetAt
(
0
);
List
<
Integer
>
cols
=
Lists
.
newArrayList
();
FileExcelUtil
.
deleteColumn
(
sheetAt
,
1
,
cols
);
List
<
String
>
ebitTitle
=
Lists
.
newArrayList
(
"EBIT考虑资产减值损失"
,
"加:特殊因素考虑"
,
"EBIT(考虑特殊因素)"
,
"EBIT rate"
,
"关联交易金额"
,
"6%增值税"
,
"价税合计金额"
);
//设置单元格居右
cellStyle1
=
workbook1
.
createCellStyle
();
//创建样式
...
...
@@ -2753,10 +2770,19 @@ public class ReportServiceImpl extends BaseService {
ebitCellDataList
.
add
(
ebitDataDto
);
}
}
else
{
ebitCellDataList
.
add
(
calculateEbitDataByEbit
(
entry
.
getValue
(),
specialConsideration
,
ebitRate
));
List
<
EbitCellData
>
list
=
entry
.
getValue
();
EbitDataDto
ebitDataDto
=
new
EbitDataDto
();
ebitDataDto
.
setEbitSubtraction
(
BigDecimal
.
ZERO
);
ebitDataDto
.
setSpecialFactors
(
BigDecimal
.
ZERO
);
ebitDataDto
.
setTransactionAmount
(
BigDecimal
.
ZERO
);
ebitDataDto
.
setSixAddTax
(
BigDecimal
.
ZERO
);
ebitDataDto
.
setTotalAmountTax
(
BigDecimal
.
ZERO
);
ebitDataDto
.
setEbitRate
(
"1%"
);
ebitDataDto
.
setSpecialConsiderations
(
"0"
);
ebitCellDataList
.
add
(
ebitDataDto
);
}
//加载计算ebit数据
//加载计算ebit数据
for
(
int
m
=
0
;
m
<=
sheetAt
.
getLastRowNum
();
m
++)
{
switch
(
m
)
{
case
7
:
...
...
@@ -2782,6 +2808,8 @@ public class ReportServiceImpl extends BaseService {
break
;
if
(
sheetAt
.
getRow
(
m
)
!=
null
&&
sheetAt
.
getRow
(
m
).
getCell
(
_index
+
1
)
!=
null
)
{
for
(
EbitCellData
ebitCellData
:
entry
.
getValue
())
{
if
(
ebitCellData
.
getRow
()
==
null
)
continue
;
if
(
m
==
ebitCellData
.
getRow
())
{
try
{
sheetAt
.
getRow
(
m
).
getCell
(
_index
+
1
).
setCellValue
(
ebitCellData
.
getData
().
equals
(
""
)
==
true
?
"0"
:
ebitCellData
.
getData
());
...
...
@@ -2794,77 +2822,45 @@ public class ReportServiceImpl extends BaseService {
//cell.setCellType(cellStyle.getAlignment());
}
if
(
m
>=
37
)
{
//加载ebit数据
for
(
EbitDataDto
ebitCellData
:
ebitCellDataList
)
{
for
(
int
i
=
0
;
i
<
ebitCellDataList
.
size
();
i
++
)
{
switch
(
m
)
{
case
37
:
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getEbitSubtraction
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"12- "
,
"13- "
,
"14- "
,
"15- "
,
"16- "
,
"1
8
"
),
_index
+
1
);
ebitCellData
List
.
get
(
_index
)
.
getEbitSubtraction
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"12- "
,
"13- "
,
"14- "
,
"15- "
,
"16- "
,
"1
7-"
,
"19
"
),
_index
+
1
);
break
;
case
38
:
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getSpecialConsiderations
(),
sheetAt
);
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
List
.
get
(
_index
)
.
getSpecialConsiderations
(),
sheetAt
);
break
;
case
39
:
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getSpecialFactors
().
toString
(),
sheetAt
),
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
List
.
get
(
_index
)
.
getSpecialFactors
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"38+ "
,
"39"
),
_index
+
1
);
break
;
case
40
:
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getEbitRate
(),
sheetAt
);
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
List
.
get
(
_index
)
.
getEbitRate
(),
sheetAt
);
break
;
case
41
:
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getTransactionAmount
().
toString
(),
sheetAt
),
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
List
.
get
(
_index
)
.
getTransactionAmount
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"40 * "
,
"41"
),
_index
+
1
);
break
;
case
42
:
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getSixAddTax
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"42 * 0.06"
),
_index
+
1
);
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellDataList
.
get
(
_index
).
getSixAddTax
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"42 * 0.06"
),
_index
+
1
);
break
;
case
43
:
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellData
.
getTotalAmountTax
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"42 * 1.06"
),
_index
+
1
);
addFormula
(
cellAndOrCreate
(
m
,
_index
+
1
,
ebitCellDataList
.
get
(
_index
).
getTotalAmountTax
().
toString
(),
sheetAt
),
Lists
.
newArrayList
(
"42 * 1.06"
),
_index
+
1
);
break
;
}
break
;
}
}
}
_index
++;
}
sheetAt
.
setForceFormulaRecalculation
(
true
);
//强制执行公式
///合并单元格
insertExcelOne
(
headerCellType
,
workbook1
,
sheetAt
,
_index
,
requestParameterDto
);
/* for (int i = 0; i < ebitSpreadData.size(); i++) {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(ebitSpreadData.get(i).getFileKey()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
String path = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
path = uploadDetail.getList().get(0).getViewHttpUrl();
}
InputStream inputStream = httpFileService.getUserTemplate(path);
}*/
/* if (sheetAt == null) {
String filePath;
File templateFile;
Template template = templateService.getTemplateById(Long.parseLong(requestParameterDto.getTemplateId()));
String templatePath = templateService.getTemplatePath(Long.parseLong(requestParameterDto.getTemplateId()));
MyAsserts.assertNotEmpty(templatePath, new NotFoundException());
filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
templateFile = new File(tempPath + templatePath);
InputStream inputStream = null;
//如果是系统报表就取本地文件夹,如果不是就取FTP
if (template.getIsSystemType()) {
inputStream = new BufferedInputStream(new FileInputStream(templateFile));
} else {
inputStream = httpFileService.getUserTemplate(templatePath);
}
workbook1 = new XSSFWorkbook(inputStream);
sheetAt = workbook1.getSheetAt(0);
List<Integer> cols = Lists.newArrayList();
FileExcelUtil.deleteColumn(sheetAt, 1, cols);
}*/
//加载所有当前期间所有利润的数据
/* insertData(requestParameterDto.getTemplateId(), requestParameterDto.getPeriod(), sheetAt, index);*/
//insertExcelOne(sheetAt, ebitSpreadData, workbook1, requestParameterDto.getPeriod());
FileExcelUtil
.
setExcelHeadInfo
(
response
,
request
,
requestParameterDto
.
getPeriod
()
+
"-汇总利润表.xlsx"
);
FileExcelUtil
.
downloadExcel
(
request
,
response
,
requestParameterDto
.
getPeriod
()
+
"-汇总利润表.xlsx"
,
workbook1
);
}
...
...
@@ -2886,66 +2882,7 @@ public class ReportServiceImpl extends BaseService {
sheetAt
.
getRow
(
row
).
getCell
(
col
).
setCellStyle
(
cellStyle1
);
return
sheetAt
.
getRow
(
row
).
getCell
(
col
);
}
/* public void insertData(String templateId, Integer period, Sheet sheet, int beginCell) {
List<Project> projects = projectMapper.selectByExample(example1);
for (EbitCell project : ebitCellData) {
String projectId = getProjId(project.getOrganizationId(), period);
List<CellDataDto> list = getCellData(getReportByTemplateEbit(Long.parseLong(templateId), period % 100, projectId).getData().getId(), projectId).getData().getCellData();
if (list.size() == 0)
return;
EbitDataDto ebitDataDto = calculateEbitData(list, specialConsideration, ebitRate);
for (CellDataDto cellDataDto : list) {
if (cellDataDto.getColumnIndex() == 2 && cellDataDto.getRowIndex() > 10)
sheet.getRow(cellDataDto.getRowIndex()).getCell(beginCell).setCellValue(cellDataDto.getCellValue());
}
for (int i = 37; i < 43; i++) {
if (i == 37) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getEbitSubtraction().toString());
sheet.getRow(i).getCell(beginCell).setCellFormula(LetterExcelUtil.NumToExcel(beginCell) + "11 - " +
LetterExcelUtil.NumToExcel(beginCell) + "12 -" +
LetterExcelUtil.NumToExcel(beginCell) + "13 -" +
LetterExcelUtil.NumToExcel(beginCell) + "14 -" +
LetterExcelUtil.NumToExcel(beginCell) + "15 -" +
LetterExcelUtil.NumToExcel(beginCell) + "16 -" +
LetterExcelUtil.NumToExcel(beginCell) + "18");
continue;
}
if (i == 38) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getSpecialConsiderations());
continue;
}
if (i == 39) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getEbitRate());
sheet.getRow(i).getCell(beginCell).setCellFormula(LetterExcelUtil.NumToExcel(beginCell) + "37 + " + LetterExcelUtil.NumToExcel(beginCell) + "38");
continue;
}
if (i == 40) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getTransactionAmount().toString());
continue;
}
if (i == 41) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getSixAddTax().toString());
sheet.getRow(i).getCell(beginCell).setCellFormula(LetterExcelUtil.NumToExcel(beginCell) + "39 * " + LetterExcelUtil.NumToExcel(beginCell) + "40");
}
if (i == 42) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getTotalAmountTax().toString());
sheet.getRow(i).getCell(beginCell).setCellFormula(LetterExcelUtil.NumToExcel(beginCell) + "41 * 6%");
continue;
}
if (i == 43) {
sheet.getRow(i).getCell(beginCell).setCellValue(ebitDataDto.getEbitSubtraction().toString());
sheet.getRow(i).getCell(beginCell).setCellFormula(LetterExcelUtil.NumToExcel(beginCell) + "41 * 1.06");
continue;
}
}
sheet.getRow(8).getCell(1).setCellValue("本年累计");
sheet.getRow(6).getCell(1).setCellValue(getOrgName(project.getOrganizationId()));
beginCell++;
}
}*/
private
static
final
String
headerEbitTitle
=
"汇总利润表"
;
public
void
insertExcelOne
(
CellStyle
headerCellType
,
XSSFWorkbook
workbook1
,
Sheet
sheetAt
,
Integer
_index
,
RequestParameterDto
requestParameterDto
)
{
headerCellType
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
// 垂直
headerCellType
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// 水平
...
...
@@ -2954,6 +2891,7 @@ public class ReportServiceImpl extends BaseService {
font
.
setFontHeight
(
30
);
headerCellType
.
setFont
(
font
);
sheetAt
.
addMergedRegion
(
new
CellRangeAddress
(
0
,
0
,
1
,
_index
+
4
));
sheetAt
.
getRow
(
0
).
getCell
(
1
).
setCellValue
(
headerEbitTitle
);
sheetAt
.
getRow
(
0
).
getCell
(
1
).
setCellStyle
(
headerCellType
);
POIStyleUtil
.
setCellBackgroundColor
(
workbook1
,
sheetAt
.
getRow
(
2
).
createCell
(
_index
+
1
),
new
XSSFColor
(
java
.
awt
.
Color
.
YELLOW
));
sheetAt
.
getRow
(
2
).
getCell
(
_index
+
1
).
setCellValue
(
"本期:"
+
requestParameterDto
.
getPeriod
());
...
...
atms-api/src/test/java/pwc/taxtech/atms/service/impl/AnalysisTest.java
View file @
dd9daf6f
...
...
@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils;
import
pwc.taxtech.atms.constant.enums.EnumTbImportType
;
import
pwc.taxtech.atms.entity.Organization
;
import
pwc.taxtech.atms.entity.OrganizationExample
;
import
pwc.taxtech.atms.vat.entity.EbitCellData
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
...
...
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