Pu Zhibing
2025-07-14 99eddbebf80c5549a7487caed95b041abdc9bb5f
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java
@@ -73,10 +73,17 @@
            if(Objects.nonNull(data1)){
                String vipJson = data1.getVipJson();
                TVip vip = JSON.parseObject(vipJson, TVip.class);
                tAccountingStrategyDetailVO.setDiscount(vip.getDiscount().divide(new BigDecimal(10)));
                if(Objects.nonNull(vip) && vip.getType() == 2){
                    tAccountingStrategyDetailVO.setDiscount(vip.getDiscount().divide(new BigDecimal(10)));
                }
            }
        }
        return tAccountingStrategyDetailVOS;
    }
    @Override
    public List<TAccountingStrategyDetailVO> queryMangementAccountingStrategyDetailByStrategyId(Integer strategyId) {
        return this.baseMapper.queryAccountingStrategyDetailByStrategyId(strategyId);
    }
    @Override
@@ -169,13 +176,13 @@
        }
        // 查询最高折扣的会员
        TVip monthlyCardDiscount = vipClient.getVipInfoByType(3).getData();
        strategyPriceVO.setServiceFeeDiscount(monthlyCardDiscount.getMonthlyCardDiscount());
        strategyPriceVO.setServiceFeeDiscount(null == monthlyCardDiscount ? new BigDecimal(10) : monthlyCardDiscount.getMonthlyCardDiscount());
        // 查询最高优惠的会员
        TVip maximumDeduction = vipClient.getVipInfoByType(1).getData();
        strategyPriceVO.setMaxDiscountAmount(maximumDeduction.getMaximumDeduction());
        strategyPriceVO.setMaxDiscountAmount(null == maximumDeduction ? new BigDecimal(10) : maximumDeduction.getMaximumDeduction());
        // 查询最低起步价会员
        TVip monthlyCard = vipClient.getVipInfoByType(2).getData();
        strategyPriceVO.setVipStartPrice(monthlyCard.getMonthlyCard());
        strategyPriceVO.setVipStartPrice(null == monthlyCard ? new BigDecimal(10) : monthlyCard.getMonthlyCard());
        // 模板折扣
        strategyPriceVO.setDiscount(accountingStrategy.getDiscount());
        return strategyPriceVO;
@@ -227,7 +234,11 @@
        TChargingGun chargingGun = chargingGunService.getById(gunId);
        TAccountingStrategy accountingStrategy = accountingStrategyMapper.selectById(chargingGun.getAccountingStrategyId());
        if(Objects.isNull(accountingStrategy)){
            throw new ServiceException("未查询到计费策略");
            Site site = siteService.getById(chargingGun.getSiteId());
            accountingStrategy = accountingStrategyMapper.selectById(site.getAccountingStrategyId());
            if(Objects.isNull(accountingStrategy)){
                throw new ServiceException("未查询到计费策略");
            }
        }
        List<TAccountingStrategyDetailVO> list = this.queryAccountingStrategyDetailByStrategyId(accountingStrategy.getId());
        list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59"));