又换调整换电数据

This commit is contained in:
andy 2026-02-24 16:23:42 +08:00
parent 55f76c22bf
commit e81b4f46c2
4 changed files with 23 additions and 13 deletions

View File

@ -5,12 +5,9 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="ec76006e-5a88-4766-9722-bc8eda172857" name="Changes" comment=""> <list default="true" id="ec76006e-5a88-4766-9722-bc8eda172857" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/dtos/system/MessageMqttDTO.java" beforeDir="false" afterPath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/dtos/system/MessageMqttDTO.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/enums/SwapBatteryStepEnum.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/entity/system/MessageMqtt.java" beforeDir="false" afterPath="$PROJECT_DIR$/commoms/core/src/main/java/com/evotech/hd/core/entity/system/MessageMqtt.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/mqtt/MessageTopic.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/service/MessageMqttService.java" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/service/MessageMqttService.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/utils/sendCloud/CloudSendInfoUtils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/service/impl/MessageMqttServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/java/com/evotech/hd/webserver/service/impl/MessageMqttServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web-server/src/main/resources/mapper/MessageMqttMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/web-server/src/main/resources/mapper/MessageMqttMapper.xml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -381,7 +378,9 @@
<workItem from="1768809252266" duration="601000" /> <workItem from="1768809252266" duration="601000" />
<workItem from="1768955894610" duration="4133000" /> <workItem from="1768955894610" duration="4133000" />
<workItem from="1768987212149" duration="43024000" /> <workItem from="1768987212149" duration="43024000" />
<workItem from="1769503255745" duration="89100000" /> <workItem from="1769503255745" duration="104829000" />
<workItem from="1771808159438" duration="2384000" />
<workItem from="1771813138867" duration="22007000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@ -18,13 +18,13 @@ public enum SwapBatteryStepEnum{
INSTITUTIONS_FOR_CHINA(3, "对中机构"), 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, "完成"), COMPLETED(8, "完成"),

View File

@ -26,7 +26,12 @@ public class MessageTopic implements Serializable {
public String toString() { public String toString() {
return businessType + "/" + stationCode + "/" + dataDirection + "/" + messageType; return businessType + "/" + stationCode + "/" + dataDirection + "/" + messageType;
} }
public MessageTopic() {
}
public MessageTopic(String messageType, String requestMethod) {
this.messageType = messageType;
this.requestMethod = requestMethod;
}
} }

View File

@ -8,7 +8,9 @@ import com.evotech.hd.core.dtos.Result;
import com.evotech.hd.utils.Collections; import com.evotech.hd.utils.Collections;
import com.evotech.hd.webserver.logging.AsyncLogService; import com.evotech.hd.webserver.logging.AsyncLogService;
import com.evotech.hd.webserver.logging.LogUtils; 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.mqtt.MqttPublishUtils;
import com.evotech.hd.webserver.service.MessageMqttService;
import com.evotech.hd.webserver.utils.ParamUtils; import com.evotech.hd.webserver.utils.ParamUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.HttpClient; import org.apache.http.client.HttpClient;
@ -40,8 +42,11 @@ public class CloudSendInfoUtils {
private static AsyncLogService asyncLogService; private static AsyncLogService asyncLogService;
public CloudSendInfoUtils(AsyncLogService asyncLogService) { private static MessageMqttService messageMqttService;
public CloudSendInfoUtils(AsyncLogService asyncLogService, MessageMqttService messageMqttService) {
this.asyncLogService = asyncLogService; this.asyncLogService = asyncLogService;
this.messageMqttService = messageMqttService;
} }
@ -183,6 +188,7 @@ public class CloudSendInfoUtils {
map.put("sign", sign); map.put("sign", sign);
map.put("data", json.toString()); map.put("data", json.toString());
JSONObject result = doPost(ParamUtils.getCloudRequestUrl(), map, Collections.asMap("Content-Type", "application/json","Accept-Language", "zh-CN")); 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)); asyncLogService.saveLog(LogUtils.getSendCloudLog(functionName, (System.currentTimeMillis()-startTime), json, (result == null ? "" : result.toString()), null));
return result; return result;
} catch (Exception e) { } catch (Exception e) {