TRX 1 سال پیش
والد
کامیت
fd30038882

+ 1 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/controller/devices/DeviceController.java

@@ -84,7 +84,7 @@ public class DeviceController {
     @RequestMapping(value = "updateDeviceState", method = {RequestMethod.POST})
     public ResultContent updateDeviceState(@RequestBody DeviceInfoUpdateRemark param) {
         Assert.hasText(param.getDeviceId(), "ID不能为空");
-        if (param.getState() != null) {
+        if (param.getState() == null) {
             return ResultContent.buildFail("state不能为空");
         }
         return deviceInfoService.updateDeviceState(param);

+ 1 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/device/DeviceInfoService.java

@@ -483,6 +483,7 @@ public class DeviceInfoService {
             BeanUtils.copyProperties(deviceInfo, deviceInfoModel);
             // 分组信息
             deviceInfoModel.setProjectInfo(projectInfoService.toSimpleModel(deviceInfo.getProjectInfo()));
+
             IotTemplateSimpleModel iotTemplate = iotService.toSimpleModel(deviceInfo.getProductCode());
             // 产品信息
             deviceInfoModel.setIotTemplate(iotTemplate);