yanghui
2022-11-21 d0875e8da50625ef0ce083a568de7c8b044aaf4c
#feat 商家运营数据统计
1个文件已添加
16个文件已修改
460 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/PageComOrderRefundDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderStoreIdCountVO.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerGoodsDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerOrderDAO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerOrderPayDAO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerRefundOrderDAO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerOrderService.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerRefundOrderService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerRefundOrderServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerGoodsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerRefundOrderDAO.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -200,17 +200,6 @@
    }
/*    @ApiOperation(value = "统计当前用户订单", response = OrderStatisticsVO.class)
    @PostMapping("orderStatistics")
    public R orderStatistics() {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        if (loginUserInfo == null) {
            return R.fail("请重新登陆");
        }
        return communityService.orderStatistics(loginUserInfo.getUserId());
    }*/
    @ApiOperation(value = "小程序微信调起支付")
    @PostMapping("wxpay")
    public R wxPay(@RequestBody OrderPayDTO orderPayDTO) {
@@ -374,5 +363,62 @@
        return communityService.pageOrderByStoreId(pageComFlowerOrderListDTO);
    }
    /**
     * 查询我的店铺各类统计数据
     * @param storeId
     * @return
     */
    @ApiOperation(value = "查询我的店铺各类统计数据")
    @GetMapping("/selectCountByStoreId")
    public R selectCountByStoreId(Long storeId){
        return communityService.selectCountByStoreId(storeId);
    }
    /**
     * 创建退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("createRefundOrder")
    @ApiOperation(value = "创建退款订单")
    public R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return communityService.createRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 用户 分页查询退款订单
     * @param pageComOrderRefundDTO
     * @return
     */
    @PostMapping("pageRefundOrder")
    @ApiOperation(value = "退款订单分页查询 用户",response = ComShopFlowerRefundOrderVO.class)
    public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO){
        pageComOrderRefundDTO.setUserId(this.getUserId());
        return communityService.pageRefundOrder(pageComOrderRefundDTO);
    }
    /**
     * 修改退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("updateRefundOrder")
    @ApiOperation(value = "修改退款订单")
    public R updateRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return communityService.updateRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    @GetMapping("selectCountGroupStatus")
    @ApiOperation(value = "商家后台-退款申请统计")
    public R selectCountGroupStatus(Long storeId){
        return communityService.selectCountGroupStatus(storeId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/PageComOrderRefundDTO.java
@@ -26,4 +26,7 @@
    @ApiModelProperty(value = "用户id", hidden = true)
    private Long userId;
    @ApiModelProperty(value = "商家用户id", hidden = true)
    private Long backstageUserId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderStoreIdCountVO.java
New file
@@ -0,0 +1,29 @@
package com.panzhihua.common.model.vos.shop;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @auther yh
 * @create 2022-11-08 17:25:45
 * @describe 统计订单数VO
 */
@Data
@ApiModel("根据商品统计日、月、年、累计订单量")
public class ComShopOrderStoreIdCountVO {
    /**
     * 订
     */
    @ApiModelProperty("订单数量")
    private Integer count;
    /**
     * 统计名称
     */
    @ApiModelProperty("统计名称")
    private String countName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10980,5 +10980,47 @@
     * @return
     */
    @GetMapping("/shopFlower/selectCountByDeliveryType")
    R selectCountByDeliveryType(Integer deliveryType);
    R selectCountByDeliveryType(Integer deliveryType,Long storeId);
    /**
     * 查询我的店铺各类统计数据
     * @param storeId
     * @return
     */
    @GetMapping("/shopFlower/selectCountByStoreId")
    R selectCountByStoreId(Long storeId);
    /**
     * 创建退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("/shopFlower/createRefundOrder")
    R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO);
    /**
     * 分页查询
     * @param pageComOrderRefundDTO
     * @return
     */
    @PostMapping("/shopFlower/pageRefundOrder")
    R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO);
    /**
     * 修改退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("/shopFlower/updateRefundOrder")
    R updateRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO);
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    @GetMapping("/shopFlower/selectCountGroupStatus")
    R selectCountGroupStatus(Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -2,6 +2,8 @@
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO;
import com.panzhihua.common.model.dtos.shop.ComShopFlowerRefundOrderDTO;
import com.panzhihua.common.model.dtos.shop.PageComOrderRefundDTO;
import com.panzhihua.common.model.dtos.shop.PageComShopFlowerGoodsDTO;
import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO;
import com.panzhihua.common.model.vos.R;
@@ -99,9 +101,12 @@
        return communityService.getAllGoodsCategories();
    }
    @ApiOperation(value = "统计查询订单数量")
    @GetMapping("/order/selectCountByDeliveryType")
    public R selectCountByDeliveryType(Integer deliveryType){
        return communityService.selectCountByDeliveryType(deliveryType);
    @ApiImplicitParams({@ApiImplicitParam(name = "deliveryType", value = "1.自提 2.快递"),
            @ApiImplicitParam(name = "storeId", value = "商店id")})
    public R selectCountByDeliveryType(Integer deliveryType,Long storeId){
        return communityService.selectCountByDeliveryType(deliveryType,storeId);
    }
    @ApiOperation(value = "商家查询 订单_分页列表", response = ComShopOrderSearchVO.class)
@@ -117,4 +122,27 @@
        return communityService.orderDetailFlower(orderId);
    }
    /**
     * 分页查询
     * @param pageComOrderRefundDTO
     * @return
     */
    @PostMapping("pageRefundOrder")
    @ApiOperation(value = "分页查询",response = ComShopFlowerRefundOrderVO.class)
    public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO){
        return communityService.pageRefundOrder(pageComOrderRefundDTO);
    }
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    @GetMapping("selectCountGroupStatus")
    @ApiOperation(value = "商家后台-退款申请统计")
    public R selectCountGroupStatus(Long storeId){
        return communityService.selectCountGroupStatus(storeId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
@@ -34,6 +34,8 @@
    private ComShopFlowerEvaluateService comShopFlowerEvaluateService;
    @Resource
    private ComShopFlowerOrderDeliveryService comShopFlowerOrderDeliveryService;
    @Resource
    private ComShopFlowerRefundOrderService comShopFlowerRefundOrderService;
    /**
@@ -425,9 +427,65 @@
        return comShopFlowerOrderService.wxPay(orderPayDTO);
    }
    /**
     * 查询订单总数
     * @param deliveryType
     * @return
     */
    @GetMapping("/selectCountByDeliveryType")
    public R selectCountByDeliveryType(Integer deliveryType){
        return comShopFlowerOrderService.selectCountByDeliveryType(deliveryType);
    public R selectCountByDeliveryType(Integer deliveryType,Long storeId){
        return comShopFlowerOrderService.selectCountByDeliveryType(deliveryType,storeId);
    }
    /**
     * 查询我的店铺各类统计数据
     * @param storeId
     * @return
     */
    @GetMapping("/selectCountByStoreId")
    public R selectCountByStoreId(Long storeId){
        return comShopFlowerOrderService.selectCountByStoreId(storeId);
    }
    /**
     * 创建退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("createRefundOrder")
    public R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return comShopFlowerRefundOrderService.createRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 分页查询
     * @param pageComOrderRefundDTO
     * @return
     */
    @PostMapping("pageRefundOrder")
    public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO){
        return comShopFlowerRefundOrderService.pageRefundOrder(pageComOrderRefundDTO);
    }
    /**
     * 修改退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("updateRefundOrder")
    public R updateRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return comShopFlowerRefundOrderService.updateRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    @GetMapping("selectCountGroupStatus")
    public R selectCountGroupStatus(Long storeId){
        return comShopFlowerRefundOrderService.selectCountGroupStatus(storeId);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerGoodsDAO.java
@@ -39,4 +39,11 @@
     * @return 商品列表
     */
    IPage<ComShopFlowerGoodsVO> pageShopGoodByApps(@Param("page") Page page, @Param("comShopFlowerGoodsDTO") ComShopFlowerGoodsDTO comShopFlowerGoodsDTO);
    /**
     * 商店内在售商品
     * @param storeId
     * @return
     */
    Integer selectCountSaleByStoreId(@Param("storeId") Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerOrderDAO.java
@@ -5,10 +5,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.shop.PageComFlowerOrderListDTO;
import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO;
import com.panzhihua.common.model.vos.shop.ComShopFlowerOrderPageVO;
import com.panzhihua.common.model.vos.shop.ComShopFlowerOrderStoreListVO;
import com.panzhihua.common.model.vos.shop.ComShopOrderCountVO;
import com.panzhihua.common.model.vos.shop.ComShopOrderSearchVO;
import com.panzhihua.common.model.vos.shop.*;
import com.panzhihua.service_community.model.dos.ComShopFlowerOrderDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -65,5 +62,10 @@
     * @param deliveryType
     * @return
     */
    List<ComShopOrderCountVO>  selectCountByDeliveryType(@Param("deliveryType") Integer deliveryType);
    List<ComShopOrderCountVO>  selectCountByDeliveryType(@Param("deliveryType") Integer deliveryType,@Param("storeId") Long storeId);
    List<ComShopOrderStoreIdCountVO> selectCountByStoreId(@Param("storeId") Long storeId,@Param("deliveryType") Integer deliveryType);
    List<ComShopOrderStoreIdCountVO> selectSumAmountByStoreId(@Param("storeId") Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerOrderPayDAO.java
@@ -12,4 +12,5 @@
 */
@Mapper
public interface ComShopFlowerOrderPayDAO extends BaseMapper<ComShopFlowerOrderPayDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopFlowerRefundOrderDAO.java
@@ -5,9 +5,12 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.shop.PageComOrderRefundDTO;
import com.panzhihua.common.model.vos.shop.ComShopFlowerRefundOrderVO;
import com.panzhihua.common.model.vos.shop.ComShopOrderCountVO;
import com.panzhihua.service_community.model.dos.ComShopFlowerRefundOrderDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @ClassName: ComShopFlowerRefundOrderMapper
@@ -18,12 +21,15 @@
@Mapper
public interface ComShopFlowerRefundOrderDAO extends BaseMapper<ComShopFlowerRefundOrderDO> {
    /**
     * 分页查询
     * 用户 分页查询退款订单
     * @param page
     * @param pageComOrderRefundDTO
     * @return
     */
    IPage<ComShopFlowerRefundOrderVO> pageRefundOrder(@Param("page") Page page, @Param("pageComOrderRefundDTO") PageComOrderRefundDTO pageComOrderRefundDTO);
    Integer selectCountByStoreId(@Param("storeId") Long storeId);
    List<ComShopOrderCountVO> selectCountGroupStatus(@Param("storeId") Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerOrderService.java
@@ -197,5 +197,12 @@
     * @param deliveryType
     * @return
     */
    R selectCountByDeliveryType(Integer deliveryType);
    R selectCountByDeliveryType(Integer deliveryType,Long storeId);
    /**
     * 查询我的店铺各类统计数据
     * @param storeId
     * @return
     */
    R selectCountByStoreId(Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerRefundOrderService.java
@@ -34,4 +34,12 @@
     * @return
     */
    R updateRefundOrder(ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO);
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    R selectCountGroupStatus(Long storeId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java
@@ -65,6 +65,8 @@
    private ConvenientElevatingPointDAO convenientElevatingPointDAO;
    @Resource
    private ComShopFlowerEvaluateDAO comShopFlowerEvaluateDAO;
    @Resource
    private ComShopFlowerRefundOrderDAO comShopFlowerRefundOrderDAO;
    @Value("${hcMin.app.isTest}")
@@ -273,6 +275,7 @@
        shopOrderDO.setOrderNo(orderNo);
        shopOrderDO.setStoreId(storeId);
        shopOrderDO.setUserId(userId);
        //TODO
        shopOrderDO.setStatus(ComShopFlowerOrderDO.status.dfk);
        shopOrderDO.setPayStatus(ComShopFlowerOrderDO.payStatus.no);
        shopOrderDO.setReceiverId(orderCreateDTO.getReceiverId());
@@ -985,23 +988,62 @@
    }
    @Override
    public R selectCountByDeliveryType(Integer deliveryType) {
        List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType);
    public R selectCountByDeliveryType(Integer deliveryType,Long storeId) {
        //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);
        Map<Integer, Integer> collect = comShopOrderCountVOS.stream().collect(Collectors.toMap(ComShopOrderCountVO::getStatus, ComShopOrderCountVO::getAmount));
        ComShopOrderCountVO comShopOrderCountVO = new ComShopOrderCountVO();
        comShopOrderCountVO.setStatus(8);
        comShopOrderCountVO.setAmount(0);
        for (int i = 1; i < 8; i++) {
        Map<String,Integer> retMap = new HashMap<>();
        int amountTotal = 0;
        for (int i = 0; i < statusStr.length; i++) {
            if (collect.containsKey(i)) {
                Integer amount = collect.get(i);
                comShopOrderCountVO.setAmount(amount + comShopOrderCountVO.getAmount());
                amountTotal = amountTotal + amount;
                retMap.put(statusStr[i],amount);
            }else {
                collect.put(i,0);
                retMap.put(statusStr[i],0);
            }
        }
        collect.put(comShopOrderCountVO.getStatus(),comShopOrderCountVO.getAmount());
        retMap.put("zdd",amountTotal);
        return R.ok(collect);
        return R.ok(retMap);
    }
    @Override
    public R selectCountByStoreId(Long storeId){
        Map<String,Object> retMap = new HashMap<>();
        //查询我的店铺订单量
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectCountByStoreId(storeId, null);
        Map<String, Integer> zddlMap = comShopOrderStoreIdCountVOS.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount));
        retMap.put("zddl",zddlMap);
        //查询我的店铺拼单订单
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS1 = this.baseMapper.selectCountByStoreId(storeId, ComShopFlowerOrderDO.deliveryType.store);
        Map<String, Integer> pdddMap = comShopOrderStoreIdCountVOS1.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount));
        retMap.put("pddd",pdddMap);
        //查询我的店铺快递订单
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS2 = this.baseMapper.selectCountByStoreId(storeId, ComShopFlowerOrderDO.deliveryType.express);
        Map<String, Integer> kdddMap = comShopOrderStoreIdCountVOS2.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount));
        retMap.put("kddd",kdddMap);
        //拼单订单各状态
        R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,storeId);
        retMap.put("pdddStatus",r.getData());
        //快递订单各状态
        R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,storeId);
        retMap.put("kdddStatus",r1.getData());
        //营业额
        List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId);
        Map<String, Integer> yyeMap = comShopOrderStoreIdCountVOS3.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount));
        retMap.put("yye",yyeMap);
        //在售商品
        Integer countSale = comShopFlowerGoodsDAO.selectCountSaleByStoreId(storeId);
        retMap.put("countSale",countSale);
        //退款申请
        Integer refundOrder = comShopFlowerRefundOrderDAO.selectCountByStoreId(storeId);
        retMap.put("refundOrder",refundOrder);
        return R.ok(retMap);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerRefundOrderServiceImpl.java
@@ -8,6 +8,7 @@
import com.panzhihua.common.model.dtos.shop.PageComOrderRefundDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.shop.ComShopFlowerRefundOrderVO;
import com.panzhihua.common.model.vos.shop.ComShopOrderCountVO;
import com.panzhihua.common.utlis.OrderNoUtils;
import com.panzhihua.common.utlis.WxPayUtils;
import com.panzhihua.common.utlis.wx.WXPayUtil;
@@ -24,9 +25,8 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
 * @ClassName: ComShopFlowerRefundOrderServiceImpl
@@ -141,4 +141,23 @@
        this.baseMapper.updateById(comShopFlowerRefundOrderDO);
        return R.ok();
    }
    public R selectCountGroupStatus(Long storeId){
        String[] statusStr = {"clz","tkcg","tksb","yqx","tkz"};
        List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountGroupStatus(storeId);
        Map<Integer, Integer> collect = comShopOrderCountVOS.stream().collect(Collectors.toMap(ComShopOrderCountVO::getStatus, ComShopOrderCountVO::getAmount));
        Map<String,Integer> retMap = new HashMap<>();
        int amountTotal = 0;
        for (int i = 0; i < statusStr.length; i++) {
            if (collect.containsKey(i)) {
                Integer amount = collect.get(i);
                amountTotal = amountTotal + amount;
                retMap.put(statusStr[i],amount);
            }else {
                retMap.put(statusStr[i],0);
            }
        }
        retMap.put("zdd",amountTotal);
        return R.ok(retMap);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerGoodsMapper.xml
@@ -77,4 +77,9 @@
        <if test='comShopFlowerGoodsDTO.categoriesId != null '>AND cgs.goods_category_id = #{comShopFlowerGoodsDTO.categoriesId}</if>
        order by sale desc,create_at desc
    </select>
    <select id="selectCountSaleByStoreId" resultType="java.lang.Integer">
        select count(1) from com_shop_flower_goods where  store_id = #{storeId} and `status` = 1 and delete_status = 1
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerOrderDAO.xml
@@ -156,7 +156,64 @@
    </select>
    <select id="selectCountByDeliveryType"
            resultType="com.panzhihua.common.model.vos.shop.ComShopOrderCountVO">
        SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} GROUP BY `status`
        SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} and store_id = #{storeId}  GROUP BY `status`
    </select>
    <select id="selectCountByStoreId"
            resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO">
        SELECT count(1) as count,'dayCount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW())
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="deliveryType != null">
                and delivery_type = #{deliveryType}
            </if>
        union all
        SELECT count(1) as count,'monthCount' as count_name FROM com_shop_flower_order WHERE  DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m')
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="deliveryType != null">
                and delivery_type = #{deliveryType}
            </if>
        union all
        SELECT count(1) as count,'yearCount' as count_name FROM com_shop_flower_order  where  YEAR(create_at) =YEAR(NOW())
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="deliveryType != null">
                and delivery_type = #{deliveryType}
            </if>
        union all
        SELECT count(1) as count,'allCount' as count_name FROM com_shop_flower_order  WHERE 1=1
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="deliveryType != null">
                and delivery_type = #{deliveryType}
            </if>
    </select>
    <select id="selectSumAmountByStoreId"
            resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO">
        SELECT IFNULL(sum(pay_amount),0) as count,'dayAmount' as count_name FROM com_shop_flower_order WHERE  TO_DAYS(create_at)=TO_DAYS(NOW())  and `status` not in (6,7)
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
        union all
        SELECT IFNULL(sum(pay_amount),0) as count,'monthAmount' as count_name FROM com_shop_flower_order WHERE  DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m')  and `status` not in (6,7)
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
        union all
        SELECT IFNULL(sum(pay_amount),0) as count,'yearAmount' as count_name FROM com_shop_flower_order  where  YEAR(create_at) =YEAR(NOW())  and `status` not in (6,7)
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
        union all
        SELECT IFNULL(sum(pay_amount),0) as count,'allAmount' as count_name FROM com_shop_flower_order  WHERE   `status` not in (6,7)
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComShopFlowerRefundOrderDAO.xml
@@ -30,15 +30,33 @@
    refund_time, handle_result, remark
  </sql>
    <select id="pageRefundOrder" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerRefundOrderVO">
      select * from com_shop_flower_refund_order where  1=1
      select ro.* from com_shop_flower_refund_order ro left join com_convenient_merchants cm on ro.store_id = cm.id   where  1=1
      <if test="pageComOrderRefundDTO.status != null">
        and status = #{pageComOrderRefundDTO.status}
        and ro.status = #{pageComOrderRefundDTO.status}
      </if>
      <if test="pageComOrderRefundDTO.storeId != null">
        and store_id = #{pageComOrderRefundDTO.storeId}
        and ro.store_id = #{pageComOrderRefundDTO.storeId}
      </if>
      <if test="pageComOrderRefundDTO.userId != null">
        and user_id = #{pageComOrderRefundDTO.userId}
        and ro.user_id = #{pageComOrderRefundDTO.userId}
      </if>
      <if test="pageComOrderRefundDTO.backstageUserId != null">
        and cm.user_id = #{pageComOrderRefundDTO.backstageUserId}
      </if>
    </select>
  <select id="selectCountByStoreId" resultType="java.lang.Integer">
    select count(1) from com_shop_flower_refund_order where 1=1
    <if test="storeId != null">
      and store_id = #{storeId}
    </if>
  </select>
  <select id="selectCountGroupStatus"
          resultType="com.panzhihua.common.model.vos.shop.ComShopOrderCountVO">
    SELECT count(1) amount , `status` FROM `com_shop_flower_refund_order` WHERE 1=1
    <if test="storeId != null">
      and store_id = #{storeId}
    </if>
    GROUP BY `status`
  </select>
</mapper>