Merge remote-tracking branch 'refs/remotes/origin/dev.template' into dev
commit
2ec6d89c62
|
@ -32,12 +32,6 @@
|
|||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>2.2.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu.server</groupId>
|
||||
<artifactId>saas-server</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -15,6 +15,7 @@ import lombok.NoArgsConstructor;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "sys_car",autoResultMap = true)
|
||||
public class SysCar extends BaseEntity {
|
||||
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String carVin;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.common.config;
|
||||
package com.muyu.server.config;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.muyu.server.service.TemplateService;
|
|
@ -84,9 +84,10 @@ public class SysCarController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/findCarByVin")
|
||||
@Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息")
|
||||
// @Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息")
|
||||
public Result<SysCar> findCarByVin(@RequestParam("carVin") String carVin){
|
||||
return Result.success(sysCarService.findCarByVin(carVin));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -19,4 +19,8 @@ public interface SysCarMapper extends BaseMapper<SysCar> {
|
|||
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);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.domain.SysCar;
|
||||
|
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
@DS("lizzDB")
|
||||
@Service
|
||||
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
|
||||
@Autowired
|
||||
|
@ -51,7 +53,8 @@ public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> impleme
|
|||
public SysCar findCarByVin(String carVin) {
|
||||
QueryWrapper<SysCar> sysCarQueryWrapper = new QueryWrapper<>();
|
||||
sysCarQueryWrapper.eq("car_vin", carVin);
|
||||
SysCar sysCar = sysCarMapper.selectOne(sysCarQueryWrapper);
|
||||
return sysCar;
|
||||
List<SysCar> sysCars = sysCarMapper.selectList(sysCarQueryWrapper);
|
||||
return sysCars.isEmpty() ? null : sysCars.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
|
|||
log.info("carVin码为:" + carVin);
|
||||
//根据VIN码获取车辆信息
|
||||
SysCar carByVin = sysCarService.findCarByVin(carVin);
|
||||
log.info("车辆信息为:" + carByVin);
|
||||
//对应车辆所对应的报文模版
|
||||
Integer templateId = carByVin.getTemplateId();
|
||||
|
||||
|
@ -102,6 +103,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
|
|||
jsonObject.put(messageTemplateType.getMessageField(), result.substring(startIndex, endIndex));
|
||||
}
|
||||
|
||||
System.out.println("哈哈哈红红火火恍恍惚惚");
|
||||
log.info("解析后的报文是:" + jsonObject);
|
||||
|
||||
|
||||
|
|
|
@ -74,4 +74,10 @@
|
|||
WHERE
|
||||
sys_car_fault_log.vin = #{carVin};
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue