From f76e91274816123e976f3766899d0c2a28df452b Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Fri, 5 Sep 2025 15:23:25 +0800
Subject: [PATCH] =?UTF-8?q?demand:=20TMS=E7=B3=BB=E7=BB=9F=20-=20=E5=AE=A2?=
=?UTF-8?q?=E6=88=B7=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86=20-=20=E8=B4=A2?=
=?UTF-8?q?=E5=8A=A1=E5=BC=80=E7=A5=A8=E5=A4=84=E7=90=86=20-=20=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=20?=
=?UTF-8?q?=E6=8C=89=E7=85=A7=E5=8F=91=E7=A5=A8=E5=8F=B7=E6=9F=A5=E8=AF=A2?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
committer: heyu
---
.../erp/emis/domain/EmisSettlePayRecord.java | 22 +++-
.../mapper/EmisSettlePayRecordMapper.xml | 103 ++++++++++++++++--
2 files changed, 112 insertions(+), 13 deletions(-)
diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettlePayRecord.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettlePayRecord.java
index 293368869..0e2f18c87 100644
--- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettlePayRecord.java
+++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisSettlePayRecord.java
@@ -1,10 +1,10 @@
-/**
+/**
* @Project: emis
* @Title: EmisSettlePayRecord.java
* @author linfso
* @date 2024-07-21 13:31:23
* @Copyright: ShangHai Duta 2022 All rights reserved.
- * @version v1.0
+ * @version v1.0
* @Description:
账单收退款记录 实体类
*/
@@ -42,7 +42,7 @@ public class EmisSettlePayRecord extends BaseEntity
private Long id;
/* 支付序号 */
private String payId;
- /* 支付类型 1-微信支付2支付宝 3-对公 */
+ /* 收款来源 1-微信支付2支付宝 3-对公 */
private String payType;
/* 收付类型 1-收款 2-退款 */
private String recType;
@@ -50,8 +50,6 @@ public class EmisSettlePayRecord extends BaseEntity
private String payMan;
/* 支付人编码 */
private String payManCode;
- /* 总账单号 */
- private String settleBillNo;
/* 审核状态 0-未审核 1-已审核 */
private String blAudit;
/* 审核日期 */
@@ -79,7 +77,7 @@ public class EmisSettlePayRecord extends BaseEntity
private String breakEmpCode;
/* 收款人代码 */
private String recManCode;
- /* 结算类型 1-现金 2-月结 */
+ /* 支付类型 1-现金 2-月结 */
private String settleType;
/* 退款日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@@ -127,4 +125,16 @@ public class EmisSettlePayRecord extends BaseEntity
// 开票记录关联
List payInvoiceRelList;
+ /* 账单号 */
+ private String settleBillNo;
+ // 扩展字段 - 用于查询结果展示
+ /* 运单号(多个用逗号分隔) */
+ private String billCodes;
+ /* 账单金额 */
+ private BigDecimal billAmount;
+ /* 开票金额 */
+ private BigDecimal invoiceAmount;
+ /* 开票状态 0-待开票 1-已开票 2-拒绝开票 */
+ private String invoiceStatus;
+
}
diff --git a/emis-biz/src/main/resources/mapper/EmisSettlePayRecordMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettlePayRecordMapper.xml
index e70b737f9..dd1056b50 100644
--- a/emis-biz/src/main/resources/mapper/EmisSettlePayRecordMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisSettlePayRecordMapper.xml
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
+
@@ -45,6 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
+
+
@@ -82,7 +86,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- select id, pay_id, pay_type, rec_type, pay_man, pay_man_code, settle_bill_no, bl_audit, audit_date, audit_man_code, audit_site_code, customer_code, customer_name, pay_money, pay_status, pay_status_desc, break_type, break_reason, break_emp_code, rec_man_code, settle_type, refund_date, refund_man_code, refund_seq, refund_mode, refund_money, refund_reason, refund_remark, refund_op_man_code, refund_register_site_code, refund_register_man_code, satisfy_money, satisfy_reason, allowance_money, allowance_reason, deduction_money, deduction_reason, other_money, other_reason, trade_date, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_pay_record
+ select
+ a.id, a.pay_id, a.pay_type, a.rec_type, a.pay_man, a.pay_man_code, a.settle_bill_no,
+ a.bl_audit, a.audit_date, a.audit_man_code, a.audit_site_code, a.customer_code,
+ a.customer_name, a.pay_money, a.pay_status, a.pay_status_desc, a.break_type,
+ a.break_reason, a.break_emp_code, a.rec_man_code, a.settle_type, a.refund_date,
+ a.refund_man_code, a.refund_seq, a.refund_mode, a.refund_money, a.refund_reason,
+ a.refund_remark, a.refund_op_man_code, a.refund_register_site_code,
+ a.refund_register_man_code, a.satisfy_money, a.satisfy_reason, a.allowance_money,
+ a.allowance_reason, a.deduction_money, a.deduction_reason, a.other_money,
+ a.other_reason, a.trade_date,
+ -- 重新赋值备注字段:财务开票备注+账单备注
+ CONCAT_WS(';',
+ COALESCE(invoice_remarks.invoice_remark, ''),
+ COALESCE(bill_remark.remark, '')
+ ) as remark,
+ a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site,
+ -- 运单号(多个用逗号分隔)
+ COALESCE(waybill_codes.bill_codes, '') as bill_codes,
+ -- 账单金额
+ COALESCE(bill_amount.rec_money, 0) as bill_amount,
+ -- 开票金额
+ COALESCE(invoice_amount.total_amount, 0) as invoice_amount,
+ -- 开票状态
+ COALESCE(invoice_status.status, '0') as invoice_status
+ from emis_settle_pay_record a
+ -- 关联获取运单号
+ left join (
+ select
+ espbr.pay_id,
+ GROUP_CONCAT(essb.bill_code SEPARATOR ',') as bill_codes
+ from emis_settle_pay_bill_rel espbr
+ left join emis_settle_sub_bill essb on espbr.settle_bill_no = essb.settle_bill_no
+ where espbr.del_flag = '0' and essb.del_flag = '0'
+ group by espbr.pay_id
+ ) waybill_codes on a.pay_id = waybill_codes.pay_id
+ -- 关联获取账单金额
+ left join (
+ select
+ espbr.pay_id,
+ esb.rec_money
+ from emis_settle_pay_bill_rel espbr
+ left join emis_settle_bill esb on espbr.settle_bill_no = esb.settle_bill_no
+ where espbr.del_flag = '0' and esb.del_flag = '0'
+ group by espbr.pay_id
+ ) bill_amount on a.pay_id = bill_amount.pay_id
+ -- 关联获取开票金额
+ left join (
+ select
+ espir.pay_id,
+ SUM(esir.open_money) as total_amount
+ from emis_settle_pay_invoice_rel espir
+ left join emis_settle_invoice_record esir on espir.apply_seq_no = esir.apply_seq_no
+ where espir.del_flag = '0' and esir.del_flag = '0' and esir.invoice_status = '1'
+ group by espir.pay_id
+ ) invoice_amount on a.pay_id = invoice_amount.pay_id
+ -- 关联获取开票状态
+ left join (
+ select
+ espir.pay_id,
+ esir.invoice_status as status
+ from emis_settle_pay_invoice_rel espir
+ left join emis_settle_invoice_record esir on espir.apply_seq_no = esir.apply_seq_no
+ where espir.del_flag = '0' and esir.del_flag = '0'
+ group by espir.pay_id
+ ) invoice_status on a.pay_id = invoice_status.pay_id
+ -- 关联获取财务开票备注
+ left join (
+ select
+ espir.pay_id,
+ GROUP_CONCAT(esir.invioce_remark SEPARATOR ';') as invoice_remark
+ from emis_settle_pay_invoice_rel espir
+ left join emis_settle_invoice_record esir on espir.apply_seq_no = esir.apply_seq_no
+ where espir.del_flag = '0' and esir.del_flag = '0'
+ and esir.invioce_remark is not null and esir.invioce_remark != ''
+ group by espir.pay_id
+ ) invoice_remarks on a.pay_id = invoice_remarks.pay_id
+ -- 关联获取账单备注
+ left join (
+ select
+ espbr.pay_id,
+ esb.remark
+ from emis_settle_pay_bill_rel espbr
+ left join emis_settle_bill esb on espbr.settle_bill_no = esb.settle_bill_no
+ where espbr.del_flag = '0' and esb.del_flag = '0'
+ group by espbr.pay_id
+ ) bill_remark on a.pay_id = bill_remark.pay_id
-
+
insert into emis_settle_pay_record
@@ -605,4 +694,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY
tradeDay
-
\ No newline at end of file
+