From e083a5f327fc9873f4f9359faf3791f2e9c929e0 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 09 十月 2024 11:50:10 +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/service/impl/TChargingGunServiceImpl.java |   37 ++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
index 0a3d4e7..c512cb8 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingGunServiceImpl.java
@@ -19,6 +19,8 @@
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.integration.api.feignClient.SendMessageClient;
+import com.ruoyi.integration.api.model.QrCodeDelivery;
 import com.ruoyi.other.api.feignClient.RoleSiteClient;
 import com.ruoyi.other.api.feignClient.UserSiteClient;
 import com.ruoyi.system.api.domain.SysUser;
@@ -60,6 +62,9 @@
 
     @Resource
     private SysUserRoleClient sysUserRoleClient;
+    
+    @Resource
+    private SendMessageClient sendMessageClient;
 
     
     
@@ -116,6 +121,17 @@
             return AjaxResult.error("接口编码已存在");
         }
         this.save(dto);
+        TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId());
+    
+        //下发硬件充电二维码
+        String code_prefix = "https://mxcd.zhinenganguan.com?No=";
+        QrCodeDelivery qrCodeDelivery = new QrCodeDelivery();
+        qrCodeDelivery.setCharging_pile_code(chargingPile.getCode());
+        qrCodeDelivery.setCode_format(1);
+        qrCodeDelivery.setPrefix_length(code_prefix.length());
+        qrCodeDelivery.setCode_prefix(code_prefix);
+        qrCodeDelivery.setQr_code(code_prefix + chargingPile.getCode() + dto.getCode());
+        sendMessageClient.qrCodeDelivery(qrCodeDelivery);
         return AjaxResult.success();
     }
     
@@ -141,6 +157,17 @@
             return AjaxResult.error("接口编码已存在");
         }
         this.updateById(dto);
+        TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId());
+    
+        //下发硬件充电二维码
+        String code_prefix = "https://mxcd.zhinenganguan.com?No=";
+        QrCodeDelivery qrCodeDelivery = new QrCodeDelivery();
+        qrCodeDelivery.setCharging_pile_code(chargingPile.getCode());
+        qrCodeDelivery.setCode_format(1);
+        qrCodeDelivery.setPrefix_length(code_prefix.length());
+        qrCodeDelivery.setCode_prefix(code_prefix);
+        qrCodeDelivery.setQr_code(code_prefix + chargingPile.getCode() + dto.getCode());
+        sendMessageClient.qrCodeDelivery(qrCodeDelivery);
         return AjaxResult.success();
     }
 
@@ -230,14 +257,17 @@
         Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
                 .eq(TChargingGun::getStatus, 1));
         HashMap<String, Integer> objectObjectHashMap1 = new HashMap<>();
-        objectObjectHashMap1.put("1", count.intValue());
+        objectObjectHashMap1.put("charge_mode",1);
+        objectObjectHashMap1.put("modeCount", count.intValue());
         statusStatistics.add(objectObjectHashMap1);
 //        statusStatistics.put(1, count.intValue());
         // 故障
         count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
                 .eq(TChargingGun::getStatus, 7));
         HashMap<String, Integer> objectObjectHashMap2 = new HashMap<>();
-        objectObjectHashMap2.put("2", count.intValue());
+//        objectObjectHashMap2.put("2", count.intValue());
+        objectObjectHashMap2.put("charge_mode",2);
+        objectObjectHashMap2.put("modeCount", count.intValue());
         statusStatistics.add(objectObjectHashMap2);
 
 //        statusStatistics.put(2, count.intValue());
@@ -245,7 +275,8 @@
         count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class)
                 .in(TChargingGun::getStatus, Arrays.asList(3,4,5,6)));
        HashMap<String, Integer> objectObjectHashMap = new HashMap<>();
-        objectObjectHashMap.put("3", count.intValue());
+        objectObjectHashMap.put("charge_mode",3);
+        objectObjectHashMap.put("modeCount", count.intValue());
         statusStatistics.add(objectObjectHashMap);
 
 //        statusStatistics.put(3, count.intValue());

--
Gitblit v1.7.1