From 0b90432a1b308de17d3aeffcdc6479232e80823b Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Wed, 12 Nov 2025 10:37:38 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=20=20=20tms-=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86-=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=A4=84=E7=90=86-=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E8=AE=B0=E5=BD=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20committer:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/MonthlyCustomerShipmentStatVO.java | 8 ++++ .../mapper/EmisSettleInvoiceRecordMapper.xml | 48 +++++++++++++++++-- .../resources/mapper/EmisWaybillMapper.xml | 26 ++++------ 3 files changed, 62 insertions(+), 20 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java index 490ed1eba..68adf333a 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java @@ -72,6 +72,14 @@ public class MonthlyCustomerShipmentStatVO implements Serializable { @Excel(name = "陆运实际重量") private BigDecimal landWeight; + /* 海运票数 */ + @Excel(name = "海运票数") + private Integer seaTickets; + + /* 海运实际重量 */ + @Excel(name = "海运实际重量") + private BigDecimal seaWeight; + /* 进口票数 */ @Excel(name = "进口票数") private Integer importTickets; diff --git a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml index fe9e461bc..e1b11b120 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleInvoiceRecordMapper.xml @@ -100,7 +100,17 @@ select a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code, a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope, a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money, a.open_money_max, a.open_money, ch.invoice_no, a.reced_money, a.payment_status, a.invoice_status, a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id, a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site from emis_settle_invoice_record a - left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0' + left join ( + select ch1.* + from emis_settle_invoice_ch_record ch1 + inner join ( + select apply_seq_no, max(id) as max_id + from emis_settle_invoice_ch_record + where del_flag = '0' + group by apply_seq_no + ) ch2 on ch1.apply_seq_no = ch2.apply_seq_no and ch1.id = ch2.max_id + where ch1.del_flag = '0' + ) ch on a.apply_seq_no = ch.apply_seq_no @@ -261,7 +271,17 @@ op_user.emp_name as op_man_name, delay_op_user.emp_name as delay_op_man_name from emis_settle_invoice_record a - left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0' + left join ( + select ch1.* + from emis_settle_invoice_ch_record ch1 + inner join ( + select apply_seq_no, max(id) as max_id + from emis_settle_invoice_ch_record + where del_flag = '0' + group by apply_seq_no + ) ch2 on ch1.apply_seq_no = ch2.apply_seq_no and ch1.id = ch2.max_id + where ch1.del_flag = '0' + ) ch on a.apply_seq_no = ch.apply_seq_no left join sys_user apply_user on a.apply_man_code = apply_user.emp_code left join sys_user audit_user on a.audit_man_code = audit_user.emp_code left join sys_user op_user on a.op_man_code = op_user.emp_code @@ -387,7 +407,17 @@ select a.id, a.apply_seq_no, a.apply_date, a.apply_man_code, a.apply_site_code, a.customer_code, a.customer_name, a.settle_bill_no, a.settle_bill_name, a.apply_money, a.invoice_type, a.openbill_scope, a.company_name, a.company_tax_no, a.company_tel, a.company_address, a.invioce_remark, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.real_tax_type, a.orig_open_money, a.add_tax_rate, a.add_open_money, a.open_money_max, a.open_money, a.invoice_no, a.invoice_status, a.invoice_status_desc, a.recieve_address, a.email, a.file_path, a.remark, a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.audit_note, a.op_man_code, a.op_date, a.op_site_code, a.open_ch_id, a.open_ch_status, a.open_ch_status_desc, a.open_com_code, a.bl_delay, a.delay_op_man_code, a.delay_op_date, ch.saler_company_name, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site from emis_settle_invoice_record a - left join emis_settle_invoice_ch_record ch on a.apply_seq_no = ch.apply_seq_no and ch.del_flag = '0' + left join ( + select ch1.* + from emis_settle_invoice_ch_record ch1 + inner join ( + select apply_seq_no, max(id) as max_id + from emis_settle_invoice_ch_record + where del_flag = '0' + group by apply_seq_no + ) ch2 on ch1.apply_seq_no = ch2.apply_seq_no and ch1.id = ch2.max_id + where ch1.del_flag = '0' + ) ch on a.apply_seq_no = ch.apply_seq_no where a.id = #{id} diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 57cb2832b..8ea1e99f7 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -4004,10 +4004,12 @@ IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '1' THEN a.bill_weight ELSE 0 END), 0) AS expressWeight, SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '2' THEN 1 ELSE 0 END) AS airTickets, IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '2' THEN a.bill_weight ELSE 0 END), 0) AS airWeight, - SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '3' THEN 1 ELSE 0 END) AS landTickets, - IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '3' THEN a.bill_weight ELSE 0 END), 0) AS landWeight, - SUM(CASE WHEN a.receive_country = '0086' AND tl.trans_type IN ('1', '2', '3') THEN 1 ELSE 0 END) AS importTickets, - IFNULL(SUM(CASE WHEN a.receive_country = '0086' AND tl.trans_type IN ('1', '2', '3') THEN a.bill_weight ELSE 0 END), 0) AS importWeight + SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type in ('3','5') THEN 1 ELSE 0 END) AS landTickets, + IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type in ('3','5') THEN a.bill_weight ELSE 0 END), 0) AS landWeight, + SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN 1 ELSE 0 END) AS seaTickets, + IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN a.bill_weight ELSE 0 END), 0) AS seaWeight, + SUM(CASE WHEN a.receive_country = '0086' THEN 1 ELSE 0 END) AS importTickets, + IFNULL(SUM(CASE WHEN a.receive_country = '0086' THEN a.bill_weight ELSE 0 END), 0) AS importWeight FROM emis_waybill a LEFT JOIN emis_trans_line tl ON a.trans_line_type = tl.line_code AND tl.del_flag = '0' LEFT JOIN emis_customer_user cu ON a.customer_code = cu.customer_code AND cu.del_flag = '0' @@ -4017,7 +4019,6 @@ AND a.order_status!='2' AND a.cust_no IS NOT NULL AND a.cust_no != '' --- AND cu.customer_type = '2' AND NOT EXISTS ( SELECT 1 FROM emis_waybill_problem_info ewpi @@ -4142,19 +4143,12 @@ SELECT 1 FROM emis_trans_line tl WHERE tl.line_code = a.trans_line_type AND tl.del_flag = '0' - AND tl.trans_type = #{transType} - - AND a.send_country = '0086' - - - AND a.send_country = '0086' - - - AND a.send_country = '0086' - AND a.receive_country = '0086' - AND tl.trans_type IN ('1', '2', '3') + + + AND FIND_IN_SET(tl.trans_type, #{transType}) + AND a.send_country = '0086' )