ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -38,6 +38,7 @@ import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -248,7 +249,12 @@ long daysBetween = ChronoUnit.DAYS.between(chargingPercentProvinceDto.getDate1(), chargingPercentProvinceDto.getDate2()); BigDecimal multiply = bigDecimal1.multiply(new BigDecimal("24")).multiply(BigDecimal.valueOf(daysBetween)); //得到利用率 BigDecimal divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); BigDecimal divide; if(CollectionUtils.isEmpty(chargingPiles)){ divide = BigDecimal.ZERO; }else { divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); } //如果利用率大于等于10 if (divide.compareTo(BigDecimal.valueOf(10))>=0){ chargingPercentBack.setCount1(chargingPercentBack.getCount1()+1); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ChargeOrderServiceImpl.java
@@ -439,7 +439,7 @@ throw new IllegalArgumentException("金额不能为null或负数"); } // 获取积分兑换比例配置 R<SysConfig> info = sysConfigClient.getInfo(8L); R<SysConfig> info = sysConfigClient.getInfo(10L); if (info == null || info.getData() == null) { throw new RuntimeException("获取积分兑换比例配置失败"); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralController.java
@@ -617,7 +617,7 @@ if (data != null ) { if (data.getRoleType() == 1) { // 平台 SysConfig data1 = sysConfigClient.getInfo(8L).getData(); SysConfig data1 = sysConfigClient.getInfo(10L).getData(); sysConfigClient.update(data1); TIntegralRule tIntegralRule = new TIntegralRule(); tIntegralRule.setChargeCredit("{\"num1\":"+data1.getConfigValue()+"}"); @@ -650,7 +650,7 @@ SysUser data = sysUserClient.getSysUser(userid).getData(); if (data.getRoleType() == 1) { SysConfig data1 = sysConfigClient.getInfo(8L).getData(); SysConfig data1 = sysConfigClient.getInfo(10L).getData(); JSONObject jsonObject = JSONObject.parseObject(dto.getChargeCredit()); Integer num1 = jsonObject.getInteger("num1"); data1.setConfigValue(num1.toString());