Merge branch 'dev' of https://gitea.qinmian.online/group-four/cloud-car into dev
commit
c35dea9159
|
@ -33,6 +33,11 @@
|
||||||
<groupId>org.springframework.kafka</groupId>
|
<groupId>org.springframework.kafka</groupId>
|
||||||
<artifactId>spring-kafka</artifactId>
|
<artifactId>spring-kafka</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.kafka</groupId>
|
||||||
|
<artifactId>kafka-clients</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import lombok.NoArgsConstructor;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "sys_car",autoResultMap = true)
|
@TableName(value = "sys_car",autoResultMap = true)
|
||||||
public class SysCar extends BaseEntity {
|
public class SysCar extends BaseEntity {
|
||||||
|
|
||||||
@TableId(value = "id",type = IdType.AUTO)
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
private String carVin;
|
private String carVin;
|
||||||
|
|
|
@ -91,9 +91,10 @@ public class SysCarController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/findCarByVin")
|
@PostMapping("/findCarByVin")
|
||||||
@Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息")
|
// @Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息")
|
||||||
public Result<SysCar> findCarByVin(@RequestParam("carVin") String carVin){
|
public Result<SysCar> findCarByVin(@RequestParam("carVin") String carVin){
|
||||||
return Result.success(sysCarService.findCarByVin(carVin));
|
return Result.success(sysCarService.findCarByVin(carVin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,8 @@ public interface SysCarMapper extends BaseMapper<SysCar> {
|
||||||
List<SysCarFaultLogVo> findFenceByCarVin(@Param("carVin") String carVin);
|
List<SysCarFaultLogVo> findFenceByCarVin(@Param("carVin") String carVin);
|
||||||
|
|
||||||
|
|
||||||
|
SysCar findCarByVin(@Param("carVin") String carVin);
|
||||||
|
|
||||||
|
SysCar selectByCarVin(@Param("carVin") String carVin);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,5 @@ public interface SysCarService {
|
||||||
|
|
||||||
SysCar findCarByVin(String carVin);
|
SysCar findCarByVin(String carVin);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.server.service.impl;
|
package com.muyu.server.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.domain.SysCar;
|
import com.muyu.common.domain.SysCar;
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@DS("lizzDB")
|
||||||
@Service
|
@Service
|
||||||
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
|
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -51,7 +53,8 @@ public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> impleme
|
||||||
public SysCar findCarByVin(String carVin) {
|
public SysCar findCarByVin(String carVin) {
|
||||||
QueryWrapper<SysCar> sysCarQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<SysCar> sysCarQueryWrapper = new QueryWrapper<>();
|
||||||
sysCarQueryWrapper.eq("car_vin", carVin);
|
sysCarQueryWrapper.eq("car_vin", carVin);
|
||||||
SysCar sysCar = sysCarMapper.selectOne(sysCarQueryWrapper);
|
List<SysCar> sysCars = sysCarMapper.selectList(sysCarQueryWrapper);
|
||||||
return sysCar;
|
return sysCars.isEmpty() ? null : sysCars.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
|
||||||
log.info("carVin码为:" + carVin);
|
log.info("carVin码为:" + carVin);
|
||||||
//根据VIN码获取车辆信息
|
//根据VIN码获取车辆信息
|
||||||
SysCar carByVin = sysCarService.findCarByVin(carVin);
|
SysCar carByVin = sysCarService.findCarByVin(carVin);
|
||||||
|
log.info("车辆信息为:" + carByVin);
|
||||||
//对应车辆所对应的报文模版
|
//对应车辆所对应的报文模版
|
||||||
Integer templateId = carByVin.getTemplateId();
|
Integer templateId = carByVin.getTemplateId();
|
||||||
|
|
||||||
|
@ -102,6 +103,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
|
||||||
jsonObject.put(messageTemplateType.getMessageField(), result.substring(startIndex, endIndex));
|
jsonObject.put(messageTemplateType.getMessageField(), result.substring(startIndex, endIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("哈哈哈红红火火恍恍惚惚");
|
||||||
log.info("解析后的报文是:" + jsonObject);
|
log.info("解析后的报文是:" + jsonObject);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,4 +74,10 @@
|
||||||
WHERE
|
WHERE
|
||||||
sys_car_fault_log.vin = #{carVin};
|
sys_car_fault_log.vin = #{carVin};
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findCarByVin" resultType="com.muyu.common.domain.SysCar">
|
||||||
|
select * from sys_car where car_vin=#{carVin}
|
||||||
|
</select>
|
||||||
|
<select id="selectByCarVin" resultType="com.muyu.common.domain.SysCar">
|
||||||
|
select * from sys_car where car_cin=#{carVin}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue