From fc7dca26012841f00fd0896e7bdf25e7474ad39a Mon Sep 17 00:00:00 2001
From: xins
Date: Mon, 16 Oct 2023 14:25:23 +0800
Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=E5=BE=AE=E6=9C=8D=E5=8A=A11.?=
=?UTF-8?q?5.6=201=E3=80=81basic=EF=BC=9Ainnerauth=202=E3=80=81business?=
=?UTF-8?q?=EF=BC=9Ainnerauth=EF=BC=9B=E8=AE=A1=E7=AE=97=E5=9C=A8=E7=BA=BF?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F=E9=9C=80=E8=A6=81=E6=98=AF?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E7=8A=B6=E6=80=81=E7=9A=84=E8=AE=BE=E5=A4=87?=
=?UTF-8?q?=EF=BC=9B=E9=A6=96=E9=A1=B5=E8=8E=B7=E5=8F=96=E5=9C=A8=E8=BF=90?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F=E9=9C=80=E5=88=A4=E6=96=AD?=
=?UTF-8?q?=E6=98=AF=E5=90=A6=E4=BC=A0sceneId=203=E3=80=81dataprocess?=
=?UTF-8?q?=EF=BC=9A=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E9=92=88=E5=AF=B9?=
=?UTF-8?q?base64=E5=9B=BE=E7=89=87=E6=B2=A1=E5=8A=A0=E5=89=8D=E7=BC=80?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E5=A4=84=E7=90=86=204=E3=80=81job=EF=BC=9Ain?=
=?UTF-8?q?nerauth?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ruoyi/basic/api/RemoteBasicService.java | 4 ++-
.../factory/RemoteBasicFallbackFactory.java | 2 +-
.../business/api/RemoteBusinessService.java | 4 ++-
.../RemoteBusinessFallbackFactory.java | 2 +-
.../core/constant/TdEngineConstants.java | 3 ++
.../basic/controller/HwTenantController.java | 2 ++
.../controller/HwDeviceController.java | 12 ++++---
.../HwMonitorPlatformController.java | 1 +
.../service/impl/HwDeviceServiceImpl.java | 18 +++++++---
.../mapper/business/HwDeviceMapper.xml | 6 ++--
.../ruoyi/dataprocess/common/ImageUtils.java | 17 +++++++++
.../service/impl/DataProcessServiceImpl.java | 35 ++++++++++++-------
.../com/ruoyi/file/utils/FileUploadUtils.java | 2 +-
.../system/controller/SysDeptController.java | 3 +-
.../system/controller/SysPostController.java | 3 +-
.../system/controller/SysUserController.java | 3 +-
ruoyi-ui/src/api/board/index.js | 2 +-
ruoyi-ui/src/views/board/equipment/index.vue | 2 +-
18 files changed, 89 insertions(+), 32 deletions(-)
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' ? '正常' : '异常' }}
类型: