记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
1a1448f6
Commit
1a1448f6
authored
Aug 14, 2025
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
票务看板V2-导出按钮
parent
d534dadd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
1 deletion
+128
-1
KylinPerformancesController.java
...ontroller/zhengzai/kylin/KylinPerformancesController.java
+115
-1
details.html
...ources/templates/zhengzai/kylin/performances/details.html
+13
-0
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinPerformancesController.java
View file @
1a1448f6
...
...
@@ -11,6 +11,7 @@ import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.KylinPerformanceSubscribeTicketStatisticalExportDao
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceOrderStatisCountResp
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceTicketSalesDto
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceTicketSumDto
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.IOpenDataService
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataSumUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
...
...
@@ -29,14 +30,20 @@ import com.liquidnet.service.kylin.entity.KylinOrderImport;
import
com.liquidnet.service.kylin.service.admin.IKylinPerformancesAdminService
;
import
com.liquidnet.service.kylin.service.other.DamaiService
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -415,4 +422,111 @@ public class KylinPerformancesController extends BaseController {
List
<
KylinPerformancesVo
>
kylinPerformancesVoList
=
kylinPerformancesService
.
searchPerformanceByTitle
(
title
);
return
ResponseDto
.
success
(
kylinPerformancesVoList
);
}
@GetMapping
(
"/performance/export"
)
public
void
exportPerformance
(
@RequestParam
(
value
=
"performanceId"
)
String
performanceId
,
HttpServletResponse
response
)
{
try
{
PerformanceOrderStatisCountResp
perCountResp
=
new
PerformanceOrderStatisCountResp
();
List
<
PerformanceOrderStatisticalDao
>
result
=
new
ArrayList
<>();
PerformanceTicketSalesDto
ticketSalesInfo
=
openDataService
.
getPerformanceTicketSalesInfo
(
performanceId
);
if
(
ticketSalesInfo
!=
null
)
{
perCountResp
.
setPerformanceTitle
(
ticketSalesInfo
.
getPerformanceTitle
());
perCountResp
.
setTotalSalePrice
(
new
BigDecimal
(
ticketSalesInfo
.
getFullSalesAmountTotal
()));
perCountResp
.
setSaleGeneral
(
new
BigDecimal
(
ticketSalesInfo
.
getFullAudienceTicketTotal
()));
perCountResp
.
setTotalGeneral
(
new
BigDecimal
(
ticketSalesInfo
.
getFullTotalGeneral
()));
perCountResp
.
setTotalRefundGeneral
(
new
BigDecimal
(
ticketSalesInfo
.
getFullRefundTicketTotal
()));
perCountResp
.
setTotalBuyUsers
(
new
BigDecimal
(
ticketSalesInfo
.
getFullBuyTotal
()));
List
<
PerformanceTicketSalesDto
.
TicketSales
>
fullTicketDataList
=
ticketSalesInfo
.
getFullTicketDataList
();
if
(!
fullTicketDataList
.
isEmpty
())
{
for
(
PerformanceTicketSalesDto
.
TicketSales
ticketSales
:
fullTicketDataList
)
{
PerformanceOrderStatisticalDao
statisticalDao
=
new
PerformanceOrderStatisticalDao
();
statisticalDao
.
setPerformancesId
(
ticketSalesInfo
.
getPerformanceId
());
statisticalDao
.
setTicketsId
(
ticketSales
.
getTicketId
());
statisticalDao
.
setTitle
(
ticketSales
.
getTicketTitle
());
statisticalDao
.
setPrice
(
new
BigDecimal
(
ticketSales
.
getTicketPrice
()));
statisticalDao
.
setType
(
ticketSales
.
getTicketType
());
statisticalDao
.
setTotalGeneral
(
new
BigDecimal
(
ticketSales
.
getTotalGeneral
()));
statisticalDao
.
setSaleGeneral
(
new
BigDecimal
(
ticketSales
.
getAudienceTicketTotal
()));
statisticalDao
.
setTotalRefundGeneral
(
new
BigDecimal
(
ticketSales
.
getRefundTicketTotal
()));
statisticalDao
.
setTotalPayingNumber
(
new
BigDecimal
(
ticketSales
.
getPayingTotal
()));
statisticalDao
.
setTimeId
(
ticketSales
.
getTimeId
());
statisticalDao
.
setTimeTitle
(
ticketSales
.
getTimeTitle
());
statisticalDao
.
setVipBuyTotal
(
ticketSales
.
getVipBuyTotal
());
statisticalDao
.
setFullRefundTicketTotal
(
ticketSales
.
getFullRefundTicketTotal
());
statisticalDao
.
setHandlingFeeRefundTicketTotal
(
ticketSales
.
getHandlingFeeRefundTicketTotal
());
statisticalDao
.
setRefundFeeRevenueTotal
(
new
BigDecimal
(
ticketSales
.
getRefundFeeRevenueTotal
()));
statisticalDao
.
setAudienceSalesAmountTotal
(
new
BigDecimal
(
ticketSales
.
getAudienceSalesAmountTotal
()));
statisticalDao
.
setSurplusGeneral
(
new
BigDecimal
(
ticketSales
.
getSurplusGeneral
()));
result
.
add
(
statisticalDao
);
}
}
}
// 汇总数据
PerformanceTicketSumDto
sumResp
=
DataSumUtils
.
sumStatistics
(
result
);
// 创建 Excel
XSSFWorkbook
workbook
=
new
XSSFWorkbook
();
XSSFSheet
sheet
=
workbook
.
createSheet
(
"演出数据"
);
// 表头
String
[]
headers
=
{
"场次"
,
"票种类型"
,
"票种名称"
,
"票种价格"
,
"库存数量"
,
"销售数量"
,
"余票数量"
,
"登登登VIP购票数量"
,
"正在支付数量"
,
"退票总数量"
,
"全额退票数量"
,
"手续费退票数量"
,
"退票手续费收益"
,
"票面销售金额"
};
XSSFRow
headerRow
=
sheet
.
createRow
(
0
);
for
(
int
i
=
0
;
i
<
headers
.
length
;
i
++)
{
headerRow
.
createCell
(
i
).
setCellValue
(
headers
[
i
]);
}
// 数据行
int
rowNum
=
1
;
for
(
PerformanceOrderStatisticalDao
item
:
result
)
{
XSSFRow
row
=
sheet
.
createRow
(
rowNum
++);
row
.
createCell
(
0
).
setCellValue
(
item
.
getTimeTitle
());
row
.
createCell
(
1
).
setCellValue
(
item
.
getType
().
equals
(
1
)
?
"单日票"
:
"通票"
);
// 记得在后端先做字典翻译
row
.
createCell
(
2
).
setCellValue
(
item
.
getTitle
());
row
.
createCell
(
3
).
setCellValue
(
item
.
getPrice
().
toPlainString
());
row
.
createCell
(
4
).
setCellValue
(
item
.
getTotalGeneral
().
toPlainString
());
row
.
createCell
(
5
).
setCellValue
(
item
.
getSaleGeneral
().
toPlainString
());
row
.
createCell
(
6
).
setCellValue
(
item
.
getSurplusGeneral
().
toPlainString
());
row
.
createCell
(
7
).
setCellValue
(
item
.
getVipBuyTotal
());
row
.
createCell
(
8
).
setCellValue
(
item
.
getTotalPayingNumber
().
toPlainString
());
row
.
createCell
(
9
).
setCellValue
(
item
.
getTotalRefundGeneral
().
toPlainString
());
row
.
createCell
(
10
).
setCellValue
(
item
.
getFullRefundTicketTotal
());
row
.
createCell
(
11
).
setCellValue
(
item
.
getHandlingFeeRefundTicketTotal
());
row
.
createCell
(
12
).
setCellValue
(
item
.
getRefundFeeRevenueTotal
().
toPlainString
());
row
.
createCell
(
13
).
setCellValue
(
item
.
getAudienceSalesAmountTotal
().
toPlainString
());
}
// 合计行
XSSFRow
totalRow
=
sheet
.
createRow
(
rowNum
);
totalRow
.
createCell
(
0
).
setCellValue
(
"总计"
);
totalRow
.
createCell
(
4
).
setCellValue
(
sumResp
.
getTotalGeneralSum
().
toPlainString
());
totalRow
.
createCell
(
5
).
setCellValue
(
sumResp
.
getSaleGeneralSum
().
toPlainString
());
totalRow
.
createCell
(
6
).
setCellValue
(
sumResp
.
getSurplusGeneralSum
().
toPlainString
());
totalRow
.
createCell
(
7
).
setCellValue
(
sumResp
.
getVipBuyTotalSum
().
toPlainString
());
totalRow
.
createCell
(
8
).
setCellValue
(
sumResp
.
getTotalPayingNumberSum
().
toPlainString
());
totalRow
.
createCell
(
9
).
setCellValue
(
sumResp
.
getTotalRefundGeneralSum
().
toPlainString
());
totalRow
.
createCell
(
10
).
setCellValue
(
sumResp
.
getFullRefundTicketTotalSum
().
toPlainString
());
totalRow
.
createCell
(
11
).
setCellValue
(
sumResp
.
getHandlingFeeRefundTicketTotalSum
().
toPlainString
());
totalRow
.
createCell
(
12
).
setCellValue
(
sumResp
.
getRefundFeeRevenueTotalSum
().
toPlainString
());
totalRow
.
createCell
(
13
).
setCellValue
(
sumResp
.
getAudienceSalesAmountTotalSum
().
toPlainString
());
// 响应头
String
fileName
=
URLEncoder
.
encode
(
"演出统计数据.xlsx"
,
StandardCharsets
.
UTF_8
.
name
());
response
.
setContentType
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
// 写出文件
workbook
.
write
(
response
.
getOutputStream
());
workbook
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performances/details.html
View file @
1a1448f6
...
...
@@ -47,6 +47,10 @@
<div
class=
"tab-content"
>
<div
id=
"tab-1"
class=
"tab-pane"
>
<div
class=
"panel-body"
>
<!-- 导出按钮 -->
<div
class=
"m-t-md"
style=
"text-align: left; margin-bottom: 2px"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"exportTableData()"
>
导出数据
</button>
</div>
<div
id=
"tab-1"
class=
"tab-pane"
>
<iframe
id=
"tab_iframe_1"
name=
"tab_iframe_1"
marginwidth=
0
marginheight=
0
width=
100%
height=
800px
frameborder=
0
></iframe>
...
...
@@ -575,6 +579,15 @@
anim
:
5
//0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
});
}
/**
* 导出文件
*/
function
exportTableData
()
{
var
performancesId
=
'[[${kylinPerformanceMisVo.performancesId}]]'
.
replaceAll
(
"
\"
"
,
""
)
var
url
=
prefix
+
'/performance/export?performanceId='
+
performancesId
;
window
.
location
.
href
=
url
;
// 直接触发下载
}
</script>
</body>
</html>
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