cdr list by phone bug fixes

This commit is contained in:
Donghuang 2021-10-25 14:48:37 +08:00
parent e72d4b5bc0
commit 0d93a4843a

View File

@ -101,8 +101,15 @@ public class CallDetailRecordController
else { else {
val startDate = form.getStartDate(); val startDate = form.getStartDate();
val endDate = form.getEndDate(); val endDate = form.getEndDate();
Assert.state(DateUtils.addDays(startDate, 14).after(endDate), val calledNumber = form.getCalledNumber();
"查询时间范围不能大于14天");
if (StringUtils.isNotBlank(calledNumber)) {
search.eq(CALLED_NUMBER, calledNumber);
}
else {
Assert.state(DateUtils.addDays(startDate, 14).after(endDate),
"无索引条件查询(被叫号码、ConnID)时间范围不能大于14天");
}
search.gt(START_STAMP, startDate); search.gt(START_STAMP, startDate);
search.lt(START_STAMP, endDate); search.lt(START_STAMP, endDate);
@ -110,7 +117,6 @@ public class CallDetailRecordController
doSearch(search::eq, CAMPAIGN_ID, form::getCampaignId, Objects::nonNull); doSearch(search::eq, CAMPAIGN_ID, form::getCampaignId, Objects::nonNull);
doSearch(search::eq, ACCOUNT, form::getAccount, StringUtils::isNotBlank); doSearch(search::eq, ACCOUNT, form::getAccount, StringUtils::isNotBlank);
doSearch(search::eq, CALLER_NUMBER, form::getCallerNumber, StringUtils::isNotBlank); doSearch(search::eq, CALLER_NUMBER, form::getCallerNumber, StringUtils::isNotBlank);
doSearch(search::eq, CALLED_NUMBER, form::getCalledNumber, StringUtils::isNotBlank);
} }
search.eq(DELETED, false); search.eq(DELETED, false);