Browse Source

补充提交

黄渊昊 9 months ago
parent
commit
5404f6e823

+ 2 - 4
snowy-plugin/snowy-plugin-coldchain/src/main/java/vip/xiaonuo/coldchain/modular/monitordevice/controller/MonitorDeviceController.java

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

+ 2 - 2
snowy-plugin/snowy-plugin-coldchain/src/main/java/vip/xiaonuo/coldchain/modular/monitordevicetype/controller/MonitorDeviceTypeController.java

@@ -139,7 +139,7 @@ public class MonitorDeviceTypeController {
     @GetMapping("/coldchain/monitordevicetype/getByTypeName")
     public CommonResult<String> getByTypeName(String name) {
         boolean b = monitorDeviceTypeService.getByName(name);
-        if (!b) {
+        if (b) {
             return CommonResult.error("类型名" + name + "已注册使用:{}");
         }
         return CommonResult.ok();
@@ -153,7 +153,7 @@ public class MonitorDeviceTypeController {
     @GetMapping("/coldchain/monitordevicetype/getByTypeCode")
     public CommonResult<String> getByTypeCode(String code) {
         boolean b = monitorDeviceTypeService.getByCode(code);
-        if (!b) {
+        if (b) {
             return CommonResult.error("类型编码" + code + "已注册使用:{}");
         }
         return CommonResult.ok();