puzhibing
2024-01-26 7b772959ec96e54a52c1750ebaa7a4409e08e81a
修改数据权限bug
4个文件已修改
32 ■■■■■ 已修改文件
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -4362,9 +4362,11 @@
        }
        HashSet<String> set = new HashSet<>();
        // 遍历MgtMemberOrderPageVoList,获取shopId并添加到set中
        if(null != mgtBasePlatformDto.getShopIdList()){
        for (Long shopId : mgtBasePlatformDto.getShopIdList()) {
            set.add(shopId.toString());
        }
        }
        // 将set中的shopId转换为逗号分隔的字符串
        String joinedString = String.join(",", set);
        // 通过remoteShopService获取MgtSimpleShopVoList
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -559,7 +559,7 @@
    <select id="totalOrderFirst" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal">
        SELECT
        COUNT(temp.order_id) orderTotal,
        IFNULL(SUM(CASE WHEN temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END),0) orderMoneyTotal
        IFNULL(SUM(CASE WHEN null = temp.change_receivable_money or temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END),0) orderMoneyTotal
        FROM
        (SELECT toc.order_id,toc.change_receivable_money,toc.receivable_money,toc.pay_money
        FROM t_order toc
@@ -578,7 +578,7 @@
            AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3))
        </if>
        <if test="param.shopIds != null and param.shopIds != ''">
            and toc.order_status = 3 AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
            AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
        </if>
        <if test="param.keyword != null and param.keyword != ''">
            AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) &gt; 0)
@@ -595,9 +595,9 @@
    <select id="totalOrderSecond" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal">
        SELECT
        COUNT(temp.order_id) shopOrderTotal,
        IFNULL(SUM(CASE WHEN temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END),0) shopOrderMoneyTotal,
        IFNULL(SUM(CASE WHEN null = temp.change_receivable_money or temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END),0) shopOrderMoneyTotal,
        IFNULL(SUM(temp.pay_money),0) shopPayMoneyTotal,
        IFNULL(SUM(CASE WHEN (CASE WHEN temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END) &gt; temp.pay_money THEN temp.change_receivable_money - temp.pay_money ELSE 0 END),0) shopUnPayMoneyTotal
        IFNULL(SUM(CASE WHEN (CASE WHEN null = temp.change_receivable_money or temp.change_receivable_money = 0 THEN temp.receivable_money ELSE temp.change_receivable_money END) &gt; temp.pay_money THEN temp.change_receivable_money - temp.pay_money ELSE 0 END),0) shopUnPayMoneyTotal
        FROM
        (SELECT toc.order_id,toc.change_receivable_money,toc.receivable_money,toc.pay_money
        FROM t_order toc
@@ -616,7 +616,7 @@
            AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3))
        </if>
        <if test="param.shopIds != null and param.shopIds != ''">
            and toc.order_status = 3 AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
            AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
        </if>
        <if test="param.keyword != null and param.keyword != ''">
            AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) &gt; 0)
@@ -734,7 +734,7 @@
            AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3))
        </if>
        <if test="param.shopIds != null and param.shopIds != ''">
            and toc.order_status = 3 AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
            AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) &gt; 0
        </if>
        <if test="param.keyword != null and param.keyword != ''">
            AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) &gt; 0)
@@ -751,16 +751,23 @@
    <select id="boardOrderTotal" resultType="com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo">
        SELECT
            IFNULL(SUM(CASE WHEN order_status = 3 THEN change_receivable_money ELSE 0 END),0) salesTotal,
            IFNULL(SUM(CASE WHEN order_status = 3 THEN (CASE WHEN null = change_receivable_money or 0 = change_receivable_money THEN receivable_money ELSE change_receivable_money) ELSE 0 END),0) salesTotal,
            IFNULL(SUM(CASE WHEN order_status = 2 THEN 1 ELSE 0 END),0) UnUseOrderTotal,
            IFNULL(SUM(CASE WHEN order_from = 2 THEN 1 ELSE 0 END),0) activityOrderTotal
        FROM t_order
        WHERE del_flag = 0 AND order_status IN (2,3)
        <if test="null != shopIds and shopIds.size() > 0">
            and order_status = 3 and shop_id in
            and (
            order_from = 2 and order_status = 3 and shop_id in
            <foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            ) or (
            order_from = 1 and shop_id in
            <foreach collection="shopIds" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            )
        </if>
    </select>
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -1938,7 +1938,7 @@
     */
    @Override
    public List<Shop> getShopBySysUserIds(List<Long> userIds) {
        if(null == userIds && userIds.size() == 0){
        if(null == userIds || userIds.size() == 0){
            return new ArrayList<>();
        }
        QueryWrapper<Shop> queryWrapper = new QueryWrapper<Shop>().eq("del_flag", 0).ne("shop_status", -1);
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopMapper.xml
@@ -538,7 +538,10 @@
            shop_name,
            shop_service_phone
        FROM t_shop
        WHERE del_flag = 0 AND FIND_IN_SET(shop_id,#{shopIds}) &gt; 0
        WHERE del_flag = 0
        <if test="null != shopIds and '' != shopIds">
            AND FIND_IN_SET(shop_id,#{shopIds}) &gt; 0
        </if>
    </select>
    
    <select id="pageMgtShopByCityCode" resultType="com.ruoyi.system.api.domain.vo.MgtSimpleShopVo">