This commit is contained in:
+7
-3
@@ -136,9 +136,12 @@ public class QueryAsinResolveService {
|
||||
if (ordered.isEmpty()) {
|
||||
throw new BusinessException("shop_names 无有效店铺名");
|
||||
}
|
||||
List<QueryAsinEntity> allAsins = queryAsinMapper.selectList(
|
||||
new LambdaQueryWrapper<QueryAsinEntity>().orderByAsc(QueryAsinEntity::getId));
|
||||
List<QueryAsinCountryAsinsDto> preloadedQueryAsins = toCountryAsins(allAsins);
|
||||
ProductRiskMatchShopsVo vo = new ProductRiskMatchShopsVo();
|
||||
for (String shopName : ordered) {
|
||||
vo.getItems().add(matchOneShop(request.getUserId(), shopName));
|
||||
vo.getItems().add(matchOneShop(shopName, preloadedQueryAsins));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
@@ -161,7 +164,8 @@ public class QueryAsinResolveService {
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
private ProductRiskShopQueueItemVo matchOneShop(Long userId, String shopName) {
|
||||
private ProductRiskShopQueueItemVo matchOneShop(String shopName,
|
||||
List<QueryAsinCountryAsinsDto> preloadedQueryAsins) {
|
||||
ProductRiskShopQueueItemVo item = new ProductRiskShopQueueItemVo();
|
||||
item.setShopName(shopName);
|
||||
try {
|
||||
@@ -180,7 +184,7 @@ public class QueryAsinResolveService {
|
||||
item.setMatchStatus(matched.getMatchStatus());
|
||||
item.setMatchMessage(matched.getMatchMessage());
|
||||
item.setOpenStoreUrl(matched.getOpenStoreUrl());
|
||||
item.setQueryAsins(loadQueryAsinsForShop(userId, shopName));
|
||||
item.setQueryAsins(preloadedQueryAsins);
|
||||
if (item.isMatched() && item.getQueryAsins().isEmpty()) {
|
||||
item.setMatchMessage("紫鸟已匹配,但后台查询 ASIN 表暂无数据");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user