41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package com.vehicle.service.impl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.vehicle.domain.common.req.VehicleOnlineReq;
|
|
import com.vehicle.mapper.VehicleOnlineMapper;
|
|
import com.vehicle.service.VehicleService;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import static com.vehicle.utils.Md5Util.md5Encrypt;
|
|
|
|
|
|
/**
|
|
* @author 冯凯
|
|
* @version 1.0
|
|
* @description: 车辆业务实现类
|
|
* @date 2023/11/27 14:27
|
|
*/
|
|
@Service
|
|
public class VehicleServiceImpl extends ServiceImpl<VehicleOnlineMapper, VehicleOnlineReq> implements VehicleService {
|
|
/**
|
|
* 车辆上线请求的回调函数
|
|
*
|
|
* @param vehicleOnlineReq 车辆上线请求参数
|
|
*/
|
|
@Override
|
|
public void vehicleOnline(VehicleOnlineReq vehicleOnlineReq) {
|
|
String vin = vehicleOnlineReq.getVin();
|
|
String username = vehicleOnlineReq.getUsername();
|
|
String time = System.currentTimeMillis() + "";
|
|
// String time = vehicleOnlineReq.getOnlineTime().getTime() + "";
|
|
String message=vin+time+username; // 拼接所要加密消息
|
|
String password = md5Encrypt(message); // 加密
|
|
vehicleOnlineReq.setPassword(password);
|
|
this.save(vehicleOnlineReq);
|
|
}
|
|
|
|
|
|
|
|
}
|