mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
验证设备的唯一性和设备字段添加验证
This commit is contained in:
@@ -115,7 +115,10 @@ public class IotDeviceController extends BaseController
|
||||
{
|
||||
LoginUser user=(LoginUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
iotDevice.setOwnerId(user.getUser().getUserId().toString());
|
||||
iotDevice.setDeviceTemp(BigDecimal.valueOf(0));
|
||||
IotDevice device=iotDeviceService.selectIotDeviceByNum(iotDevice.getDeviceNum());
|
||||
if(device!=null){
|
||||
return AjaxResult.error("设备编号已存在,请重新填写");
|
||||
}
|
||||
return toAjax(iotDeviceService.insertIotDevice(iotDevice));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user