diff --git a/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/RemoteBasicService.java b/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/RemoteBasicService.java
index d9f5aa3..c399e7e 100644
--- a/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/RemoteBasicService.java
+++ b/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/RemoteBasicService.java
@@ -2,10 +2,12 @@ package com.ruoyi.basic.api;
import com.ruoyi.basic.api.domain.HwTenant;
import com.ruoyi.basic.api.factory.RemoteBasicFallbackFactory;
+import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
@@ -21,5 +23,5 @@ import java.util.List;
public interface RemoteBasicService {
@GetMapping("/tenant/getTenants")
- R> getTenants();
+ R> getTenants(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
diff --git a/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/factory/RemoteBasicFallbackFactory.java b/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/factory/RemoteBasicFallbackFactory.java
index 45023cb..f6fd8bb 100644
--- a/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/factory/RemoteBasicFallbackFactory.java
+++ b/ruoyi-api/hw-api-basic/src/main/java/com/ruoyi/basic/api/factory/RemoteBasicFallbackFactory.java
@@ -22,7 +22,7 @@ public class RemoteBasicFallbackFactory implements FallbackFactory> getTenants() {
+ public R> getTenants(String source) {
return R.fail("获取租户信息失败:" + throwable.getMessage());
}
};
diff --git a/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/RemoteBusinessService.java b/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/RemoteBusinessService.java
index 073d200..8421fac 100644
--- a/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/RemoteBusinessService.java
+++ b/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/RemoteBusinessService.java
@@ -1,11 +1,13 @@
package com.ruoyi.business.api;
import com.ruoyi.business.api.factory.RemoteBusinessFallbackFactory;
+import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestHeader;
@FeignClient(contextId = "remoteBusinessService", value = ServiceNameConstants.BUSINESS_SERVICE, fallbackFactory = RemoteBusinessFallbackFactory.class)
public interface RemoteBusinessService {
@@ -17,5 +19,5 @@ public interface RemoteBusinessService {
* @return 结果
*/
@GetMapping("/device/computeOnlineDevicecCount/{days}")
- public R> computeOnlineDevicecCount(@PathVariable("days") int days);
+ public R> computeOnlineDevicecCount(@PathVariable("days") int days, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
diff --git a/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/factory/RemoteBusinessFallbackFactory.java b/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/factory/RemoteBusinessFallbackFactory.java
index f4bbc62..cb97dd6 100644
--- a/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/factory/RemoteBusinessFallbackFactory.java
+++ b/ruoyi-api/hw-api-business/src/main/java/com/ruoyi/business/api/factory/RemoteBusinessFallbackFactory.java
@@ -18,7 +18,7 @@ public class RemoteBusinessFallbackFactory implements FallbackFactory computeOnlineDevicecCount(int days) {
+ public R> computeOnlineDevicecCount(int days, String source) {
return R.fail("获取租户信息失败:" + throwable.getMessage());
}
};
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java
index 1e853c7..23c204f 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/TdEngineConstants.java
@@ -19,10 +19,13 @@ public class TdEngineConstants {
public static final String PAYLOAD_PARAM = "param";//协议上传的param key
+ public static final String PAYLOAD_DATATYPE = "datatype";//协议上传数据数据类型的key
public static final String PAYLOAD_DATAVALUE = "datavalue";//协议上传数据的key
public static final String PAYLOAD_DEVICE_CODE = "uid";//协议上传设备编号的key
+ public static final String PAYLOAD_DEVICE_DATA_TYPE_IMAGE = "image";//协议上传图片类型的key
+
// public static final String DEFAULT_DB_NAME_PREFIX = "db_scene_";//数据库名称前缀
public static final String DEFAULT_SUPER_TABLE_NAME_PREFIX = "st_devicemode_";//超级表名称前缀
diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTenantController.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTenantController.java
index e54738d..1f814b6 100644
--- a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTenantController.java
+++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTenantController.java
@@ -10,6 +10,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.InnerAuth;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
@@ -115,6 +116,7 @@ public class HwTenantController extends BaseController
/**
* 查询租户信息列表
*/
+ @InnerAuth
@GetMapping("/getTenants")
public R> getTenants(HwTenant hwTenant)
{
diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java
index ceac203..7c110a6 100644
--- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java
+++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwDeviceController.java
@@ -13,6 +13,7 @@ import com.ruoyi.business.service.IHwDeviceModeService;
import com.ruoyi.business.service.IHwMonitorUnitService;
import com.ruoyi.business.service.IHwSceneService;
import com.ruoyi.common.core.constant.HwDictConstants;
+import com.ruoyi.common.security.annotation.InnerAuth;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.api.domain.SysRole;
@@ -191,10 +192,6 @@ public class HwDeviceController extends BaseController {
return success();
}
- @GetMapping("/computeOnlineDevicecCount/{days}")
- public void computeOnlineDevicecCount(@PathVariable("days") int days) {
- hwDeviceService.computeOnlineDevicecCount(days);
- }
@RequiresPermissions("business:device:rebuild")
@Log(title = "设备信息", businessType = BusinessType.REBUILD)
@@ -203,4 +200,11 @@ public class HwDeviceController extends BaseController {
hwDeviceService.rebuildTdTables();
}
+
+ @InnerAuth
+ @GetMapping("/computeOnlineDevicecCount/{days}")
+ public void computeOnlineDevicecCount(@PathVariable("days") int days) {
+ hwDeviceService.computeOnlineDevicecCount(days);
+ }
+
}
diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java
index 5aeb495..2182993 100644
--- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java
+++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/controller/HwMonitorPlatformController.java
@@ -102,6 +102,7 @@ public class HwMonitorPlatformController extends BaseController {
@RequiresPermissions("business:monitor:index")
@GetMapping("/getDeviceOperations/{sceneId}")
public AjaxResult selectDeviceStatus(@PathVariable("sceneId") Long sceneId) {
+ System.out.println(("sceneid:" + sceneId));
return AjaxResult.success(hwDeviceService.getOnlineDevicesCount(sceneId));
}
diff --git a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceServiceImpl.java b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceServiceImpl.java
index fa9d457..59b84ab 100644
--- a/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceServiceImpl.java
+++ b/ruoyi-modules/hw-business/src/main/java/com/ruoyi/business/service/impl/HwDeviceServiceImpl.java
@@ -680,6 +680,15 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
});
}
+ public String getDeviceTslJson(Long deviceId) {
+ HwDevice device = hwDeviceMapper.selectHwDeviceByDeviceId(deviceId);
+ String deviceCode = device.getDeviceCode();
+ String devideType = device.getDeviceType();
+
+ return "";
+ }
+
+
/**
* @param: hwDevice 前端传的对象
* @param: dbDevice 目前数据库的对象
@@ -771,7 +780,7 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
List
状态:
- {{ MonitorInfo.monitorUnitStatus === 1 ? '正常' : '异常' }}
+ {{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }}
类型: