|
@@ -141,14 +141,12 @@ public class MonitorDeviceController {
|
|
@GetMapping("/coldchain/monitordevice/getByDeviceName")
|
|
@GetMapping("/coldchain/monitordevice/getByDeviceName")
|
|
public CommonResult<String> getByDeviceName(String deviceName) {
|
|
public CommonResult<String> getByDeviceName(String deviceName) {
|
|
boolean b = monitorDeviceService.getByDeviceName(deviceName);
|
|
boolean b = monitorDeviceService.getByDeviceName(deviceName);
|
|
- if (!b) {
|
|
|
|
|
|
+ if (b) {
|
|
return CommonResult.error("设备名" + deviceName + "已注册使用:{}");
|
|
return CommonResult.error("设备名" + deviceName + "已注册使用:{}");
|
|
}
|
|
}
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 检查设备编码是否已注册
|
|
* 检查设备编码是否已注册
|
|
*/
|
|
*/
|
|
@@ -157,7 +155,7 @@ public class MonitorDeviceController {
|
|
@GetMapping("/coldchain/monitordevice/getByDeviceCode")
|
|
@GetMapping("/coldchain/monitordevice/getByDeviceCode")
|
|
public CommonResult<String> getByDeviceCode(String deviceCode) {
|
|
public CommonResult<String> getByDeviceCode(String deviceCode) {
|
|
boolean b = monitorDeviceService.getByDeviceCode(deviceCode);
|
|
boolean b = monitorDeviceService.getByDeviceCode(deviceCode);
|
|
- if (!b) {
|
|
|
|
|
|
+ if (b) {
|
|
return CommonResult.error("设备编码" + deviceCode + "已注册使用:{}");
|
|
return CommonResult.error("设备编码" + deviceCode + "已注册使用:{}");
|
|
}
|
|
}
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|