mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 15:49:20 +08:00
remove: 移除遗留代码
This commit is contained in:
-1
@@ -3,7 +3,6 @@ package top.xyquan.ecomdmbbackend.modules.agent.mcp.adapter.bi.model;
|
|||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/** 工作台经营概览瘦视图(给 Agent)。 */
|
/** 工作台经营概览瘦视图(给 Agent)。 */
|
||||||
|
|||||||
+1
-1
@@ -139,7 +139,7 @@ public class OrderDailyStatComputeService {
|
|||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
Map<Long, Long> categoryByProduct = new HashMap<>();
|
Map<Long, Long> categoryByProduct = new HashMap<>();
|
||||||
if (!productIds.isEmpty()) {
|
if (!productIds.isEmpty()) {
|
||||||
List<ProductPO> products = productMapper.selectBatchIds(productIds);
|
List<ProductPO> products = productMapper.selectByIds(productIds);
|
||||||
for (ProductPO p : products) {
|
for (ProductPO p : products) {
|
||||||
categoryByProduct.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
|
categoryByProduct.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -172,7 +172,7 @@ public class OrderStatContributionCalculator {
|
|||||||
if (ids.isEmpty()) {
|
if (ids.isEmpty()) {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
for (ProductPO p : productMapper.selectBatchIds(ids)) {
|
for (ProductPO p : productMapper.selectByIds(ids)) {
|
||||||
map.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
|
map.put(p.getId(), p.getCategoryId() != null ? p.getCategoryId() : 0L);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
+1
-1
@@ -249,7 +249,7 @@ public class BiProductOverviewServiceImpl implements BiProductOverviewService {
|
|||||||
.collect(Collectors.toCollection(HashSet::new));
|
.collect(Collectors.toCollection(HashSet::new));
|
||||||
Map<Long, ProductSkuPO> skuMap = new HashMap<>();
|
Map<Long, ProductSkuPO> skuMap = new HashMap<>();
|
||||||
if (!skuIds.isEmpty()) {
|
if (!skuIds.isEmpty()) {
|
||||||
for (ProductSkuPO sku : productSkuMapper.selectBatchIds(skuIds)) {
|
for (ProductSkuPO sku : productSkuMapper.selectByIds(skuIds)) {
|
||||||
if (sku != null && sku.getId() != null) {
|
if (sku != null && sku.getId() != null) {
|
||||||
skuMap.put(sku.getId(), sku);
|
skuMap.put(sku.getId(), sku);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -238,7 +238,7 @@ public class BiShopOverviewServiceImpl implements BiShopOverviewService {
|
|||||||
return Map.of();
|
return Map.of();
|
||||||
}
|
}
|
||||||
Map<Long, ProductPO> map = new HashMap<>();
|
Map<Long, ProductPO> map = new HashMap<>();
|
||||||
for (ProductPO p : productMapper.selectBatchIds(ids)) {
|
for (ProductPO p : productMapper.selectByIds(ids)) {
|
||||||
if (p != null && p.getId() != null) {
|
if (p != null && p.getId() != null) {
|
||||||
map.put(p.getId(), p);
|
map.put(p.getId(), p);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-59
@@ -35,7 +35,6 @@ import java.math.RoundingMode;
|
|||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -275,16 +274,6 @@ public class BiWorkbenchServiceImpl implements BiWorkbenchService {
|
|||||||
m.dealAmount(), m.dealOrderCount(), m.dealQuantitySum());
|
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,
|
private WorkbenchFinancePanelVO buildFinancePanelFromSql(ShopContext ctx, Totals cur,
|
||||||
ComparePeriodBundle compare, SqlAggBundle agg) {
|
ComparePeriodBundle compare, SqlAggBundle agg) {
|
||||||
Map<String, Agg> platformAgg = new HashMap<>();
|
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));
|
.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) {
|
private static BigDecimal nz(BigDecimal v) {
|
||||||
return v != null ? v : BigDecimal.ZERO;
|
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);
|
return num.multiply(new BigDecimal("100")).divide(den, 2, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询闭区间:起止均为 LocalDate,查询订单时用当天 0 点与 23:59:59 */
|
/** 查询闭区间:起止均为自然日 */
|
||||||
private record DateRange(LocalDate startDate, LocalDate endDate) {
|
private record DateRange(LocalDate startDate, LocalDate endDate) {
|
||||||
LocalDateTime startDateTime() {
|
|
||||||
return startDate.atStartOfDay();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalDateTime endDateTime() {
|
|
||||||
return endDate.atTime(23, 59, 59);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 工作台查询公共上下文 */
|
/** 工作台查询公共上下文 */
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ public class BiWorkbenchFeeLoader {
|
|||||||
return Map.of();
|
return Map.of();
|
||||||
}
|
}
|
||||||
Map<Long, Long> map = new HashMap<>();
|
Map<Long, Long> map = new HashMap<>();
|
||||||
for (ProductPO p : productMapper.selectBatchIds(productIds)) {
|
for (ProductPO p : productMapper.selectByIds(productIds)) {
|
||||||
if (p != null && p.getId() != null) {
|
if (p != null && p.getId() != null) {
|
||||||
map.put(p.getId(), p.getCategoryId());
|
map.put(p.getId(), p.getCategoryId());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -296,7 +296,7 @@ public class PddGoodsAdFeeServiceImpl implements PddGoodsAdFeeService {
|
|||||||
|
|
||||||
Map<Long, String> shopNameMap = new HashMap<>();
|
Map<Long, String> shopNameMap = new HashMap<>();
|
||||||
if (!shopIds.isEmpty()) {
|
if (!shopIds.isEmpty()) {
|
||||||
List<PddShopPO> shops = pddShopMapper.selectBatchIds(shopIds);
|
List<PddShopPO> shops = pddShopMapper.selectByIds(shopIds);
|
||||||
for (PddShopPO shop : shops) {
|
for (PddShopPO shop : shops) {
|
||||||
shopNameMap.put(shop.getId(), shop.getMallName());
|
shopNameMap.put(shop.getId(), shop.getMallName());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-8
@@ -111,7 +111,7 @@ public class PddAuthServiceImpl implements PddAuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String authorizeUrl = UriComponentsBuilder
|
String authorizeUrl = UriComponentsBuilder
|
||||||
.fromHttpUrl(properties.getAuthorizeUrl())
|
.fromUriString(properties.getAuthorizeUrl())
|
||||||
.queryParam("response_type", "code")
|
.queryParam("response_type", "code")
|
||||||
.queryParam("client_id", properties.getClientId())
|
.queryParam("client_id", properties.getClientId())
|
||||||
.queryParam("redirect_uri", properties.getRedirectUri())
|
.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 失效)。
|
* 按 company_id + owner_id 新增或覆盖写入 channel_pdd_auth(重复授权会使旧 token 失效)。
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -558,7 +558,7 @@ public class PddGoodsServiceImpl extends ServiceImpl<PddGoodsMapper, PddGoodsPO>
|
|||||||
return Map.of();
|
return Map.of();
|
||||||
}
|
}
|
||||||
Map<Long, String> map = new HashMap<>();
|
Map<Long, String> map = new HashMap<>();
|
||||||
for (ProductPO p : productMapper.selectBatchIds(ids)) {
|
for (ProductPO p : productMapper.selectByIds(ids)) {
|
||||||
if (p != null && p.getId() != null) {
|
if (p != null && p.getId() != null) {
|
||||||
map.put(p.getId(), p.getName());
|
map.put(p.getId(), p.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -300,7 +300,7 @@ public class PddOrderConvertService {
|
|||||||
if (ids.isEmpty()) {
|
if (ids.isEmpty()) {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
return pddOrderMapper.selectBatchIds(ids).stream()
|
return pddOrderMapper.selectByIds(ids).stream()
|
||||||
.filter(o -> Objects.equals(o.getCompanyId(), message.getCompanyId())
|
.filter(o -> Objects.equals(o.getCompanyId(), message.getCompanyId())
|
||||||
&& Objects.equals(o.getShopId(), message.getShopId()))
|
&& Objects.equals(o.getShopId(), message.getShopId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
+1
-1
@@ -187,7 +187,7 @@ public class PddShopServiceImpl extends ServiceImpl<PddShopMapper, PddShopPO> im
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
if (!authIds.isEmpty()) {
|
if (!authIds.isEmpty()) {
|
||||||
authById = pddAuthMapper.selectBatchIds(authIds).stream()
|
authById = pddAuthMapper.selectByIds(authIds).stream()
|
||||||
.collect(Collectors.toMap(PddAuthPO::getId, this::toAuthVo, (a, b) -> a));
|
.collect(Collectors.toMap(PddAuthPO::getId, this::toAuthVo, (a, b) -> a));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -44,7 +44,6 @@ import java.util.stream.Collectors;
|
|||||||
public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorService {
|
public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorService {
|
||||||
|
|
||||||
private final ImportTaskService importTaskService;
|
private final ImportTaskService importTaskService;
|
||||||
private final OrderMapper orderMapper;
|
|
||||||
private final RealtimeSseService realtimeSseService;
|
private final RealtimeSseService realtimeSseService;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
private final OssService ossService;
|
private final OssService ossService;
|
||||||
@@ -71,7 +70,6 @@ public class ImportTaskProcessorServiceImpl implements ImportTaskProcessorServic
|
|||||||
LicenseFeatureGuard licenseFeatureGuard) {
|
LicenseFeatureGuard licenseFeatureGuard) {
|
||||||
this.importTaskService = importTaskService;
|
this.importTaskService = importTaskService;
|
||||||
this.licenseFeatureGuard = licenseFeatureGuard;
|
this.licenseFeatureGuard = licenseFeatureGuard;
|
||||||
this.orderMapper = orderMapper;
|
|
||||||
this.realtimeSseService = realtimeSseService;
|
this.realtimeSseService = realtimeSseService;
|
||||||
this.objectMapper = objectMapper;
|
this.objectMapper = objectMapper;
|
||||||
this.ossService = ossService;
|
this.ossService = ossService;
|
||||||
|
|||||||
-16
@@ -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;
|
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;
|
return subscriptionListVO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-3
@@ -196,9 +196,6 @@ public class UserMenuServiceImpl implements UserMenuService {
|
|||||||
meta.setAffixTab(false);
|
meta.setAffixTab(false);
|
||||||
meta.setShowChildrenInMenu(true);
|
meta.setShowChildrenInMenu(true);
|
||||||
|
|
||||||
// TODO: 从 sys_menu_permission 表获取权限码列表
|
|
||||||
// meta.setAccess(permissionService.getMenuPermissions(menu.getId()));
|
|
||||||
|
|
||||||
route.setMeta(meta);
|
route.setMeta(meta);
|
||||||
|
|
||||||
// 注意:children 由 buildTreeRecursive 方法处理,这里不设置
|
// 注意:children 由 buildTreeRecursive 方法处理,这里不设置
|
||||||
|
|||||||
Reference in New Issue
Block a user