puzhibing
2024-12-18 9b532eeb6068971abb09d4c90b94431eb14b4e83
合并代码
5个文件已修改
84 ■■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsBargainPriceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopCommissionStatisticsVO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -34,6 +34,7 @@
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@@ -516,6 +517,32 @@
        }
        return R.ok(byId);
    }
    @Resource
    private UserChangeLogService userChangeLogService;
    @GetMapping("/change/vip")
    @ApiOperation(value = "用户列表-修改会员等级", tags = {"管理后台"})
    public R<Page<AppUser>> changevip(Long id,Integer vipId)
    {
        AppUser byId = appUserService.getById(id);
        UserChangeLog userChangeLog = new UserChangeLog();
        userChangeLog.setCreateTime(LocalDateTime.now());
        userChangeLog.setAppUserId(byId.getId());
        userChangeLog.setBeforeVipId(byId.getVipId());
        userChangeLog.setAfterVipId(vipId);
        if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) {
            userChangeLog.setChangeType(0);
        }else {
            userChangeLog.setChangeType(1);
        }
        userChangeLogService.save(userChangeLog);
        byId.setVipId(vipId);
        appUserService.updateById(byId);
        return R.ok();
    }
    @GetMapping("/bottom")
    @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"})
    public R<Page<AppUser>> bottom(Long id,Integer pageNum,Integer pageSize)
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsBargainPriceServiceImpl.java
@@ -101,6 +101,6 @@
    @Override
    public IPage<GoodsBargainPrice> queryGoodsBargainPricePage(Page<GoodsBargainPrice> page, GoodsBargainPrice goodsBargainPrice) {
        return null;
        return this.baseMapper.queryGoodsBargainPricePage(page,goodsBargainPrice);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java
@@ -10,6 +10,7 @@
import com.ruoyi.other.service.ShopService;
import com.ruoyi.other.vo.ShopCommissionStatisticsVO;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
@@ -54,15 +55,17 @@
        IPage<ShopBalanceStatement> statementIPage = page(page, new LambdaQueryWrapper<ShopBalanceStatement>());
        List<ShopBalanceStatement> records = statementIPage.getRecords();
        List<Integer> shopIds = records.stream().map(ShopBalanceStatement::getShopId).collect(Collectors.toList());
        List<Shop> shopList = shopService.listByIds(shopIds);
        records.forEach(st -> {
            shopList.stream().filter(shop -> shop.getId().equals(st.getShopId())).findFirst().ifPresent(shop -> {
                st.setShopName(shop.getName());
                st.setShopManagerName(shop.getShopManager());
                st.setPhone(shop.getPhone());
        if (!CollectionUtils.isEmpty(records)){
            List<Integer> shopIds = records.stream().map(ShopBalanceStatement::getShopId).collect(Collectors.toList());
            List<Shop> shopList = shopService.listByIds(shopIds);
            records.forEach(st -> {
                shopList.stream().filter(shop -> shop.getId().equals(st.getShopId())).findFirst().ifPresent(shop -> {
                    st.setShopName(shop.getName());
                    st.setShopManagerName(shop.getShopManager());
                    st.setPhone(shop.getPhone());
                });
            });
        });
        }
        shopCommissionStatisticsVO.setStatementIPage(statementIPage);
        return shopCommissionStatisticsVO;
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopCommissionStatisticsVO.java
@@ -16,25 +16,25 @@
     * 总金额
     */
    @ApiModelProperty(value = "总金额")
    private BigDecimal totalAmount;
    private BigDecimal totalAmount = BigDecimal.ZERO;
    /**
     * 分佣总金额
     */
    @ApiModelProperty(value = "分佣总金额")
    private BigDecimal totalCommission;
    private BigDecimal totalCommission = BigDecimal.ZERO;
    /**
     * 服务费总计
     */
    @ApiModelProperty(value = "服务费总计")
    private BigDecimal totalServiceCharge;
    private BigDecimal totalServiceCharge = BigDecimal.ZERO;
    /**
     * 下级门店分佣总金额
     */
    @ApiModelProperty(value = "下级门店分佣总金额")
    private BigDecimal totalSubordinateCommission;
    private BigDecimal totalSubordinateCommission = BigDecimal.ZERO;
    private IPage<ShopBalanceStatement> statementIPage;
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml
@@ -15,19 +15,21 @@
            object_id
        FROM
            (
                SELECT
                    id,
                    shop_id,
                    type,
                    historical_balance,
                    variable_amount,
                    balance,
                    create_time,
                    create_user_id,
                    object_id,
                    ROW_NUMBER() OVER ( PARTITION BY type, create_user_id ORDER BY create_time DESC ) AS rn
                FROM
                    t_shop_balance_statement
            SELECT
                id,
                shop_id,
                type,
                historical_balance,
                variable_amount,
                balance,
                create_time,
                create_user_id,
                object_id,
                ROW_NUMBER() OVER ( PARTITION BY type, create_user_id ORDER BY create_time DESC ) AS rn
            FROM
                t_shop_balance_statement
            ) AS subquery
        WHERE
            rn = 1
    </select>
</mapper>