连接数据
parent
37f45c4805
commit
449118c06d
|
@ -62,6 +62,14 @@
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<version>8.0.33</version>
|
<version>8.0.33</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- rabbitMQ -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
|
|
@ -8,6 +8,9 @@ import com.shiyi.launch.service.VehiclelaunchService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description : 车辆上线业务层
|
* @Description : 车辆上线业务层
|
||||||
* @Author : YangHaoYu
|
* @Author : YangHaoYu
|
||||||
|
@ -25,6 +28,15 @@ public class VehiclelaunchServiceimpl implements VehiclelaunchService {
|
||||||
if (StringUtils.isEmpty(vehiclelaunch.getVin())){
|
if (StringUtils.isEmpty(vehiclelaunch.getVin())){
|
||||||
return "vin为空";
|
return "vin为空";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long time = new Date().getTime();
|
||||||
|
|
||||||
|
vehiclelaunch.setTimestamp(String.valueOf(time));
|
||||||
|
|
||||||
|
String uuid = UUID.randomUUID().toString().replaceAll("-","").substring(0,8);
|
||||||
|
|
||||||
|
vehiclelaunch.setNonce(uuid);
|
||||||
|
|
||||||
int i = vehicleaunchMapper.into(vehiclelaunch);
|
int i = vehicleaunchMapper.into(vehiclelaunch);
|
||||||
|
|
||||||
if(i < 0){
|
if(i < 0){
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.shiyi.launch.mapper.VehicleaunchMapper">
|
<mapper namespace="com.shiyi.launch.mapper.VehicleaunchMapper">
|
||||||
<insert id="into">
|
<insert id="into">
|
||||||
insert into t_car(car_vin) values
|
insert into t_car(car_vin,car_address,car_license,car_name) values
|
||||||
(#{vin})
|
(#{vin},#{timestamp},#{nonce},#{userName})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue