From bf954ec42f6f36742b8c5e36a4c3e9ad3f4470fc Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 01 十一月 2024 18:37:09 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java index 8b3b6ac..f45575b 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java @@ -144,6 +144,11 @@ Long userId = tokenService.getLoginUserApplet().getUserId(); // 根据id查询用户信息 TAppUser appUser = appUserClient.getUserById(userId).getData(); + if(Objects.nonNull(byId1.getDiscount())){ + siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); + }else { + siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); + } if(Objects.nonNull(appUser)){ // TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); @@ -156,14 +161,8 @@ TVip vip = JSON.parseObject(vipJson, TVip.class); if(Objects.nonNull(vip) && vip.getType() == 2){ siteInfoVO.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(tAccountingStrategyDetail.getServiceCharge()).add(tAccountingStrategyDetail.getElectrovalence())); - }else { - siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); } - }else { - siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); } - }else { - siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); } } } @@ -196,6 +195,11 @@ Long userId = tokenService.getLoginUserApplet().getUserId(); // 根据id查询用户信息 TAppUser appUser = appUserClient.getUserById(userId).getData(); + if(Objects.nonNull(byId1.getDiscount())){ + siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); + }else { + siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); + } if(Objects.nonNull(appUser)){ // TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); @@ -208,14 +212,8 @@ TVip vip = JSON.parseObject(vipJson, TVip.class); if(Objects.nonNull(vip) && vip.getType() == 2){ siteInfoVO.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(tAccountingStrategyDetail.getServiceCharge()).add(tAccountingStrategyDetail.getElectrovalence())); - }else{ - siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); } - }else { - siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); } - }else { - siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); } } } -- Gitblit v1.7.1