parent
a144a4d96a
commit
08acad4531
|
@ -8,6 +8,9 @@ import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@ -19,5 +22,6 @@ public interface RemoteBreakService {
|
||||||
@PostMapping("logAdd")
|
@PostMapping("logAdd")
|
||||||
public Result logAdd(@RequestBody BreakLog breakLog);
|
public Result logAdd(@RequestBody BreakLog breakLog);
|
||||||
|
|
||||||
|
@GetMapping("/checkIfBreakLogExists/{breakCode}/{breakVin}")
|
||||||
|
public ResponseEntity<Boolean> checkIfBreakLogExists(@PathVariable("breakCode") String breakCode, @PathVariable("breakVin") String breakVin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.zhilian.business.remote.RemoteBreakService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
|
@ -15,8 +17,14 @@ public class RemoteBreakFallbackFactory implements FallbackFactory<RemoteBreakSe
|
||||||
return new RemoteBreakService() {
|
return new RemoteBreakService() {
|
||||||
@Override
|
@Override
|
||||||
public Result logAdd(BreakLog breakLog) {
|
public Result logAdd(BreakLog breakLog) {
|
||||||
log.error("故障日志服务调用失败");
|
log.error("故障日志服务调用失败");
|
||||||
return Result.error("故障日志服务调用失败");
|
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Boolean> checkIfBreakLogExists(String breakCode, String breakVin) {
|
||||||
|
log.error("根据VIN和故障码查询服务调用失败");
|
||||||
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// return new RemoteBreakService() {
|
// return new RemoteBreakService() {
|
||||||
|
|
|
@ -5,10 +5,8 @@ import com.zhilian.business.service.BreakLogService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import io.swagger.models.auth.In;
|
import io.swagger.models.auth.In;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -69,6 +67,16 @@ public class BreakLogController {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/checkIfBreakLogExists/{breakCode}/{breakVin}")
|
||||||
|
public ResponseEntity <Boolean> checkIfBreakLogExists(@PathVariable("breakCode") String breakCode,@PathVariable("breakVin") String breakVin){
|
||||||
|
boolean exists =breakLogService.checkIfBreakLogExists(breakCode,breakVin);
|
||||||
|
return ResponseEntity.ok(exists);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.zhilian.business.domain.BreakLog;
|
import com.zhilian.business.domain.BreakLog;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -20,4 +21,12 @@ public interface BreakLogMapper {
|
||||||
int updLog(BreakLog breakLog);
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
int logDel(Integer breakLogId);
|
int logDel(Integer breakLogId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BreakLog findByBreakCodeAndBreakVin(@Param("breakCode") String breakCode, @Param("breakVin") String breakVin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,12 @@ public interface BreakLogService {
|
||||||
int updLog(BreakLog breakLog);
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
int logDel(Integer breakLogId);
|
int logDel(Integer breakLogId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkIfBreakLogExists(String breakCode, String breakVin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,4 +80,17 @@ public class BreakLogServiceImpl implements BreakLogService {
|
||||||
return breakLogMapper.logDel(breakLogId);
|
return breakLogMapper.logDel(breakLogId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkIfBreakLogExists(String breakCode, String breakVin) {
|
||||||
|
BreakLog breakLog =breakLogMapper.findByBreakCodeAndBreakVin(breakCode,breakVin);
|
||||||
|
return breakLog!=null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,19 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.zhilian.business.mapper.BreakLogMapper">
|
<mapper namespace="com.zhilian.business.mapper.BreakLogMapper">
|
||||||
|
|
||||||
|
<!-- 查询-->
|
||||||
|
<resultMap type="com.zhilian.business.domain.BreakLog" id="BaseResultMap">
|
||||||
|
<result property="breakLogId" column="break_log_id"/>
|
||||||
|
<result property="breakCode" column="break_code"/>
|
||||||
|
<result property="breakVin" column="break_vin"/>
|
||||||
|
<result property="breakType" column="break_time"/>
|
||||||
|
<result property="breakTime" column="break_type"/>
|
||||||
|
<result property="breakDate" column="break_date"/>
|
||||||
|
<result property="breakState" column="break_state"/>
|
||||||
|
<result property="breakDel" column="break_del"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<insert id="logAdd">
|
<insert id="logAdd">
|
||||||
|
|
||||||
INSERT INTO `zhilian-business`.`business_break_log`
|
INSERT INTO `zhilian-business`.`business_break_log`
|
||||||
|
@ -25,4 +38,10 @@
|
||||||
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
||||||
select * from business_break_log where break_del = 0
|
select * from business_break_log where break_del = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据故障码和vin判断数据库中是否有数据-->
|
||||||
|
<select id="findByBreakCodeAndBreakVin" resultMap="BaseResultMap">
|
||||||
|
select * from business_break_log where break_code =#{breakCode} and break_vin =#{breakVin} and break_del =0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -22,9 +22,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
@EnableMyFeignClients(basePackages = {"com.zhilian.business.remote","com.zhilian.common.system.remote"})
|
@EnableMyFeignClients(basePackages = {"com.zhilian.business.remote","com.zhilian.common.system.remote"})
|
||||||
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//com.zhilian.business.remote.factory.RemoteBreakFallbackFactory
|
|
||||||
//com.zhilian.business.remote.factory.RemoteFenceFallbackFactory
|
|
||||||
//com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory
|
|
||||||
public class ZhiLianResolverApplication {
|
public class ZhiLianResolverApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(ZhiLianResolverApplication.class,args);
|
SpringApplication.run(ZhiLianResolverApplication.class,args);
|
||||||
|
|
|
@ -90,34 +90,11 @@ public class ResolverMqttMsg {
|
||||||
ResolverEventService resolverEventService =SpringUtils.getBean(stringEvent);
|
ResolverEventService resolverEventService =SpringUtils.getBean(stringEvent);
|
||||||
resolverEventService.execute(vehicleData);
|
resolverEventService.execute(vehicleData);
|
||||||
|
|
||||||
// if(isAnyFieldZero(vehicleData)){
|
|
||||||
// malfunctionEventService.execute(vehicleData);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("字符串:{}",str);
|
log.info("字符串:{}",str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// private boolean isAnyFieldZero(ResolverReportData resolverReportData){
|
|
||||||
// return resolverReportData.getChargingStatus() == 0 ||
|
|
||||||
// resolverReportData.getOperatingStatus() == 0 ||
|
|
||||||
// resolverReportData.getSocStatus() == 0 ||
|
|
||||||
// resolverReportData.getVehicleStatus() == 0 ||
|
|
||||||
// resolverReportData.getChargingEnergyStorageStatus() == 0 ||
|
|
||||||
// resolverReportData.getDriveMotorStatus() == 0 ||
|
|
||||||
// resolverReportData.getPositionStatus() == 0 ||
|
|
||||||
// resolverReportData.getEasStatus() == 0 ||
|
|
||||||
// resolverReportData.getPtcStatus() == 0 ||
|
|
||||||
// resolverReportData.getEpsStatus() == 0 ||
|
|
||||||
// resolverReportData.getAbsStatus() == 0 ||
|
|
||||||
// resolverReportData.getMcuStatus() == 0 ||
|
|
||||||
// resolverReportData.getHeatingStatus() == 0 ||
|
|
||||||
// resolverReportData.getBatteryStatus() == 0 ||
|
|
||||||
// resolverReportData.getBatteryInsulationStatus() == 0 ||
|
|
||||||
// resolverReportData.getDcdcStatus() == 0 ||
|
|
||||||
// resolverReportData.getChgStatus() == 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deliveryComplete(IMqttDeliveryToken token) {
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
log.info("消息已成功投递:{}",token);
|
log.info("消息已成功投递:{}",token);
|
||||||
|
@ -177,15 +154,11 @@ public class ResolverMqttMsg {
|
||||||
String tim =str.substring(18,31);
|
String tim =str.substring(18,31);
|
||||||
long timestamp = Long.parseLong(tim);
|
long timestamp = Long.parseLong(tim);
|
||||||
|
|
||||||
log.info("时间串=="+tim);
|
|
||||||
Date date = new Date(timestamp);
|
Date date = new Date(timestamp);
|
||||||
System.out.println("时间"+date);
|
|
||||||
vehicleData.setCreateTime(date);
|
vehicleData.setCreateTime(date);
|
||||||
log.info("shijian =="+vehicleData.getCreateTime());
|
|
||||||
|
|
||||||
//经度
|
//经度
|
||||||
String lt = str.substring(31,42);
|
String lt = str.substring(31,42);
|
||||||
log.info("经度串==:{}",lt);
|
|
||||||
// 如果末尾是零,则舍去
|
// 如果末尾是零,则舍去
|
||||||
int endIndex = lt.length() - 1;
|
int endIndex = lt.length() - 1;
|
||||||
while (lt.charAt(endIndex) == '0'){
|
while (lt.charAt(endIndex) == '0'){
|
||||||
|
@ -194,11 +167,9 @@ public class ResolverMqttMsg {
|
||||||
|
|
||||||
String longitude = lt.substring(0, endIndex + 1);
|
String longitude = lt.substring(0, endIndex + 1);
|
||||||
vehicleData.setLongitude(longitude);
|
vehicleData.setLongitude(longitude);
|
||||||
log.info("经度 =="+vehicleData.getLongitude());
|
|
||||||
|
|
||||||
//维度
|
//维度
|
||||||
String latitudeIndex =str.substring(42,52);
|
String latitudeIndex =str.substring(42,52);
|
||||||
log.info("维度串==:{}",latitudeIndex);
|
|
||||||
int endIndexT = latitudeIndex.length() - 1;
|
int endIndexT = latitudeIndex.length() - 1;
|
||||||
while (latitudeIndex.charAt(endIndexT) == '0'){
|
while (latitudeIndex.charAt(endIndexT) == '0'){
|
||||||
endIndexT--;
|
endIndexT--;
|
||||||
|
@ -206,303 +177,231 @@ public class ResolverMqttMsg {
|
||||||
|
|
||||||
String latitude = latitudeIndex.substring(0, endIndexT + 1);
|
String latitude = latitudeIndex.substring(0, endIndexT + 1);
|
||||||
vehicleData.setLatitude(latitude);
|
vehicleData.setLatitude(latitude);
|
||||||
log.info("维度==:{}",vehicleData.getLatitude());
|
|
||||||
|
|
||||||
//速度speed
|
//速度speed
|
||||||
String speed =str.substring(52,58);
|
String speed =str.substring(52,58);
|
||||||
log.info("速度==:{}",speed);
|
|
||||||
vehicleData.setSpeed(speed);
|
vehicleData.setSpeed(speed);
|
||||||
log.info("速度==:{}",vehicleData.getSpeed());
|
|
||||||
|
|
||||||
//里程
|
//里程
|
||||||
BigDecimal mileage= new BigDecimal(str.substring(58,69));
|
BigDecimal mileage= new BigDecimal(str.substring(58,69));
|
||||||
log.info("里程==:{}",mileage);
|
|
||||||
mileage=mileage.stripTrailingZeros();
|
mileage=mileage.stripTrailingZeros();
|
||||||
vehicleData.setMileage(mileage);
|
vehicleData.setMileage(mileage);
|
||||||
log.info("里程==:{}",vehicleData.getMileage());
|
|
||||||
|
|
||||||
//总电压
|
//总电压
|
||||||
String voltage =str.substring(69,75);
|
String voltage =str.substring(69,75);
|
||||||
log.info("总电压==:{}",voltage);
|
|
||||||
while (voltage.endsWith("0")) {
|
while (voltage.endsWith("0")) {
|
||||||
voltage = voltage.substring(0, voltage.length() - 1); // 去除末尾的零
|
voltage = voltage.substring(0, voltage.length() - 1); // 去除末尾的零
|
||||||
}
|
}
|
||||||
vehicleData.setVoltage(voltage);
|
vehicleData.setVoltage(voltage);
|
||||||
log.info("总电压==:{}",vehicleData.getVoltage());
|
|
||||||
|
|
||||||
//总电流
|
//总电流
|
||||||
String current =str.substring(75,80);
|
String current =str.substring(75,80);
|
||||||
log.info("总电流==:{}",current);
|
|
||||||
while (current.endsWith("0")){
|
while (current.endsWith("0")){
|
||||||
current=current.substring(0,current.length()-1);
|
current=current.substring(0,current.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setCurrent(current);
|
vehicleData.setCurrent(current);
|
||||||
log.info("总电流==:{}",vehicleData.getCurrent());
|
|
||||||
|
|
||||||
//绝缘电阻 resistance
|
//绝缘电阻 resistance
|
||||||
String res =str.substring(80,89);
|
String res =str.substring(80,89);
|
||||||
log.info("绝缘电阻==:{}",res);
|
|
||||||
String resistance = res.substring(0, 5);
|
String resistance = res.substring(0, 5);
|
||||||
vehicleData.setResistance(resistance);
|
vehicleData.setResistance(resistance);
|
||||||
log.info("绝缘电阻==:{}",vehicleData.getResistance());
|
|
||||||
|
|
||||||
//档位
|
//档位
|
||||||
String gear =str.substring(89,90);
|
String gear =str.substring(89,90);
|
||||||
log.info("档位==:{}",gear);
|
|
||||||
vehicleData.setGear(gear);
|
vehicleData.setGear(gear);
|
||||||
log.info("档位==:{}",vehicleData.getGear());
|
|
||||||
|
|
||||||
//accelerationPedal 加速踏板行程值
|
//accelerationPedal 加速踏板行程值
|
||||||
String accelerationPedal =str.substring(90,91);
|
String accelerationPedal =str.substring(90,91);
|
||||||
log.info("加速踏板行程值==:{}",accelerationPedal);
|
|
||||||
vehicleData.setAccelerationPedal(accelerationPedal);
|
vehicleData.setAccelerationPedal(accelerationPedal);
|
||||||
log.info("加速踏板行程值==:{}",vehicleData.getAccelerationPedal());
|
|
||||||
|
|
||||||
//brakePedal 制动踏板行程值
|
//brakePedal 制动踏板行程值
|
||||||
String brakePedal =str.substring(92,93);
|
String brakePedal =str.substring(92,93);
|
||||||
log.info("制动踏板行程值==:{}",brakePedal);
|
|
||||||
vehicleData.setBrakePedal(brakePedal);
|
vehicleData.setBrakePedal(brakePedal);
|
||||||
log.info("制动踏板行程值==:{}",vehicleData.getBrakePedal());
|
|
||||||
|
|
||||||
//fuelConsumptionRate 燃料消耗率
|
//fuelConsumptionRate 燃料消耗率
|
||||||
String fuelConsumptionRate =str.substring(94,99);
|
String fuelConsumptionRate =str.substring(94,99);
|
||||||
log.info("燃料消耗率==:{}",fuelConsumptionRate);
|
|
||||||
vehicleData.setFuelConsumptionRate(fuelConsumptionRate);
|
vehicleData.setFuelConsumptionRate(fuelConsumptionRate);
|
||||||
log.info("燃料消耗率==:{}",vehicleData.getFuelConsumptionRate());
|
|
||||||
|
|
||||||
//motorControllerTemperature 电机控制器温度
|
//motorControllerTemperature 电机控制器温度
|
||||||
String motorControllerTemperature =str.substring(99,105);
|
String motorControllerTemperature =str.substring(99,105);
|
||||||
while (motorControllerTemperature.endsWith("0")){
|
while (motorControllerTemperature.endsWith("0")){
|
||||||
motorControllerTemperature=motorControllerTemperature.substring(0,motorControllerTemperature.length()-1);
|
motorControllerTemperature=motorControllerTemperature.substring(0,motorControllerTemperature.length()-1);
|
||||||
}
|
}
|
||||||
log.info("电机控制器温度==:{}",motorControllerTemperature);
|
|
||||||
vehicleData.setMotorControllerTemperature(motorControllerTemperature);
|
vehicleData.setMotorControllerTemperature(motorControllerTemperature);
|
||||||
log.info("电机控制器温度==:{}",vehicleData.getMotorControllerTemperature());
|
|
||||||
|
|
||||||
//motorSpeed 电机转速
|
//motorSpeed 电机转速
|
||||||
String motorSpeed =str.substring(105,110);
|
String motorSpeed =str.substring(105,110);
|
||||||
log.info("电机转速==:{}",motorSpeed);
|
|
||||||
vehicleData.setMotorSpeed(motorSpeed);
|
vehicleData.setMotorSpeed(motorSpeed);
|
||||||
log.info("电机转速==:{}",vehicleData.getMotorSpeed());
|
|
||||||
|
|
||||||
//motorTorque 电机转矩
|
//motorTorque 电机转矩
|
||||||
String motorTorque =str.substring(110,114);
|
String motorTorque =str.substring(110,114);
|
||||||
log.info("电机转矩==:{}",motorTorque);
|
|
||||||
while (motorTorque.endsWith("0")){
|
while (motorTorque.endsWith("0")){
|
||||||
motorTorque=motorTorque.substring(0,motorTorque.length()-1);
|
motorTorque=motorTorque.substring(0,motorTorque.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMotorTorque(motorTorque);
|
vehicleData.setMotorTorque(motorTorque);
|
||||||
log.info("电机转矩==:{}",vehicleData.getMotorTorque());
|
|
||||||
|
|
||||||
|
|
||||||
//motorTemperature 电机温度
|
//motorTemperature 电机温度
|
||||||
String motorTemperature =str.substring(114,120);
|
String motorTemperature =str.substring(114,120);
|
||||||
log.info("电机温度==:{}",motorTemperature);
|
|
||||||
while (motorTemperature.endsWith("0")){
|
while (motorTemperature.endsWith("0")){
|
||||||
motorTemperature=motorTemperature.substring(0,motorTemperature.length()-1);
|
motorTemperature=motorTemperature.substring(0,motorTemperature.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMotorTemperature(motorTemperature);
|
vehicleData.setMotorTemperature(motorTemperature);
|
||||||
log.info("电机温度==:{}",vehicleData.getMotorTemperature());
|
|
||||||
|
|
||||||
//motorVoltage 电机电压
|
//motorVoltage 电机电压
|
||||||
String motorVoltage =str.substring(120,125);
|
String motorVoltage =str.substring(120,125);
|
||||||
log.info("电机电压==:{}",motorVoltage);
|
|
||||||
while (motorVoltage.endsWith("0")){
|
while (motorVoltage.endsWith("0")){
|
||||||
motorVoltage=motorVoltage.substring(0,motorVoltage.length()-1);
|
motorVoltage=motorVoltage.substring(0,motorVoltage.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMotorVoltage(motorVoltage);
|
vehicleData.setMotorVoltage(motorVoltage);
|
||||||
log.info("电机电压==:{}",vehicleData.getMotorVoltage());
|
|
||||||
|
|
||||||
//motorCurrent 电机电流
|
//motorCurrent 电机电流
|
||||||
String motorCurrent =str.substring(125,133);
|
String motorCurrent =str.substring(125,133);
|
||||||
log.info("电机电流==:{}",motorCurrent);
|
|
||||||
while (motorCurrent.endsWith("0")){
|
while (motorCurrent.endsWith("0")){
|
||||||
motorCurrent=motorCurrent.substring(0,motorCurrent.length()-1);
|
motorCurrent=motorCurrent.substring(0,motorCurrent.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMotorCurrent(motorCurrent);
|
vehicleData.setMotorCurrent(motorCurrent);
|
||||||
log.info("电机电流==:{}",vehicleData.getMotorCurrent());
|
|
||||||
|
|
||||||
//remainingBattery 动力电池剩余电量SOC
|
//remainingBattery 动力电池剩余电量SOC
|
||||||
BigDecimal remainingBattery = new BigDecimal(str.substring(133,138));
|
BigDecimal remainingBattery = new BigDecimal(str.substring(133,138));
|
||||||
log.info("动力电池剩余电量SOC==:{}",remainingBattery);
|
|
||||||
vehicleData.setRemainingBattery(remainingBattery);
|
vehicleData.setRemainingBattery(remainingBattery);
|
||||||
log.info("动力电池剩余电量SOC==:{}",vehicleData.getRemainingBattery());
|
|
||||||
|
|
||||||
//maximumFeedbackPower 当前状态允许的最大反馈功率
|
//maximumFeedbackPower 当前状态允许的最大反馈功率
|
||||||
String maximumFeedbackPower =str.substring(139,144);
|
String maximumFeedbackPower =str.substring(139,144);
|
||||||
log.info("当前状态允许的最大反馈功率==:{}",maximumFeedbackPower);
|
|
||||||
while (maximumFeedbackPower.endsWith("0")){
|
while (maximumFeedbackPower.endsWith("0")){
|
||||||
maximumFeedbackPower=maximumFeedbackPower.substring(0,maximumFeedbackPower.length()-1);
|
maximumFeedbackPower=maximumFeedbackPower.substring(0,maximumFeedbackPower.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMaximumFeedbackPower(maximumFeedbackPower);
|
vehicleData.setMaximumFeedbackPower(maximumFeedbackPower);
|
||||||
log.info("当前状态允许的最大反馈功率==:{}",vehicleData.getMaximumFeedbackPower());
|
|
||||||
|
|
||||||
//maximumDischargePower 当前状态允许最大放电功率
|
//maximumDischargePower 当前状态允许最大放电功率
|
||||||
String maximumDischargePower =str.substring(145,151);
|
String maximumDischargePower =str.substring(145,151);
|
||||||
log.info("当前状态允许最大放电功率:{}",maximumDischargePower);
|
|
||||||
while (maximumDischargePower.endsWith("0")){
|
while (maximumDischargePower.endsWith("0")){
|
||||||
maximumDischargePower=maximumDischargePower.substring(0,maximumDischargePower.length()-1);
|
maximumDischargePower=maximumDischargePower.substring(0,maximumDischargePower.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setMaximumDischargePower(maximumDischargePower);
|
vehicleData.setMaximumDischargePower(maximumDischargePower);
|
||||||
log.info("当前状态允许最大放电功率:{}",vehicleData.getMaximumDischargePower());
|
|
||||||
|
|
||||||
//selfCheckCounter BMS自检计数器
|
//selfCheckCounter BMS自检计数器
|
||||||
String selfCheckCounter =str.substring(151,153);
|
String selfCheckCounter =str.substring(151,153);
|
||||||
String selfCheckCounterReplace = selfCheckCounter.replace("0", "");
|
String selfCheckCounterReplace = selfCheckCounter.replace("0", "");
|
||||||
log.info("BMS自检计数器==:{}",selfCheckCounter);
|
|
||||||
vehicleData.setSelfCheckCounter(selfCheckCounterReplace);
|
vehicleData.setSelfCheckCounter(selfCheckCounterReplace);
|
||||||
log.info("BMS自检计数器==:{}",vehicleData.getSelfCheckCounter());
|
|
||||||
|
|
||||||
//totalBatteryCurrent 动力电池充放电电流
|
//totalBatteryCurrent 动力电池充放电电流
|
||||||
String totalBatteryCurrent =str.substring(153,158);
|
String totalBatteryCurrent =str.substring(153,158);
|
||||||
log.info("BMS自检计数器==:{}",totalBatteryCurrent);
|
|
||||||
while (totalBatteryCurrent.endsWith("0")){
|
while (totalBatteryCurrent.endsWith("0")){
|
||||||
totalBatteryCurrent=totalBatteryCurrent.substring(0,totalBatteryCurrent.length()-1);
|
totalBatteryCurrent=totalBatteryCurrent.substring(0,totalBatteryCurrent.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setTotalBatteryCurrent(totalBatteryCurrent);
|
vehicleData.setTotalBatteryCurrent(totalBatteryCurrent);
|
||||||
log.info("BMS自检计数器==:{}",vehicleData.getTotalBatteryCurrent());
|
|
||||||
|
|
||||||
//totalBatteryVoltage 动力电池负载端总电压V3
|
//totalBatteryVoltage 动力电池负载端总电压V3
|
||||||
String totalBatteryVoltage =str.substring(158,164);
|
String totalBatteryVoltage =str.substring(158,164);
|
||||||
log.info("动力电池负载端总电压V3==:{}",totalBatteryVoltage);
|
|
||||||
while (totalBatteryVoltage.endsWith("0")){
|
while (totalBatteryVoltage.endsWith("0")){
|
||||||
totalBatteryVoltage=totalBatteryVoltage.substring(0,totalBatteryVoltage.length()-1);
|
totalBatteryVoltage=totalBatteryVoltage.substring(0,totalBatteryVoltage.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setTotalBatteryVoltage(totalBatteryVoltage);
|
vehicleData.setTotalBatteryVoltage(totalBatteryVoltage);
|
||||||
log.info("动力电池负载端总电压V3==:{}",vehicleData.getTotalBatteryVoltage());
|
|
||||||
|
|
||||||
//singleBatteryMaxVoltage 单次最大电压
|
//singleBatteryMaxVoltage 单次最大电压
|
||||||
String singleBatteryMaxVoltage =str.substring(164,168);
|
String singleBatteryMaxVoltage =str.substring(164,168);
|
||||||
log.info("单次最大电压==:{}",singleBatteryMaxVoltage);
|
|
||||||
while (singleBatteryMaxVoltage.endsWith("0")){
|
while (singleBatteryMaxVoltage.endsWith("0")){
|
||||||
singleBatteryMaxVoltage=singleBatteryMaxVoltage.substring(0,singleBatteryMaxVoltage.length()-1);
|
singleBatteryMaxVoltage=singleBatteryMaxVoltage.substring(0,singleBatteryMaxVoltage.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setSingleBatteryMaxVoltage(singleBatteryMaxVoltage);
|
vehicleData.setSingleBatteryMaxVoltage(singleBatteryMaxVoltage);
|
||||||
log.info("单次最大电压==:{}",vehicleData.getSingleBatteryMaxVoltage());
|
|
||||||
|
|
||||||
//singleBatteryMinVoltage 单体电池最低电压
|
//singleBatteryMinVoltage 单体电池最低电压
|
||||||
String singleBatteryMinVoltage =str.substring(168,172);
|
String singleBatteryMinVoltage =str.substring(168,172);
|
||||||
log.info("单体电池最低电压==:{}",singleBatteryMinVoltage);
|
|
||||||
while (singleBatteryMinVoltage.endsWith("0")){
|
while (singleBatteryMinVoltage.endsWith("0")){
|
||||||
singleBatteryMinVoltage=singleBatteryMinVoltage.substring(0,singleBatteryMinVoltage.length()-1);
|
singleBatteryMinVoltage=singleBatteryMinVoltage.substring(0,singleBatteryMinVoltage.length()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicleData.setSingleBatteryMinVoltage(singleBatteryMinVoltage);
|
vehicleData.setSingleBatteryMinVoltage(singleBatteryMinVoltage);
|
||||||
log.info("单体电池最低电压==:{}",vehicleData.getSingleBatteryMinVoltage());
|
|
||||||
|
|
||||||
//singleBatteryMaxTemperature 单体电池最高温度
|
//singleBatteryMaxTemperature 单体电池最高温度
|
||||||
String singleBatteryMaxTemperature =str.substring(172,178);
|
String singleBatteryMaxTemperature =str.substring(172,178);
|
||||||
log.info("单体电池最高温度==:{}",singleBatteryMaxTemperature);
|
|
||||||
while (singleBatteryMaxTemperature.endsWith("0")){
|
while (singleBatteryMaxTemperature.endsWith("0")){
|
||||||
singleBatteryMaxTemperature=singleBatteryMaxTemperature.substring(0,singleBatteryMaxTemperature.length()-1);
|
singleBatteryMaxTemperature=singleBatteryMaxTemperature.substring(0,singleBatteryMaxTemperature.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setSingleBatteryMaxTemperature(singleBatteryMaxTemperature);
|
vehicleData.setSingleBatteryMaxTemperature(singleBatteryMaxTemperature);
|
||||||
log.info("单体电池最高温度==:{}",vehicleData.getSingleBatteryMaxTemperature());
|
|
||||||
|
|
||||||
//singleBatteryMinTemperature 单体电池最低温度
|
//singleBatteryMinTemperature 单体电池最低温度
|
||||||
String singleBatteryMinTemperature =str.substring(178,184);
|
String singleBatteryMinTemperature =str.substring(178,184);
|
||||||
log.info("单体电池最低温度==:{}",singleBatteryMinTemperature);
|
|
||||||
while (singleBatteryMinTemperature.endsWith("0")){
|
while (singleBatteryMinTemperature.endsWith("0")){
|
||||||
singleBatteryMinTemperature=singleBatteryMinTemperature.substring(0,singleBatteryMinTemperature.length()-1);
|
singleBatteryMinTemperature=singleBatteryMinTemperature.substring(0,singleBatteryMinTemperature.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setSingleBatteryMinTemperature(singleBatteryMinTemperature);
|
vehicleData.setSingleBatteryMinTemperature(singleBatteryMinTemperature);
|
||||||
log.info("单体电池最低温度==:{}",vehicleData.getSingleBatteryMinTemperature());
|
|
||||||
|
|
||||||
//availableBatteryCapacity 可用电池容量
|
//availableBatteryCapacity 可用电池容量
|
||||||
String availableBatteryCapacity =str.substring(184,190);
|
String availableBatteryCapacity =str.substring(184,190);
|
||||||
log.info("可用电池容量==:{}",availableBatteryCapacity);
|
|
||||||
while (availableBatteryCapacity.endsWith("0")){
|
while (availableBatteryCapacity.endsWith("0")){
|
||||||
availableBatteryCapacity=availableBatteryCapacity.substring(0,availableBatteryCapacity.length()-1);
|
availableBatteryCapacity=availableBatteryCapacity.substring(0,availableBatteryCapacity.length()-1);
|
||||||
}
|
}
|
||||||
vehicleData.setAvailableBatteryCapacity(availableBatteryCapacity);
|
vehicleData.setAvailableBatteryCapacity(availableBatteryCapacity);
|
||||||
log.info("可用电池容量==:{}",vehicleData.getAvailableBatteryCapacity());
|
|
||||||
|
|
||||||
//vehicleStatus 车辆状态
|
//vehicleStatus 车辆状态
|
||||||
int vehicleStatus = Integer.parseInt(str.substring(190,191));
|
int vehicleStatus = Integer.parseInt(str.substring(190,191));
|
||||||
vehicleData.setVehicleStatus(vehicleStatus);
|
vehicleData.setVehicleStatus(vehicleStatus);
|
||||||
log.info("车辆状态==:{}",vehicleData.getVehicleStatus());
|
|
||||||
|
|
||||||
//chargingStatus 充电状态
|
//chargingStatus 充电状态
|
||||||
int chargingStatus = Integer.parseInt(str.substring(191,192));
|
int chargingStatus = Integer.parseInt(str.substring(191,192));
|
||||||
vehicleData.setChargingStatus(chargingStatus);
|
vehicleData.setChargingStatus(chargingStatus);
|
||||||
log.info("充电状态==:{}",vehicleData.getChargingStatus());
|
|
||||||
|
|
||||||
//operatingStatus 运行状态
|
//operatingStatus 运行状态
|
||||||
int operatingStatus = Integer.parseInt(str.substring(192,193));
|
int operatingStatus = Integer.parseInt(str.substring(192,193));
|
||||||
vehicleData.setOperatingStatus(operatingStatus);
|
vehicleData.setOperatingStatus(operatingStatus);
|
||||||
log.info("运行状态==:{}",vehicleData.getOperatingStatus());
|
|
||||||
|
|
||||||
//socStatus SOC
|
//socStatus SOC
|
||||||
int socStatus = Integer.parseInt(str.substring(193,194));
|
int socStatus = Integer.parseInt(str.substring(193,194));
|
||||||
vehicleData.setSocStatus(socStatus);
|
vehicleData.setSocStatus(socStatus);
|
||||||
log.info("SOC==:{}",vehicleData.getSocStatus());
|
|
||||||
|
|
||||||
//chargingEnergyStorageStatus 可充电储能装置工作状态
|
//chargingEnergyStorageStatus 可充电储能装置工作状态
|
||||||
int chargingEnergyStorageStatus = Integer.parseInt(str.substring(194,195));
|
int chargingEnergyStorageStatus = Integer.parseInt(str.substring(194,195));
|
||||||
vehicleData.setChargingEnergyStorageStatus(chargingEnergyStorageStatus);
|
vehicleData.setChargingEnergyStorageStatus(chargingEnergyStorageStatus);
|
||||||
log.info("可充电储能装置工作状态==:{}",vehicleData.getChargingEnergyStorageStatus());
|
|
||||||
|
|
||||||
//driveMotorStatus 驱动电机状态
|
//driveMotorStatus 驱动电机状态
|
||||||
int driveMotorStatus = Integer.parseInt(str.substring(195,196));
|
int driveMotorStatus = Integer.parseInt(str.substring(195,196));
|
||||||
vehicleData.setDriveMotorStatus(driveMotorStatus);
|
vehicleData.setDriveMotorStatus(driveMotorStatus);
|
||||||
log.info("驱动电机状态==:{}",vehicleData.getDriveMotorStatus());
|
|
||||||
|
|
||||||
//positionStatus 定位是否有效
|
//positionStatus 定位是否有效
|
||||||
int positionStatus = Integer.parseInt(str.substring(196,197));
|
int positionStatus = Integer.parseInt(str.substring(196,197));
|
||||||
vehicleData.setPositionStatus(positionStatus);
|
vehicleData.setPositionStatus(positionStatus);
|
||||||
log.info("定位是否有效==:{}",vehicleData.getPositionStatus());
|
|
||||||
|
|
||||||
//easStatus EAS(汽车防盗系统)状态
|
//easStatus EAS(汽车防盗系统)状态
|
||||||
int easStatus = Integer.parseInt(str.substring(197,198));
|
int easStatus = Integer.parseInt(str.substring(197,198));
|
||||||
vehicleData.setEasStatus(easStatus);
|
vehicleData.setEasStatus(easStatus);
|
||||||
log.info("EAS(汽车防盗系统)状态==:{}",vehicleData.getEasStatus());
|
|
||||||
|
|
||||||
//ptcStatus PTC(电动加热器)状态
|
//ptcStatus PTC(电动加热器)状态
|
||||||
int ptcStatus = Integer.parseInt(str.substring(198,199));
|
int ptcStatus = Integer.parseInt(str.substring(198,199));
|
||||||
vehicleData.setPtcStatus(ptcStatus);
|
vehicleData.setPtcStatus(ptcStatus);
|
||||||
log.info("PTC(电动加热器)状态==:{}",vehicleData.getPtcStatus());
|
|
||||||
|
|
||||||
//epsStatus
|
//epsStatus
|
||||||
int epsStatus = Integer.parseInt(str.substring(199,200));
|
int epsStatus = Integer.parseInt(str.substring(199,200));
|
||||||
vehicleData.setEpsStatus(epsStatus);
|
vehicleData.setEpsStatus(epsStatus);
|
||||||
log.info("车辆状态==:{}",vehicleData.getEpsStatus());
|
|
||||||
|
|
||||||
//absStatus EPS(电动助力系统)状态
|
//absStatus EPS(电动助力系统)状态
|
||||||
int absStatus = Integer.parseInt(str.substring(200,201));
|
int absStatus = Integer.parseInt(str.substring(200,201));
|
||||||
vehicleData.setAbsStatus(absStatus);
|
vehicleData.setAbsStatus(absStatus);
|
||||||
log.info("EPS(电动助力系统)状态==:{}",vehicleData.getAbsStatus());
|
|
||||||
|
|
||||||
//mcuStatus MCU(电机/逆变器)状态
|
//mcuStatus MCU(电机/逆变器)状态
|
||||||
int mcuStatus = Integer.parseInt(str.substring(201,202));
|
int mcuStatus = Integer.parseInt(str.substring(201,202));
|
||||||
vehicleData.setMcuStatus(mcuStatus);
|
vehicleData.setMcuStatus(mcuStatus);
|
||||||
log.info("MCU(电机/逆变器)状态==:{}",vehicleData.getMcuStatus());
|
|
||||||
|
|
||||||
//heatingStatus 动力电池加热状态
|
//heatingStatus 动力电池加热状态
|
||||||
int heatingStatus = Integer.parseInt(str.substring(202,203));
|
int heatingStatus = Integer.parseInt(str.substring(202,203));
|
||||||
vehicleData.setHeatingStatus(heatingStatus);
|
vehicleData.setHeatingStatus(heatingStatus);
|
||||||
log.info("动力电池加热状态==:{}",vehicleData.getHeatingStatus());
|
|
||||||
|
|
||||||
//batteryStatus 动力电池当前状态
|
//batteryStatus 动力电池当前状态
|
||||||
int batteryStatus = Integer.parseInt(str.substring(203,204));
|
int batteryStatus = Integer.parseInt(str.substring(203,204));
|
||||||
vehicleData.setBatteryStatus(batteryStatus);
|
vehicleData.setBatteryStatus(batteryStatus);
|
||||||
log.info("动力电池当前状态==:{}",vehicleData.getBatteryStatus());
|
|
||||||
|
|
||||||
//batteryInsulationStatus 动力电池保温状态
|
//batteryInsulationStatus 动力电池保温状态
|
||||||
int batteryInsulationStatus = Integer.parseInt(str.substring(204,205));
|
int batteryInsulationStatus = Integer.parseInt(str.substring(204,205));
|
||||||
vehicleData.setBatteryInsulationStatus(batteryInsulationStatus);
|
vehicleData.setBatteryInsulationStatus(batteryInsulationStatus);
|
||||||
log.info("动力电池保温状态==:{}",vehicleData.getBatteryInsulationStatus());
|
|
||||||
|
|
||||||
//dcdcStatus DCDC(电力交换系统)状态
|
//dcdcStatus DCDC(电力交换系统)状态
|
||||||
int dcdcStatus = Integer.parseInt(str.substring(205,206));
|
int dcdcStatus = Integer.parseInt(str.substring(205,206));
|
||||||
vehicleData.setDcdcStatus(dcdcStatus);
|
vehicleData.setDcdcStatus(dcdcStatus);
|
||||||
log.info("DCDC(电力交换系统)状态==:{}",vehicleData.getDcdcStatus());
|
|
||||||
|
|
||||||
//chgStatus CHG(充电机)状态
|
//chgStatus CHG(充电机)状态
|
||||||
int chgStatus = Integer.parseInt(str.substring(206,207));
|
int chgStatus = Integer.parseInt(str.substring(206,207));
|
||||||
vehicleData.setChgStatus(chgStatus);
|
vehicleData.setChgStatus(chgStatus);
|
||||||
log.info("CHG(充电机)状态 ==:{}",vehicleData.getChgStatus());
|
|
||||||
|
|
||||||
log.info("车辆数据解析完成:{}",vehicleData);
|
|
||||||
|
|
||||||
vehicleDataList.add(vehicleData);
|
vehicleDataList.add(vehicleData);
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,12 @@ import com.zhilian.resolver.service.ResolverEventService;
|
||||||
import com.zhilian.resolver.service.ResolverReportInfoService;
|
import com.zhilian.resolver.service.ResolverReportInfoService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -39,6 +41,9 @@ public class MalfunctionEventServiceImpl implements ResolverEventService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResolverReportInfoService resolverReportInfoService;
|
private ResolverReportInfoService resolverReportInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程调用 BreakLog服务
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteBreakService remoteBreakService;
|
private RemoteBreakService remoteBreakService;
|
||||||
|
|
||||||
|
@ -180,9 +185,10 @@ public class MalfunctionEventServiceImpl implements ResolverEventService {
|
||||||
|
|
||||||
Set<BreakLog> breakLogsFromRedis = redisService.getCacheSet("breakdown:gz::" + vehicleData.getVin());
|
Set<BreakLog> breakLogsFromRedis = redisService.getCacheSet("breakdown:gz::" + vehicleData.getVin());
|
||||||
if(breakLogsFromRedis !=null && !breakLogsFromRedis.isEmpty()){
|
if(breakLogsFromRedis !=null && !breakLogsFromRedis.isEmpty()){
|
||||||
// 将Redis中的数据遍历,逐条插入数据库
|
// 检查第一条故障记录是否已存在于数据库中
|
||||||
for (BreakLog breakLogs : breakLogsFromRedis) {
|
BreakLog firstBreakLog = breakLogsFromRedis.iterator().next();
|
||||||
remoteBreakService.logAdd(breakLogs);
|
if (!isInDatabase(firstBreakLog)) {
|
||||||
|
remoteBreakService.logAdd(firstBreakLog);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
log.info("没有找到对应VIN的故障记录在Redis中,无需同步到数据库");
|
log.info("没有找到对应VIN的故障记录在Redis中,无需同步到数据库");
|
||||||
|
@ -221,4 +227,12 @@ public class MalfunctionEventServiceImpl implements ResolverEventService {
|
||||||
public String getEventName() {
|
public String getEventName() {
|
||||||
return "malfunction";
|
return "malfunction";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isInDatabase(BreakLog breakLog) {
|
||||||
|
// 查询数据库,判断是否已存在相同的故障记录
|
||||||
|
// 故障记录的唯一标识是breakCode和breakVin
|
||||||
|
ResponseEntity<Boolean> existingBreakLog = remoteBreakService.checkIfBreakLogExists(breakLog.getBreakCode(), breakLog.getBreakVin());
|
||||||
|
return existingBreakLog != null && existingBreakLog.getBody();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue