更新故障
parent
e026594df3
commit
fc1e4eea0c
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 8089
|
||||
port: 8087
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package com.fivegroup.analysis.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.feign.FaultLogFeign;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.fault.domain.FaultLog;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @program: car-server
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-12-02 12:43
|
||||
**/
|
||||
@Component
|
||||
@Log4j2
|
||||
public class RabbitConfig {
|
||||
@Autowired
|
||||
private RedisTemplate<String,String> redisTemplate;
|
||||
@Autowired
|
||||
private FaultLogFeign faultLogFeign;
|
||||
|
||||
@RabbitListener(queuesToDeclare = {@Queue(name = "faultLog")})
|
||||
public void addFaultLog(String msg, Message message, Channel channel) {
|
||||
String messageId = message.getMessageProperties().getMessageId();
|
||||
Long faultCode =redisTemplate.opsForSet().add("faultLog", messageId);
|
||||
if(faultCode==1) {
|
||||
log.info("消息id:{} 写入redis", messageId);
|
||||
FaultLog faultLog = JSONObject.parseObject(msg, FaultLog.class);
|
||||
faultLogFeign.addFaultLog(faultLog);
|
||||
try {
|
||||
log.info("消息id:{} 写入数据库", messageId);
|
||||
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
||||
} catch (Exception e) {
|
||||
// 其他异常处理逻辑
|
||||
log.error("Feign调用出错:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.fivegroup.analysis.feign;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import com.fivegroup.fault.domain.FaultLog;
|
||||
|
||||
/**
|
||||
* @program: car-server
|
||||
* @description: 远程调用
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-12-01 22:04
|
||||
**/
|
||||
@FeignClient(value = "fivegroup-fault")
|
||||
public interface FaultLogFeign {
|
||||
@PostMapping("/faultLog/add")
|
||||
void addFaultLog(@RequestBody FaultLog faultLog);
|
||||
}
|
|
@ -1,25 +1,15 @@
|
|||
package com.fivegroup.analysis.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.analysis.feign.FaultLogFeign;
|
||||
import com.fivegroup.common.core.domain.Result;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.service.VehicleIncidentService;
|
||||
import com.fivegroup.fault.domain.FaultLog;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.common.protocol.types.Field;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 车辆故障事件检测
|
||||
|
@ -35,6 +25,8 @@ public class VehicleBreakdownIncidentServiceImpl implements VehicleIncidentServ
|
|||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
// @Autowired
|
||||
// private FaultLogMapper faultLogMapper;
|
||||
|
||||
/**
|
||||
* 车辆故障信息
|
||||
|
@ -43,79 +35,126 @@ public class VehicleBreakdownIncidentServiceImpl implements VehicleIncidentServ
|
|||
@Override
|
||||
public void execute(VehicleData vehicleDate) {
|
||||
|
||||
FaultLog faultLog = new FaultLog();
|
||||
if (vehicleDate.getVehicleStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("车辆状态异常");
|
||||
log.info("车辆状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getChargingStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("充电状态异常");
|
||||
log.info("充电状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getOperatingStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("运行状态异常");
|
||||
log.info("运行状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getSocStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("SOC状态异常");
|
||||
log.info("SOC状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getChargingEnergyStorageStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("充电电池状态异常");
|
||||
log.info("充电电池状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getDriveMotorStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("驱动电机状态异常");
|
||||
log.info("驱动电机状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
if (vehicleDate.getPositionStatus() == 0) {
|
||||
faultLog.setCarVin(vehicleDate.getVin());
|
||||
faultLog.setFaultStartTime(new Date());
|
||||
faultLog.setFaultDetail("定位状态异常");
|
||||
log.info("定位状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
rabbitTemplate.convertAndSend("faultLog", JSONObject.toJSONString(faultLog),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
||||
return message;
|
||||
});
|
||||
}
|
||||
log.info("--------------");
|
||||
// ArrayList<String> strings = new ArrayList<>();
|
||||
// FaultLog faultLog = new FaultLog();
|
||||
// List<VehicleData> vehicleData = new ArrayList<>();
|
||||
// vehicleData.add(vehicleDate);
|
||||
//
|
||||
// vehicleData.forEach(item->{
|
||||
// if (item.getVehicleStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("车辆状态异常");
|
||||
// log.info("车辆状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("车辆状态异常");
|
||||
// }
|
||||
// if (item.getChargingStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("充电状态异常");
|
||||
// log.info("充电状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("充电状态异常");
|
||||
// }
|
||||
// if (item.getOperatingStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("运行状态异常");
|
||||
// log.info("运行状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("运行状态异常");
|
||||
// }
|
||||
// if (item.getSocStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("SOC状态异常");
|
||||
// log.info("SOC状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("SOC状态异常");
|
||||
// }
|
||||
// if (item.getChargingEnergyStorageStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("充电电池状态异常");
|
||||
// log.info("充电电池状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("充电状态异常");
|
||||
// }
|
||||
// if (item.getDriveMotorStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("驱动电机状态异常");
|
||||
// log.info("驱动电机状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("驱动电机状态异常");
|
||||
// }
|
||||
// if (item.getPositionStatus() == 0) {
|
||||
// faultLog.setCarVin(item.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("定位状态异常");
|
||||
// log.info("定位状态异常,车辆VIN:{}",item.getVin());
|
||||
// strings.add("定位状态异常");
|
||||
// }
|
||||
// faultLogMapper.addLog(faultLog);
|
||||
// });
|
||||
|
||||
// FaultLog faultLog = new FaultLog();
|
||||
// if (vehicleDate.getVehicleStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("车辆状态异常");
|
||||
// log.info("车辆状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("车辆状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getChargingStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("充电状态异常");
|
||||
// log.info("充电状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("充电状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getOperatingStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("运行状态异常");
|
||||
// log.info("运行状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("运行状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getSocStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("SOC状态异常");
|
||||
// log.info("SOC状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("SOC状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getChargingEnergyStorageStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("充电电池状态异常");
|
||||
// log.info("充电电池状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("充电状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getDriveMotorStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("驱动电机状态异常");
|
||||
// log.info("驱动电机状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("驱动电机状态异常");
|
||||
// }
|
||||
// if (vehicleDate.getPositionStatus() == 0) {
|
||||
// faultLog.setCarVin(vehicleDate.getVin());
|
||||
// faultLog.setFaultStartTime(new Date());
|
||||
// faultLog.setFaultDetail("定位状态异常");
|
||||
// log.info("定位状态异常,车辆VIN:{}",vehicleDate.getVin());
|
||||
// strings.add("定位状态异常");
|
||||
// }
|
||||
// for (String string : strings) {
|
||||
// faultLog.setFaultDetail(string);
|
||||
// }
|
||||
// faultLogMapper.addLog(faultLog);
|
||||
// log.info("--------------");
|
||||
log.info("车辆VIN:{}有故障",vehicleDate.getVin());
|
||||
if(vehicleDate.getVehicleStatus()==0){
|
||||
rabbitTemplate.convertAndSend("faultQueue",JSONObject.toJSONString(vehicleDate),message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
return message;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.analysis.FiveGroupAnalysisApplication;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.feign.FaultLogFeign;
|
||||
import com.fivegroup.analysis.service.impl.VehicleBreakdownIncidentServiceImpl;
|
||||
import com.fivegroup.fault.domain.FaultLog;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
@ -24,20 +22,27 @@ import java.util.ArrayList;
|
|||
public class FaultDetailTest {
|
||||
@Autowired
|
||||
private VehicleBreakdownIncidentServiceImpl vehicleBreakdownIncidentService;
|
||||
/**
|
||||
* 故障详情测试方法
|
||||
*/
|
||||
@Test
|
||||
public void faultDetailTest(){
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
// 添加第一个JSON字符串
|
||||
list.add("{\"absStatus\":1,\"accelerationPedal\":\"5\",\"availableBatteryCapacity\":\"6\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"5\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"28\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.538996\",\"longitude\":\"116.670235\",\"maximumDischargePower\":\"15\",\"maximumFeedbackPower\":\"44\",\"mcuStatus\":1,\"mileage\":13.08,\"motorControllerTemperature\":\"90\",\"motorCurrent\":\"3374\",\"motorSpeed\":\"47648\",\"motorTemperature\":\"33\",\"motorTorque\":\"787\",\"motorVoltage\":\"296\",\"msg\":\"VIN123456789123451701419211998116.670235039.5389960180.0013.0800000028600028000133210000D505010.90900000476487870330000296003374000044959.44000015000013110002340004000300010000070000060000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44959.40,\"resistance\":\"13321\",\"selfCheckCounter\":\"13\",\"singleBatteryMaxTemperature\":\"1\",\"singleBatteryMaxVoltage\":\"4\",\"singleBatteryMinTemperature\":\"70\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"180.00\",\"totalBatteryCurrent\":\"11\",\"totalBatteryVoltage\":\"234\",\"vehicleStatus\":1,\"vin\":\"VIN12345678912345\",\"voltage\":\"286\"}");
|
||||
list.add("{\"absStatus\":1,\"accelerationPedal\":\"5\",\"availableBatteryCapacity\":\"6\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"5\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"28\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.538996\",\"longitude\":\"116.670235\",\"maximumDischargePower\":\"15\",\"maximumFeedbackPower\":\"44\",\"mcuStatus\":1,\"mileage\":13.08,\"motorControllerTemperature\":\"90\",\"motorCurrent\":\"3374\",\"motorSpeed\":\"47648\",\"motorTemperature\":\"33\",\"motorTorque\":\"787\",\"motorVoltage\":\"296\",\"msg\":\"VIN123456789123451701419211998116.670235039.5389960180.0013.0800000028600028000133210000D505010.90900000476487870330000296003374000044959.44000015000013110002340004000300010000070000060000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":0,\"ptcStatus\":0,\"remainingBattery\":44959.40,\"resistance\":\"13321\",\"selfCheckCounter\":\"13\",\"singleBatteryMaxTemperature\":\"1\",\"singleBatteryMaxVoltage\":\"4\",\"singleBatteryMinTemperature\":\"70\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":0,\"speed\":\"180.00\",\"totalBatteryCurrent\":\"11\",\"totalBatteryVoltage\":\"234\",\"vehicleStatus\":1,\"vin\":\"VIN12345678912345\",\"voltage\":\"286\"}");
|
||||
// 添加第二个JSON字符串
|
||||
list.add("{\"absStatus\":1,\"accelerationPedal\":\"4\",\"availableBatteryCapacity\":\"86\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"7\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"41\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.40\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.537432\",\"longitude\":\"116.67038\",\"maximumDischargePower\":\"51\",\"maximumFeedbackPower\":\"0\",\"mcuStatus\":1,\"mileage\":12.98,\"motorControllerTemperature\":\"30\",\"motorCurrent\":\"12807\",\"motorSpeed\":\"32871\",\"motorTemperature\":\"63\",\"motorTorque\":\"508\",\"motorVoltage\":\"206\",\"msg\":\"VIN223456789123451701419211000116.670380039.537432072.00012.9800000044400041000163390000D407010.40300000328715080630000206001280700044970.00000051000060800006500003000300066000083000086000001111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"16339\",\"selfCheckCounter\":\"6\",\"singleBatteryMaxTemperature\":\"66\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"83\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"650\",\"vehicleStatus\":0,\"vin\":\"VIN22345678912345\",\"voltage\":\"444\"}");
|
||||
// 添加第三个JSON字符串
|
||||
list.add("{\"absStatus\":1,\"accelerationPedal\":\"8\",\"availableBatteryCapacity\":\"90\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"3\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"43\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"9.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.536898\",\"longitude\":\"116.670799\",\"maximumDischargePower\":\"45\",\"maximumFeedbackPower\":\"68\",\"mcuStatus\":1,\"mileage\":12.94,\"motorControllerTemperature\":\"72\",\"motorCurrent\":\"2762\",\"motorSpeed\":\"25959\",\"motorTemperature\":\"13\",\"motorTorque\":\"467\",\"motorVoltage\":\"116\",\"msg\":\"VIN323456789123451701419209989116.670799039.536898072.00012.9400000052700043000287600000D80309.900720007013000002595946116002762000044970.68000045000080800007390003000400031000053000090000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"2876\",\"selfCheckCounter\":\"8\",\"singleBatteryMaxTemperature\":\"31\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"53\",\"singleBatteryMinVoltage\":\"4\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"739\",\"vehicleStatus\":1,\"vin\":\"VIN32345678912345\",\"voltage\":\"527\"}");
|
||||
// 在新线程中执行逻辑
|
||||
new Thread(() -> {
|
||||
list.forEach(s->{
|
||||
// 将JSON字符串转换为VehicleData对象
|
||||
VehicleData vehicleData = JSONObject.parseObject(s, VehicleData.class);
|
||||
// 执行车辆故障 breakdown 逻辑
|
||||
vehicleBreakdownIncidentService.execute(vehicleData);
|
||||
try {
|
||||
// 线程休眠1秒
|
||||
Thread.sleep(1000);
|
||||
}catch (InterruptedException e){
|
||||
throw new RuntimeException(e);
|
||||
|
@ -47,4 +52,5 @@ public class FaultDetailTest {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,88 +0,0 @@
|
|||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.fivegroup.analysis.FiveGroupAnalysisApplication;
|
||||
//import com.fivegroup.analysis.domain.VehicleData;
|
||||
//import com.fivegroup.analysis.feign.FaultLogFeign;
|
||||
//import org.junit.jupiter.api.Test;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import com.fivegroup.analysis.service.impl.VehicleBreakdownIncidentServiceImpl;
|
||||
//import org.springframework.boot.test.context.SpringBootTest;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import java.util.concurrent.CopyOnWriteArrayList;
|
||||
//import java.util.concurrent.ExecutorService;
|
||||
//import java.util.concurrent.Executors;
|
||||
//
|
||||
///**
|
||||
// * @program: car-server
|
||||
// * @description:
|
||||
// * @author: Mr.Wang
|
||||
// * @create: 2023-12-01 18:32
|
||||
// **/
|
||||
//@SpringBootTest(classes = FiveGroupAnalysisApplication.class)
|
||||
//public class FaultTest {
|
||||
// @Autowired
|
||||
// private FaultLogFeign faultLogFeign;
|
||||
// /**
|
||||
// * 测试方法
|
||||
// */
|
||||
// @Test
|
||||
// public void test() {
|
||||
// ArrayList<String> list = new ArrayList<>();
|
||||
//
|
||||
// // 添加第一个JSON字符串
|
||||
// list.add("{\"absStatus\":1,\"accelerationPedal\":\"5\",\"availableBatteryCapacity\":\"6\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"5\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"28\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.538996\",\"longitude\":\"116.670235\",\"maximumDischargePower\":\"15\",\"maximumFeedbackPower\":\"44\",\"mcuStatus\":1,\"mileage\":13.08,\"motorControllerTemperature\":\"90\",\"motorCurrent\":\"3374\",\"motorSpeed\":\"47648\",\"motorTemperature\":\"33\",\"motorTorque\":\"787\",\"motorVoltage\":\"296\",\"msg\":\"VIN123456789123451701419211998116.670235039.5389960180.0013.0800000028600028000133210000D505010.90900000476487870330000296003374000044959.44000015000013110002340004000300010000070000060000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44959.40,\"resistance\":\"13321\",\"selfCheckCounter\":\"13\",\"singleBatteryMaxTemperature\":\"1\",\"singleBatteryMaxVoltage\":\"4\",\"singleBatteryMinTemperature\":\"70\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"180.00\",\"totalBatteryCurrent\":\"11\",\"totalBatteryVoltage\":\"234\",\"vehicleStatus\":1,\"vin\":\"VIN12345678912345\",\"voltage\":\"286\"}");
|
||||
// // 添加第二个JSON字符串
|
||||
// list.add("{\"absStatus\":1,\"accelerationPedal\":\"4\",\"availableBatteryCapacity\":\"86\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"7\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"41\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.40\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.537432\",\"longitude\":\"116.67038\",\"maximumDischargePower\":\"51\",\"maximumFeedbackPower\":\"0\",\"mcuStatus\":1,\"mileage\":12.98,\"motorControllerTemperature\":\"30\",\"motorCurrent\":\"12807\",\"motorSpeed\":\"32871\",\"motorTemperature\":\"63\",\"motorTorque\":\"508\",\"motorVoltage\":\"206\",\"msg\":\"VIN223456789123451701419211000116.670380039.537432072.00012.9800000044400041000163390000D407010.40300000328715080630000206001280700044970.00000051000060800006500003000300066000083000086000001111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"16339\",\"selfCheckCounter\":\"6\",\"singleBatteryMaxTemperature\":\"66\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"83\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"650\",\"vehicleStatus\":0,\"vin\":\"VIN22345678912345\",\"voltage\":\"444\"}");
|
||||
// // 添加第三个JSON字符串
|
||||
// list.add("{\"absStatus\":1,\"accelerationPedal\":\"8\",\"availableBatteryCapacity\":\"90\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"3\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"43\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"9.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.536898\",\"longitude\":\"116.670799\",\"maximumDischargePower\":\"45\",\"maximumFeedbackPower\":\"68\",\"mcuStatus\":1,\"mileage\":12.94,\"motorControllerTemperature\":\"72\",\"motorCurrent\":\"2762\",\"motorSpeed\":\"25959\",\"motorTemperature\":\"13\",\"motorTorque\":\"467\",\"motorVoltage\":\"116\",\"msg\":\"VIN323456789123451701419209989116.670799039.536898072.00012.9400000052700043000287600000D80309.900720007013000002595946116002762000044970.68000045000080800007390003000400031000053000090000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"2876\",\"selfCheckCounter\":\"8\",\"singleBatteryMaxTemperature\":\"31\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"53\",\"singleBatteryMinVoltage\":\"4\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"739\",\"vehicleStatus\":1,\"vin\":\"VIN32345678912345\",\"voltage\":\"527\"}");
|
||||
//
|
||||
// for (String s : list) {
|
||||
// VehicleData vehicleData = JSONObject.parseObject(s, VehicleData.class);
|
||||
// new Thread(() -> {
|
||||
// // 执行车辆故障服务,并传递VehicleData对象
|
||||
// VehicleBreakdownIncidentServiceImpl vehicleBreakdownIncidentService = new VehicleBreakdownIncidentServiceImpl(faultLogFeign);
|
||||
// vehicleBreakdownIncidentService.execute(vehicleData);
|
||||
// try {
|
||||
// Thread.sleep(1000);
|
||||
// } catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }).start();
|
||||
// }
|
||||
// }
|
||||
//// for (String s : list) {
|
||||
//// new Thread(new Runnable() {
|
||||
//// @Override
|
||||
//// public void run() {
|
||||
//// VehicleData vehicleData = JSONObject.parseObject(s, VehicleData.class);
|
||||
//// VehicleBreakdownIncidentServiceImpl vehicleBreakdownIncidentService = new VehicleBreakdownIncidentServiceImpl(faultLogFeign);
|
||||
//// vehicleBreakdownIncidentService.execute(vehicleData);
|
||||
//// }
|
||||
//// }).start();
|
||||
//// }
|
||||
//
|
||||
////
|
||||
//// }
|
||||
//// @Test
|
||||
//// public void test(){
|
||||
//// CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();
|
||||
//// // 添加第一个JSON字符串
|
||||
//// list.add("{\"absStatus\":1,\"accelerationPedal\":\"5\",\"availableBatteryCapacity\":\"6\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"5\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"28\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.538996\",\"longitude\":\"116.670235\",\"maximumDischargePower\":\"15\",\"maximumFeedbackPower\":\"44\",\"mcuStatus\":1,\"mileage\":13.08,\"motorControllerTemperature\":\"90\",\"motorCurrent\":\"3374\",\"motorSpeed\":\"47648\",\"motorTemperature\":\"33\",\"motorTorque\":\"787\",\"motorVoltage\":\"296\",\"msg\":\"VIN123456789123451701419211998116.670235039.5389960180.0013.0800000028600028000133210000D505010.90900000476487870330000296003374000044959.44000015000013110002340004000300010000070000060000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44959.40,\"resistance\":\"13321\",\"selfCheckCounter\":\"13\",\"singleBatteryMaxTemperature\":\"1\",\"singleBatteryMaxVoltage\":\"4\",\"singleBatteryMinTemperature\":\"70\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"180.00\",\"totalBatteryCurrent\":\"11\",\"totalBatteryVoltage\":\"234\",\"vehicleStatus\":1,\"vin\":\"VIN12345678912345\",\"voltage\":\"286\"}");
|
||||
//// // 添加第二个JSON字符串
|
||||
//// list.add("{\"absStatus\":1,\"accelerationPedal\":\"4\",\"availableBatteryCapacity\":\"86\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"7\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"41\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"10.40\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.537432\",\"longitude\":\"116.67038\",\"maximumDischargePower\":\"51\",\"maximumFeedbackPower\":\"0\",\"mcuStatus\":1,\"mileage\":12.98,\"motorControllerTemperature\":\"30\",\"motorCurrent\":\"12807\",\"motorSpeed\":\"32871\",\"motorTemperature\":\"63\",\"motorTorque\":\"508\",\"motorVoltage\":\"206\",\"msg\":\"VIN223456789123451701419211000116.670380039.537432072.00012.9800000044400041000163390000D407010.40300000328715080630000206001280700044970.00000051000060800006500003000300066000083000086000001111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"16339\",\"selfCheckCounter\":\"6\",\"singleBatteryMaxTemperature\":\"66\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"83\",\"singleBatteryMinVoltage\":\"3\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"650\",\"vehicleStatus\":0,\"vin\":\"VIN22345678912345\",\"voltage\":\"444\"}");
|
||||
//// // 添加第三个JSON字符串
|
||||
//// list.add("{\"absStatus\":1,\"accelerationPedal\":\"8\",\"availableBatteryCapacity\":\"90\",\"batteryInsulationStatus\":1,\"batteryLevel\":50000,\"batteryStatus\":1,\"brakePedal\":\"3\",\"chargingEnergyStorageStatus\":1,\"chargingStatus\":1,\"chgStatus\":1,\"current\":\"43\",\"dcdcStatus\":1,\"driveMotorStatus\":1,\"easStatus\":1,\"epsStatus\":1,\"fuelConsumptionRate\":\"9.90\",\"gear\":\"D\",\"heatingStatus\":1,\"latitude\":\"39.536898\",\"longitude\":\"116.670799\",\"maximumDischargePower\":\"45\",\"maximumFeedbackPower\":\"68\",\"mcuStatus\":1,\"mileage\":12.94,\"motorControllerTemperature\":\"72\",\"motorCurrent\":\"2762\",\"motorSpeed\":\"25959\",\"motorTemperature\":\"13\",\"motorTorque\":\"467\",\"motorVoltage\":\"116\",\"msg\":\"VIN323456789123451701419209989116.670799039.536898072.00012.9400000052700043000287600000D80309.900720007013000002595946116002762000044970.68000045000080800007390003000400031000053000090000011111111111111111\",\"operatingStatus\":1,\"positionStatus\":1,\"ptcStatus\":1,\"remainingBattery\":44970.30,\"resistance\":\"2876\",\"selfCheckCounter\":\"8\",\"singleBatteryMaxTemperature\":\"31\",\"singleBatteryMaxVoltage\":\"3\",\"singleBatteryMinTemperature\":\"53\",\"singleBatteryMinVoltage\":\"4\",\"socStatus\":1,\"speed\":\"72.00\",\"totalBatteryCurrent\":\"8\",\"totalBatteryVoltage\":\"739\",\"vehicleStatus\":1,\"vin\":\"VIN32345678912345\",\"voltage\":\"527\"}");
|
||||
//// ExecutorService executorService = Executors.newFixedThreadPool(list.size());
|
||||
//// for (String s : list) {
|
||||
//// executorService.submit(() ->{
|
||||
//// VehicleData vehicleData = JSONObject.parseObject(s, VehicleData.class);
|
||||
//// VehicleBreakdownIncidentServiceImpl vehicleBreakdownIncidentService = new VehicleBreakdownIncidentServiceImpl(faultLog -> {
|
||||
//// });
|
||||
//// vehicleBreakdownIncidentService.execute(vehicleData);
|
||||
//// });
|
||||
//// }
|
||||
//// executorService.shutdown();
|
||||
//// }
|
||||
//
|
||||
//}
|
|
@ -0,0 +1,85 @@
|
|||
package com.fivegroup.fault.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.fault.domain.FaultLog;
|
||||
import com.fivegroup.fault.domain.VehicleData;
|
||||
import com.fivegroup.fault.domain.req.FaultCodeReq;
|
||||
import com.fivegroup.fault.mapper.FaultLogMapper;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: car-server
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-12-04 21:35
|
||||
**/
|
||||
@Log4j2
|
||||
@Component
|
||||
public class FaultConfig {
|
||||
@Autowired
|
||||
private FaultLogMapper faultLogMapper;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@RabbitListener(queuesToDeclare = {@Queue(name = "faultQueue")})
|
||||
public void FaultAccept(String msg, Channel channel, Message message){
|
||||
String messageId = message.getMessageProperties().getMessageId();
|
||||
try {
|
||||
Long faultQueue = redisService.redisTemplate.opsForSet().add("faultQueue", messageId);
|
||||
if(faultQueue==1){
|
||||
VehicleData vehicleData = JSONObject.parseObject(msg, VehicleData.class);
|
||||
List<FaultCodeReq> faultCodeReqList = redisService.getCacheList("faultCodeReqList");
|
||||
ArrayList<FaultLog> faultLogs = new ArrayList<>();
|
||||
for (FaultCodeReq faultCodeReq : faultCodeReqList) {
|
||||
Integer faultSeat = faultCodeReq.getFaultSeat();
|
||||
String carVin = vehicleData.getVin();
|
||||
long time = vehicleData.getCreateTime().getTime();
|
||||
if(Integer.parseInt(msg.substring(faultSeat,faultSeat+1))==0){
|
||||
FaultLog faultLog = redisService.getCacheObject("faultLog" + carVin + faultCodeReq.getFaultTypeName());
|
||||
if(faultLog==null){
|
||||
FaultLog faultLog1 = new FaultLog();
|
||||
faultLog1.setFaultBh(faultCodeReq.getFaultBh());
|
||||
faultLog1.setCarVin(faultCodeReq.getCarVin());
|
||||
faultLog1.setFaultStartTime(new Date(time));
|
||||
redisService.setCacheObject("faultLog"+carVin+faultCodeReq.getFaultTypeName(),faultLog1);
|
||||
faultLogs.add(faultLog1);
|
||||
}
|
||||
}else {
|
||||
FaultLog faultLog=redisService.getCacheObject("faultLog"+carVin+faultCodeReq.getFaultTypeName());
|
||||
if(faultLog!=null){
|
||||
faultLog.setFaultEndTime(new Date(time));
|
||||
redisService.deleteObject("faultLog"+carVin+faultCodeReq.getFaultTypeName());
|
||||
}
|
||||
}
|
||||
}
|
||||
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
|
||||
log.info("队列名称:{},队列参数:{},消费成功。。。","faultQueue",msg);
|
||||
}else{
|
||||
log.info("队列名称:{},队列参数:{},消费重复。。。","faultQueue",msg);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
try{
|
||||
log.info("队列名称:{},队列参数:{},消费异常。。。","faultQueue",msg);
|
||||
try {
|
||||
channel.basicReject(message.getMessageProperties().getDeliveryTag(),true);
|
||||
}catch (IOException ioException){
|
||||
ioException.printStackTrace();
|
||||
}
|
||||
}catch (Exception exception){
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,8 +48,8 @@ public class FaultCode {
|
|||
/**
|
||||
* 故障位
|
||||
*/
|
||||
@NotEmpty(message = "故障位不能为空")
|
||||
private String faultSeat;
|
||||
@NotNull(message = "故障位不能为空")
|
||||
private Integer faultSeat;
|
||||
/**
|
||||
* 故障值
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.fivegroup.fault.domain;
|
||||
|
||||
/**
|
||||
* @program: car-server
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-12-03 20:07
|
||||
**/
|
||||
public class VehicleConstant {
|
||||
public static final String DATA_PACK_SEPARATOR = "#$&*";
|
||||
public static final String MSG_START = "7E";
|
||||
public static final String MSG_END = "7E";
|
||||
public final static String START_VIN_VIN_SUF="START_VIN:";
|
||||
public final static String START_VIN_SUCCESS_SUF="SUCCESS_VIN";
|
||||
public final static String VEHICLE_MSG_SUF = "VEHICLE_MSG:";
|
||||
public final static String VEHICLE_START_SUF = "VEHICLE_START:";
|
||||
public final static String VEHICLE_STOP_SUF = "VEHICLE_STOP:";
|
||||
public final static String NETTY_CONNECT = "CONNECT";
|
||||
public final static String NETTY_WILL_CLOSE = "WILL_CLOSE:";
|
||||
public final static String NETTY_CLOSE = "CLOSE";
|
||||
public final static String VIN_REGEX = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{17}$";
|
||||
public final static String VEHICLE_BASE_FAULT = "vehicle_base";
|
||||
public final static String VEHICLE_PARTS_FAULT = "vehicle_parts";
|
||||
public final static String VEHICLE_BATTERY_FAULT = "vehicle_battery";
|
||||
}
|
|
@ -4,11 +4,15 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fivegroup.fault.mapper.FaultLogMapper">
|
||||
<insert id="addLog">
|
||||
INSERT INTO `car`.`t_fault_log` ( `fault_bh`, `car_vin`, `fault_start_time`, `fault_end_time`, `fault_detail`)
|
||||
INSERT INTO `car`.`t_fault_log` (`fault_bh`, `car_vin`, `fault_start_time`, `fault_end_time`, `fault_detail`)
|
||||
VALUES ( #{faultBh}, #{carVin}, #{faultStartTime}, #{faultEndTime}, #{faultDetail})
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- <insert id="addLog">-->
|
||||
<!-- INSERT INTO `car`.`t_fault_log` ( `fault_bh`, `car_vin`, `fault_start_time`, `fault_end_time`, `fault_detail`)-->
|
||||
<!-- VALUES <foreach collection="list" item="s" separator=",">-->
|
||||
<!-- ( #{s.faultBh}, #{s.carVin}, #{s.faultStartTime}, #{s.faultEndTime}, #{s.faultDetail})-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </insert>-->
|
||||
<select id="findFaultLogById" resultType="com.fivegroup.fault.domain.FaultLog">
|
||||
select * from t_fault_log where fault_log_id=#{faultLogId}
|
||||
</select>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9223
|
||||
port: 9224
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
Loading…
Reference in New Issue