From 873b05ed68b2eabf2152954e88dc5598a8aeb8ea Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 15 七月 2025 15:56:41 +0800
Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile

---
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/JianGuanAccountFallbackFactory.java |    2 --
 ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/TaskUtil.java                            |   10 ++++++++++
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/JianGuanAccountClient.java      |    3 ++-
 ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/ChuanYiChongSuperviseUtil.java           |   22 +++++++++++-----------
 ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/mqtt/util/MqttPushUtil.java                   |   17 ++++++++++++++++-
 ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java       |    2 +-
 ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/GovernmentCloudTask.java                 |    3 ++-
 7 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/JianGuanAccountFallbackFactory.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/JianGuanAccountFallbackFactory.java
index 7c87d77..c2b8dd6 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/JianGuanAccountFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/JianGuanAccountFallbackFactory.java
@@ -2,8 +2,6 @@
 
 import com.ruoyi.account.api.feignClient.InviteUserClient;
 import com.ruoyi.account.api.feignClient.JianGuanAccountClient;
-import com.ruoyi.account.api.model.TInviteUser;
-import com.ruoyi.account.api.vo.GetInviteUser;
 import com.ruoyi.account.api.vo.GovernmentCloudAccountVO;
 import com.ruoyi.common.core.domain.R;
 import org.slf4j.Logger;
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/JianGuanAccountClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/JianGuanAccountClient.java
index 3f1d8e5..6e9bc37 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/JianGuanAccountClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/JianGuanAccountClient.java
@@ -1,6 +1,7 @@
 package com.ruoyi.account.api.feignClient;
 
 import com.ruoyi.account.api.factory.InviteUserFallbackFactory;
+import com.ruoyi.account.api.factory.JianGuanAccountFallbackFactory;
 import com.ruoyi.account.api.model.TInviteUser;
 import com.ruoyi.account.api.vo.GetInviteUser;
 import com.ruoyi.account.api.vo.GovernmentCloudAccountVO;
@@ -14,7 +15,7 @@
  * @author zhibing.pu
  * @Date 2024/9/4 17:54
  */
-@FeignClient(contextId = "JianGuanAccountClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = InviteUserFallbackFactory.class)
+@FeignClient(contextId = "JianGuanAccountClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = JianGuanAccountFallbackFactory.class)
 public interface JianGuanAccountClient {
     /**
      * 政务云查询数据接口
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
index 3bb46bf..ef85729 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
@@ -35,7 +35,7 @@
     /**
      * 每天的9点执行的任务
      */
-    @Scheduled(cron = "0 0 11 * * ?")
+    @Scheduled(cron = "0 0 12 * * ?")
     public void taskDay(){
         try {
             // 传输mongodb的硬件数据
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/mqtt/util/MqttPushUtil.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/mqtt/util/MqttPushUtil.java
index a76477a..9fbd581 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/mqtt/util/MqttPushUtil.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/mqtt/util/MqttPushUtil.java
@@ -140,8 +140,23 @@
     public void reconnect() {
         while (!mqttClient.isConnected()) {
             try {
-                mqttClient.connect();
+                // MQTT的连接设置
+                MqttConnectOptions options = new MqttConnectOptions();
+                options.setUserName(USER_NAME);
+                options.setPassword(PASS_WORD.toCharArray());
+                // 设置超时时间 单位为秒
+                options.setConnectionTimeout(TIME_OUT);///默认:30
+                // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,设置为true表示每次连接到服务器都以新的身份连接
+                options.setCleanSession(true);//默认:true
+                // 设置断开后重新连接(设置为true时将启用自动重新连接)
+                options.setAutomaticReconnect(true);//默认:false
+                // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制
+                options.setKeepAliveInterval(KEEP_ALIVE);//默认:60
+                mqttClient.connect(options);
+                System.out.println("重连成功");
             } catch (MqttException e) {
+                System.out.println("重连失败");
+                log.info("connectionLost e:{}", e.getMessage());
                 e.printStackTrace();
             }
         }
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/ChuanYiChongSuperviseUtil.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/ChuanYiChongSuperviseUtil.java
index 6c9a985..85510e7 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/ChuanYiChongSuperviseUtil.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/ChuanYiChongSuperviseUtil.java
@@ -163,19 +163,19 @@
 		buildBody(post, info, operator);
 		HttpResponse execute = post.execute();
 		if(200 != execute.getStatus()){
-			log.error("推送三方平台充电开始状态失败:" + execute.body());
+			log.error("川易充推送三方平台充电开始状态失败:" + execute.body());
 			return null;
 		}
-		log.info("推送三方平台设备状态响应:" + execute.body());
+		log.info("川易充推送三方平台设备状态响应:" + execute.body());
 		BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class);
 		Integer Ret = baseResult.getRet();
 		if(0 != Ret){
-			log.error("推送三方平台充电开始状态失败:" + baseResult.getMsg());
+			log.error("川易充推送三方平台充电开始状态失败:" + baseResult.getMsg());
 			return null;
 		}
 		//解密参数
 		String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV);
-		log.info("推送三方平台设备状态Data:" + decrypt);
+		log.info("川易充推送三方平台设备状态Data:" + decrypt);
 		NotificationStationStatusResult notificationStationStatusResult = JSON.parseObject(decrypt, NotificationStationStatusResult.class);
 		return notificationStationStatusResult;
 	}
@@ -197,19 +197,19 @@
 		buildBody(post, info, operator);
 		HttpResponse execute = post.execute();
 		if(200 != execute.getStatus()){
-			log.error("推送川逸充平台充电结束状态失败:" + execute.body());
+			log.error("川易充推送川逸充平台充电结束状态失败:" + execute.body());
 			return null;
 		}
-		log.info("推送川逸充平台充电结束状态响应:" + execute.body());
+		log.info("川易充推送川逸充平台充电结束状态响应:" + execute.body());
 		BaseResult baseResult = JSON.parseObject(execute.body(), BaseResult.class);
 		Integer Ret = baseResult.getRet();
 		if(0 != Ret){
-			log.error("推送川逸充平台充电结束状态失败:" + baseResult.getMsg());
+			log.error("川易充推送川逸充平台充电结束状态失败:" + baseResult.getMsg());
 			return null;
 		}
 		//解密参数
 		String decrypt = AESUtil.decrypt(baseResult.getData(), DataSecret, DataSecretIV);
-		log.info("推送川逸充充电结束.状态Data:" + decrypt);
+		log.info("川易充推送川逸充充电结束.状态Data:" + decrypt);
 		NotificationEquipChargeStatusResult notificationEquipChargeStatusResult = JSON.parseObject(decrypt, NotificationEquipChargeStatusResult.class);
 		return notificationEquipChargeStatusResult;
 	}
@@ -300,9 +300,9 @@
 		baseRequest.setSig(hmacMD5);
 		String request_json = JacksonUtils.toJson(baseRequest);
 		post.body(request_json);
-		log.info("推送三方平台请求地址:" + post.getUrl());
-		log.info("推送三方平台请求参数:" + request_json);
-		log.info("推送三方平台请求Data:" + o.toJSONString());
+		log.info("川易充推送三方平台请求地址:" + post.getUrl());
+		log.info("川易充推送三方平台请求参数:" + request_json);
+		log.info("川易充推送三方平台请求Data:" + o.toJSONString());
 	}
 	/**
 	 * 构建请求参数和消息头
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/GovernmentCloudTask.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/GovernmentCloudTask.java
index 269ba7c..66a213c 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/GovernmentCloudTask.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/GovernmentCloudTask.java
@@ -1,4 +1,6 @@
 package com.ruoyi.jianguan.util;
+import com.ruoyi.account.api.factory.JianGuanAccountFallbackFactory;
+import com.ruoyi.account.api.feignClient.JianGuanAccountClient;
 import com.ruoyi.system.api.domain.SysRole;
 import com.ruoyi.system.api.domain.SysLoginLog;
 import com.ruoyi.system.api.domain.SysOperLog;
@@ -69,7 +71,6 @@
 import com.ruoyi.account.api.model.TAppUserIntegralChange;
 import com.ruoyi.account.api.model.TAppUserTag;
 
-import com.ruoyi.account.api.feignClient.JianGuanAccountClient;
 import com.ruoyi.account.api.vo.GovernmentCloudAccountVO;
 import com.ruoyi.chargingPile.api.feignClient.JianGuanChargingPileClient;
 import com.ruoyi.chargingPile.api.model.TChargingPile;
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/TaskUtil.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/TaskUtil.java
index 4c2d906..1f5f5cd 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/TaskUtil.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/util/TaskUtil.java
@@ -1,6 +1,8 @@
 package com.ruoyi.jianguan.util;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.TAppUser;
 import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient;
 import com.ruoyi.chargingPile.api.model.TChargingGun;
 import com.ruoyi.jianguan.model.ConnectorStatusInfo;
@@ -13,6 +15,7 @@
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
@@ -39,6 +42,8 @@
 	private TCECSuperviseUtil tcecSuperviseUtil;
 	@Resource
 	private ChargingOrderClient chargingOrderClient;
+	@Resource
+	private AppUserClient appUserClient;
 	
 	@Resource
 	private RedisTemplate redisTemplate;
@@ -129,11 +134,16 @@
 			supEquipChargeStatus.setEndTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
 			supEquipChargeStatus.setTotalPower(chargingOrder.getElectrovalence());
 			tcecSuperviseUtil.notificationSupEquipChargeStatus(new Operator(), supEquipChargeStatus);
+			TAppUser data = appUserClient.getUserById(chargingOrder.getAppUserId()).getData();
+
 			// 川逸充
 			if (chargingOrder.getRechargePaymentType()==3){
 				JSONObject jsonObject = new JSONObject();
 				jsonObject.put("StartChargeSeq",chargingOrder.getCode());
 				jsonObject.put("ConnectorID",chargingGun2.getFullNumber());
+				if (StringUtils.hasLength(data.getPhone())){
+					jsonObject.put("Mobile",data.getPhone());
+				}
 				LocalDateTime startTime = chargingOrder.getStartTime();
 				
 				//状态(0=未知,1=等待中/已插枪,2=启动中,3=充电中,4=停止中,5=已结束)

--
Gitblit v1.7.1