yanghui
2022-11-22 f747c717505ae19d0875d51abc8d5a889a01123b
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java
@@ -219,7 +219,7 @@
        // 生成订单号
        String orderNo = OrderNoUtils.NextOrderNo(userId);
        // 配送方式
        Integer deliveryType = 0;
        Integer deliveryType = 1;
        // 订单总金额
        BigDecimal orderTotal = BigDecimal.ZERO;
        // 创建订单商品信息
@@ -235,7 +235,7 @@
                    continue;
                }
                storeId = goodsDO.getStoreId();
                deliveryType = goodsDO.getDeliveryType();
                deliveryType = orderCreateDTO.getDeliveryType();
                ComShopFlowerOrderGoodsDO orderGoodsDO = new ComShopFlowerOrderGoodsDO();
                orderGoodsDO.setGoodsId(goodsDO.getId());
                orderGoodsDO.setGoodsName(goodsDO.getName());
@@ -988,10 +988,11 @@
    }
    @Override
    public R selectCountByDeliveryType(Integer deliveryType,Long storeId) {
    public R selectCountByDeliveryType(Integer deliveryType,Long userId) {
        //1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款 8.总订单
        String[] statusStr = {"ddps","psz","dsh","dpj","ywc","yqx","ytk"};
        List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType,storeId);
        ConvenientMerchantVO convenientMerchantVO = convenientMerchantDAO.selectMerchantByUserId(userId);
        List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType,convenientMerchantVO.getId());
        Map<Integer, Integer> collect = comShopOrderCountVOS.stream().collect(Collectors.toMap(ComShopOrderCountVO::getStatus, ComShopOrderCountVO::getAmount));
        Map<String,Integer> retMap = new HashMap<>();
        int amountTotal = 0;
@@ -1010,7 +1011,9 @@
    }
    @Override
    public R selectCountByStoreId(Long storeId){
    public R selectCountByUserId(Long userId){
        ConvenientMerchantVO convenientMerchantVO = convenientMerchantDAO.selectMerchantByUserId(userId);
        Long storeId = convenientMerchantVO.getId();
        Map<String,Object> retMap = new HashMap<>();
        //查询我的店铺订单量
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectCountByStoreId(storeId, null);
@@ -1026,11 +1029,11 @@
        retMap.put("kddd",kdddMap);
        //拼单订单各状态
        R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,storeId);
        R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,userId);
        retMap.put("pdddStatus",r.getData());
        //快递订单各状态
        R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,storeId);
        R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,userId);
        retMap.put("kdddStatus",r1.getData());
        //营业额
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId);