Commit 48007604 by 黄小葱

Merge remote-tracking branch 'origin/master'

2 parents 034a11e3 2f2e64c6
...@@ -13,7 +13,7 @@ public class VehicleInfoVo implements Serializable { ...@@ -13,7 +13,7 @@ public class VehicleInfoVo implements Serializable {
/** /**
* 车辆Id * 车辆Id
*/ */
private Long tempId; private Long id;
/** /**
* 姓名 * 姓名
......
...@@ -1251,7 +1251,7 @@ public class VehicleService { ...@@ -1251,7 +1251,7 @@ public class VehicleService {
if (vehicleType != null) { if (vehicleType != null) {
vehicle.setModelName(vehicleType.getTypeName()); vehicle.setModelName(vehicleType.getTypeName());
} }
String userId = vehicleInfoVo.getOrganizationId().replace("u", ""); String userId = vehicleInfoVo.getOrganizationId().replaceAll("u", "");
vehicle.setCreatedBy(Long.parseLong(userId)); vehicle.setCreatedBy(Long.parseLong(userId));
vehicle.setCreatedDate(new Date()); vehicle.setCreatedDate(new Date());
vehicleMapper.insert(vehicle); vehicleMapper.insert(vehicle);
...@@ -1287,17 +1287,13 @@ public class VehicleService { ...@@ -1287,17 +1287,13 @@ public class VehicleService {
public void updateVehicleInfo(VehicleInfoVo vehicleInfoVo) { public void updateVehicleInfo(VehicleInfoVo vehicleInfoVo) {
Vehicle vehicle = new Vehicle(); Vehicle vehicle = new Vehicle();
BeanUtils.copyProperties(vehicleInfoVo, vehicle); BeanUtils.copyProperties(vehicleInfoVo, vehicle);
// 是配前端参数
vehicle.setId(vehicleInfoVo.getTempId());
TenantVehicleType vehicleType = tenantVehicleTypeMapper.selectByTypeId(vehicleInfoVo.getModelId()); TenantVehicleType vehicleType = tenantVehicleTypeMapper.selectByTypeId(vehicleInfoVo.getModelId());
if (vehicleType != null) { if (vehicleType != null) {
vehicle.setModelName(vehicleType.getTypeName()); vehicle.setModelName(vehicleType.getTypeName());
} }
String userId = vehicleInfoVo.getOrganizationId().replace("u", "");
vehicle.setCreatedBy(Long.parseLong(userId));
vehicle.setUpdatedDate(new Date()); vehicle.setUpdatedDate(new Date());
vehicle.setUpdatedBy(Long.parseLong(userId)); vehicle.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleMapper.updateByPrimaryKey(vehicle); vehicleMapper.updateByPrimaryKeySelective(vehicle);
// 绑定设备 // 绑定设备
List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos(); List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos();
for (DeviceInfoDto deviceInfoDto : deviceInfoDtos) { for (DeviceInfoDto deviceInfoDto : deviceInfoDtos) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!