From e0fc8f7e2230b51e3bbe8dea43790cf11b7170e9 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 04 十一月 2024 15:39:01 +0800 Subject: [PATCH] merge --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java index 655485e..82450f6 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TAccountingStrategyDetailServiceImpl.java @@ -61,6 +61,28 @@ private AppUserVipDetailClient vipDetailClient; @Override public List<TAccountingStrategyDetailVO> queryAccountingStrategyDetailByStrategyId(Integer strategyId) { + List<TAccountingStrategyDetailVO> tAccountingStrategyDetailVOS = this.baseMapper.queryAccountingStrategyDetailByStrategyId(strategyId); + Long userId = tokenService.getLoginUserApplet().getUserId(); + TAppUser appUser = appUserClient.getUserById(userId).getData(); + for (TAccountingStrategyDetailVO tAccountingStrategyDetailVO : tAccountingStrategyDetailVOS) { + GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); + getAppUserVipDetail.setAppUserId(userId); + getAppUserVipDetail.setVipId(appUser.getVipId()); + R<TAppUserVipDetail> appUserVipDetail = vipDetailClient.getAppUserVipDetail(getAppUserVipDetail); + TAppUserVipDetail data1 = appUserVipDetail.getData(); + if(Objects.nonNull(data1)){ + String vipJson = data1.getVipJson(); + TVip vip = JSON.parseObject(vipJson, TVip.class); + 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); } @@ -105,6 +127,7 @@ if(Objects.nonNull(vip)) { if (vip.getType() == 2) { accountingStrategyDetailVO.setTotalPrice(accountingStrategyDetailVO.getElectrovalence().add(accountingStrategyDetailVO.getServiceCharge().multiply(vip.getDiscount()))); + accountingStrategyDetailVO.setDiscount(vip.getDiscount().divide(new BigDecimal(10))); accountingStrategyDetailNext.setTotalPrice(accountingStrategyDetailNext.getElectrovalence().add(accountingStrategyDetailNext.getServiceCharge().multiply(vip.getDiscount()))); } else { if(Objects.isNull(accountingStrategy.getDiscount())){ -- Gitblit v1.7.1