From 4ccc5f7243aa5e4c390e9ff21e6b96524195707f Mon Sep 17 00:00:00 2001 From: "lisai17@sina.com" Date: Thu, 4 Mar 2021 17:29:15 +0800 Subject: [PATCH] . --- .../stat/invoice/InvoiceUseController.java | 5 ++-- .../stat/invoice/InvoiceUseService.java | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseController.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseController.java index 1579e5f..980fdad 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseController.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseController.java @@ -16,6 +16,7 @@ public class InvoiceUseController extends Controller { Integer invoice_type = getInt("invoice_type"); String invoice_number = get("invoice_number"); String invoice_code = get("invoice_code"); + String ticket_code = get("ticket_code"); Integer invoice_state = getInt("invoice_state"); String order_sn = get("order_sn"); String truck_license = get("truck_license"); @@ -23,9 +24,9 @@ public class InvoiceUseController extends Controller { int export = getInt("export", 0); if (export == 0) { - renderJson(Result.success(InvoiceUseService.me.statuse(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, order_sn, truck_license, order_state))); + renderJson(Result.success(InvoiceUseService.me.statuse(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, ticket_code, order_sn, truck_license, order_state))); }else{ - Workbook wb = InvoiceUseService.me.statuseExport(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, order_sn, truck_license, order_state); + Workbook wb = InvoiceUseService.me.statuseExport(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, ticket_code, order_sn, truck_license, order_state); render(new ExcelRender(tm + "_票据使用记录_" + System.currentTimeMillis() + ".xlsx", wb)); } } diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java index 8701ed8..1782a5f 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/stat/invoice/InvoiceUseService.java @@ -36,6 +36,7 @@ public class InvoiceUseService { String invoice_number, String invoice_code, Integer invoice_state, + String ticket_code, String order_sn, String truck_license, Integer order_state @@ -43,7 +44,7 @@ public class InvoiceUseService { String logsql = "select \n" + " t.id rowkey, t.invoice_number, t.`code` invoice_code, t.state invoice_state, t.settlement_user_name, t.settlement_time, t.create_time, t.invalid_time, t.invalid_memo, t.invoice_type, t.invalid_user_name\n" + " , r.receive_user_name, r.create_time receive_time, r.supermarket_id\n" + - " , o.sn order_sn, o.weight, o.total_price, o.unit_price, o.truck_license, o.customer_id, o.customer_texpayer_name, o.customer_texpayer_num, o.isprepaid, o.state order_state\n" + + " , o.sn order_sn, o.weight, o.total_price, o.unit_price, o.truck_license, o.customer_id, o.customer_texpayer_name, o.customer_texpayer_num, o.isprepaid, o.state order_state, o.ticket_code\n" + " , s.name supermarket_name " + " from invoice_log t\n" + " left join invoice_receive r on t.invoice_receive_id = r.id\n" + @@ -54,8 +55,9 @@ public class InvoiceUseService { String ordsql = "select\n" + " t.uuid rowkey, t.invoice_number, t.invoice_code, l.state invoice_state, t.settlement_user_name, l.settlement_time, t.create_time, l.invalid_time, l.invalid_memo, t.invoice_type, l.invalid_user_name\n" + " , r.receive_user_name, r.create_time receive_time, t.supermarket_id \n" + - " , t.sn order_sn, t.weight, t.total_price, t.unit_price, t.truck_license, t.customer_id, t.customer_texpayer_name, t.customer_texpayer_num, t.isprepaid, t.state order_state \n" + - " , s.name supermarket_name from order_temp t \n" + + " , t.sn order_sn, t.weight, t.total_price, t.unit_price, t.truck_license, t.customer_id, t.customer_texpayer_name, t.customer_texpayer_num, t.isprepaid, t.state order_state, t.ticket_code \n" + + " , s.name supermarket_name \n" + + " from order_temp t \n" + " left join invoice_log l on l.invoice_number = t.invoice_number and l.code = t.invoice_code and l.order_sn = t.sn \n" + " left join supermarket s on s.id = t.supermarket_id\n" + " left join invoice_receive r on l.invoice_receive_id = r.id\n" + @@ -112,6 +114,14 @@ public class InvoiceUseService { paramord.add("%" + truck_license.trim() + "%"); } + if (StrKit.notBlank(ticket_code)) { + logsql += " and o.ticket_code like ? \n"; + ordsql += " and t.ticket_code like ? \n"; + + paramlog.add("%" + ticket_code.trim() + "%"); + paramord.add("%" + ticket_code.trim() + "%"); + } + if (invoice_state != null) { if (invoice_state == 9) { logsql += " and t.state = ? \n"; @@ -225,11 +235,12 @@ public class InvoiceUseService { String invoice_number, String invoice_code, Integer invoice_state, + String ticket_code, String order_sn, String truck_license, Integer order_state ) { - Record ret = statuse(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, order_sn, truck_license, order_state); + Record ret = statuse(tm, supermarket_id, invoice_type, invoice_number, invoice_code, invoice_state, ticket_code, order_sn, truck_license, order_state); List list = ret.get("list"); @@ -253,6 +264,7 @@ public class InvoiceUseService { row.createCell(a++).setCellValue("发票编号"); row.createCell(a++).setCellValue("发票类型"); row.createCell(a++).setCellValue("发票状态"); + row.createCell(a++).setCellValue("结算单单号"); row.createCell(a++).setCellValue("开票人"); row.createCell(a++).setCellValue("开票时间"); row.createCell(a++).setCellValue("作废人"); @@ -260,7 +272,7 @@ public class InvoiceUseService { row.createCell(a++).setCellValue("备注"); // 表头 end - int end_col = 19; + int end_col = 20; int datalen = list.size(); for (int i = 0; i < datalen; i++) { Record order = list.get(i); @@ -313,6 +325,7 @@ public class InvoiceUseService { } else { row.createCell(a++).setCellValue(""); } + row.createCell(a++).setCellValue(order.getStr("ticket_code")); row.createCell(a++).setCellValue(order.getStr("settlement_user_name")); if (order.get("settlement_time") != null) { row.createCell(a++).setCellValue(DateTimeUtil.sdfhms.get().format(order.getDate("settlement_time")));