doum
7 小时以前 bd57b7c6e2307d6dfb07d778adfefc13c1afbffe
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)