diff --git a/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/exception/analyze/AnalyzeException.java b/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/exception/analyze/AnalyzeException.java new file mode 100644 index 0000000..d939053 --- /dev/null +++ b/couplet-common/couplet-common-core/src/main/java/com/couplet/common/core/exception/analyze/AnalyzeException.java @@ -0,0 +1,25 @@ +package com.couplet.common.core.exception.analyze; + +/** + * @Author: LiJiaYao + * @Date: 2024/4/4 + * @Description: 解析系统统一异常 + */ +public class AnalyzeException extends RuntimeException{ + + private int code; + private String message; + + public AnalyzeException(int code, String message) { + this.code = code; + this.message = message; + } + + public AnalyzeException(String message) { + super(message); + } + + public AnalyzeException() { + + } +} diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/contents/StateConstant.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/contents/StateConstant.java new file mode 100644 index 0000000..b94c76a --- /dev/null +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/contents/StateConstant.java @@ -0,0 +1,39 @@ +package com.couplet.analyze.msg.contents; + +import org.springframework.stereotype.Component; + +/** + * @Author: LiJiaYao + * @Date: 2024/4/4 + * @Description: + */ +@Component +public class StateConstant { + + /** + * 车辆状态 + */ + public static final Integer VEHICLE_STATUS = 0; + + /** + * 充电状态 + */ + public static final Integer CHARGING_STATUS = 0; + + /** + * 运行状态 + */ + public static final Integer OPERATING_STATUS = 0; + + /** + * soc状态 + */ + public static final Integer SOC_STATUS = 0; + + /** + * 可充电储能装置工作状态 + */ + public static final Integer CHARGING_ENERGY_STORAGE_STATUS = 0 ; + + +} diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java index c992ddc..2e92c39 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java @@ -2,6 +2,7 @@ package com.couplet.analyze.msg.model; import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.analyze.msg.service.IncidentService; +import com.couplet.common.core.exception.analyze.AnalyzeException; import com.couplet.common.core.utils.SpringUtils; import com.couplet.common.core.utils.uuid.IdUtils; import lombok.extern.slf4j.Slf4j; @@ -110,7 +111,7 @@ public class ModelMessage { Thread.sleep(1000*6*10); } catch (Exception e) { - throw new RuntimeException(e); + throw new AnalyzeException("连接断开:"+ e.getMessage()); } } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java index 3a5ca25..721046f 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java @@ -23,6 +23,7 @@ public class BreakdownServiceImpl implements IncidentService { public void incident(CoupletMsgData coupletMsgData) { log.info("故障事件开始....."); + log.info("故障事件结束....."); diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java index 971e428..7bbcbb9 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java @@ -23,6 +23,9 @@ public class RealTimeDataServiceImpl implements IncidentService { public void incident(CoupletMsgData coupletMsgData) { log.info("实时数据事件开始....."); + + + log.info("实时数据事件结束....."); } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/mapper/incident/SysIncidentMapper.xml b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/mapper/incident/SysIncidentMapper.xml index 3b863a6..39f16ee 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/mapper/incident/SysIncidentMapper.xml +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/mapper/incident/SysIncidentMapper.xml @@ -18,7 +18,7 @@ `single_battery_max_voltage`, `single_battery_min_voltage`, `single_battery_max_temperature`, `single_battery_min_temperature`, `available_battery_capacity`, `vehicle_status`, `charging_status`, - `operatingStatus`, `soc_status`, `charging_energy_storage_status`, + `operating_status`, `soc_status`, `charging_energy_storage_status`, `drive_motor_status`, `position_status`, `eas_status`, `ptc_status`, `eps_status`, `abs_status`, `mcu_status`, `heating_status`, `battery_status`, `battery_insulation_status`, `dcdc_status`, `chg_status`, `brake_pedal`)