增加计费时间的搜索

This commit is contained in:
wuweihua
2026-10-12 16:41:39 +08:00
parent a115926e9f
commit 3456a0bf7f
5 changed files with 63 additions and 7 deletions
@@ -30,6 +30,10 @@ public class BatchAddIncomeBillFeeRequest implements Serializable
private String countryCode;
private String creditArrearsStatus;
/** Billing time range (biz_date), inclusive; format yyyy-MM-dd. */
private String beginBizDate;
private String endBizDate;
/** Surcharge config id (prc_surcharge.sc_id). */
@NotNull(message = "scId required")
private Long scId;
@@ -595,13 +595,19 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
: request.getCreditArrearsStatus().trim();
String countryCode = StringUtils.isEmpty(request.getCountryCode()) ? null
: request.getCountryCode().trim().toUpperCase();
String beginBizDate = StringUtils.isEmpty(request.getBeginBizDate()) ? null
: request.getBeginBizDate().trim();
String endBizDate = StringUtils.isEmpty(request.getEndBizDate()) ? null
: request.getEndBizDate().trim();
boolean hasFilter = (orderNos != null && !orderNos.isEmpty())
|| (trackingNos != null && !trackingNos.isEmpty())
|| (transferNos != null && !transferNos.isEmpty())
|| (customerCodes != null && !customerCodes.isEmpty())
|| (productCodes != null && !productCodes.isEmpty())
|| StringUtils.isNotEmpty(creditArrearsStatus)
|| StringUtils.isNotEmpty(countryCode);
|| StringUtils.isNotEmpty(countryCode)
|| StringUtils.isNotEmpty(beginBizDate)
|| StringUtils.isNotEmpty(endBizDate);
if (!hasFilter)
{
throw new ServiceException(MessageUtils.message("price.bill.fee.batch.filterRequired"));
@@ -625,6 +631,14 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
query.setProductCodes(productCodes);
query.setCreditArrearsStatus(creditArrearsStatus);
query.setCountryCode(countryCode);
if (beginBizDate != null)
{
query.getParams().put("beginBizDate", beginBizDate);
}
if (endBizDate != null)
{
query.getParams().put("endBizDate", endBizDate);
}
}
// Use self proxy so @DataScope applies
List<PrcOrderBill> list = self.selectBillList(query);
@@ -314,6 +314,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bizDate != null">
AND p.biz_date = #{bizDate}
</if>
<if test="params.beginBizDate != null and params.beginBizDate != ''">
AND p.biz_date &gt;= #{params.beginBizDate}
</if>
<if test="params.endBizDate != null and params.endBizDate != ''">
AND p.biz_date &lt;= #{params.endBizDate}
</if>
<if test="params.beginTime != null and params.beginTime != ''">
AND date_format(p.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
+32 -5
View File
@@ -178,11 +178,31 @@ const searchColumns = [
options: arrearsStatusOptions,
placeholder: '请选择',
props: { clearable: true }
},
{
label: '计费时间',
prop: 'bizDateRange',
component: 'datetimerange',
colSpan: 2,
props: {
clearable: true,
// 只选日期时自动补全为当天 00:00:00 ~ 23:59:59
defaultTime: [new Date(2000, 0, 1, 0, 0, 0), new Date(2000, 0, 1, 23, 59, 59)]
}
}
]
function queryList(params) {
return listBill(params)
const { bizDateRange, ...rest } = params
const query = { ...rest }
if (Array.isArray(bizDateRange) && (bizDateRange[0] || bizDateRange[1])) {
query.params = {
...(query.params || {}),
beginBizDate: bizDateRange[0] || null,
endBizDate: bizDateRange[1] || null
}
}
return listBill(query)
}
function handleUpdateArrears(ids, selection) {
@@ -231,17 +251,23 @@ function hasBatchFeeQuery(q) {
|| hasArr(q.transferNos)
|| hasArr(q.customerCodes)
|| hasArr(q.productCodes)
|| hasArr(q.bizDateRange)
|| !!(q.creditArrearsStatus && String(q.creditArrearsStatus).trim())
}
function openBatchFee() {
const q = tableRef.value?.getQueryParams?.() || {}
const { pageNum, pageSize, ...rest } = q
if (!hasBatchFeeQuery(rest)) {
const { pageNum, pageSize, bizDateRange, ...rest } = q
if (!hasBatchFeeQuery({ ...rest, bizDateRange })) {
ElMessage.warning('请先设置列表查询条件')
return
}
batchFeeListQuery.value = { ...rest }
const listQuery = { ...rest }
if (Array.isArray(bizDateRange) && (bizDateRange[0] || bizDateRange[1])) {
listQuery.beginBizDate = bizDateRange[0] || null
listQuery.endBizDate = bizDateRange[1] || null
}
batchFeeListQuery.value = listQuery
batchFeeSelectedIds.value = tableRef.value?.getSelectionIds?.() || []
batchFeeOpen.value = true
}
@@ -316,7 +342,8 @@ function creditArrearsTagType(status) {
/* 搜索栏走 BasicTable search-per-row=4 的栅格布局(固定 4 项一行,多余换行),
这里只补齐插槽渲染的控件宽度,不再覆盖 BasicForm 的布局 */
.billing-bill :deep(.basic-form .el-form-item .el-select),
.billing-bill :deep(.basic-form .el-form-item .el-input) {
.billing-bill :deep(.basic-form .el-form-item .el-input),
.billing-bill :deep(.basic-form .el-form-item .el-date-editor) {
width: 100%;
}
</style>
@@ -209,6 +209,9 @@ function buildQueryTags(q) {
: (q.creditArrearsStatus === 'NORMAL' ? "正常" : q.creditArrearsStatus)
tags.push("额度欠费" + ':' + label)
}
if (q.beginBizDate || q.endBizDate) {
tags.push("计费时间:" + (q.beginBizDate || '…') + ' ~ ' + (q.endBizDate || '…'))
}
return tags
}
@@ -255,7 +258,9 @@ function buildPayload() {
transferNos: q.transferNos || [],
customerCodes: q.customerCodes || [],
productCodes: q.productCodes || [],
creditArrearsStatus: q.creditArrearsStatus || undefined
creditArrearsStatus: q.creditArrearsStatus || undefined,
beginBizDate: q.beginBizDate || undefined,
endBizDate: q.endBizDate || undefined
}
if (scopeMode.value === 'SELECTED') {
payload.billIds = (props.selectedIds || []).filter(Boolean)