From bd57b7c6e2307d6dfb07d778adfefc13c1afbffe Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 06 二月 2026 11:48:44 +0800
Subject: [PATCH] 经销商管理

---
 server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java
index c8e576b..4f6291f 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/WorkbenchServiceImpl.java
@@ -70,7 +70,7 @@
     private GoodsorderDetailMapper goodsorderDetailMapper;
     @Override
     public List<BusinessDataCountVO> shopRankList10(CountDataDTO param) {
-        Date startDate = null,endDate = null;
+ /*       Date startDate = null,endDate = null;
         if(param.getYear()!=null && param.getMonth()!=null){
             List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1);
             startDate = dList.get(0);
@@ -79,7 +79,7 @@
             List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear());
             startDate = dList.get(0);
             endDate = dList.get(1);
-        }
+        }*/
         //缁熻璁㈠崟閿�閲忓拰閿�鍞闆嗗悎
         List<BusinessDataCountVO> list1 =  goodsorderMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<Goodsorder>()
                 .selectAs(Shop::getName,BusinessDataCountVO::getName)
@@ -87,8 +87,8 @@
                 .select("(select count(t.id) )",BusinessDataCountVO::getNum)
                 .select("(select sum(t.total_price) )",BusinessDataCountVO::getPrice)
                 .leftJoin(Shop.class,Shop::getId,Goodsorder::getDistributionShopId)
-                .ge(startDate!=null,Goodsorder::getCreateDate,startDate)
-                .ne(endDate!=null,Goodsorder::getCreateDate,endDate)
+                .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() )
+                .apply(param.getYear()!=null && param.getMonth()!=null,"MONTH ( t.CREATE_DATE )="+param.getMonth() )
                 .eq(Goodsorder::getIsdeleted,Constants.ZERO)
                 .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey())
                 .groupBy(Goodsorder::getDistributionShopId)
@@ -101,7 +101,7 @@
     }
     @Override
     public List<BusinessDataCountVO> goodsRankList10(CountDataDTO param) {
-        Date startDate = null,endDate = null;
+ /*       Date startDate = null,endDate = null;
         if(param.getYear()!=null && param.getMonth()!=null){
             List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1);
             startDate = dList.get(0);
@@ -110,7 +110,7 @@
             List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear());
             startDate = dList.get(0);
             endDate = dList.get(1);
-        }
+        }*/
         //缁熻璁㈠崟閿�閲忓拰閿�鍞闆嗗悎
         List<BusinessDataCountVO> list1 =  goodsorderDetailMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<GoodsorderDetail>()
                 .selectAs(Goods::getName,BusinessDataCountVO::getName)
@@ -118,8 +118,10 @@
                 .select("(select  sum(ifnull(t.price,0) * ifnull(t.goods_num,0)))",BusinessDataCountVO::getPrice)
                 .leftJoin(Goodsorder.class,Goodsorder::getId,GoodsorderDetail::getOrderId)
                 .leftJoin(Goods.class,Goods::getId,GoodsorderDetail::getGoodsId)
-                .ge(startDate!=null,Goodsorder::getCreateDate,startDate)
-                .ne(endDate!=null,Goodsorder::getCreateDate,endDate)
+//                .ge(startDate!=null,Goodsorder::getCreateDate,startDate)
+//                .ne(endDate!=null,Goodsorder::getCreateDate,endDate)
+                .apply(param.getYear()!=null,"YEAR ( t1.CREATE_DATE )="+param.getYear() )
+                .apply(param.getYear()!=null && param.getMonth()!=null,"MONTH ( t1.CREATE_DATE )="+param.getMonth() )
                 .eq(Goodsorder::getIsdeleted,Constants.ZERO)
                 .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey())
                 .groupBy(GoodsorderDetail::getGoodsId)

--
Gitblit v1.9.3