Commit e6b7c811 by 杨林龙

修改组织ID 换位string接受参数

1 parent 8cdea9ef
...@@ -48,7 +48,7 @@ public class VehicleInfoVo implements Serializable { ...@@ -48,7 +48,7 @@ public class VehicleInfoVo implements Serializable {
/** /**
* 组织id 实际对应着用户Id * 组织id 实际对应着用户Id
*/ */
private Long organizationId; private String organizationId;
/** /**
* 组织名 实际对应着用户名 * 组织名 实际对应着用户名
......
...@@ -1251,7 +1251,8 @@ public class VehicleService { ...@@ -1251,7 +1251,8 @@ public class VehicleService {
if (vehicleType != null) { if (vehicleType != null) {
vehicle.setModelName(vehicleType.getTypeName()); vehicle.setModelName(vehicleType.getTypeName());
} }
vehicle.setCreatedBy(vehicleInfoVo.getOrganizationId()); String userId = vehicleInfoVo.getOrganizationId().replace("u", "");
vehicle.setCreatedBy(Long.parseLong(userId));
vehicle.setCreatedDate(new Date()); vehicle.setCreatedDate(new Date());
vehicleMapper.insert(vehicle); vehicleMapper.insert(vehicle);
List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos(); List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos();
...@@ -1265,7 +1266,6 @@ public class VehicleService { ...@@ -1265,7 +1266,6 @@ public class VehicleService {
VehicleInfoVo vehicleInfoVo = new VehicleInfoVo(); VehicleInfoVo vehicleInfoVo = new VehicleInfoVo();
BeanUtils.copyProperties(vehicle, vehicleInfoVo); BeanUtils.copyProperties(vehicle, vehicleInfoVo);
// 设置组织ID 其实是用户ID // 设置组织ID 其实是用户ID
vehicleInfoVo.setOrganizationId(vehicle.getCreatedBy());
User user = userApiService.getUserById(vehicle.getCreatedBy()); User user = userApiService.getUserById(vehicle.getCreatedBy());
if (user != null) { if (user != null) {
vehicleInfoVo.setOrganizationName(user.getUsername()); vehicleInfoVo.setOrganizationName(user.getUsername());
...@@ -1291,9 +1291,10 @@ public class VehicleService { ...@@ -1291,9 +1291,10 @@ public class VehicleService {
if (vehicleType != null) { if (vehicleType != null) {
vehicle.setModelName(vehicleType.getTypeName()); vehicle.setModelName(vehicleType.getTypeName());
} }
vehicle.setCreatedBy(vehicleInfoVo.getOrganizationId()); String userId = vehicleInfoVo.getOrganizationId().replace("u", "");
vehicle.setCreatedBy(Long.parseLong(userId));
vehicle.setUpdatedDate(new Date()); vehicle.setUpdatedDate(new Date());
vehicle.setUpdatedBy(vehicleInfoVo.getOrganizationId()); vehicle.setUpdatedBy(Long.parseLong(userId));
vehicleMapper.updateByPrimaryKey(vehicle); vehicleMapper.updateByPrimaryKey(vehicle);
// 绑定设备 // 绑定设备
List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos(); List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos();
......
...@@ -2026,7 +2026,7 @@ public class VehicleServiceTest { ...@@ -2026,7 +2026,7 @@ public class VehicleServiceTest {
vehicleInfoVo.setLicensePlate("月1234j"); vehicleInfoVo.setLicensePlate("月1234j");
vehicleInfoVo.setVin("dsfsdfs4456666116"); vehicleInfoVo.setVin("dsfsdfs4456666116");
vehicleInfoVo.setEngine("adfd"); vehicleInfoVo.setEngine("adfd");
vehicleInfoVo.setOrganizationId(0L); vehicleInfoVo.setOrganizationId("0");
vehicleInfoVo.setModelId(40610); vehicleInfoVo.setModelId(40610);
vehicleInfoVo.setDisplacement(""); vehicleInfoVo.setDisplacement("");
vehicleInfoVo.setVehicleType(0); vehicleInfoVo.setVehicleType(0);
...@@ -2053,7 +2053,7 @@ public class VehicleServiceTest { ...@@ -2053,7 +2053,7 @@ public class VehicleServiceTest {
vehicleInfoVo.setLicensePlate("月1234j"); vehicleInfoVo.setLicensePlate("月1234j");
vehicleInfoVo.setVin("dsfsdfs4456666116"); vehicleInfoVo.setVin("dsfsdfs4456666116");
vehicleInfoVo.setEngine("adfd"); vehicleInfoVo.setEngine("adfd");
vehicleInfoVo.setOrganizationId(0L); vehicleInfoVo.setOrganizationId("0");
vehicleInfoVo.setModelId(40610); vehicleInfoVo.setModelId(40610);
vehicleInfoVo.setDisplacement(""); vehicleInfoVo.setDisplacement("");
vehicleInfoVo.setVehicleType(0); vehicleInfoVo.setVehicleType(0);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!