完善后台管理店铺搜索

This commit is contained in:
super
2026-04-08 21:08:52 +08:00
parent e1cd176ab2
commit 144d03965e
11 changed files with 69 additions and 11 deletions

View File

@@ -18,5 +18,5 @@ public class DeleteBrandProgressProperties {
* 商品风险PRODUCT_RISK_RESOLVERUNNING 超时自动收尾/失败,按分钟计算;
* 与删除品牌共用同一定时调度。
*/
private long productRiskStaleTimeoutMinutes = 1;
private long productRiskStaleTimeoutMinutes = 10;
}

View File

@@ -50,8 +50,10 @@ public class ShopManageController {
})
public ApiResponse<ShopManagePageVo> page(
@Parameter(description = "页码") @RequestParam(defaultValue = "1") Long page,
@Parameter(description = "每页数量") @RequestParam(defaultValue = "15") Long pageSize) {
return ApiResponse.success(shopManageService.page(page, pageSize));
@Parameter(description = "每页数量") @RequestParam(defaultValue = "15") Long pageSize,
@Parameter(description = "分组ID") @RequestParam(required = false) Long groupId,
@Parameter(description = "店铺名") @RequestParam(required = false) String shopName) {
return ApiResponse.success(shopManageService.page(page, pageSize, groupId, shopName));
}
@PostMapping

View File

@@ -28,15 +28,23 @@ public class ShopManageService {
private final ShopCredentialCryptoService shopCredentialCryptoService;
public ShopManagePageVo page(long page, long pageSize) {
return page(page, pageSize, null, null);
}
public ShopManagePageVo page(long page, long pageSize, Long groupId, String shopName) {
long safePage = Math.max(page, 1);
long safePageSize = Math.min(Math.max(pageSize, 1), 100);
String safeShopName = shopName == null ? "" : shopName.trim();
LambdaQueryWrapper<ShopManageEntity> query = new LambdaQueryWrapper<ShopManageEntity>()
.eq(groupId != null && groupId > 0, ShopManageEntity::getGroupId, groupId)
.like(!safeShopName.isEmpty(), ShopManageEntity::getShopName, safeShopName)
.orderByDesc(ShopManageEntity::getId);
Long total = shopManageMapper.selectCount(query);
List<ShopManageEntity> rows = shopManageMapper
.selectList(query.last("LIMIT " + ((safePage - 1) * safePageSize) + ", " + safePageSize));
Map<Long, String> groupNameById = buildGroupNameMap(rows.stream()
Map<Long, String> groupNameById = buildGroupNameMap(rows.stream()
.map(ShopManageEntity::getGroupId)
.filter(id -> id != null && id > 0)
.distinct()

View File

@@ -81,7 +81,7 @@ aiimage:
heartbeat-timeout-minutes: ${AIIMAGE_DELETE_BRAND_HEARTBEAT_TIMEOUT_MINUTES:15}
stale-check-cron: ${AIIMAGE_DELETE_BRAND_STALE_CHECK_CRON:*/30 * * * * *}
finalize-check-cron: ${AIIMAGE_DELETE_BRAND_FINALIZE_CHECK_CRON:30 */2 * * * *}
product-risk-stale-timeout-minutes: ${AIIMAGE_PRODUCT_RISK_STALE_TIMEOUT_MINUTES:1}
product-risk-stale-timeout-minutes: ${AIIMAGE_PRODUCT_RISK_STALE_TIMEOUT_MINUTES:10}
module-cleanup:
enabled: ${AIIMAGE_MODULE_CLEANUP_ENABLED:true}
cron: ${AIIMAGE_MODULE_CLEANUP_CRON:0 0 0 * * *}

View File

@@ -947,10 +947,24 @@ def delete_dedupe_total_data(item_id):
def list_shop_manages():
page = max(1, int(request.args.get('page', 1)))
page_size = min(100, max(1, int(request.args.get('page_size', 15))))
group_id_raw = (request.args.get('group_id') or '').strip()
shop_name = (request.args.get('shop_name') or '').strip()
params = {'page': page, 'pageSize': page_size}
if group_id_raw:
try:
group_id = int(group_id_raw)
if group_id > 0:
params['groupId'] = group_id
except (TypeError, ValueError):
pass
if shop_name:
params['shopName'] = shop_name
result, error_response, status = _proxy_backend_java(
'GET',
'/api/admin/shop-manages',
params={'page': page, 'pageSize': page_size},
params=params,
)
if error_response is not None:
return error_response, status

View File

@@ -382,6 +382,19 @@
</div>
<div class="panel-box">
<h3 style="margin-bottom:16px;font-size:15px;">店铺列表</h3>
<div class="form-row" style="margin-bottom:12px;">
<div class="form-group" style="min-width:180px;">
<label>分组</label>
<select id="shopManageFilterGroupId">
<option value="">全部分组</option>
</select>
</div>
<div class="form-group" style="min-width:220px;">
<label>店铺名</label>
<input type="text" id="shopManageFilterShopName" placeholder="请输入店铺名">
</div>
<button class="btn" id="btnSearchShopManage">查询</button>
</div>
<table>
<thead>
<tr>
@@ -1456,20 +1469,32 @@
var shopManageGroups = [];
function buildShopManageQuery(page) {
return 'page=' + (page || 1) + '&page_size=' + shopManagePageSize;
var query = 'page=' + (page || 1) + '&page_size=' + shopManagePageSize;
var groupId = (document.getElementById('shopManageFilterGroupId').value || '').trim();
var shopName = (document.getElementById('shopManageFilterShopName').value || '').trim();
if (groupId) query += '&group_id=' + encodeURIComponent(groupId);
if (shopName) query += '&shop_name=' + encodeURIComponent(shopName);
return query;
}
function refreshShopGroupSelects(selectedCreateId, selectedEditId) {
var createSel = document.getElementById('shopManageGroupSelect');
var editSel = document.getElementById('editShopManageGroupSelect');
var opts = ['<option value="">请选择分组</option>'];
var filterSel = document.getElementById('shopManageFilterGroupId');
var selectedFilterId = filterSel ? filterSel.value : '';
var createOpts = ['<option value="">请选择分组</option>'];
var filterOpts = ['<option value="">全部分组</option>'];
shopManageGroups.forEach(function(g) {
opts.push('<option value="' + g.id + '">' + (g.group_name || '') + '</option>');
var option = '<option value="' + g.id + '">' + (g.group_name || '') + '</option>';
createOpts.push(option);
filterOpts.push(option);
});
createSel.innerHTML = opts.join('');
editSel.innerHTML = opts.join('');
createSel.innerHTML = createOpts.join('');
editSel.innerHTML = createOpts.join('');
if (filterSel) filterSel.innerHTML = filterOpts.join('');
if (selectedCreateId != null) createSel.value = String(selectedCreateId);
if (selectedEditId != null) editSel.value = String(selectedEditId);
if (filterSel && selectedFilterId) filterSel.value = selectedFilterId;
}
function loadShopManageGroups(selectedCreateId, selectedEditId) {
@@ -1603,6 +1628,15 @@
document.getElementById('btnManageShopGroups').onclick = openShopManageGroupModal;
document.getElementById('btnManageShopGroupsFromEdit').onclick = openShopManageGroupModal;
document.getElementById('btnSearchShopManage').onclick = function() {
loadShopManage(1);
};
document.getElementById('shopManageFilterShopName').addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
e.preventDefault();
loadShopManage(1);
}
});
document.getElementById('btnCloseShopManageGroupModal').onclick = function() {
document.getElementById('shopManageGroupModal').classList.remove('show');
};