Commit f4d11439 by 杨林龙

新增车辆标签对应关系

1 parent 33449cfd
...@@ -376,34 +376,6 @@ public class VehicleController { ...@@ -376,34 +376,6 @@ public class VehicleController {
@SysLog(module = "车辆管理", value = "编辑车辆信息", action = OperateType.EDIT) @SysLog(module = "车辆管理", value = "编辑车辆信息", action = OperateType.EDIT)
@PostMapping("/vehicleinfo/update") @PostMapping("/vehicleinfo/update")
public R updateVehicleInfo(@RequestBody @Validated(ValidateGroups.Update.class) VehicleInfoVo vehicleInfoVo) { public R updateVehicleInfo(@RequestBody @Validated(ValidateGroups.Update.class) VehicleInfoVo vehicleInfoVo) {
// 校验设备号
List<String> noExistSnList = new ArrayList<>();
List<String> bindSnList = new ArrayList<>();
// 获取设备数据集合
List<DeviceInfoDto> deviceInfoDtos = vehicleInfoVo.getDeviceInfoDtos();
for (DeviceInfoDto deviceInfoDto : deviceInfoDtos) {
// 校验设备号是否存在
boolean snExist = deviceService.checkSnLocalAndRemote(deviceInfoDto.getSn());
if (!snExist) {
noExistSnList.add(deviceInfoDto.getSn());
}
// 校验设备号是否已经绑定
boolean bindSn = deviceService.checkBindSn(deviceInfoDto.getSn());
if (!bindSn) {
bindSnList.add(deviceInfoDto.getSn());
}
}
if (CollectionUtil.isNotEmpty(noExistSnList)) {
noExistSnList = noExistSnList.stream().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
return R.error(StringUtils.join(noExistSnList, ",") + "设备不存在,请重新输入");
}
if (CollectionUtil.isNotEmpty(bindSnList)) {
bindSnList = bindSnList.stream().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
return R.error(StringUtils.join(bindSnList, ",") + "设备已经绑定,请重新输入");
}
vehicleService.updateVehicleInfo(vehicleInfoVo); vehicleService.updateVehicleInfo(vehicleInfoVo);
return R.ok(); return R.ok();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!