remove: 移除遗留代码

This commit is contained in:
2026-08-18 10:26:46 +08:00
parent 964f516ade
commit a1c9c47958
15 changed files with 11 additions and 98 deletions
@@ -3,7 +3,6 @@ package top.xyquan.ecomdmbbackend.modules.agent.mcp.adapter.bi.model;
import lombok.Builder;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/** 工作台经营概览瘦视图(给 Agent)。 */
@@ -139,7 +139,7 @@ public class OrderDailyStatComputeService {
.collect(Collectors.toSet());
Map<Long, Long> categoryByProduct = new HashMap<>();
if (!productIds.isEmpty()) {
List<ProductPO> products = productMapper.selectBatchIds(productIds);
List<ProductPO> products = productMapper.selectByIds(productIds);
for (ProductPO p : products) {
categoryByProduct.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
}
@@ -172,7 +172,7 @@ public class OrderStatContributionCalculator {
if (ids.isEmpty()) {
return map;
}
for (ProductPO p : productMapper.selectBatchIds(ids)) {
for (ProductPO p : productMapper.selectByIds(ids)) {
map.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
}
return map;
@@ -249,7 +249,7 @@ public class BiProductOverviewServiceImpl implements BiProductOverviewService {
.collect(Collectors.toCollection(HashSet::new));
Map<Long, ProductSkuPO> skuMap = new HashMap<>();
if (!skuIds.isEmpty()) {
for (ProductSkuPO sku : productSkuMapper.selectBatchIds(skuIds)) {
for (ProductSkuPO sku : productSkuMapper.selectByIds(skuIds)) {
if (sku != null && sku.getId() != null) {
skuMap.put(sku.getId(), sku);
}
@@ -238,7 +238,7 @@ public class BiShopOverviewServiceImpl implements BiShopOverviewService {
return Map.of();
}
Map<Long, ProductPO> map = new HashMap<>();
for (ProductPO p : productMapper.selectBatchIds(ids)) {
for (ProductPO p : productMapper.selectByIds(ids)) {
if (p != null && p.getId() != null) {
map.put(p.getId(), p);
}
@@ -35,7 +35,6 @@ import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
@@ -275,16 +274,6 @@ public class BiWorkbenchServiceImpl implements BiWorkbenchService {
m.dealAmount(), m.dealOrderCount(), m.dealQuantitySum());
}
private Totals buildShopPeriodTotals(ShopContext ctx, DateRange range, BigDecimal promotion, BigDecimal brush) {
var shopDocs = orderStatQueryService.listShopDocs(
ctx.companyId(), ctx.shopIds(), range.startDate(), range.endDate());
BiOrderStatQueryService.ShopPeriodMetrics m = orderStatQueryService.sumShopDocs(shopDocs);
return buildTotals(m.salesAmount(), m.refundAmount(), m.productCost(), m.freightCost(), m.otherCost(),
promotion, brush, ctx.taxRate(),
m.salesOrderCount(), m.salesQuantitySum(),
m.dealAmount(), m.dealOrderCount(), m.dealQuantitySum());
}
private WorkbenchFinancePanelVO buildFinancePanelFromSql(ShopContext ctx, Totals cur,
ComparePeriodBundle compare, SqlAggBundle agg) {
Map<String, Agg> platformAgg = new HashMap<>();
@@ -429,46 +418,6 @@ public class BiWorkbenchServiceImpl implements BiWorkbenchService {
.stream().collect(Collectors.toMap(CategoryPO::getId, CategoryPO::getName, (a, b) -> a));
}
private static LocalDate minDate(LocalDate... dates) {
LocalDate min = dates[0];
for (LocalDate d : dates) {
if (d.isBefore(min)) {
min = d;
}
}
return min;
}
private static LocalDate maxDate(LocalDate... dates) {
LocalDate max = dates[0];
for (LocalDate d : dates) {
if (d.isAfter(max)) {
max = d;
}
}
return max;
}
private static LocalDateTime minTime(LocalDateTime... times) {
LocalDateTime min = times[0];
for (LocalDateTime t : times) {
if (t.isBefore(min)) {
min = t;
}
}
return min;
}
private static LocalDateTime maxTime(LocalDateTime... times) {
LocalDateTime max = times[0];
for (LocalDateTime t : times) {
if (t.isAfter(max)) {
max = t;
}
}
return max;
}
private static BigDecimal nz(BigDecimal v) {
return v != null ? v : BigDecimal.ZERO;
}
@@ -877,15 +826,8 @@ public class BiWorkbenchServiceImpl implements BiWorkbenchService {
return num.multiply(new BigDecimal("100")).divide(den, 2, RoundingMode.HALF_UP);
}
/** 查询闭区间:起止均为 LocalDate,查询订单时用当天 0 点与 23:59:59 */
/** 查询闭区间:起止均为自然日 */
private record DateRange(LocalDate startDate, LocalDate endDate) {
LocalDateTime startDateTime() {
return startDate.atStartOfDay();
}
LocalDateTime endDateTime() {
return endDate.atTime(23, 59, 59);
}
}
/** 工作台查询公共上下文 */
@@ -78,7 +78,7 @@ public class BiWorkbenchFeeLoader {
return Map.of();
}
Map<Long, Long> map = new HashMap<>();
for (ProductPO p : productMapper.selectBatchIds(productIds)) {
for (ProductPO p : productMapper.selectByIds(productIds)) {
if (p != null && p.getId() != null) {
map.put(p.getId(), p.getCategoryId());
}
@@ -296,7 +296,7 @@ public class PddGoodsAdFeeServiceImpl implements PddGoodsAdFeeService {
Map<Long, String> shopNameMap = new HashMap<>();
if (!shopIds.isEmpty()) {
List<PddShopPO> shops = pddShopMapper.selectBatchIds(shopIds);
List<PddShopPO> shops = pddShopMapper.selectByIds(shopIds);
for (PddShopPO shop : shops) {
shopNameMap.put(shop.getId(), shop.getMallName());
}
@@ -111,7 +111,7 @@ public class PddAuthServiceImpl implements PddAuthService {
}
String authorizeUrl = UriComponentsBuilder
.fromHttpUrl(properties.getAuthorizeUrl())
.fromUriString(properties.getAuthorizeUrl())
.queryParam("response_type", "code")
.queryParam("client_id", properties.getClientId())
.queryParam("redirect_uri", properties.getRedirectUri())
@@ -215,13 +215,6 @@ public class PddAuthServiceImpl implements PddAuthService {
}
}
/**
* 使用授权码向拼多多换取 token(含 refresh 过期信息)。
*/
private PddOAuthTokenExchange.TokenBundle exchangeCode(String code) throws Exception {
return tokenExchange.exchangeCode(code);
}
/**
* 按 company_id + owner_id 新增或覆盖写入 channel_pdd_auth(重复授权会使旧 token 失效)。
*/
@@ -558,7 +558,7 @@ public class PddGoodsServiceImpl extends ServiceImpl<PddGoodsMapper, PddGoodsPO>
return Map.of();
}
Map<Long, String> map = new HashMap<>();
for (ProductPO p : productMapper.selectBatchIds(ids)) {
for (ProductPO p : productMapper.selectByIds(ids)) {
if (p != null && p.getId() != null) {
map.put(p.getId(), p.getName());
}
@@ -300,7 +300,7 @@ public class PddOrderConvertService {
if (ids.isEmpty()) {
return List.of();
}
return pddOrderMapper.selectBatchIds(ids).stream()
return pddOrderMapper.selectByIds(ids).stream()
.filter(o -> Objects.equals(o.getCompanyId(), message.getCompanyId())
&& Objects.equals(o.getShopId(), message.getShopId()))
.collect(Collectors.toList());
@@ -187,7 +187,7 @@ public class PddShopServiceImpl extends ServiceImpl<PddShopMapper, PddShopPO> im
.filter(Objects::nonNull)
.collect(Collectors.toSet());
if (!authIds.isEmpty()) {
authById = pddAuthMapper.selectBatchIds(authIds).stream()
authById = pddAuthMapper.selectByIds(authIds).stream()
.collect(Collectors.toMap(PddAuthPO::getId, this::toAuthVo, (a, b) -> a));
}
}
@@ -44,7 +44,6 @@ import java.util.stream.Collectors;
public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorService {
private final ImportTaskService importTaskService;
private final OrderMapper orderMapper;
private final RealtimeSseService realtimeSseService;
private final ObjectMapper objectMapper;
private final OssService ossService;
@@ -71,7 +70,6 @@ public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorServic
LicenseFeatureGuard licenseFeatureGuard) {
this.importTaskService = importTaskService;
this.licenseFeatureGuard = licenseFeatureGuard;
this.orderMapper = orderMapper;
this.realtimeSseService = realtimeSseService;
this.objectMapper = objectMapper;
this.ossService = ossService;
@@ -205,14 +205,6 @@ public class SubscriptionServiceImpl extends ServiceImpl<SubscriptionMapper, Sub
}
}
// TODO: 获取公司名称,需要注入CompanyService
// if (subscription.getCompanyId() != null) {
// var company = companyService.getById(subscription.getCompanyId());
// if (company != null) {
// subscriptionVO.setCompanyName(company.getName());
// }
// }
return subscriptionVO;
}
@@ -231,14 +223,6 @@ public class SubscriptionServiceImpl extends ServiceImpl<SubscriptionMapper, Sub
}
}
// TODO: 获取公司名称,需要注入CompanyService
// if (subscription.getCompanyId() != null) {
// var company = companyService.getById(subscription.getCompanyId());
// if (company != null) {
// subscriptionListVO.setCompanyName(company.getName());
// }
// }
return subscriptionListVO;
}
}
@@ -196,9 +196,6 @@ public class UserMenuServiceImpl implements UserMenuService {
meta.setAffixTab(false);
meta.setShowChildrenInMenu(true);
// TODO: 从 sys_menu_permission 表获取权限码列表
// meta.setAccess(permissionService.getMenuPermissions(menu.getId()));
route.setMeta(meta);
// 注意:children 由 buildTreeRecursive 方法处理,这里不设置