记得上下班打卡 | git大法好,push需谨慎

Commit 0b82deed authored by jiangxiulong's avatar jiangxiulong

打印选择票种

parent 6fd9689a
......@@ -292,8 +292,8 @@ public class PerformancesExpressController extends BaseController {
@RequiresPermissions("kylin:performancesExpress:batchPrintExpress")
@PostMapping("/batchPrintExpress")
@ResponseBody
public ResponseDto<KylinOrderExpressPrintVo> batchPrintExpress(@RequestParam("ids") String performanceId) {
KylinOrderExpressPrintVo res = performancesExpressServiceImpl.batchPrintExpress(performanceId);
public ResponseDto<KylinOrderExpressPrintVo> batchPrintExpress(@RequestParam("ids") String performanceId, @RequestParam("ticketId") String ticketId) {
KylinOrderExpressPrintVo res = performancesExpressServiceImpl.batchPrintExpress(performanceId, ticketId);
try {
return ResponseDto.success(res);
} catch (Exception e) {
......
......@@ -41,9 +41,26 @@
</div>
</div>
</div>
<div id="selectTicketDiv" hidden>
<form class="mt20 mb10">
<div class="col-xs-offset-1">
<div class="form-group">
<div class="col-sm-12">
<select class="form-control m-b" name="ticketId" id="openTicketListTplSelect">
<option>选项 1</option>
<option>选项 2</option>
</select>
</div>
</div>
</div>
</form>
</div>
<script th:src="@{/lodop6226/LodopFuncs.js}"></script>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var performanceOrderListFlag = [[${@permission.hasPermi('kylin:performancesExpress:performanceOrderList')}]];
var batchPlaceOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchPlaceOrder')}]];
......@@ -249,7 +266,7 @@
LODOP.PRINT();
}
function printExpress(performanceId) {
function printExpress(performanceId, ticketId) {
var message = "确定打印吗?";
$.modal.confirm(message, function () {
try {
......@@ -262,7 +279,7 @@
}
var data = '';
var ids = [performanceId];
data = {"ids": ids.join()};
data = {"ids": ids.join(), "ticketId": ticketId};
var configPrint = {
url: prefix + "/batchPrintExpress",
type: "post",
......@@ -305,12 +322,44 @@
},
success: function (result) {
$.modal.closeLoading();
console.log(result)
var rows = result.rows;
var html = '<option value="">全部</option>';
$.each(rows,function(index,value){
html += '<option value="'+value.ticketsId+'">'+value.title+'</option>'
});
$('#selectTicketDiv').find('#openTicketListTplSelect').html(html);
openTicketList("openTicketListTpl", performanceId);
}
};
$.ajax(configPrint)
}
function openTicketList(formId, performanceId, width, height) {
table.set();
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId;
var _width = $.common.isEmpty(width) ? "400" : width;
var _height = $.common.isEmpty(height) ? "230" : height;
let selectTicketDiv = $('#selectTicketDiv').html();
$('#' + currentId).html(selectTicketDiv);
layer.open({
type: 1,
area: [_width + 'px', _height + 'px'],
fix: false,
//不固定
maxmin: true,
shade: 0.3,
title: '选择票种打印',
content: $('#' + currentId).html(),
btn: ['<i class="fa fa-check"></i> 打印', '<i class="fa fa-remove"></i> 取消'],
// 弹层外区域关闭
shadeClose: true,
btn1: function (index, layero) {
var ticketId = layero.find('#openTicketListTplSelect').val();
printExpress(performanceId, ticketId);
}
});
}
function exportExcel(performancesId) {
var data = {"ids": performancesId};
$.table.exportExcel("", data)
......@@ -384,7 +433,8 @@
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
&nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i
class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
......@@ -393,4 +443,9 @@
</form>
</script>
<!-- 票种选择区域 -->
<script id="openTicketListTpl" type="text/template">
</script>
</html>
\ No newline at end of file
......@@ -614,13 +614,13 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
return kylinOrderExpressPrintVo;
}
public KylinOrderExpressPrintVo batchPrintExpress(String performanceId) {
public KylinOrderExpressPrintVo batchPrintExpress(String performanceId, String ticketId) {
List<OrderExpressListDao> newList = new ArrayList<>();
int count = 0;
int limitNum = 1000;
int mid = 0;
do {
List<OrderExpressListDao> list = kylinOrderExpressMapper.selectPrintListOfPerformanceId(performanceId, mid, limitNum);
List<OrderExpressListDao> list = kylinOrderExpressMapper.selectPrintListOfPerformanceId(performanceId, ticketId, mid, limitNum);
if (!CollectionUtil.isEmpty(list)) {
newList.addAll(list);
......
......@@ -21,6 +21,7 @@ public interface KylinOrderExpressMapper extends BaseMapper<KylinOrderExpress> {
List<OrderExpressListDao> selectPrintListOfPerformanceId(
@Param("performanceId") String performanceId,
@Param("ticketId") String ticketId,
@Param("mid") Integer mid,
@Param("limitNum") Integer limitNum
);
......
......@@ -34,6 +34,7 @@
<where>
a.express_status = 2
AND a.performances_id = #{performanceId}
<if test="ticketId != ''">AND e.tickets_id = #{ticketId}</if>
AND a.mid > ${mid}
</where>
ORDER BY a.mid ASC
......
......@@ -53,5 +53,6 @@
LEFT JOIN kylin_ticket_time_relation AS d ON d.times_id = c.times_id
where d.performance_id = ${performanceId}
and b.is_express = 1
and b.status IN (2, 3, 6, 7, 8, 9, 10)
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment