无关风月
2025-01-14 a448d1716d59fbce1c2b4b82a95d339d5b37d8ae
修改bug
7个文件已修改
162 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OrderActivityInfoController.java 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/BalanceChangeRecord.java
@@ -45,8 +45,11 @@
    private BigDecimal beforeAmount;
    @ApiModelProperty("变更金额")
    @Excel(name = "变更数量")
    private BigDecimal changeAmount;
    @ApiModelProperty("变更金额-带人民币符号")
    @Excel(name = "变更数量")
    @TableField(exist = false)
    private String changeAmountString;
    @ApiModelProperty("变更后金额")
    private BigDecimal afterAmount;
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java
@@ -51,10 +51,13 @@
    @ApiModelProperty(value = "变动金额")
    @TableField("variable_amount")
    private BigDecimal variableAmount;
    @ApiModelProperty(value = "变动金额")
    @TableField(exist = false)
    @Excel(name = "变更数量")
    private String variableAmountString;
    @ApiModelProperty(value = "变动后余额")
    @TableField("balance")
    @Excel(name = "变更后数量")
    private BigDecimal balance;
    @ApiModelProperty(value = "变动时间")
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
@@ -53,6 +53,17 @@
        IPage<BalanceChangeRecord> balanceChangeRecordIPage = this.baseMapper.queryCommissionStatistics(page, balanceChangeRecord);
        // 过滤商城购物
        List<BalanceChangeRecord> collect = balanceChangeRecordIPage.getRecords().stream().filter(e -> e.getChangeType() != 5).collect(Collectors.toList());
        for (BalanceChangeRecord changeRecord : collect) {
            BigDecimal subtract = changeRecord.getBeforeAmount().subtract(changeRecord.getAfterAmount());
            if (subtract.compareTo(BigDecimal.ZERO)>0){
                // 减少
                changeRecord.setChangeAmountString("-¥"+changeRecord.getChangeAmount());
            }else if (subtract.compareTo(BigDecimal.ZERO)<0){
                changeRecord.setChangeAmountString("+¥"+changeRecord.getChangeAmount());
            }else{
                changeRecord.setChangeAmountString("¥"+changeRecord.getChangeAmount());
            }
        }
        balanceChangeRecordIPage.setRecords(collect);
        return new CommissionStatistics(totalCommission, balanceChangeRecordIPage);
    }
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
@@ -140,6 +140,7 @@
                </foreach>
            </if>
        and  tau.del_flag = 0
        and tau.`status` !=3
        </where>
    </select>
    <select id="getUserStatisticsDetail" resultType="com.ruoyi.account.vo.UserStatisticsDetail">
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -48,6 +48,9 @@
    @PostMapping("/addGoods")
    @ApiOperation(value = "发布商品", tags = {"管理后台-商品管理"})
    public R<Void> addGoods(@RequestBody Goods goods) {
        if(goods.getPurchaseLimit()==null){
            goods.setPurchaseLimit(-1);
        }
        goodsService.addGoods(goods);
        return R.ok();
    }
@@ -78,6 +81,9 @@
    @PutMapping("/manageGoodsUpdate")
    @ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"})
    public R<Void> manageGoodsUpdate(@RequestBody Goods goods){
        if(goods.getPurchaseLimit()==null){
            goods.setPurchaseLimit(-1);
        }
        goodsService.updateManageGoods(goods);
        if (goods.getType()==2){
            goods.setAppointStore(2);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/OrderActivityInfoController.java
@@ -15,9 +15,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -70,37 +68,41 @@
            if (!list.isEmpty()){
                for (OrderActivityInfo activityInfo : list) {
                    List<String> vips = Arrays.asList(activityInfo.getVipIds().split(","));
                    vipIds.addAll(vips);
                    if (!vipIds.isEmpty()){
                        StringBuilder message = new StringBuilder();
                        List<String> collect = vips.stream().sorted().collect(Collectors.toList());
                        for (String s : collect) {
                            switch (s){
                                case "1":
                                    message.append("普通会员,");
                                    break;
                                case "2":
                                    message.append("黄金会员,");
                                    break;
                                case "3":
                                    message.append("钻石会员,");
                                    break;
                                case "4":
                                    message.append("准代理,");
                                    break;
                                case "5":
                                    message.append("代理,");
                                    break;
                                case "6":
                                    message.append("总代,");
                                    break;
                                case "7":
                                    message.append("合伙人,");
                                    break;
                        Set<String> set1 = new HashSet<>(vipIds);
                        Set<String> set2 = new HashSet<>(vips);
                        set1.retainAll(set2);
                        if (!set1.isEmpty()) {
                            // 有交集 判断是哪些会员
                            for (String s : set1) {
                                switch (s){
                                    case "1":
                                        message.append("普通会员,");
                                        break;
                                    case "2":
                                        message.append("黄金会员,");
                                        break;
                                    case "3":
                                        message.append("钻石会员,");
                                        break;
                                    case "4":
                                        message.append("准代理,");
                                        break;
                                    case "5":
                                        message.append("代理,");
                                        break;
                                    case "6":
                                        message.append("总代,");
                                        break;
                                    case "7":
                                        message.append("合伙人,");
                                        break;
                                }
                            }
                            StringBuilder res = message.deleteCharAt(message.length() - 1);
                            return R.fail(res+"在当前活动时间已有订单优惠");
                        }
                        StringBuilder res = message.deleteCharAt(message.length() - 1);
                        return R.fail(res+"在当前活动时间已有订单优惠");
                    }
                }
            }
@@ -128,7 +130,7 @@
    public R<Void> updateActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){
        orderActivityInfo.setId(Long.valueOf(orderActivityInfo.getIdStr()));
        if (org.springframework.util.StringUtils.hasLength(orderActivityInfo.getVipIds())){
            List<String> vipIds = Arrays.asList(orderActivityInfo.getVipIds().split(","));
            List<String> vipIds = new ArrayList<>(Arrays.asList(orderActivityInfo.getVipIds().split(",")));
            List<OrderActivityInfo> list = orderActivityInfoService.lambdaQuery()
                    .le(OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime())
                    .or()
@@ -136,37 +138,41 @@
            if (!list.isEmpty()){
                for (OrderActivityInfo activityInfo : list) {
                    List<String> vips = Arrays.asList(activityInfo.getVipIds().split(","));
                    vipIds.retainAll(vips);
                    if (!vipIds.isEmpty()){
                        StringBuilder message = new StringBuilder();
                        List<String> collect = vips.stream().sorted().collect(Collectors.toList());
                        for (String s : collect) {
                            switch (s){
                                case "1":
                                    message.append("普通会员,");
                                    break;
                                case "2":
                                    message.append("黄金会员,");
                                    break;
                                case "3":
                                    message.append("钻石会员,");
                                    break;
                                case "4":
                                    message.append("准代理,");
                                    break;
                                case "5":
                                    message.append("代理,");
                                    break;
                                case "6":
                                    message.append("总代,");
                                    break;
                                case "7":
                                    message.append("合伙人,");
                                    break;
                        Set<String> set1 = new HashSet<>(vipIds);
                        Set<String> set2 = new HashSet<>(vips);
                        set1.retainAll(set2);
                        if (!set1.isEmpty()) {
                            // 有交集 判断是哪些会员
                            for (String s : set1) {
                                switch (s){
                                    case "1":
                                        message.append("普通会员,");
                                        break;
                                    case "2":
                                        message.append("黄金会员,");
                                        break;
                                    case "3":
                                        message.append("钻石会员,");
                                        break;
                                    case "4":
                                        message.append("准代理,");
                                        break;
                                    case "5":
                                        message.append("代理,");
                                        break;
                                    case "6":
                                        message.append("总代,");
                                        break;
                                    case "7":
                                        message.append("合伙人,");
                                        break;
                                }
                            }
                            StringBuilder res = message.deleteCharAt(message.length() - 1);
                            return R.fail(res+"在当前活动时间已有订单优惠");
                        }
                        StringBuilder res = message.deleteCharAt(message.length() - 1);
                        return R.fail(res+"在当前活动时间已有订单优惠");
                    }
                }
            }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java
@@ -49,8 +49,18 @@
        shopCommissionStatisticsVO.setTotalServiceCharge(totalServiceCharge);
        BigDecimal totalAmount = totalCommission.add(totalSubordinateCommission).add(totalServiceCharge);
        shopCommissionStatisticsVO.setTotalAmount(totalAmount);
        IPage<ShopBalanceStatement> statementIPage = this.baseMapper.queryShopBalanceStatementPage(page, shopBalanceStatement);
        for (ShopBalanceStatement record : statementIPage.getRecords()) {
            BigDecimal subtract = record.getHistoricalBalance().subtract(record.getBalance());
            if (subtract.compareTo(BigDecimal.ZERO)>0){
                // 减少
                record.setVariableAmountString("-¥"+record.getVariableAmount());
            }else if (subtract.compareTo(BigDecimal.ZERO)<0){
                record.setVariableAmountString("+¥"+record.getVariableAmount());
            }else{
                record.setVariableAmountString("¥"+record.getVariableAmount());
            }
        }
        shopCommissionStatisticsVO.setStatementIPage(statementIPage);
        return shopCommissionStatisticsVO;
    }