From 6f3e48f79f04989735054ef9903d86a74eae795b Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期二, 10 十二月 2024 10:17:12 +0800 Subject: [PATCH] 修改 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TOrderSaleServiceImpl.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TOrderSaleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TOrderSaleServiceImpl.java index d1329d4..0a2a83d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TOrderSaleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TOrderSaleServiceImpl.java @@ -447,4 +447,44 @@ public List<GoodsProfitVO> profitDetailsExport(ProfitDetailsQuery query) { return this.baseMapper.profitDetailsExport(query); } + + @Override + public void deleteByShopId(Long shopId) { + this.baseMapper.deleteByShopId(shopId); + } + + @Override + public Map<String, Double> getDataGeneratorSaleDetailOrderMoney(TDataGeneratorSaleQuery query) { + if(StringUtils.isEmpty(query.getStartTime()) && StringUtils.isEmpty(query.getEndTime())){ + if(Objects.nonNull(query.getTimeType())){ + LocalDateTime startTime = null; + LocalDateTime endTime = null; + switch (query.getTimeType()){ + case 1: + // 今日 + startTime = DateUtils.getDayStart(LocalDateTime.now()); + endTime = DateUtils.getDayEnd(LocalDateTime.now()); + break; + case 2: + // 昨日 + startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(1)); + endTime = DateUtils.getDayEnd(LocalDateTime.now().minusDays(1)); + break; + case 3: + // 近7天 + startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(7)); + endTime = DateUtils.getDayEnd(LocalDateTime.now()); + break; + case 4: + // 近30天 + startTime = DateUtils.getDayStart(LocalDateTime.now().minusDays(30)); + endTime = DateUtils.getDayEnd(LocalDateTime.now()); + break; + } + query.setStartTime(DateUtils.localDateTimeToDate(startTime)); + query.setEndTime(DateUtils.localDateTimeToDate(endTime)); + } + } + return this.baseMapper.getDataGeneratorSaleDetailOrderMoney(query); + } } -- Gitblit v1.7.1