demand: TMS-航信开票记录-定制导出:增加上旬和下旬,导出表格定制备注中

committer: heyu
This commit is contained in:
aike 2025-08-15 17:16:41 +08:00
parent 34bb02e08c
commit ec9b36fafb
3 changed files with 48 additions and 17 deletions

View File

@ -23,7 +23,6 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
* @ClassName EmisSettleInvoiceChRecord * @ClassName EmisSettleInvoiceChRecord
* @Description 渠道开票记录表 * @Description 渠道开票记录表
@ -31,8 +30,7 @@ import lombok.Data;
* @date 2024-07-24 23:39:08 * @date 2024-07-24 23:39:08
*/ */
@Data @Data
public class EmisSettleInvoiceChRecord extends BaseEntity public class EmisSettleInvoiceChRecord extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* id */ /* id */
@ -143,4 +141,7 @@ public class EmisSettleInvoiceChRecord extends BaseEntity
// 付款日期 // 付款日期
private String exportPayDays; private String exportPayDays;
// 结算账单名称
private String settleBillName;
} }

View File

@ -145,7 +145,7 @@ public class InvoiceExportHelper {
public static String processCustomRemark(EmisSettleInvoiceChRecord record) { public static String processCustomRemark(EmisSettleInvoiceChRecord record) {
String remark = record.getOpenBillRemark(); String remark = record.getOpenBillRemark();
if (remark == null) { if (remark == null) {
return ""; remark = "";
} }
// 只去除与 LTD 直接相邻的符号 // 只去除与 LTD 直接相邻的符号
@ -157,9 +157,8 @@ public class InvoiceExportHelper {
finalResult = finalResult.replaceAll("(有限公司|有限责任公司)", "").trim(); finalResult = finalResult.replaceAll("(有限公司|有限责任公司)", "").trim();
if ("2".equals(record.getSettleType())) { if ("2".equals(record.getSettleType())) {
return finalResult.replaceAll("-", ",").replaceAll("(\\d+)\\s+", "$1").trim(); finalResult = finalResult.replaceAll("-", ",").replaceAll("(\\d+)\\s+", "$1").trim();
} } else {
// 处理多个日期的情况 // 处理多个日期的情况
String[] dateParts = finalResult.split("-"); String[] dateParts = finalResult.split("-");
if (dateParts.length > 0) { if (dateParts.length > 0) {
@ -168,6 +167,17 @@ public class InvoiceExportHelper {
lastPart = lastPart.replaceAll("(\\d+)\\s+", "$1"); lastPart = lastPart.replaceAll("(\\d+)\\s+", "$1");
finalResult = "现金-" + lastPart; finalResult = "现金-" + lastPart;
} }
}
// 检查结算账单名称是否包含上旬/下旬,如果包含则在末尾拼接
String settleBillName = record.getSettleBillName();
if (settleBillName != null && !settleBillName.trim().isEmpty()) {
if (settleBillName.contains("上旬")) {
finalResult = finalResult + "上旬";
} else if (settleBillName.contains("下旬")) {
finalResult = finalResult + "下旬";
}
}
return finalResult; return finalResult;
} }

View File

@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="settleType" column="settle_type" /> <result property="settleType" column="settle_type" />
<result property="openBillRemark" column="open_bill_remark" /> <result property="openBillRemark" column="open_bill_remark" />
<result property="payDays" column="pay_days" /> <result property="payDays" column="pay_days" />
<result property="settleBillName" column="settle_bill_name" />
<association property="billMonth" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillMonthByApplySeqNo"/> <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"/> <association property="billCode" column="apply_seq_no" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectBillCodeByApplySeqNo"/>
@ -105,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="salesmen" column="salesmen" /> <result property="salesmen" column="salesmen" />
<result property="applyManName" column="apply_man_name" /> <result property="applyManName" column="apply_man_name" />
<result property="applyRemark" column="apply_remark" /> <result property="applyRemark" column="apply_remark" />
<result property="settleBillName" column="settle_bill_name" />
</resultMap> </resultMap>
<sql id="selectEmisSettleInvoiceChRecordVo"> <sql id="selectEmisSettleInvoiceChRecordVo">
@ -314,6 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bri.settle_type, bri.settle_type,
bri.open_bill_remark, bri.open_bill_remark,
pdi.pay_days, pdi.pay_days,
sbi.settle_bill_name,
cu.emp_name as create_by_name, cu.emp_name as create_by_name,
uu.emp_name as update_by_name, uu.emp_name as update_by_name,
cs.site_name as create_site_name, cs.site_name as create_site_name,
@ -408,6 +411,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE bd.del_flag = '0' WHERE bd.del_flag = '0'
GROUP BY bd.id, b.settle_type GROUP BY bd.id, b.settle_type
) bri ON bri.id = a.id ) bri ON bri.id = a.id
LEFT JOIN (
SELECT
bd.id,
MAX(esb.settle_bill_name) as settle_bill_name
FROM emis_settle_invoice_ch_record bd
LEFT JOIN emis_settle_invoice_bill_rel ibr ON ibr.apply_seq_no = bd.apply_seq_no AND ibr.del_flag = '0'
LEFT JOIN emis_settle_bill esb ON esb.settle_bill_no = ibr.settle_bill_no AND esb.del_flag = '0'
WHERE bd.del_flag = '0'
GROUP BY bd.id
) sbi ON sbi.id = a.id
LEFT JOIN sys_user cu ON cu.user_id = a.create_by AND cu.del_flag = '0' LEFT JOIN sys_user cu ON cu.user_id = a.create_by AND cu.del_flag = '0'
LEFT JOIN sys_user uu ON uu.user_id = a.update_by AND uu.del_flag = '0' LEFT JOIN sys_user uu ON uu.user_id = a.update_by AND uu.del_flag = '0'
LEFT JOIN emis_site cs ON cs.site_code = a.create_site AND cs.del_flag = '0' LEFT JOIN emis_site cs ON cs.site_code = a.create_site AND cs.del_flag = '0'
@ -867,7 +880,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN emis_settle_pay_bill_rel pbr ON ibr.settle_bill_no = pbr.settle_bill_no LEFT JOIN emis_settle_pay_bill_rel pbr ON ibr.settle_bill_no = pbr.settle_bill_no
LEFT JOIN emis_settle_pay_record pr ON pr.pay_id = pbr.pay_id LEFT JOIN emis_settle_pay_record pr ON pr.pay_id = pbr.pay_id
WHERE bd.apply_seq_no = a.apply_seq_no AND bd.del_flag = '0' WHERE bd.apply_seq_no = a.apply_seq_no AND bd.del_flag = '0'
) as pay_days ) as pay_days,
(
SELECT MAX(esb.settle_bill_name)
FROM emis_settle_invoice_ch_record bd
LEFT JOIN emis_settle_invoice_bill_rel ibr ON ibr.apply_seq_no = bd.apply_seq_no AND ibr.del_flag = '0'
LEFT JOIN emis_settle_bill esb ON esb.settle_bill_no = ibr.settle_bill_no AND esb.del_flag = '0'
WHERE bd.apply_seq_no = a.apply_seq_no AND bd.del_flag = '0'
) as settle_bill_name
FROM emis_settle_invoice_ch_record a FROM emis_settle_invoice_ch_record a
WHERE a.del_flag = '0' WHERE a.del_flag = '0'
AND a.apply_seq_no IN AND a.apply_seq_no IN