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

Commit c9d23f8a authored by jiangxiulong's avatar jiangxiulong

批量打印更改

parent 371371a2
...@@ -135,21 +135,21 @@ ...@@ -135,21 +135,21 @@
return str return str
} }
function printExpressData(dataInfo, jContact, jAddress, jTel) { function printExpressData(dataInfo, jContact, jAddress, jTel, index, listLen) {
var LODOP = getLodop(); var LODOP = getLodop();
LODOP.PRINT_INIT("运单打印"); LODOP.PRINT_INIT("运单打印");
// LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "100mm*148mm"); // LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "100mm*148mm");
// LODOP.ADD_PRINT_TEXT(22, 115, 200, 20, "打印时间:" + getNowFormatDate()); LODOP.ADD_PRINT_TEXT(22, 115, 200, 20, "打印时间:" + getNowFormatDate());
// LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
// LODOP.SET_PRINT_STYLEA(0, "FontSize", 5); LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
// LODOP.ADD_PRINT_TEXT(32, 115, 200, 20, "第1次打印"); // LODOP.ADD_PRINT_TEXT(32, 115, 200, 20, "第1次打印");
// LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); // LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
// LODOP.SET_PRINT_STYLEA(0, "FontSize", 5); // LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
// LODOP.ADD_PRINT_TEXT(98, 55, 42, 20, "1/1"); // LODOP.ADD_PRINT_TEXT(98, 55, 42, 20, index + "/" + listLen); //子母单
LODOP.ADD_PRINT_TEXT(60, 20, 100, 20, "FQ"); LODOP.ADD_PRINT_TEXT(60, 20, 100, 20, "FQ");
// LODOP.ADD_PRINT_TEXT(32, 190, 200, 20, "序号1"); LODOP.ADD_PRINT_TEXT(32, 190, 200, 20, "第" + index + "/" + listLen + "个");
// LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
// LODOP.SET_PRINT_STYLEA(0, "FontSize", 5); LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
LODOP.ADD_PRINT_BARCODE(45, 55, "80mm", "13mm", "128Auto", dataInfo.mailno); LODOP.ADD_PRINT_BARCODE(45, 55, "80mm", "13mm", "128Auto", dataInfo.mailno);
LODOP.SET_PRINT_STYLEA(0, "ShowBarText", 0); LODOP.SET_PRINT_STYLEA(0, "ShowBarText", 0);
LODOP.ADD_PRINT_TEXT(98, 95, 500, 15, "运单号 " + substrMailno(dataInfo.mailno)); LODOP.ADD_PRINT_TEXT(98, 95, 500, 15, "运单号 " + substrMailno(dataInfo.mailno));
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
var jTel = result.data.jtel; var jTel = result.data.jtel;
if (listLen > 0) { if (listLen > 0) {
$.each(expressList, function (index, value) { $.each(expressList, function (index, value) {
printExpressData(value, jContact, jAddress, jTel); printExpressData(value, jContact, jAddress, jTel, index+1, listLen);
}); });
} }
$.modal.closeLoading(); $.modal.closeLoading();
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
</div> </div>
</div> </div>
</div> </div>
<script th:src="@{/lodop6226/LodopFuncs.js}"></script>
<th:block th:include="include :: footer"/> <th:block th:include="include :: footer"/>
<script th:inline="javascript"> <script th:inline="javascript">
var performanceOrderListFlag = [[${@permission.hasPermi('kylin:performancesExpress:performanceOrderList')}]]; var performanceOrderListFlag = [[${@permission.hasPermi('kylin:performancesExpress:performanceOrderList')}]];
...@@ -66,90 +68,131 @@ ...@@ -66,90 +68,131 @@
$.ajax(configPrint) $.ajax(configPrint)
} }
function printExpressData(list) { /**
* 打印
* @returns {string}
*/
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
return currentdate;
}
function substrMailno(str) {
if (str != null && str != "" && str.length == 15) {
var newStr1 = (str.slice(0, 2) + "\xa0" + str.slice(2))
var newStr2 = (newStr1.slice(0, 6) + "\xa0" + newStr1.slice(6));
var newStr3 = (newStr2.slice(0, 10) + "\xa0" + newStr2.slice(10));
var newStr4 = (newStr3.slice(0, 14) + "\xa0" + newStr3.slice(14));
return newStr4
}
return str
}
function printExpressData(dataInfo, jContact, jAddress, jTel, index, listLen) {
var LODOP = getLodop(); var LODOP = getLodop();
LODOP.PRINT_INIT("运单打印"); LODOP.PRINT_INIT("运单打印");
// LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "100mm*148mm"); // LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "100mm*148mm");
LODOP.ADD_PRINT_TEXT(22, 115, 200, 20, "打印时间:"); LODOP.ADD_PRINT_TEXT(22, 115, 200, 20, "打印时间:" + getNowFormatDate());
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
LODOP.ADD_PRINT_TEXT(32, 115, 200, 20, "第1次打印");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 5); LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
LODOP.ADD_PRINT_TEXT(98, 55, 42, 20, "1/1"); // LODOP.ADD_PRINT_TEXT(32, 115, 200, 20, "第1次打印");
// LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
// LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
// LODOP.ADD_PRINT_TEXT(98, 55, 42, 20, index + "/" + listLen); //子母单
LODOP.ADD_PRINT_TEXT(60, 20, 100, 20, "FQ"); LODOP.ADD_PRINT_TEXT(60, 20, 100, 20, "FQ");
LODOP.ADD_PRINT_TEXT(32, 190, 200, 20, "序号1"); LODOP.ADD_PRINT_TEXT(32, 190, 200, 20, "第" + index + "/" + listLen + "个");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 5); LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
LODOP.ADD_PRINT_BARCODE(45, 55, "80mm", "13mm", "128Auto", "mo6789056"); LODOP.ADD_PRINT_BARCODE(45, 55, "80mm", "13mm", "128Auto", dataInfo.mailno);
LODOP.SET_PRINT_STYLEA(0, "ShowBarText", 0); LODOP.SET_PRINT_STYLEA(0, "ShowBarText", 0);
LODOP.ADD_PRINT_TEXT(98, 95, 500, 15, "母单号69678"); LODOP.ADD_PRINT_TEXT(98, 95, 500, 15, "运单号 " + substrMailno(dataInfo.mailno));
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 9); LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(9, 290, 100, 40, "proCode"); LODOP.ADD_PRINT_TEXT(9, 290, 100, 40, dataInfo.proCode);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 26); LODOP.SET_PRINT_STYLEA(0, "FontSize", 26);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1); LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(125, 10, 500, 45, "destRouteLabel"); LODOP.ADD_PRINT_TEXT(125, 10, 500, 45, dataInfo.destRouteLabel);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 33); LODOP.SET_PRINT_STYLEA(0, "FontSize", 33);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_ELLIPSE(175, 18, 41, 39, 0, 1); LODOP.ADD_PRINT_ELLIPSE(175, 18, 41, 39, 0, 1);
LODOP.ADD_PRINT_TEXT(183, 27, 31, 31, "收"); LODOP.ADD_PRINT_TEXT(183, 27, 31, 31, "收");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 17); LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
LODOP.ADD_PRINT_TEXT(181, 76, 200, 20, "dcontact"); LODOP.ADD_PRINT_TEXT(181, 76, 200, 20, dataInfo.expressContacts);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(181, 230, 296, 20, "158***999"); LODOP.ADD_PRINT_TEXT(181, 230, 296, 20, dataInfo.expressPhone.substr(0, 3) + "****" + dataInfo.expressPhone.substr(8, 11));
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(195, 74, 296, 39, "beijing"); LODOP.ADD_PRINT_TEXT(195, 74, 296, 39, dataInfo.expressAddress);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "desc"); if (dataInfo.freightPrice > 0) {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付 " + dataInfo.freightPrice + "元");
} else {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付");
}
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2); LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1)
LODOP.ADD_PRINT_TEXT(263, 21, 120, 50, "codingMapping"); LODOP.ADD_PRINT_TEXT(263, 21, 120, 50, dataInfo.cargoTypeCode);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 30); LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2); LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_BARCODE(228, 150, 115, 99, "QRCode", "7895678768"); LODOP.ADD_PRINT_BARCODE(228, 150, 115, 99, "QRCode", dataInfo.twoDimensionCode);
LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 7); LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 7);
LODOP.SET_PRINT_STYLEA(0, "DataCharset", "UTF-8"); LODOP.SET_PRINT_STYLEA(0, "DataCharset", "UTF-8");
LODOP.ADD_PRINT_TEXT("61.94mm", "67.47mm", "7.41mm", "21.17mm", "已\r\n\r\n视"); LODOP.ADD_PRINT_TEXT("61.94mm", "67.47mm", "7.41mm", "21.17mm", "已\r\n\r\n视");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15); LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
LODOP.ADD_PRINT_TEXT(235, 300, 80, 50, "proName"); LODOP.ADD_PRINT_TEXT(235, 300, 80, 50, dataInfo.proName);
LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(295, 300, 80, 20, dataInfo.expressTypeCode);
LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 10); LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1); LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_ELLIPSE(329, 18, 41, 38, 0, 1); LODOP.ADD_PRINT_ELLIPSE(329, 18, 41, 38, 0, 1);
LODOP.ADD_PRINT_TEXT(336, 27, 31, 31, "寄"); LODOP.ADD_PRINT_TEXT(336, 27, 31, 31, "寄");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 17); LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
LODOP.ADD_PRINT_TEXT(335, 76, 200, 15, "jcontact"); LODOP.ADD_PRINT_TEXT(335, 76, 200, 15, jContact);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(335, 230, 200, 15, "158***9999"); LODOP.ADD_PRINT_TEXT(335, 230, 200, 15, jTel);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(350, 74, 296, 30, "beijingshi"); LODOP.ADD_PRINT_TEXT(350, 74, 296, 30, jAddress);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8); LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1) LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(388, 10, 57, 15, "托寄物:"); LODOP.ADD_PRINT_TEXT(388, 10, 57, 15, "托寄物:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
LODOP.ADD_PRINT_TEXT(400, 10 , 180, 70, "mailingContent"); LODOP.ADD_PRINT_TEXT(400, 10, 180, 70, "演出票");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
...@@ -161,13 +204,13 @@ ...@@ -161,13 +204,13 @@
LODOP.ADD_PRINT_TEXT(433, 200, 57, 15, "重量:"); LODOP.ADD_PRINT_TEXT(433, 200, 57, 15, "重量:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
LODOP.ADD_PRINT_TEXT(433, 225, 80, 15, "2kg"); LODOP.ADD_PRINT_TEXT(433, 225, 80, 15, "1kg");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1); LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.ADD_PRINT_TEXT(483, 10, 55, 15, "备注:"); LODOP.ADD_PRINT_TEXT(483, 10, 55, 15, "备注:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "宋体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
LODOP.ADD_PRINT_TEXT(494, 10, 180, 55, "remarks"); LODOP.ADD_PRINT_TEXT(494, 10, 180, 55, dataInfo.timeTitle + " " + dataInfo.ticketsTitle + "\r\n数量 " + dataInfo.number);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 7); LODOP.SET_PRINT_STYLEA(0, "FontSize", 7);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1); LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
...@@ -196,23 +239,36 @@ ...@@ -196,23 +239,36 @@
LODOP.ADD_PRINT_LINE("147mm", "0mm", "147mm", "100mm", 0, 1); LODOP.ADD_PRINT_LINE("147mm", "0mm", "147mm", "100mm", 0, 1);
LODOP.PRINT(); LODOP.PRINT();
} }
function printExpress(orderExpressId) {
/*var configPrint = { function printExpress(performanceId) {
url: prefix + "/print", var data = '';
var ids = [performanceId];
data = {"ids": ids.join()};
var configPrint = {
url: prefix + "/batchPrintExpress",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: {ids: orderExpressId}, data: data,
beforeSend: function () { beforeSend: function () {
$.modal.loading("正在处理中,请稍后..."); $.modal.loading("正在获取数据中,请稍后...");
}, },
success: function (result) { success: function (result) {
$.modal.closeLoading(); $.modal.closeLoading();
var url = "https://img.zhengzai.tv/" + result.data; $.modal.loading("正在打印中,请稍后...");
window.location.href = url; var expressList = result.data.expressList;
var listLen = expressList.length;
var jContact = result.data.jcontact;
var jAddress = result.data.jaddress;
var jTel = result.data.jtel;
if (listLen > 0) {
$.each(expressList, function (index, value) {
printExpressData(value, jContact, jAddress, jTel, index+1, listLen);
});
}
$.modal.closeLoading();
} }
}; };
$.ajax(configPrint)*/ $.ajax(configPrint)
printExpressData();
} }
$(function () { $(function () {
...@@ -262,7 +318,7 @@ ...@@ -262,7 +318,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + batchPlaceOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量下单吗?\', table.options.batchPlaceOrderUrl)"></i>下单</a> '); actions.push('<a class="btn btn-danger btn-xs ' + batchPlaceOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量下单吗?\', table.options.batchPlaceOrderUrl)"></i>下单</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + batchCancelOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量取消吗?\', table.options.batchCancelOrderUrl)"></i>取消</a> '); actions.push('<a class="btn btn-warning btn-xs ' + batchCancelOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量取消吗?\', table.options.batchCancelOrderUrl)"></i>取消</a> ');
// actions.push('<a class="btn btn-warning btn-xs ' + batchGenerateImageFlag + '" href="javascript:void(0)" onclick="generateImage(\'' + row.performancesId + '\',)"></i>下载快递单</a> '); // actions.push('<a class="btn btn-warning btn-xs ' + batchGenerateImageFlag + '" href="javascript:void(0)" onclick="generateImage(\'' + row.performancesId + '\',)"></i>下载快递单</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + batchPrintExpressFlag + '" href="javascript:void(0)" onclick="printExpress(\'' + row.orderExpressId + '\',)"></i>打印快递单</a> '); actions.push('<a class="btn btn-warning btn-xs ' + batchPrintExpressFlag + '" href="javascript:void(0)" onclick="printExpress(\'' + row.performancesId + '\',)"></i>打印快递单</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
......
...@@ -23,6 +23,7 @@ import com.liquidnet.service.kylin.entity.*; ...@@ -23,6 +23,7 @@ import com.liquidnet.service.kylin.entity.*;
import com.liquidnet.service.kylin.mapper.*; import com.liquidnet.service.kylin.mapper.*;
import com.liquidnet.service.kylin.service.IKylinOrderExpress; import com.liquidnet.service.kylin.service.IKylinOrderExpress;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -633,33 +634,31 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -633,33 +634,31 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
} }
public KylinOrderExpressPrintVo batchPrintExpress(String performanceId) { public KylinOrderExpressPrintVo batchPrintExpress(String performanceId) {
List<OrderExpressListDao> newList = new ArrayList<>();
int count = 0; int count = 0;
int limitNum = 20; int limitNum = 1;
int mid = 0; int mid = 0;
do { do {
/*List<KylinOrderRefunds> list = kylinOrderExpressMapper.selectPrintList(whereType, refundBatchId, whereStatus, mid, limitNum); List<OrderExpressListDao> list = kylinOrderExpressMapper.selectPrintListOfPerformanceId(performanceId, mid, limitNum);
List<String> ids = performanceExpressSearchAdminParam.getIds(); if (!CollectionUtil.isEmpty(list)) {
newList.addAll(list);
List<OrderExpressListDao> list = kylinOrderExpressMapper.selectPrintList(ids); count = list.size();
OrderExpressListDao lastInfo = list.get(count - 1);
mid = lastInfo.getMid();
} else {
count = 0;
}
} while (count >= limitNum);
KylinOrderExpressPrintVo kylinOrderExpressPrintVo = new KylinOrderExpressPrintVo(); KylinOrderExpressPrintVo kylinOrderExpressPrintVo = new KylinOrderExpressPrintVo();
kylinOrderExpressPrintVo.setExpressList(list); kylinOrderExpressPrintVo.setExpressList(newList);
kylinOrderExpressPrintVo.setJContact(jContact); kylinOrderExpressPrintVo.setJContact(jContact);
kylinOrderExpressPrintVo.setJAddress(jAddress); kylinOrderExpressPrintVo.setJAddress(jAddress);
kylinOrderExpressPrintVo.setJTel(jTel); kylinOrderExpressPrintVo.setJTel(jTel);
return kylinOrderExpressPrintVo; return kylinOrderExpressPrintVo;
count = refundList.size();
if (count > 0) {
KylinOrderRefunds lastInfo = refundList.get(count - 1);
if (lastInfo != null) {
mid = lastInfo.getMid();
}
}*/
} while (count >= limitNum);
return null;
} }
} }
...@@ -7,6 +7,7 @@ import java.math.BigDecimal; ...@@ -7,6 +7,7 @@ import java.math.BigDecimal;
@Data @Data
public class OrderExpressListDao implements Serializable { public class OrderExpressListDao implements Serializable {
private Integer mid;
private String orderExpressId; private String orderExpressId;
private String orderTicketsId; private String orderTicketsId;
private String orderExpressCode; private String orderExpressCode;
......
...@@ -19,4 +19,9 @@ public interface KylinOrderExpressMapper extends BaseMapper<KylinOrderExpress> { ...@@ -19,4 +19,9 @@ public interface KylinOrderExpressMapper extends BaseMapper<KylinOrderExpress> {
List<OrderExpressListDao> selectPrintList(@Param("ids") List<String> ids); List<OrderExpressListDao> selectPrintList(@Param("ids") List<String> ids);
List<OrderExpressListDao> selectPrintListOfPerformanceId(
@Param("performanceId") String performanceId,
@Param("mid") Integer mid,
@Param("limitNum") Integer limitNum
);
} }
...@@ -18,6 +18,24 @@ ...@@ -18,6 +18,24 @@
${orderExpressId} ${orderExpressId}
</foreach> </foreach>
</where> </where>
ORDER BY mid DESC ORDER BY a.mid DESC
</select>
<select id="selectPrintListOfPerformanceId" resultType="com.liquidnet.service.kylin.dao.OrderExpressListDao">
SELECT a.*,
b.express_contacts, b.express_address, b.express_phone, b.province, b.city, b.county, b.number,
d.use_start, d.title AS time_title, d.type AS time_type,
e.title AS tickets_title, e.type AS tickets_type
FROM kylin_order_express a
INNER JOIN kylin_order_tickets b ON a.order_tickets_id = b.order_tickets_id
INNER JOIN kylin_order_ticket_relations c ON b.order_tickets_id = c.order_id
INNER JOIN kylin_ticket_times d ON c.time_id = d.ticket_times_id
INNER JOIN kylin_tickets e ON c.ticket_id = e.tickets_id
<where>
a.express_status = 2
AND a.performances_id = #{performanceId}
AND a.mid > ${mid}
</where>
ORDER BY a.mid ASC
LIMIT ${limitNum}
</select> </select>
</mapper> </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