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