Merge pull request 'demand: TMS系统 - 客户账单管理 - 财务开票处理 - 定制导出设置超时时间 TMS系统 - 签收管理 - 签收异常对比-未签收列表-查询过滤掉运输方式为空运且清关方式为自清自提的运单' (#223) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/223
This commit is contained in:
commit
f7de649465
@ -13,6 +13,9 @@ package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
@ -113,6 +116,7 @@ public class EmisSettleInvoiceRecordController extends BaseController {
|
||||
|
||||
/**
|
||||
* 定制导出开票记录表列表
|
||||
* 设置5分钟超时,超时后自动关闭
|
||||
*
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisSettleInvoiceRecord:customExport')")
|
||||
@ -137,9 +141,44 @@ public class EmisSettleInvoiceRecordController extends BaseController {
|
||||
emisSettleInvoiceRecord.getParams().put("billCode", billCodeStr);
|
||||
}
|
||||
|
||||
List<EmisSettleInvoiceRecordExportVO> list = emisSettleInvoiceRecordService
|
||||
.selectCustomExportList(emisSettleInvoiceRecord);
|
||||
EmisSettleInvoiceRecordCustomExcelUtil.exportCustomExcel(response, list, "开票记录表定制导出数据_"+ UUID.randomUUID());
|
||||
CompletableFuture<Void> exportFuture = CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
List<EmisSettleInvoiceRecordExportVO> list = emisSettleInvoiceRecordService
|
||||
.selectCustomExportList(emisSettleInvoiceRecord);
|
||||
EmisSettleInvoiceRecordCustomExcelUtil.exportCustomExcel(response, list,
|
||||
"开票记录表定制导出数据_" + UUID.randomUUID());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导出失败: " + e.getMessage(), e);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
// 设置5分钟超时
|
||||
exportFuture.get(5, TimeUnit.MINUTES);
|
||||
} catch (TimeoutException e) {
|
||||
// 超时后取消任务
|
||||
exportFuture.cancel(true);
|
||||
try {
|
||||
if (!response.isCommitted()) {
|
||||
response.reset();
|
||||
response.setContentType("application/json;charset=utf-8");
|
||||
response.getWriter().write("{\"success\":false,\"message\":\"导出数据量过大导致超时,请缩小查询范围后重试\"}");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// 忽略写入错误
|
||||
}
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
if (!response.isCommitted()) {
|
||||
response.reset();
|
||||
response.setContentType("application/json;charset=utf-8");
|
||||
String errorMsg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
|
||||
response.getWriter().write("{\"success\":false,\"message\":\"导出失败: " + errorMsg + "\"}");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// 忽略写入错误
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -208,11 +208,13 @@
|
||||
a.scan_man_code
|
||||
FROM
|
||||
emis_tms_scan_record a ,emis_waybill b
|
||||
LEFT JOIN emis_trans_line k ON b.trans_line_type = k.line_code AND k.del_flag = '0'
|
||||
WHERE
|
||||
a.del_flag = '0' and b.del_flag='0'
|
||||
and a.bill_code = b.bill_code
|
||||
and b.bl_sign = '0'
|
||||
and b.bill_code NOT IN ( SELECT bill_code FROM emis_waybill_problem_info ewpi WHERE ewpi.del_flag = '0' AND ewpi.`problem_type` IN ( 151, 173, 170 ) )
|
||||
and NOT (b.customs_clear = 2 AND k.trans_type = 2)
|
||||
and a.scan_site_code=#{scanSiteCode}
|
||||
and a.scan_type=#{scanType}
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user