diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d8ce25b..5d8db9a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,12 +5,9 @@ - - + - - - + diff --git a/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java b/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java index dd37660..1bfc3ee 100644 --- a/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java +++ b/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java @@ -18,13 +18,13 @@ public enum SwapBatteryStepEnum{ INSTITUTIONS_FOR_CHINA(3, "对中机构"), - DISMANTLE_OLD_ELECTRICITY(4, "拆旧电"), + GET_NEW_ELECTRICITY(4, "取新电"), - DISCHARGE_OLD_ELECTRICITY(5, "放旧电"), + DISMANTLE_OLD_ELECTRICITY(5, "拆旧电"), - GET_NEW_ELECTRICITY(6, "取新电"), + INSTALL_NEW_ELECTRICITY(6, "装新电"), - INSTALL_NEW_ELECTRICITY(7, "装新电"), + DISCHARGE_OLD_ELECTRICITY(7, "放旧电"), COMPLETED(8, "完成"), diff --git a/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java b/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java index bfbdee6..e5eba60 100644 --- a/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java +++ b/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java @@ -26,7 +26,12 @@ public class MessageTopic implements Serializable { public String toString() { return businessType + "/" + stationCode + "/" + dataDirection + "/" + messageType; } - - + public MessageTopic() { + } + + public MessageTopic(String messageType, String requestMethod) { + this.messageType = messageType; + this.requestMethod = requestMethod; + } } diff --git a/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java b/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java index f15c0f0..a184002 100644 --- a/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java +++ b/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java @@ -8,7 +8,9 @@ import com.evotech.hd.core.dtos.Result; import com.evotech.hd.utils.Collections; import com.evotech.hd.webserver.logging.AsyncLogService; import com.evotech.hd.webserver.logging.LogUtils; +import com.evotech.hd.webserver.mqtt.MessageTopic; import com.evotech.hd.webserver.mqtt.MqttPublishUtils; +import com.evotech.hd.webserver.service.MessageMqttService; import com.evotech.hd.webserver.utils.ParamUtils; import lombok.extern.slf4j.Slf4j; import org.apache.http.client.HttpClient; @@ -40,8 +42,11 @@ public class CloudSendInfoUtils { private static AsyncLogService asyncLogService; - public CloudSendInfoUtils(AsyncLogService asyncLogService) { + private static MessageMqttService messageMqttService; + + public CloudSendInfoUtils(AsyncLogService asyncLogService, MessageMqttService messageMqttService) { this.asyncLogService = asyncLogService; + this.messageMqttService = messageMqttService; } @@ -183,6 +188,7 @@ public class CloudSendInfoUtils { map.put("sign", sign); map.put("data", json.toString()); JSONObject result = doPost(ParamUtils.getCloudRequestUrl(), map, Collections.asMap("Content-Type", "application/json","Accept-Language", "zh-CN")); + messageMqttService.update(null,new MessageTopic(json.getString("method"), "HTTP"), "-1", 1, JSONUtil.parseObj(map)); asyncLogService.saveLog(LogUtils.getSendCloudLog(functionName, (System.currentTimeMillis()-startTime), json, (result == null ? "" : result.toString()), null)); return result; } catch (Exception e) {