demand: TMS系统 - 客户账单管理 - 航信开票记录 - 界面优化如下图所示

committer: heyu
This commit is contained in:
aike 2025-05-12 17:00:15 +08:00
parent 3dbf682425
commit 96b1f12a40
2 changed files with 67 additions and 4 deletions

View File

@ -126,4 +126,13 @@ public class EmisSettleInvoiceChRecord extends BaseEntity
// 申请备注
private String applyRemark;
// 发送月份
private String sendMonth;
// 结算类型
private String settleType;
// 开票备注
private String openBillRemark;
// 付款天数
private String payDays;
}

View File

@ -43,6 +43,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="openChStatusDesc" column="open_ch_status_desc" />
<result property="openComCode" column="open_com_code" />
<result property="extData" column="ext_data" />
<result property="sendMonth" column="send_month" />
<result property="settleType" column="settle_type" />
<result property="openBillRemark" column="open_bill_remark" />
<result property="payDays" column="pay_days" />
<association property="billMonth" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillMonthByApplySeqNo"/>
<association property="billCode" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillCodeByApplySeqNo"/>
@ -57,10 +61,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectEmisSettleInvoiceChRecordList" parameterType="EmisSettleInvoiceChRecord" resultMap="EmisSettleInvoiceChRecordResult">
select id, req_no, apply_seq_no, bl_ecinv, invoice_type, real_invoice_type, company_name, company_tax_no, company_tel, company_address, bank_name, bank_acc_no, contact, phone, tax_rate, open_money, email, saler_company_name, saler_company_tax_no, saler_company_tel, saler_company_address, saler_bank_name, saler_bank_acc_no, saler_contact, saler_phone, saler_checker, saler_payee, invoice_no, file_path, qr_path, op_man_code, op_date, op_site_code, open_ch_id, open_ch_status, open_ch_status_desc, open_com_code, ext_data, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_invoice_ch_record a
<where>
del_flag='0'
SELECT
a.id, a.req_no, a.apply_seq_no, a.bl_ecinv, a.invoice_type, a.real_invoice_type, a.company_name, a.company_tax_no, a.company_tel,
a.company_address, a.bank_name, a.bank_acc_no, a.contact, a.phone, a.tax_rate, a.open_money, a.email, a.saler_company_name, a.saler_company_tax_no,
a.saler_company_tel, a.saler_company_address, a.saler_bank_name, a.saler_bank_acc_no, a.saler_contact, a.saler_phone, a.saler_checker, a.saler_payee,
a.invoice_no, a.file_path, a.qr_path, 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.ext_data, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.create_site, a.update_site,
(SELECT GROUP_CONCAT(DISTINCT CONCAT(SUBSTRING(DATE_FORMAT(w.send_date, '%Y'), 3, 2), DATE_FORMAT(w.send_date, '%m')))
FROM emis_waybill w
INNER JOIN emis_settle_invoice_rel ir ON w.bill_code = ir.bill_no
WHERE ir.apply_seq_no = a.apply_seq_no) as send_month,
(SELECT b.settle_type
FROM emis_settle_bill b
INNER JOIN emis_settle_invoice_record r ON b.settle_bill_no = r.settle_bill_no
WHERE r.apply_seq_no = a.apply_seq_no
LIMIT 1) as settle_type,
CASE
WHEN (SELECT b.settle_type
FROM emis_settle_bill b
INNER JOIN emis_settle_invoice_record r ON b.settle_bill_no = r.settle_bill_no
WHERE r.apply_seq_no = a.apply_seq_no
LIMIT 1) = '2'
THEN (
SELECT GROUP_CONCAT(DISTINCT
CONCAT(
CONCAT(SUBSTRING(DATE_FORMAT(w.send_date, '%Y'), 3, 2), DATE_FORMAT(w.send_date, '%m ')),
b.cust_name
)
)
FROM emis_waybill w
INNER JOIN emis_settle_invoice_rel ir ON w.bill_code = ir.bill_no
INNER JOIN emis_settle_invoice_record r ON ir.apply_seq_no = r.apply_seq_no
INNER JOIN emis_settle_bill b ON r.settle_bill_no = b.settle_bill_no
WHERE ir.apply_seq_no = a.apply_seq_no
)
ELSE (
SELECT GROUP_CONCAT(DISTINCT
CONCAT(
DATE_FORMAT(w.send_date, '%m%d '),
w.send_company
)
)
FROM emis_waybill w
INNER JOIN emis_settle_invoice_rel ir ON w.bill_code = ir.bill_no
WHERE ir.apply_seq_no = a.apply_seq_no
)
END as open_bill_remark,
(SELECT GROUP_CONCAT(DISTINCT CONCAT(DATE_FORMAT(pr.trade_date, '%m/%d'), ' 已付'))
FROM emis_settle_pay_record pr
INNER JOIN emis_settle_pay_bill_rel pbr ON pr.pay_id = pbr.pay_id
INNER JOIN emis_settle_invoice_bill_rel ibr ON ibr.settle_bill_no = pbr.settle_bill_no
WHERE ibr.apply_seq_no = a.apply_seq_no) as pay_days
FROM emis_settle_invoice_ch_record a
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="reqNo != null and reqNo != ''"> and req_no = #{reqNo}</if>
<if test="applySeqNo != null and applySeqNo != ''"> and apply_seq_no = #{applySeqNo}</if>