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

Commit efa1d41c authored by jiangxiulong's avatar jiangxiulong

pring test

parent 838718dd
...@@ -228,6 +228,25 @@ public class PerformancesExpressController extends BaseController { ...@@ -228,6 +228,25 @@ public class PerformancesExpressController extends BaseController {
} }
} }
/**
* 批量下单
*/
@RequiresPermissions("kylin:performancesExpress:batchPrint")
@PostMapping("/batchPrint")
@ResponseBody
public ResponseDto batchPrint(@RequestParam("ids") String performanceId) {
String res = performancesExpressServiceImpl.batchPrint(performanceId);
try {
if (res.isEmpty()) {
return ResponseDto.failure("处理失败");
} else {
return ResponseDto.success(res);
}
} catch (Exception e) {
return ResponseDto.failure(e.getMessage());
}
}
/** /**
* 打印快递单 * 打印快递单
*/ */
......
...@@ -85,13 +85,14 @@ ...@@ -85,13 +85,14 @@
url: prefix + "/print", url: prefix + "/print",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: {ids:orderExpressId}, data: {ids: orderExpressId},
beforeSend: function () { beforeSend: function () {
$.modal.loading("正在处理中,请稍后..."); $.modal.loading("正在处理中,请稍后...");
}, },
success: function (result) { success: function (result) {
$.modal.closeLoading(); $.modal.closeLoading();
console.log(result); var url = "https://img.zhengzai.tv/" + result.data;
window.location.href = url;
} }
}; };
$.ajax(configPrint) $.ajax(configPrint)
...@@ -129,22 +130,22 @@ ...@@ -129,22 +130,22 @@
{ {
field: '', field: '',
title: '购买用户', title: '购买用户',
formatter: function(value, row, index) { formatter: function (value, row, index) {
// var userId = row.userId; // var userId = row.userId;
var userMobile = row.userMobile; var userMobile = row.userMobile;
var userName = row.userName; var userName = row.userName;
// return 'ID:'+userId+'<br>'+'姓名:'+userName+'<br>'+'手机号:'+userMobile; // return 'ID:'+userId+'<br>'+'姓名:'+userName+'<br>'+'手机号:'+userMobile;
return '昵称:'+userName+'<br>'+'手机号:'+userMobile; return '昵称:' + userName + '<br>' + '手机号:' + userMobile;
} }
}, },
{ {
field: '', field: '',
title: '收货用户', title: '收货用户',
formatter: function(value, row, index) { formatter: function (value, row, index) {
var expressContacts = row.expressContacts; var expressContacts = row.expressContacts;
var expressAddress = row.expressAddress; var expressAddress = row.expressAddress;
var expressPhone = row.expressPhone; var expressPhone = row.expressPhone;
return '姓名:'+expressContacts+'<br>'+'手机号:'+expressPhone+'<br>'+'地址:'+expressAddress; return '姓名:' + expressContacts + '<br>' + '手机号:' + expressPhone + '<br>' + '地址:' + expressAddress;
} }
}, },
{ {
...@@ -168,7 +169,7 @@ ...@@ -168,7 +169,7 @@
{ {
field: '', field: '',
title: '快递信息', title: '快递信息',
formatter: function(value, row, index) { formatter: function (value, row, index) {
var mailno = row.mailno; var mailno = row.mailno;
var expressStatus = row.expressStatus; var expressStatus = row.expressStatus;
var expressStatusName = ''; var expressStatusName = '';
...@@ -197,7 +198,7 @@ ...@@ -197,7 +198,7 @@
break; break;
} }
} }
return '快递单号:'+mailno+'<br>'+'快递状态:'+expressStatusName; return '快递单号:' + mailno + '<br>' + '快递状态:' + expressStatusName;
} }
}, },
{ {
...@@ -208,7 +209,7 @@ ...@@ -208,7 +209,7 @@
actions.push('<a class="btn btn-success btn-xs ' + placeOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定下单吗?\', table.options.placeOrderUrl)"></i>下单</a> '); actions.push('<a class="btn btn-success btn-xs ' + placeOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定下单吗?\', table.options.placeOrderUrl)"></i>下单</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + cancelOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定取消快递单吗?\', table.options.cancelOrderUrl)"></i>取消</a> '); actions.push('<a class="btn btn-danger btn-xs ' + cancelOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定取消快递单吗?\', table.options.cancelOrderUrl)"></i>取消</a> ');
// actions.push('<a class="btn btn-warning btn-xs ' + printFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderExpressId + '\', \'确定批量打印吗?\', table.options.printUrl)"></i>打印</a> '); // actions.push('<a class="btn btn-warning btn-xs ' + printFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderExpressId + '\', \'确定批量打印吗?\', table.options.printUrl)"></i>打印</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + printFlag + '" href="javascript:void(0)" onclick="printAjax(\'' + row.orderExpressId + '\',)"></i>打印</a> '); actions.push('<a class="btn btn-warning btn-xs ' + printFlag + '" href="javascript:void(0)" onclick="printAjax(\'' + row.orderExpressId + '\',)"></i>下载快递单</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + getResultFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取快递信息吗?\', table.options.getResultUrl)"></i>主动获取下单信息</a> '); // actions.push('<a class="btn btn-success btn-xs ' + getResultFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取快递信息吗?\', table.options.getResultUrl)"></i>主动获取下单信息</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + getFreightFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取估算运费吗?\', table.options.getFreightUrl)"></i>运费估算</a> '); // actions.push('<a class="btn btn-success btn-xs ' + getFreightFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取估算运费吗?\', table.options.getFreightUrl)"></i>运费估算</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + getListFreightFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取运费信息吗?\', table.options.getListFreightUrl)"></i>主动获取运费</a> '); // actions.push('<a class="btn btn-success btn-xs ' + getListFreightFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定获取运费信息吗?\', table.options.getListFreightUrl)"></i>主动获取运费</a> ');
......
...@@ -39,8 +39,31 @@ ...@@ -39,8 +39,31 @@
var performanceOrderListFlag = [[${@permission.hasPermi('kylin:performancesExpress:performanceOrderList')}]]; var performanceOrderListFlag = [[${@permission.hasPermi('kylin:performancesExpress:performanceOrderList')}]];
var batchPlaceOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchPlaceOrder')}]]; var batchPlaceOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchPlaceOrder')}]];
var batchCancelOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchCancelOrder')}]]; var batchCancelOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchCancelOrder')}]];
var printFlag = [[${@permission.hasPermi('kylin:performancesExpress:print')}]];
var prefix = ctx + "kylin/performancesExpress"; var prefix = ctx + "kylin/performancesExpress";
var batchPrintFlag = [[${@permission.hasPermi('kylin:performancesExpress:batchPrint')}]];
function printAjax(performanceId) {
var configPrint = {
url: prefix + "/batchPrint",
type: "post",
dataType: "json",
data: {ids: performanceId},
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
},
success: function (result) {
$.modal.closeLoading();
if (result.data != '' && result.data != null) {
var url = "https://img.zhengzai.tv/" + result.data;
window.location.href = url;
} else {
$.modal.msg("暂无需打印单");
}
}
};
$.ajax(configPrint)
}
$(function () { $(function () {
var options = { var options = {
...@@ -87,7 +110,7 @@ ...@@ -87,7 +110,7 @@
actions.push('<a class="btn btn-success btn-xs ' + performanceOrderListFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>查看</a> '); actions.push('<a class="btn btn-success btn-xs ' + performanceOrderListFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.performancesId + '\')"><i class="fa fa-edit"></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-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 ' + printFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.performancesId + '\', \'确定批量打印吗?\', table.options.printUrl)"></i>打印</a> '); actions.push('<a class="btn btn-warning btn-xs ' + batchPrintFlag + '" href="javascript:void(0)" onclick="printAjax(\'' + row.performancesId + '\',)"></i>下载快递单</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
......
...@@ -575,25 +575,22 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -575,25 +575,22 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
public String print(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) { public String print(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) {
List<String> ids = performanceExpressSearchAdminParam.getIds(); List<String> ids = performanceExpressSearchAdminParam.getIds();
int num = 0;
do {
for (String orderExpressId : ids) { for (String orderExpressId : ids) {
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
KylinOrderExpress kylinOrderExpress = kylinOrderExpressMapper.selectOne( KylinOrderExpress kylinOrderExpress = kylinOrderExpressMapper.selectOne(
Wrappers.lambdaQuery(KylinOrderExpress.class) Wrappers.lambdaQuery(KylinOrderExpress.class)
.eq(KylinOrderExpress::getOrderExpressId, orderExpressId) .eq(KylinOrderExpress::getOrderExpressId, orderExpressId)
); );
log.debug("#OrderExpress查询耗时:{}ms", System.currentTimeMillis() - s); // System.out.println(System.currentTimeMillis() - s);
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne( KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
Wrappers.lambdaQuery(KylinOrderTickets.class) Wrappers.lambdaQuery(KylinOrderTickets.class)
.eq(KylinOrderTickets::getOrderTicketsId, kylinOrderExpress.getOrderTicketsId()) .eq(KylinOrderTickets::getOrderTicketsId, kylinOrderExpress.getOrderTicketsId())
); );
log.debug("#orderInfo查询耗时:{}ms", System.currentTimeMillis() - s); // System.out.println(System.currentTimeMillis() - s);
String imgPath = codeUtil.html2img(kylinOrderExpress, jContact, jProvince.concat(jCity).concat(jAddress), jTel, orderInfo, num); String imgPath = codeUtil.html2img(kylinOrderExpress, jContact, jProvince.concat(jCity).concat(jAddress), jTel, orderInfo);
// System.out.println(System.currentTimeMillis() - s);
} }
num++;
System.out.println(num);
} while (num <= 1000);
String zpiPath = zipMultiFileUtil.goZip(); String zpiPath = zipMultiFileUtil.goZip();
...@@ -603,4 +600,16 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -603,4 +600,16 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
return upload.getOssPath(); return upload.getOssPath();
} }
public String batchPrint(String performanceId) {
List<KylinOrderTickets> orderList = kylinOrderTicketsMapper.getCanCancelOrderList(performanceId, 0, 9999999);
String ossPath = "";
if (!CollectionUtil.isEmpty(orderList)) {
List<String> orderIds = orderList.stream().map(KylinOrderTickets -> KylinOrderTickets.getOrderTicketsId()).collect(Collectors.toList());
PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam = new PerformanceExpressSearchAdminParam();
performanceExpressSearchAdminParam.setIds(orderIds);
ossPath = print(performanceExpressSearchAdminParam);
}
return ossPath;
}
} }
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