This commit is contained in:
wuweihua
2026-09-23 16:54:01 +08:00
5 changed files with 45 additions and 15 deletions
@@ -20,6 +20,6 @@ public class ArBillGenerateQuery
/** 订单号、运单号或转单号;支持换行、逗号、分号或空格分隔多个号码。 */
private String orderOrTrackingNo;
/** 全选模式下,排除弹窗使用的附加订单号、运单号或转单号关键词。 */
/** 全选模式下,排除弹窗使用的多行订单号、运单号或转单号。 */
private String excludeOrderOrTrackingNo;
}
@@ -224,9 +224,10 @@ public class ArBillServiceImpl implements IArBillService {
public List<PrcOrderBill> previewBill(ArBillGenerateQuery query) {
validatePreviewQuery(query);
List<String> orderIdentifiers = normalizeOrderIdentifiers(query.getOrderOrTrackingNo());
List<String> excludeOrderIdentifiers = normalizeOrderIdentifiers(query.getExcludeOrderOrTrackingNo());
return sourceBillMapper.selectPrcOrderBillByCustomerPeriod(query.getCustomerId(),
query.getCustomerCode(), orderIdentifiers,
StringUtils.trim(query.getExcludeOrderOrTrackingNo()), query.getBillPeriodEnd(), query.getCurrency(),
excludeOrderIdentifiers, query.getBillPeriodEnd(), query.getCurrency(),
eligibleOrderBillStatuses(), ArIncomeBillFeeStatus.UNBILLED.getCode(), null);
}
@@ -237,9 +238,10 @@ public class ArBillServiceImpl implements IArBillService {
public BigDecimal sumPreviewBill(ArBillGenerateQuery query) {
validatePreviewQuery(query);
List<String> orderIdentifiers = normalizeOrderIdentifiers(query.getOrderOrTrackingNo());
List<String> excludeOrderIdentifiers = normalizeOrderIdentifiers(query.getExcludeOrderOrTrackingNo());
return nvl(sourceBillMapper.sumPrcOrderBillIncomeByCustomerPeriod(query.getCustomerId(),
query.getCustomerCode(), orderIdentifiers,
StringUtils.trim(query.getExcludeOrderOrTrackingNo()), query.getBillPeriodEnd(), query.getCurrency(),
excludeOrderIdentifiers, query.getBillPeriodEnd(), query.getCurrency(),
eligibleOrderBillStatuses(), ArIncomeBillFeeStatus.UNBILLED.getCode()));
}
@@ -32,7 +32,7 @@ public interface PrcOrderBillMapper
/** 应收账单生成读取指定客户截止日期前仍存在未出账费用的订单计费快照。 */
public List<PrcOrderBill> selectPrcOrderBillByCustomerPeriod(@Param("customerId") Long customerId,
@Param("customerCode") String customerCode, @Param("orderIdentifiers") List<String> orderIdentifiers,
@Param("excludeOrderOrTrackingNo") String excludeOrderOrTrackingNo,
@Param("excludeOrderIdentifiers") List<String> excludeOrderIdentifiers,
@Param("cutoffDate") Date cutoffDate, @Param("currency") String currency,
@Param("arBillStatuses") List<String> arBillStatuses, @Param("feeArBillStatus") String feeArBillStatus,
@Param("excludedBillIds") List<String> excludedBillIds);
@@ -40,7 +40,7 @@ public interface PrcOrderBillMapper
/** 统计应收账单预览结果金额,供全选模式展示。 */
BigDecimal sumPrcOrderBillIncomeByCustomerPeriod(@Param("customerId") Long customerId,
@Param("customerCode") String customerCode, @Param("orderIdentifiers") List<String> orderIdentifiers,
@Param("excludeOrderOrTrackingNo") String excludeOrderOrTrackingNo,
@Param("excludeOrderIdentifiers") List<String> excludeOrderIdentifiers,
@Param("cutoffDate") Date cutoffDate, @Param("currency") String currency,
@Param("arBillStatuses") List<String> arBillStatuses, @Param("feeArBillStatus") String feeArBillStatus);
@@ -293,10 +293,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and p.customer_code like concat('%', #{customerCode}, '%')
</if>
<include refid="orderIdentifierCondition"/>
<if test="excludeOrderOrTrackingNo != null and excludeOrderOrTrackingNo != ''">
and (p.order_no like concat('%', #{excludeOrderOrTrackingNo}, '%')
or p.tracking_no like concat('%', #{excludeOrderOrTrackingNo}, '%')
or p.transfer_no like concat('%', #{excludeOrderOrTrackingNo}, '%'))
<if test="excludeOrderIdentifiers != null and excludeOrderIdentifiers.size() > 0">
and (p.order_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
or p.tracking_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
or p.transfer_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
)
</if>
and p.biz_date &lt;= #{cutoffDate}
and p.ar_bill_status in
@@ -330,10 +340,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and p.customer_code like concat('%', #{customerCode}, '%')
</if>
<include refid="orderIdentifierCondition"/>
<if test="excludeOrderOrTrackingNo != null and excludeOrderOrTrackingNo != ''">
and (p.order_no like concat('%', #{excludeOrderOrTrackingNo}, '%')
or p.tracking_no like concat('%', #{excludeOrderOrTrackingNo}, '%')
or p.transfer_no like concat('%', #{excludeOrderOrTrackingNo}, '%'))
<if test="excludeOrderIdentifiers != null and excludeOrderIdentifiers.size() > 0">
and (p.order_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
or p.tracking_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
or p.transfer_no in
<foreach collection="excludeOrderIdentifiers" item="identifier" open="(" separator="," close=")">
#{identifier}
</foreach>
)
</if>
and p.biz_date &lt;= #{cutoffDate}
and p.ar_bill_status in
@@ -95,7 +95,10 @@
<el-dialog v-model="excludeDialogOpen" title="选择排除订单" width="1100px" append-to-body destroy-on-close @close="handleExcludeDialogClose">
<div class="exclude-toolbar">
<el-input v-model="excludeKeyword" clearable placeholder="请输入订单号、运单号或转单号" class="exclude-search-input" />
<div class="order-identifier-input exclude-search-input">
<el-input v-model="excludeKeyword" type="textarea" :rows="4" resize="vertical" clearable placeholder="请输入订单号、运单号或转单号,每行一个,最多2000个" />
<el-button v-if="excludeKeyword" class="order-identifier-clear" link type="primary" @click="clearExcludeIdentifiers">清空</el-button>
</div>
<el-button type="primary" :loading="excludeLoading" @click="queryExcludeRows">查询</el-button>
</div>
<el-table ref="excludeTableRef" v-loading="excludeLoading" :data="excludeRowsPage" row-key="billId" border stripe max-height="420" empty-text="暂无符合条件的订单" @selection-change="handleExcludeSelectionChange">
@@ -243,6 +246,11 @@ function clearOrderIdentifiers() {
generateForm.orderOrTrackingNo = ''
}
// 只清空排除输入内容,不自动刷新排除结果;用户点击“查询”后再按新条件筛选。
function clearExcludeIdentifiers() {
excludeKeyword.value = ''
}
function loadDefaultBankAccount() {
bankAccountLoading.value = true
bankAccount.value = null
@@ -552,7 +560,7 @@ function createRequestId() { return globalThis.crypto?.randomUUID?.() || `ar-${D
.excluded-order-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-height: 64px; margin: 0 0 8px; padding: 4px 8px; overflow-y: auto; border-radius: 4px; background: var(--el-fill-color-light); }
.excluded-order-title { color: var(--el-text-color-secondary); font-size: 13px; }
.exclude-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.exclude-search-input { width: 360px; }
.exclude-search-input { width: 540px; }
.exclude-pagination { justify-content: flex-end; margin: 12px 0 4px; }
.preview-pagination { justify-content: flex-end; margin: 12px 0 4px; }
.bill-name-summary { margin: -4px 0 8px 90px; color: var(--el-text-color-secondary); font-size: 13px; }