Bladeren bron

更新!

TRX 1 jaar geleden
bovenliggende
commit
15bc357ac5

+ 4 - 3
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoSearchParam.java

@@ -24,7 +24,7 @@ public class DeviceInfoSearchParam extends SuperSearchParam {
     @Schema(description = "所属项目code")
     private String projectInfoCode;
 
-    @Schema(description = "设备code,产品code")
+    @Schema(description = "产品code")
     private String productCode;
 
     @Schema(description = "设备类型:消费机 闸机")
@@ -54,12 +54,13 @@ public class DeviceInfoSearchParam extends SuperSearchParam {
     @Schema(description = "设置状态")
     private DeviceState state;
 
-    @Schema(description = "最后上线时间搜索")
+    @Schema(description = "最后上线时间搜索开始时间")
     private Long startLastOnlineTime;
 
+    @Schema(description = "最后上线时间搜索结束时间")
     private Long endLastOnlineTime;
 
+    @Schema(description = "设备类型")
     private DeviceType deviceType;
 
-
 }

+ 8 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/controller/common/CommonController.java

@@ -5,6 +5,7 @@ import com.github.microservice.auth.security.type.AuthType;
 import com.github.microservice.net.ResultContent;
 import com.github.microservice.types.deviceUse.DeviceCategory;
 import com.github.microservice.types.deviceUse.DeviceType;
+import com.github.microservice.types.deviceUse.OnLineState;
 import com.zhongshu.iot.server.core.service.base.CommonService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -42,4 +43,11 @@ public class CommonController {
     public ResultContent getDeviceCategory() {
         return ResultContent.buildSuccess(commonService.getEnums(DeviceCategory.values()));
     }
+
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "设备状态 选择项")
+    @RequestMapping(value = "getOnLineState", method = {RequestMethod.GET})
+    public ResultContent getOnLineState() {
+        return ResultContent.buildSuccess(commonService.getEnums(OnLineState.values()));
+    }
 }

+ 2 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/controller/iot/IotController.java

@@ -122,7 +122,8 @@ public class IotController {
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "产品属性-服务-方法列表-分页查询")
     @RequestMapping(value = {"devicePageIotMain"}, method = {RequestMethod.POST})
-    public ResultContent<Page<IotMainModel>> devicePageIotMain(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
+    public ResultContent<Page<IotMainModel>> devicePageIotMain(
+            @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
             @Parameter(required = false) IotMainSearch param) {
         param.setIotDataType(IotDataType.Device);
         return iotService.pageIotMain(pageable, param);

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

@@ -343,9 +343,6 @@ public class DeviceInfoService {
         if (ObjectUtils.isEmpty(deviceInfo)) {
             return ResultContent.buildFail(String.format("设备ID不存在:%s", deviceId));
         }
-        if (deviceInfo.getState() != DeviceState.Cancel) {
-            return ResultContent.buildFail("设备未注销,不能删除");
-        }
         if (deviceInfo.getIsDelete() != null && deviceInfo.getIsDelete()) {
             return ResultContent.buildFail("设备已删除");
         }