Compare commits

...

4 Commits

12 changed files with 79 additions and 8 deletions

View File

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@FeignClient(contextId = "remoteVehicleService" , @FeignClient(contextId = "remoteVehicleService" ,
value = ServiceNameConstants.VEHICLE_SERVICE, value = ServiceNameConstants.BUSINESS_SERVICE,
fallbackFactory = RemoteVehicleFallbackFactory.class, fallbackFactory = RemoteVehicleFallbackFactory.class,
path = "/vehicle" path = "/vehicle"
) )

View File

@ -48,6 +48,7 @@ public class RemoteVehicleFallbackFactory implements FallbackFactory<RemoteVehic
@Override @Override
public Result<List<Vehicle>> findByVIN(String vin) { public Result<List<Vehicle>> findByVIN(String vin) {
log.error("车辆服务调用失败:"+cause.getMessage());
return Result.error("车辆服务调用失败:" + cause.getMessage()); return Result.error("车辆服务调用失败:" + cause.getMessage());
} }
}; };

View File

@ -26,8 +26,8 @@ public class ServiceNameConstants {
* @param null: * @param null:
* @return null * @return null
* @author * @author
* @description * @description couplet-business
* @date * @date
*/ */
public static final String VEHICLE_SERVICE = "couplet-vehicle"; public static final String BUSINESS_SERVICE = "couplet-business";
} }

View File

@ -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() {
}
}

View File

@ -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 ;
}

View File

@ -2,6 +2,7 @@ package com.couplet.analyze.msg.model;
import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.analyze.msg.service.IncidentService; 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.SpringUtils;
import com.couplet.common.core.utils.uuid.IdUtils; import com.couplet.common.core.utils.uuid.IdUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -110,7 +111,7 @@ public class ModelMessage {
Thread.sleep(1000*6*10); Thread.sleep(1000*6*10);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new AnalyzeException("连接断开:"+ e.getMessage());
} }
} }

View File

@ -23,6 +23,7 @@ public class BreakdownServiceImpl implements IncidentService {
public void incident(CoupletMsgData coupletMsgData) { public void incident(CoupletMsgData coupletMsgData) {
log.info("故障事件开始....."); log.info("故障事件开始.....");
log.info("故障事件结束....."); log.info("故障事件结束.....");

View File

@ -23,6 +23,9 @@ public class RealTimeDataServiceImpl implements IncidentService {
public void incident(CoupletMsgData coupletMsgData) { public void incident(CoupletMsgData coupletMsgData) {
log.info("实时数据事件开始....."); log.info("实时数据事件开始.....");
log.info("实时数据事件结束....."); log.info("实时数据事件结束.....");
} }

View File

@ -18,7 +18,7 @@
`single_battery_max_voltage`, `single_battery_min_voltage`, `single_battery_max_voltage`, `single_battery_min_voltage`,
`single_battery_max_temperature`, `single_battery_min_temperature`, `single_battery_max_temperature`, `single_battery_min_temperature`,
`available_battery_capacity`, `vehicle_status`, `charging_status`, `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`, `drive_motor_status`, `position_status`, `eas_status`, `ptc_status`,
`eps_status`, `abs_status`, `mcu_status`, `heating_status`, `battery_status`, `eps_status`, `abs_status`, `mcu_status`, `heating_status`, `battery_status`,
`battery_insulation_status`, `dcdc_status`, `chg_status`, `brake_pedal`) `battery_insulation_status`, `dcdc_status`, `chg_status`, `brake_pedal`)

View File

@ -19,6 +19,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
public class CoupletMqApplatcaion { public class CoupletMqApplatcaion {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(CoupletMqApplatcaion.class, args); SpringApplication.run(CoupletMqApplatcaion.class, args);
System.out.println("获取报文、RabbitMQ模块启动成功"); System.out.println("RabbitMQ模块启动成功");
} }
} }

View File

@ -18,9 +18,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableMyFeignClients @EnableMyFeignClients
@SpringBootApplication @SpringBootApplication
//@EnableFeignClients //@EnableFeignClients
public class OnlineApplication { public class CoupletOnlineApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(OnlineApplication.class); SpringApplication.run(CoupletOnlineApplication.class);
System.out.println("车辆上线模块启动成功"); System.out.println("车辆上线模块启动成功");
} }
} }