From 837b806fa21bb440c720edd1e980373eb529cb23 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 01 四月 2025 19:07:17 +0800 Subject: [PATCH] 修改统计手续费和离线时间判定逻辑 --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java index 9fc876b..1fac220 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java @@ -247,8 +247,8 @@ Integer status = vo.getStatus(); Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_gun_online"); Long time = (Long) charging_pile_online.get(pile_code + gun_code); - //小于30秒才处理数据,防止频繁查询数据 - if(null != time && (System.currentTimeMillis() - time) < 30000){ + //小于1分钟才处理数据,防止频繁查询数据 + if(null != time && (System.currentTimeMillis() - time) < 60000){ return; } TChargingGun tChargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, (pile_code + gun_code)).eq(TChargingGun::getDelFlag, 0)); @@ -321,16 +321,19 @@ TChargingGun tChargingGun1 = new TChargingGun(); if(Arrays.asList(1, 2, 5).contains(chargingOrder.getStatus())){ tChargingGun1.setStatus(3); + tChargingGun1.setId(tChargingGun.getId()); + chargingGunService.updateById(tChargingGun1); } if(Arrays.asList(3).contains(chargingOrder.getStatus())){ tChargingGun1.setStatus(4); + tChargingGun1.setId(tChargingGun.getId()); + chargingGunService.updateById(tChargingGun1); } if(Arrays.asList(4).contains(chargingOrder.getStatus()) && chargingOrder.getEndMode() == 2){ tChargingGun1.setStatus(5); + tChargingGun1.setId(tChargingGun.getId()); + chargingGunService.updateById(tChargingGun1); } - tChargingGun1.setId(tChargingGun.getId()); - chargingGunService.updateById(tChargingGun1); - //推送状态给三方平台 tcecClient.pushChargingGunStatus(tChargingGun.getFullNumber(), tChargingGun1.getStatus()); }else{ -- Gitblit v1.7.1