Compare commits
3 Commits
master
...
master_net
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c86475c9c | ||
|
|
1a4777f86f | ||
|
|
8fb245d8c6 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -60,4 +60,3 @@
|
||||
/gateways/JiShe.IoT.WebGateway/bin/Debug/net10.0
|
||||
/host/JiShe.IoT.HttpApi.Host/bin/Debug/net10.0
|
||||
/src/JiShe.IoT.Application/bin/Debug/net10.0
|
||||
/host/JiShe.IoT.HttpApi.Host/UploadFile/20251210/host/abp-file-management
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
# FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
FROM registry.cn-qingdao.aliyuncs.com/jisheyun/aspnetcore:9.0.11_ub24_simsun_pdp_v350 AS base
|
||||
FROM registry.cn-qingdao.aliyuncs.com/jisheyun/aspnetcore:9.0.6_ub24_simsun_pdp_v341 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 10500
|
||||
EXPOSE 443
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0.308 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
COPY ["JiShe.IoT.Admin.sln", "."]
|
||||
COPY ["Directory.Build.JiShe.targets", "."]
|
||||
COPY ["Directory.Build.Microsoft.targets", "."]
|
||||
|
||||
@ -20,11 +20,8 @@
|
||||
<PackageReference Update="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0"/>
|
||||
<PackageReference Update="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0"/>
|
||||
<PackageReference Update="Microsoft.AspNetCore.Http.Features" Version="2.3.0"/>
|
||||
<PackageReference Update="Microsoft.CSharp" Version="4.14.0"/>
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.Common " Version="4.14.0" />
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
|
||||
<PackageReference Update="Microsoft.CSharp" Version="4.12.0"/>
|
||||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.12.0"/>
|
||||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -7,7 +7,7 @@
|
||||
<VoloAbpVersion>9.3.4</VoloAbpVersion>
|
||||
|
||||
<!--Dotnet 组件 版本-->
|
||||
<DotnetInfoVersion>9.0.11</DotnetInfoVersion>
|
||||
<DotnetInfoVersion>9.0.6</DotnetInfoVersion>
|
||||
|
||||
<!--Dotnet 框架 版本-->
|
||||
<DotnetTargetFrameworkVersion>net9.0</DotnetTargetFrameworkVersion>
|
||||
|
||||
@ -23,22 +23,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Ocelot 网关-->
|
||||
<PackageReference Update="Ocelot" Version="18.0.0"/>
|
||||
<PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/>
|
||||
<PackageReference Update="Ocelot.Provider.Polly" Version="18.0.0"/>
|
||||
<!-- Ocelot 网关-->
|
||||
<PackageReference Update="Ocelot" Version="18.0.0"/>
|
||||
<PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/>
|
||||
<PackageReference Update="Ocelot.Provider.Polly" Version="18.0.0"/>
|
||||
|
||||
<!--FreeRedis-->
|
||||
<PackageReference Update="FreeRedis" Version="1.3.7"/>
|
||||
<PackageReference Update="FreeRedis.DistributedCache" Version="1.3.7"/>
|
||||
|
||||
<!--FreeSql-->
|
||||
<PackageReference Update="FreeSql.Cloud" Version="2.0.1" />
|
||||
<PackageReference Update="FreeSql.Extensions.JsonMap" Version="3.5.303" />
|
||||
<PackageReference Update="FreeSql" Version="3.5.303"/>
|
||||
<PackageReference Update="FreeSql.Provider.MysqlConnector" Version="3.5.303"/>
|
||||
<PackageReference Update="FreeSql.Provider.Sqlite" Version="3.5.303"/>
|
||||
<PackageReference Update="FreeSql.Provider.SqlServer" Version="3.5.303" />
|
||||
|
||||
<!-- 单元测试包-->
|
||||
<PackageReference Update="xunit" Version="2.9.3"/>
|
||||
@ -80,8 +69,8 @@
|
||||
|
||||
|
||||
<!-- Magicodes 导入导出Excel-->
|
||||
<PackageReference Update="Magicodes.IE.Excel" Version="2.8.0"/>
|
||||
<PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.8.0"/>
|
||||
<PackageReference Update="Magicodes.IE.Excel" Version="2.7.5.2"/>
|
||||
<PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.7.5.2"/>
|
||||
|
||||
<!-- MiniProfiler 查看接口耗时,sql耗时-->
|
||||
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.5.4"/>
|
||||
@ -115,28 +104,8 @@
|
||||
<PackageReference Update="Otp.NET" Version="1.4.0" />
|
||||
<PackageReference Update="QRCoder" Version="1.6.0" />
|
||||
|
||||
|
||||
<!--Flurl-->
|
||||
<PackageReference Update="Flurl.Http" Version="4.0.2" />
|
||||
<PackageReference Update="Mapster" Version="7.4.0" />
|
||||
|
||||
<!--Apache.IoTDB-->
|
||||
<PackageReference Update="Apache.IoTDB" Version="2.0.2.12" />
|
||||
|
||||
<!--Kafka-->
|
||||
<PackageReference Update="Confluent.Kafka" Version="2.11.0" />
|
||||
|
||||
<!--DotPulsar-->
|
||||
<PackageReference Update="DotPulsar" Version="5.1.0" />
|
||||
<PackageReference Update="K4os.Compression.LZ4" Version="1.3.8" />
|
||||
<PackageReference Update="ZstdNet" Version="1.4.5" />
|
||||
<PackageReference Update="ZstdSharp.Port" Version="0.8.6" />
|
||||
|
||||
<!--SixLabors.ImageSharp-->
|
||||
<PackageReference Update="SixLabors.ImageSharp" Version="3.1.12" />
|
||||
|
||||
<!--SkiaSharp-->
|
||||
<PackageReference Update="SkiaSharp" Version="3.119.1" />
|
||||
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": true, //开启自动创建Topic
|
||||
"TopicMode": "Static", //Dynamic、Static 主题模式
|
||||
"TopicMode": "Static", //Dynamic 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Static" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": false, //开启自动创建Topic
|
||||
"TopicMode": "Dynamic", //Dynamic、Static 主题模式
|
||||
"TopicMode": "Dynamic", //Dynamic 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Dynamic" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
|
||||
@ -268,7 +268,7 @@ services:
|
||||
- pulsar-net
|
||||
|
||||
admin-api-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1216.1440
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1119.1155
|
||||
container_name: admin-api
|
||||
hostname: admin-api
|
||||
restart: always
|
||||
|
||||
@ -27,11 +27,6 @@ services:
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "3"
|
||||
|
||||
bookie:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1
|
||||
@ -70,11 +65,6 @@ services:
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "3"
|
||||
|
||||
broker:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1
|
||||
@ -145,11 +135,6 @@ services:
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "3"
|
||||
|
||||
iotdb-standalone-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/iotdb:2.0.5-standalone
|
||||
@ -183,11 +168,6 @@ services:
|
||||
- ./iotdb/logs:/iotdb/logs
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "500m"
|
||||
max-file: "5"
|
||||
|
||||
redis-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21
|
||||
@ -209,11 +189,6 @@ services:
|
||||
tty: true
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "3"
|
||||
|
||||
mysql-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6
|
||||
@ -243,14 +218,9 @@ services:
|
||||
tty: true
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "5"
|
||||
|
||||
admin-api-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1216.1440
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1119.1155
|
||||
container_name: admin-api
|
||||
hostname: admin-api
|
||||
restart: always
|
||||
@ -278,11 +248,6 @@ services:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "5"
|
||||
|
||||
admin-web-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949
|
||||
@ -303,11 +268,6 @@ services:
|
||||
condition: service_started
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "2"
|
||||
|
||||
networks:
|
||||
pulsar-net:
|
||||
|
||||
@ -31,11 +31,6 @@ services:
|
||||
- ./iotdb/logs:/iotdb/logs
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "200m"
|
||||
max-file: "5"
|
||||
|
||||
redis-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21
|
||||
@ -57,11 +52,6 @@ services:
|
||||
tty: true
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "3"
|
||||
|
||||
mysql-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6
|
||||
@ -91,14 +81,9 @@ services:
|
||||
tty: true
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "5"
|
||||
|
||||
admin-api-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1216.1440
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1119.1155
|
||||
container_name: admin-api
|
||||
hostname: admin-api
|
||||
restart: always
|
||||
@ -122,11 +107,6 @@ services:
|
||||
condition: service_started
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "5"
|
||||
|
||||
admin-web-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949
|
||||
@ -147,11 +127,6 @@ services:
|
||||
condition: service_started
|
||||
networks:
|
||||
- pulsar-net
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "2"
|
||||
|
||||
networks:
|
||||
pulsar-net:
|
||||
|
||||
@ -85,7 +85,7 @@ services:
|
||||
- pulsar-net
|
||||
|
||||
admin-api-service:
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1216.1440
|
||||
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.1119.1155
|
||||
container_name: admin-api
|
||||
hostname: admin-api
|
||||
restart: always
|
||||
|
||||
@ -1,5 +1 @@
|
||||
CREATE TABLE IF NOT EXISTS CTWingAepReceiveMessageEntity( time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, PlatformTenantId STRING FIELD, ProductId STRING FIELD, ServiceId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, MessageType STRING FIELD, Protocol STRING FIELD, RawMessage STRING FIELD, ReceivedPayload STRING FIELD, ReceivedTimestamps INT64 FIELD, IMSI STRING FIELD, IMEI STRING FIELD ) COMMENT 'CTWingAepReceiveMessageEntity';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS DeviceTelemetryPacketTaskInfo( time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, IoTPlatformProductId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, IoTPlatformProductName STRING FIELD, IoTPlatformAccountId STRING FIELD, AccountPhoneNumber STRING FIELD, IssueRawMessage STRING FIELD, IssuePayload STRING FIELD, ResponseRawMessage STRING FIELD, ResponsePayload STRING FIELD, TelemetrySource INT32 FIELD, IoTPlatform INT32 FIELD, RetryCount INT32 FIELD, LastIssueTime TIMESTAMP FIELD, IssueStatus INT32 FIELD ) COMMENT 'DeviceTelemetryPacketTaskInfo';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS OneNETReceiveMessageEntity( time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, ProductId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, MessageType STRING FIELD, Protocol STRING FIELD, RawMessage STRING FIELD, IsEncrypted BOOLEAN FIELD, PlaintextMessage STRING FIELD, ReceivedPayload STRING FIELD, ReceivedTimestamps INT64 FIELD ) COMMENT 'OneNETReceiveMessageEntity';
|
||||
CREATE TABLE IF NOT EXISTS CTWingAepReceiveMessageEntity(time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, PlatformTenantId STRING FIELD, ProductId STRING FIELD, ServiceId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, MessageType STRING FIELD, Protocol STRING FIELD, RawMessage STRING FIELD, ReceivedPayload STRING FIELD, ReceivedTimestamps INT64 FIELD, IMSI STRING FIELD, IMEI STRING FIELD ) COMMENT 'CTWingAepReceiveMessageEntity';CREATE TABLE IF NOT EXISTS DeviceTelemetryPacketTaskInfo(time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, IoTPlatformProductId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, IoTPlatformProductName STRING FIELD, IoTPlatformAccountId STRING FIELD, AccountPhoneNumber STRING FIELD, TelemetryType INT32 FIELD, IssueRawMessage STRING FIELD, IssuePayload STRING FIELD, ResponseRawMessage STRING FIELD, ResponsePayload STRING FIELD, TelemetrySource INT32 FIELD, IoTPlatform INT32 FIELD, RetryCount INT32 FIELD, LastIssueTime TIMESTAMP FIELD, IssueStatus INT32 FIELD ) COMMENT 'DeviceTelemetryPacketTaskInfo';CREATE TABLE IF NOT EXISTS OneNETReceiveMessageEntity(time TIMESTAMP TIME, IoTDataType STRING TAG, DeviceType STRING TAG, DeviceAddress STRING TAG, SubDevice STRING TAG, ProductId STRING FIELD, IoTPlatformDeviceOpenInfo STRING FIELD, MessageType STRING FIELD, Protocol STRING FIELD, RawMessage STRING FIELD, IsEncrypted BOOLEAN FIELD, PlaintextMessage STRING FIELD, ReceivedPayload STRING FIELD, ReceivedTimestamps INT64 FIELD ) COMMENT 'OneNETReceiveMessageEntity';
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.0.11217.181
|
||||
VisualStudioVersion = 18.0.11217.181 d18.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JiShe.IoT.Domain", "src\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}"
|
||||
EndProject
|
||||
@ -291,12 +291,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DockerComposeShells", "Dock
|
||||
DockerComposeShells\start-service-sub.sh = DockerComposeShells\start-service-sub.sh
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.ServicePro.Shared.DynamicAnalyzerEngine", "JiShe.ServicePro\shared\JiShe.ServicePro.Shared.DynamicAnalyzerEngine\JiShe.ServicePro.Shared.DynamicAnalyzerEngine.csproj", "{539D0149-B52C-7FE1-373D-67EC401D5B47}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.ServicePro.DynamicAnalyzerEngine", "JiShe.ServicePro\frameworks\src\JiShe.ServicePro.DynamicAnalyzerEngine\JiShe.ServicePro.DynamicAnalyzerEngine.csproj", "{6CDFFB25-15FF-19C2-D4AB-921CF40DB056}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.ServicePro.DynamicAnalyzer.Provider", "JiShe.ServicePro\frameworks\src\JiShe.ServicePro.DynamicAnalyzer.Provider\JiShe.ServicePro.DynamicAnalyzer.Provider.csproj", "{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -759,18 +753,6 @@ Global
|
||||
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{539D0149-B52C-7FE1-373D-67EC401D5B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{539D0149-B52C-7FE1-373D-67EC401D5B47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{539D0149-B52C-7FE1-373D-67EC401D5B47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{539D0149-B52C-7FE1-373D-67EC401D5B47}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6CDFFB25-15FF-19C2-D4AB-921CF40DB056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6CDFFB25-15FF-19C2-D4AB-921CF40DB056}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6CDFFB25-15FF-19C2-D4AB-921CF40DB056}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6CDFFB25-15FF-19C2-D4AB-921CF40DB056}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -900,9 +882,6 @@ Global
|
||||
{6A26D2DE-215B-CB11-F882-3984B2EE7AA6} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E}
|
||||
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E}
|
||||
{8FE7CFC6-BA2A-4717-941C-0C227EB151B9} = {2C4A6DB8-8D9E-42E6-B7C3-1EDB7B3DE22E}
|
||||
{539D0149-B52C-7FE1-373D-67EC401D5B47} = {E10B1433-8E8E-4163-AC98-1058004980F9}
|
||||
{6CDFFB25-15FF-19C2-D4AB-921CF40DB056} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E}
|
||||
{516CAE8B-3EDC-8B5C-D15C-5BF9ABF971D8} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 95a6f31a5a1546e612566198f63a2f5e6ce24748
|
||||
Subproject commit 323492e10b2937a063c9e60b26bc40c6954503c7
|
||||
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
<packageSources>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||
<PackageReference Include="Volo.Abp.Account.Web" />
|
||||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
|
||||
@ -85,7 +85,10 @@
|
||||
<Folder Include="UploadFile\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="configs\appsettings - 复制.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="configs\appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
@ -4,19 +4,19 @@
|
||||
"CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Default": "Data Source=192.168.111.174;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;"
|
||||
"Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB54;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;"
|
||||
},
|
||||
"Hangfire": {
|
||||
"Redis": {
|
||||
"Host": "192.168.111.174:30712,password=1q3J@BGf!yhTaD46nS#",
|
||||
"Host": "47.110.53.196:30712,password=1q3J@BGf!yhTaD46nS#",
|
||||
"DB": "2"
|
||||
}
|
||||
},
|
||||
"Redis": {
|
||||
"Configuration": "192.168.111.174:30712,password=1q3J@BGf!yhTaD46nS#,defaultdatabase=5"
|
||||
"Configuration": "47.110.53.196:30712,password=1q3J@BGf!yhTaD46nS#,defaultdatabase=5"
|
||||
},
|
||||
"Kafka": {
|
||||
"BootstrapServers": "47.110.62.104:9094,192.168.111.174:9094,47.110.60.222:9094",
|
||||
"BootstrapServers": "47.110.62.104:9094,47.110.53.196:9094,47.110.60.222:9094",
|
||||
"EnableFilter": true,
|
||||
"EnableAuthorization": false,
|
||||
"SaslUserName": "lixiao",
|
||||
@ -26,8 +26,8 @@
|
||||
"TaskThreadCount": -1
|
||||
},
|
||||
"Pulsar": {
|
||||
"ServiceUrl": "pulsar://192.168.111.174:26974", //pulsar+ssl://iot-north-mq.heclouds.com:6651 ,pulsar://192.168.111.174:26974
|
||||
"WebUrl": "http://192.168.111.174:9094",
|
||||
"ServiceUrl": "pulsar+ssl://iot-north-mq.heclouds.com:6651", //pulsar+ssl://iot-north-mq.heclouds.com:6651 ,pulsar://47.110.53.196:26974
|
||||
"WebUrl": "http://47.110.53.196:9094",
|
||||
"UserName": "admin",
|
||||
"TenantName": "1YMVZZkAkRArjxSD8457",
|
||||
"Namespace": "OneNET",
|
||||
@ -39,14 +39,14 @@
|
||||
"ConnectionTimeout": 30,
|
||||
"OperationTimeout": 30,
|
||||
"KeepAliveInterval": 30,
|
||||
"TaskThreadCount": 1,
|
||||
"TaskThreadCount": 8,
|
||||
"IsSubscriber": true,
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": true, //开启自动创建Topic
|
||||
"TopicMode": "Static", //Dynamic、Static 主题模式
|
||||
"EnableAutoCreation": false, //开启自动创建Topic
|
||||
"TopicMode": "Dynamic", //Dynamic 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Static" ], //允许的Topic类型
|
||||
"AllowedTopicTypes": [ "Dynamic" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
"AdminRoles": [ "admin" ],
|
||||
"EnableConsumerIdleCleanup": true,
|
||||
@ -57,10 +57,10 @@
|
||||
"IoTDBOptions": {
|
||||
"UserName": "root",
|
||||
"Password": "Lixiao@1980",
|
||||
//"TreeModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
//"TableModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
"TreeModelClusterList": [ "192.168.111.174:30710" ],
|
||||
"TableModelClusterList": [ "192.168.111.174:30710" ],
|
||||
//"TreeModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
//"TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
"TreeModelClusterList": [ "47.110.53.196:30710" ],
|
||||
"TableModelClusterList": [ "47.110.53.196:30710" ],
|
||||
"PoolSize": 32,
|
||||
"DataBaseName": "jisheiotdata",
|
||||
"OpenDebugMode": true,
|
||||
@ -97,7 +97,7 @@
|
||||
}
|
||||
},
|
||||
"FreeRedisOptions": {
|
||||
"ConnectionString": "192.168.111.174:30712,password=1q3J@BGf!yhTaD46nS#,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=500,defaultdatabase=14",
|
||||
"ConnectionString": "47.110.53.196:30712,password=1q3J@BGf!yhTaD46nS#,abortConnect=false,connectTimeout=30000,allowAdmin=true,maxPoolSize=500,defaultdatabase=14",
|
||||
"UseDistributedCache": true
|
||||
},
|
||||
"FreeSqlProviderOptions": {
|
||||
|
||||
@ -11,9 +11,19 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
public class DeviceCommandForApiInput:IdInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备在物联网平台中属性设置的参数键值对
|
||||
/// 设备在物联网平台中发送的命令内容,JSON格式
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "命令内容不能为空")]
|
||||
public Dictionary<string,object> CommandContent { get; set; }
|
||||
public string CommandContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public DeviceTypeEnum? DeviceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备指令类型
|
||||
/// </summary>
|
||||
public DeviceTelemetryCommandTypeEnum? TelemetryType { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
using JiShe.ServicePro.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.IoT.IoTPlatformAggregation.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 产品信息输入
|
||||
/// </summary>
|
||||
public class IoTPlatformProductInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台类型
|
||||
/// </summary>
|
||||
[Required]
|
||||
public IoTPlatformTypeEnum IoTPlatformType { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
using JiShe.ServicePro.Enums;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.IoT.IoTPlatformAggregation.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台产品信息
|
||||
/// </summary>
|
||||
public class IoTPlatformProductInfoOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 物联网平台类型
|
||||
/// </summary>
|
||||
public IoTPlatformTypeEnum IoTPlatformType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物联网平台对应的产品Id
|
||||
/// </summary>
|
||||
public string IoTPlatformProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
public string ProductName { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
using JiShe.ServicePro.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.IoT.IoTPlatformAggregation.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 产品属性信息输入
|
||||
/// </summary>
|
||||
public class IoTPlatformProductPropertyInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 物联网平台类型,默认没有指定
|
||||
/// </summary>
|
||||
[Required]
|
||||
public IoTPlatformTypeEnum IoTPlatformType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物联网平台中对应的产品Id
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string IoTPlatformProductId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
using JiShe.IoT.IoTPlatformAggregation.Dto;
|
||||
using JiShe.ServicePro.Commons;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JiShe.IoT.IoTPlatformAggregation
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台聚合服务
|
||||
/// </summary>
|
||||
public interface IIoTPlatformAggregationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取平台产品信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<IoTPlatformProductInfoOutput>> GetIoTPlatformProductInfoAsync(IoTPlatformProductInfoInput input
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// 获取平台产品物模型属性信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SelectResult>> GetIoTPlatformProductPropertyInfoAsync(IoTPlatformProductPropertyInfoInput input
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -45,10 +45,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
return handleResult;
|
||||
}
|
||||
var messageBody = handleResult.Data;
|
||||
if(messageBody== null || messageBody.Commands == null || messageBody.Commands.Count <= 0)
|
||||
{
|
||||
return HttpDataResultExtensions.Failed("设备指令不能为空", -103, ResponeResultEnum.Fail);
|
||||
}
|
||||
string tempMessageBody = null;
|
||||
|
||||
//限定来源类型必须为业务系统
|
||||
if (messageBody.SourceType != DeviceTelemetrySourceTypeEnum.BusinessSystem)
|
||||
@ -63,7 +60,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
return HttpDataResultExtensions.Failed("设备不存在", -1041, ResponeResultEnum.Fail);
|
||||
}
|
||||
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, input, deviceInfo.Adapt<DeviceCacheInfos>(), messageBody.Commands.Serialize());
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, input, deviceInfo.Adapt<DeviceCacheInfos>(), tempMessageBody);
|
||||
|
||||
//将指令存储IoTDB数据库和Redis发布通道
|
||||
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
|
||||
|
||||
@ -6,7 +6,6 @@ using JiShe.ServicePro.DataChannelManages;
|
||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto;
|
||||
using JiShe.ServicePro.DeviceManagement.Permissions;
|
||||
using JiShe.ServicePro.DeviceManagement.ThingModels;
|
||||
using JiShe.ServicePro.Dto;
|
||||
using JiShe.ServicePro.Enums;
|
||||
using JiShe.ServicePro.FreeRedisProvider;
|
||||
@ -30,9 +29,7 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
/// <param name="redisPubSubService">Redis发布订阅服务</param>
|
||||
/// <param name="ioTDBDataChannelManageService">数据通道</param>
|
||||
/// <param name="_ioTDBOptions">IoTDBOptions</param>
|
||||
/// <param name="oneNETProductService">OneNET产品服务</param>
|
||||
/// <param name="deviceThingModelService">设备端物模型服务</param>
|
||||
public class DeviceAggregationService(ILogger<DeviceAggregationService> logger, IDeviceAppService deviceAppService, IOneNETDeviceService oneNETDeviceService, IReliableRedisPubSubService redisPubSubService, IIoTDBDataChannelManageService ioTDBDataChannelManageService,IOptions<IoTDBOptions> _ioTDBOptions, IOneNETProductService oneNETProductService, IDeviceThingModelManagementAppService deviceThingModelService) : IoTAppService, IDeviceAggregationService
|
||||
public class DeviceAggregationService(ILogger<DeviceAggregationService> logger, IDeviceAppService deviceAppService, IOneNETDeviceService oneNETDeviceService, IReliableRedisPubSubService redisPubSubService, IIoTDBDataChannelManageService ioTDBDataChannelManageService,IOptions<IoTDBOptions> _ioTDBOptions) : IoTAppService, IDeviceAggregationService
|
||||
{
|
||||
IoTDBOptions ioTDBOptions = _ioTDBOptions.Value;
|
||||
|
||||
@ -291,45 +288,47 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
{
|
||||
try
|
||||
{
|
||||
if (input.CommandContent == null || input.CommandContent.Keys.Count <=0)
|
||||
{
|
||||
throw new UserFriendlyException($"指令参数异常");
|
||||
}
|
||||
|
||||
var deviceInfo = await deviceAppService.FindByIdAsync(input);
|
||||
if (deviceInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"设备不存在");
|
||||
}
|
||||
|
||||
//将指令存储
|
||||
var receiveCommandInfoDto = new ReceiveCommandInfoDto()
|
||||
var commandRequest = new OpenApiRequest()
|
||||
{
|
||||
DeviceAddress = deviceInfo.DeviceAddress,
|
||||
Commands = input.CommandContent,
|
||||
DeviceType = deviceInfo.DeviceType,
|
||||
SourceType = DeviceTelemetrySourceTypeEnum.AdminSystem,
|
||||
IoTPlatform = deviceInfo.IoTPlatform,
|
||||
Message = new ReceiveCommandInfoDto()
|
||||
{
|
||||
DeviceAddress = deviceInfo.DeviceAddress,
|
||||
Commands = input.CommandContent.Deserialize<Dictionary<string,object>>(),
|
||||
DeviceType = input.DeviceType ?? DeviceTypeEnum.GATEWAY,//todo 设备类型 需要跟设备统一什么情况下知道具体设备类型
|
||||
SourceType = DeviceTelemetrySourceTypeEnum.AdminSystem,
|
||||
TelemetryType = input.TelemetryType ?? DeviceTelemetryCommandTypeEnum.抄读,
|
||||
IoTPlatform = deviceInfo.IoTPlatform,
|
||||
}.Serialize(),
|
||||
};
|
||||
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt<DeviceCacheInfos>(), commandRequest.Message);
|
||||
|
||||
//数据写入遥测任务数据存储通道
|
||||
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
|
||||
{
|
||||
return await DeviceCommandInfoToOneNET(deviceInfo, receiveCommandInfoDto);
|
||||
{
|
||||
await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
|
||||
|
||||
return await DeviceCommandInfoToOneNET(deviceInfo, packetTaskInfo);
|
||||
}
|
||||
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
|
||||
{
|
||||
//await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName,commandRequest);
|
||||
//return true;
|
||||
throw new UserFriendlyException($"发送设备指令信息失败,CTWing暂未实现。");
|
||||
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName,commandRequest);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new UserFriendlyException($"发送设备指令信息失败,未找到对应的产品配置信息。");
|
||||
throw new UserFriendlyException($"创建设备失败,未找到对应的产品配置信息。");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
@ -388,17 +387,15 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
try
|
||||
{
|
||||
CreateDeviceInput createDeviceInput = input.Adapt<CreateDeviceInput>();
|
||||
|
||||
var productInfo = await oneNETProductService.GetProductInfoAsync(new IdInput<string>() { Id = input.IoTPlatformProductId });
|
||||
|
||||
var productInfo = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
|
||||
.Where(e => e.IoTPlatformProductId == input.IoTPlatformProductId)//此处不需要过滤产品状态,方便测试产品配置信息是否准确,避免跟车间生产搞混
|
||||
.WhereIf(input.DeviceSourceTypeEnum == DeviceSourceTypeEnum.Workshop, e => e.IsEnabled == true)
|
||||
.FirstAsync();
|
||||
|
||||
if (productInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"OneNET创建设备失败,未找到对应的产品配置信息。");
|
||||
}
|
||||
|
||||
if (input.DeviceSourceTypeEnum == DeviceSourceTypeEnum.Workshop && !productInfo.IsEnabled) //车间生产推送,必须是已经启用的产品才可以
|
||||
{
|
||||
throw new UserFriendlyException($"车间生产推送OneNET创建设备失败,产品未启用。");
|
||||
throw new UserFriendlyException($"创建设备失败,未找到对应的产品配置信息。");
|
||||
}
|
||||
|
||||
createDeviceInput.DeviceName = input.DeviceAddress;
|
||||
@ -535,26 +532,35 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
public async Task<DeviceManagementInfoDto> RepushDeviceInfoToOneNET(DeviceManagementInfoDto input)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
var productInfo = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
|
||||
.Where(e => e.IoTPlatformProductId == input.IoTPlatformProductId)
|
||||
.FirstAsync();
|
||||
|
||||
if (productInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"推送失败,未找到对应的产品配置信息。");
|
||||
}
|
||||
|
||||
//检查OneNET平台设备是否已经存在
|
||||
var oneNETDeviceInfoResult = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput()
|
||||
{
|
||||
DeviceName = input.IoTPlatformDeviceOpenInfo,
|
||||
ProductId = input.IoTPlatformProductId,
|
||||
OneNETAccountId = input.IoTPlatformAccountId,
|
||||
ProductId = productInfo.IoTPlatformProductId,
|
||||
OneNETAccountId = productInfo.OneNETAccountId,
|
||||
});
|
||||
|
||||
if (oneNETDeviceInfoResult != null && oneNETDeviceInfoResult.Code == ServicePro.Enums.ResponeResultEnum.Success)
|
||||
{
|
||||
throw new UserFriendlyException($"OneNET推送失败,账号产品下{input.IoTPlatformProductId}已经存在该设备{input.DeviceAddress}。");
|
||||
throw new UserFriendlyException($"推送失败,OneNET账号{productInfo.AccountPhoneNumber}的产品下{productInfo.ProductName}已经存在该设备{input.DeviceAddress}。");
|
||||
}
|
||||
|
||||
//推送至OneNET平台
|
||||
var pushResult = await oneNETDeviceService.CreateDeviceInfoAsync(new CreateDeviceInfoInput()
|
||||
{
|
||||
DeviceName = input.IoTPlatformDeviceOpenInfo,
|
||||
ProductId = input.IoTPlatformProductId,
|
||||
OneNETAccountId = input.IoTPlatformAccountId,
|
||||
ProductId = productInfo.IoTPlatformProductId,
|
||||
OneNETAccountId = productInfo.OneNETAccountId,
|
||||
Description = input.DeviceAddress,
|
||||
});
|
||||
|
||||
@ -583,13 +589,23 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
public async Task<bool> DeleteDeviceInfoToOneNET(DeviceManagementInfoDto input)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
var productInfo = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
|
||||
.Where(e => e.IoTPlatformProductId == input.IoTPlatformProductId)
|
||||
.FirstAsync();
|
||||
|
||||
if (productInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"删除失败,未找到对应的产品配置信息。");
|
||||
}
|
||||
|
||||
|
||||
//删除OneNET平台设备信息
|
||||
var deleteResult = await oneNETDeviceService.DeleteDeviceInfoAsync(new DeleteDeviceInfoInput()
|
||||
{
|
||||
DeviceName = input.IoTPlatformDeviceOpenInfo,
|
||||
ProductId = input.IoTPlatformProductId,
|
||||
OneNETAccountId = input.IoTPlatformAccountId,
|
||||
ProductId = productInfo.IoTPlatformProductId,
|
||||
OneNETAccountId = productInfo.OneNETAccountId,
|
||||
});
|
||||
|
||||
if (deleteResult == null || deleteResult.Code != ServicePro.Enums.ResponeResultEnum.Success)
|
||||
@ -618,39 +634,13 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
/// 发送OneNET平台设备指令
|
||||
/// </summary>
|
||||
/// <param name="deviceInfo"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="packetTaskInfo"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="UserFriendlyException"></exception>
|
||||
public async Task<bool> DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto input)
|
||||
public async Task<bool> DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, DeviceTelemetryPacketTaskInfo packetTaskInfo)
|
||||
{
|
||||
try
|
||||
{
|
||||
//检查设备是否有配置设备端物模型信息
|
||||
//如果有配置,就检查指令字典中是否有SpecialCommand标识符
|
||||
//如果有就需要构建 SpecialCommand 的特别指令
|
||||
|
||||
if (deviceInfo.IsNeedConfigDevicMdoel && deviceInfo.DeviceThingModelDataId.HasValue && input.Commands.ContainsKey(ThingModelFixedTypeConst.SpecialCommand))
|
||||
{
|
||||
var propertyInfo = await oneNETProductService.GetProductThingModelSpecialCommandDataTypeListAsync(new IdInput<string>() { Id = deviceInfo.IoTPlatformProductId });
|
||||
|
||||
if (propertyInfo == null)
|
||||
{
|
||||
throw new UserFriendlyException($"{nameof(DeviceCommandInfoToOneNET)} OneNET设备属性设置失败,产品Id{deviceInfo.IoTPlatformProductId}未找到对应的属性信息。");
|
||||
}
|
||||
|
||||
Dictionary<string, string> tempSpecialCommand = await deviceThingModelService.BuildThingModelSpecialCommandAsync(propertyInfo, deviceInfo.DeviceThingModelDataId.Value);
|
||||
|
||||
input.Commands[ThingModelFixedTypeConst.SpecialCommand] = tempSpecialCommand;
|
||||
}
|
||||
|
||||
var commandRequest = new OpenApiRequest()
|
||||
{
|
||||
Message = input.Serialize(),
|
||||
};
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt<DeviceCacheInfos>(), input.Commands.Serialize());
|
||||
|
||||
await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
|
||||
|
||||
{
|
||||
//检查下设备是否在线
|
||||
var deviceOnlineStatus = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput()
|
||||
{
|
||||
|
||||
@ -52,8 +52,8 @@ namespace JiShe.IoT
|
||||
DeviceType = $"{commandIssueInfo.DeviceType}",
|
||||
DeviceAddress = commandIssueInfo.DeviceAddress,
|
||||
IssueRawMessage = input.Serialize(),
|
||||
IssuePayload = messageBody,
|
||||
IoTDataType = IoTDBDataTypeConst.Command,
|
||||
TelemetryType = (int)commandIssueInfo.TelemetryType,
|
||||
TelemetrySource = (int)commandIssueInfo.SourceType,
|
||||
IoTPlatform = (int)commandIssueInfo.IoTPlatform,
|
||||
IoTPlatformProductId = deviceInfo.IoTPlatformProductId,
|
||||
@ -61,6 +61,7 @@ namespace JiShe.IoT
|
||||
IoTPlatformAccountId = deviceInfo.IoTPlatformAccountId,
|
||||
AccountPhoneNumber = deviceInfo.AccountPhoneNumber,
|
||||
IoTPlatformProductName = deviceInfo.IoTPlatformProductName,
|
||||
IssuePayload = messageBody,
|
||||
RetryCount = 0,
|
||||
IssueStatus = (int)DeviceCommandIssueStatusEnum.Unprocessed,
|
||||
LastIssueTime = DateTime.Now
|
||||
|
||||
@ -1,179 +0,0 @@
|
||||
using Castle.Core.Logging;
|
||||
using JiShe.IoT.IoTPlatformAggregation.Dto;
|
||||
using JiShe.ServicePro.Commons;
|
||||
using JiShe.ServicePro.Core;
|
||||
using JiShe.ServicePro.CTWingManagement.CTWingProducts;
|
||||
using JiShe.ServicePro.Enums;
|
||||
using JiShe.ServicePro.FreeRedisProvider;
|
||||
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
||||
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace JiShe.IoT.IoTPlatformAggregation
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台聚合服务
|
||||
/// </summary>
|
||||
public class IoTPlatformAggregationService : IoTAppService, IIoTPlatformAggregationService
|
||||
{
|
||||
private readonly ILogger<IoTPlatformAggregationService> _logger;
|
||||
private readonly ICTWingProductService _ctwingProductService;
|
||||
private readonly IOneNETProductService _oneNetProductService;
|
||||
|
||||
public IoTPlatformAggregationService(ILogger<IoTPlatformAggregationService> logger,
|
||||
ICTWingProductService ctwingProductService,
|
||||
IOneNETProductService oneNetProductService)
|
||||
{
|
||||
_logger = logger;
|
||||
_ctwingProductService = ctwingProductService;
|
||||
_oneNetProductService = oneNetProductService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取平台产品信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<IoTPlatformProductInfoOutput>> GetIoTPlatformProductInfoAsync(IoTPlatformProductInfoInput input
|
||||
)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new UserFriendlyException($"{nameof(GetIoTPlatformProductInfoAsync)} 平台产品聚合服务获取产品信息失败,参数异常");
|
||||
}
|
||||
List<IoTPlatformProductInfoOutput> ioTPlatformProductInfoOutputs = new List<IoTPlatformProductInfoOutput>();
|
||||
if (input.IoTPlatformType == IoTPlatformTypeEnum.CTWing)
|
||||
{
|
||||
var ctwingProductInfos = await _ctwingProductService.GetAllListAsync();
|
||||
if (ctwingProductInfos == null)
|
||||
{
|
||||
return ioTPlatformProductInfoOutputs;
|
||||
}
|
||||
|
||||
foreach (var ctwingProductInfo in ctwingProductInfos)
|
||||
{
|
||||
ioTPlatformProductInfoOutputs.Add(new IoTPlatformProductInfoOutput
|
||||
{
|
||||
IoTPlatformType = IoTPlatformTypeEnum.CTWing,
|
||||
IoTPlatformProductId = ctwingProductInfo.IoTPlatformProductId,
|
||||
ProductName = ctwingProductInfo.ProductName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (input.IoTPlatformType == IoTPlatformTypeEnum.OneNET)
|
||||
{
|
||||
var oneNetProductInfos = await _oneNetProductService.GetAllListAsync();
|
||||
if (oneNetProductInfos == null)
|
||||
{
|
||||
return ioTPlatformProductInfoOutputs;
|
||||
}
|
||||
foreach (var oneNetProductInfo in oneNetProductInfos)
|
||||
{
|
||||
ioTPlatformProductInfoOutputs.Add(new IoTPlatformProductInfoOutput
|
||||
{
|
||||
IoTPlatformType = IoTPlatformTypeEnum.OneNET,
|
||||
IoTPlatformProductId = oneNetProductInfo.IoTPlatformProductId,
|
||||
ProductName = oneNetProductInfo.ProductName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return ioTPlatformProductInfoOutputs;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取平台产品物模型属性信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SelectResult>> GetIoTPlatformProductPropertyInfoAsync(IoTPlatformProductPropertyInfoInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new UserFriendlyException($"{nameof(GetIoTPlatformProductPropertyInfoAsync)} 平台产品聚合服务获取产品属性信息失败,参数异常");
|
||||
}
|
||||
var key = string.Format($"{RedisConst.CachePlatformProductThingModelInfoKey}", input.IoTPlatformType);
|
||||
List<SelectResult> selectResults = new List<SelectResult>();
|
||||
|
||||
List<IoTPlatformProductInfoOutput> ioTPlatformProductInfoOutputs = new List<IoTPlatformProductInfoOutput>();
|
||||
if (input.IoTPlatformType == IoTPlatformTypeEnum.CTWing)
|
||||
{
|
||||
//var ctwingProductInfos = await _ctwingProductService.GetAllListAsync();
|
||||
//if (ctwingProductInfos == null)
|
||||
//{
|
||||
// return ioTPlatformProductInfoOutputs;
|
||||
//}
|
||||
|
||||
//foreach (var ctwingProductInfo in ctwingProductInfos)
|
||||
//{
|
||||
// ioTPlatformProductInfoOutputs.Add(new IoTPlatformProductInfoOutput
|
||||
// {
|
||||
// IoTPlatformType = IoTPlatformTypeEnum.CTWing,
|
||||
// IoTPlatformProductId = ctwingProductInfo.IoTPlatformProductId,
|
||||
// ProductName = ctwingProductInfo.ProductName
|
||||
// });
|
||||
//}
|
||||
_logger.LogError($"{nameof(GetIoTPlatformProductPropertyInfoAsync)}产品聚合服务暂不支持CTWing产品物模型属性信息查询");
|
||||
|
||||
return selectResults;
|
||||
}
|
||||
|
||||
|
||||
if (input.IoTPlatformType == IoTPlatformTypeEnum.OneNET)
|
||||
{
|
||||
|
||||
var oneNETAllThingModel = FreeRedisProvider.Instance.HGet<OneNETAllThingModel>(key, input.IoTPlatformProductId);
|
||||
if (oneNETAllThingModel != null)
|
||||
{
|
||||
return OneNETAllThingModel.GetAllPropertiesSelectResult(oneNETAllThingModel.Properties);
|
||||
}
|
||||
|
||||
var oneNetProductInfos = await _oneNetProductService.GetProductInfoAsync(new IdInput<string>() { Id = input.IoTPlatformProductId });
|
||||
if (oneNetProductInfos == null || string.IsNullOrWhiteSpace(oneNetProductInfos.ThingModelInfos))
|
||||
{
|
||||
return selectResults;
|
||||
}
|
||||
|
||||
|
||||
|
||||
oneNETAllThingModel = oneNetProductInfos.ThingModelInfos.Deserialize<OneNETAllThingModel>();
|
||||
|
||||
if (oneNETAllThingModel == null)
|
||||
{
|
||||
return selectResults;
|
||||
}
|
||||
|
||||
await FreeRedisProvider.Instance.HSetAsync<OneNETAllThingModel>(key, input.IoTPlatformProductId, oneNETAllThingModel);
|
||||
|
||||
return OneNETAllThingModel.GetAllPropertiesSelectResult(oneNETAllThingModel.Properties);
|
||||
}
|
||||
|
||||
return selectResults;
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -38,7 +38,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" />
|
||||
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"Default": "Data Source=192.168.111.174;Port=13306;Database=JiSheIoTProDB;uid=root;pwd=JiShe!aqG#5kGgh&0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;"
|
||||
"Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB54;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;"
|
||||
},
|
||||
"IoTDBOptions": {
|
||||
"UserName": "root",
|
||||
"Password": "Lixiao@1980",
|
||||
//"TreeModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
//"TableModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
"TreeModelClusterList": [ "192.168.111.174:30710" ],
|
||||
"TableModelClusterList": [ "192.168.111.174:30710" ],
|
||||
//"TreeModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
//"TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
|
||||
"TreeModelClusterList": [ "47.110.53.196:30710" ],
|
||||
"TableModelClusterList": [ "47.110.53.196:30710" ],
|
||||
"PoolSize": 32,
|
||||
"DataBaseName": "jisheiotdata",
|
||||
"OpenDebugMode": false,
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
<ProjectReference Include="..\..\JiShe.ServicePro\modules\TemplateManagement\src\JiShe.ServicePro.TemplateManagement.Domain.Shared\JiShe.ServicePro.TemplateManagement.Domain.Shared.csproj" />
|
||||
<ProjectReference Include="..\..\JiShe.ServicePro\modules\OneNETManagement\src\JiShe.ServicePro.OneNETManagement.Domain.Shared\JiShe.ServicePro.OneNETManagement.Domain.Shared.csproj" />
|
||||
<ProjectReference Include="..\..\JiShe.ServicePro\frameworks\src\JiShe.ServicePro.Core\JiShe.ServicePro.Core.csproj" />
|
||||
<ProjectReference Include="..\..\JiShe.ServicePro\shared\JiShe.ServicePro.Shared.DynamicAnalyzerEngine\JiShe.ServicePro.Shared.DynamicAnalyzerEngine.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@ -40,11 +39,10 @@
|
||||
<PackageReference Include="JiShe.ServicePro.Core" />
|
||||
<PackageReference Include="JiShe.ServicePro.CTWingManagement.Domain.Shared" />
|
||||
<PackageReference Include="JiShe.ServicePro.OneNETManagement.Domain.Shared" />
|
||||
<PackageReference Include="JiShe.ServicePro.Shared.DynamicAnalyzerEngine" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Volo.Abp.Core" />
|
||||
</ItemGroup>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -7,9 +7,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj" />
|
||||
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL.Pomelo" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug'" Label="Debug">
|
||||
|
||||
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||
namespace JiShe.IoT.Migrations
|
||||
{
|
||||
[DbContext(typeof(IoTDbContext))]
|
||||
[Migration("20251222073841_InitialCreate")]
|
||||
[Migration("20251207055002_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@ -22,7 +22,7 @@ namespace JiShe.IoT.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("ProductVersion", "9.0.6")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
@ -887,6 +887,7 @@ namespace JiShe.IoT.Migrations
|
||||
.HasComment("函数解析标记,默认为false, 不能解析");
|
||||
|
||||
b.Property<string>("FunctionScript")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasComment("脚本函数体");
|
||||
|
||||
@ -926,6 +927,10 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权最后修改者Id");
|
||||
|
||||
b.Property<int>("ParsingSequence")
|
||||
.HasColumnType("int")
|
||||
.HasComment("解析顺序,1234或者3412(高低位反转)");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("备注");
|
||||
@ -1011,6 +1016,7 @@ namespace JiShe.IoT.Migrations
|
||||
.HasComment("物联网平台中对应的产品Id");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldDataType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
|
||||
@ -1021,10 +1027,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(64)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件名称");
|
||||
|
||||
b.Property<Guid>("IoTPlatformThingModelDataId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("系统中平台端物模型数据Id");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit(1)")
|
||||
@ -1043,14 +1045,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<int>("NativeSkipNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("正序跳过数量");
|
||||
|
||||
b.Property<int>("NativeTakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("正序获取数量");
|
||||
|
||||
b.Property<int?>("OSACreatorId")
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权创建者Id");
|
||||
@ -1063,21 +1057,13 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权最后修改者Id");
|
||||
|
||||
b.Property<int>("ParsingSequence")
|
||||
.HasColumnType("int")
|
||||
.HasComment("解析顺序,1234或者3412(高低反转)");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("备注");
|
||||
|
||||
b.Property<int?>("ReversalSkipNumber")
|
||||
b.Property<int>("SkipNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("反转跳过数量");
|
||||
|
||||
b.Property<int?>("ReversalTakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("反转获取数量");
|
||||
.HasComment("跳过数量");
|
||||
|
||||
b.Property<string>("StandardFieldDisplayName")
|
||||
.IsRequired()
|
||||
@ -1097,6 +1083,10 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(20)")
|
||||
.HasComment("标准物模型字段值类型");
|
||||
|
||||
b.Property<int>("TakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("获取数量");
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("TenantId")
|
||||
@ -1167,15 +1157,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("物联网平台中对应的产品Id");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldDataType")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldExtension")
|
||||
.HasColumnType("text")
|
||||
.HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
@ -1188,10 +1169,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<sbyte>("IsSpecialIdentifier")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("是否是特殊物模型标识符");
|
||||
|
||||
b.Property<sbyte>("IsValueNeedConvert")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("是否需要值类型转换");
|
||||
@ -984,8 +984,9 @@ namespace JiShe.IoT.Migrations
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ScriptName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FunctionScript = table.Column<string>(type: "text", nullable: true, comment: "脚本函数体")
|
||||
FunctionScript = table.Column<string>(type: "text", nullable: false, comment: "脚本函数体")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ParsingSequence = table.Column<int>(type: "int", nullable: false, comment: "解析顺序,1234或者3412(高低位反转)"),
|
||||
FunctionAnalysisFlag = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "函数解析标记,默认为false, 不能解析"),
|
||||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
@ -1021,12 +1022,11 @@ namespace JiShe.IoT.Migrations
|
||||
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型"),
|
||||
IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IoTPlatformThingModelDataId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "系统中平台端物模型数据Id", collation: "ascii_general_ci"),
|
||||
FiledType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IoTPlatformRawFieldDataType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "物联网平台中对应的产品物模型属性或者事件数据类型")
|
||||
IoTPlatformRawFieldDataType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件数据类型")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
@ -1035,11 +1035,8 @@ namespace JiShe.IoT.Migrations
|
||||
StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"),
|
||||
NativeSkipNumber = table.Column<int>(type: "int", nullable: false, comment: "正序跳过数量"),
|
||||
NativeTakeNumber = table.Column<int>(type: "int", nullable: false, comment: "正序获取数量"),
|
||||
ParsingSequence = table.Column<int>(type: "int", nullable: false, comment: "解析顺序,1234或者3412(高低反转)"),
|
||||
ReversalSkipNumber = table.Column<int>(type: "int", nullable: true, comment: "反转跳过数量"),
|
||||
ReversalTakeNumber = table.Column<int>(type: "int", nullable: true, comment: "反转获取数量"),
|
||||
SkipNumber = table.Column<int>(type: "int", nullable: false, comment: "跳过数量"),
|
||||
TakeNumber = table.Column<int>(type: "int", nullable: false, comment: "获取数量"),
|
||||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
@ -1077,8 +1074,6 @@ namespace JiShe.IoT.Migrations
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IoTPlatformRawFieldDataType = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "物联网平台中对应的产品物模型属性或者事件数据类型")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
StandardFieldValueType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型")
|
||||
@ -1086,9 +1081,6 @@ namespace JiShe.IoT.Migrations
|
||||
StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"),
|
||||
IsSpecialIdentifier = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否是特殊物模型标识符"),
|
||||
IoTPlatformRawFieldExtension = table.Column<string>(type: "text", nullable: true, comment: "物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
@ -19,7 +19,7 @@ namespace JiShe.IoT.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("ProductVersion", "9.0.6")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
@ -884,6 +884,7 @@ namespace JiShe.IoT.Migrations
|
||||
.HasComment("函数解析标记,默认为false, 不能解析");
|
||||
|
||||
b.Property<string>("FunctionScript")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasComment("脚本函数体");
|
||||
|
||||
@ -923,6 +924,10 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权最后修改者Id");
|
||||
|
||||
b.Property<int>("ParsingSequence")
|
||||
.HasColumnType("int")
|
||||
.HasComment("解析顺序,1234或者3412(高低位反转)");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("备注");
|
||||
@ -1008,6 +1013,7 @@ namespace JiShe.IoT.Migrations
|
||||
.HasComment("物联网平台中对应的产品Id");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldDataType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
|
||||
@ -1018,10 +1024,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(64)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件名称");
|
||||
|
||||
b.Property<Guid>("IoTPlatformThingModelDataId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("系统中平台端物模型数据Id");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit(1)")
|
||||
@ -1040,14 +1042,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<int>("NativeSkipNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("正序跳过数量");
|
||||
|
||||
b.Property<int>("NativeTakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("正序获取数量");
|
||||
|
||||
b.Property<int?>("OSACreatorId")
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权创建者Id");
|
||||
@ -1060,21 +1054,13 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("int")
|
||||
.HasComment("旧系统授权最后修改者Id");
|
||||
|
||||
b.Property<int>("ParsingSequence")
|
||||
.HasColumnType("int")
|
||||
.HasComment("解析顺序,1234或者3412(高低反转)");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("备注");
|
||||
|
||||
b.Property<int?>("ReversalSkipNumber")
|
||||
b.Property<int>("SkipNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("反转跳过数量");
|
||||
|
||||
b.Property<int?>("ReversalTakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("反转获取数量");
|
||||
.HasComment("跳过数量");
|
||||
|
||||
b.Property<string>("StandardFieldDisplayName")
|
||||
.IsRequired()
|
||||
@ -1094,6 +1080,10 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(20)")
|
||||
.HasComment("标准物模型字段值类型");
|
||||
|
||||
b.Property<int>("TakeNumber")
|
||||
.HasColumnType("int")
|
||||
.HasComment("获取数量");
|
||||
|
||||
b.Property<Guid?>("TenantId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnName("TenantId")
|
||||
@ -1164,15 +1154,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("物联网平台中对应的产品Id");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldDataType")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("varchar(64)")
|
||||
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldExtension")
|
||||
.HasColumnType("text")
|
||||
.HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
|
||||
|
||||
b.Property<string>("IoTPlatformRawFieldName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
@ -1185,10 +1166,6 @@ namespace JiShe.IoT.Migrations
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<sbyte>("IsSpecialIdentifier")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("是否是特殊物模型标识符");
|
||||
|
||||
b.Property<sbyte>("IsValueNeedConvert")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("是否需要值类型转换");
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
using JiShe.IoT.DeviceAggregation;
|
||||
using JiShe.IoT.DeviceAggregation.Dto;
|
||||
using JiShe.IoT.IoTPlatformAggregation;
|
||||
using JiShe.IoT.IoTPlatformAggregation.Dto;
|
||||
using JiShe.ServicePro;
|
||||
using JiShe.ServicePro.Commons;
|
||||
using JiShe.ServicePro.Core;
|
||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
||||
|
||||
namespace JiShe.IoT.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台产品聚合服务
|
||||
/// </summary>
|
||||
[Route("/Aggregation/IoTPlatform")]
|
||||
public class IoTPlatformAggregationController : IoTController
|
||||
{
|
||||
private readonly IIoTPlatformAggregationService _iotPlatformAggregationService;
|
||||
public IoTPlatformAggregationController(IIoTPlatformAggregationService deviceAggregationService)
|
||||
{
|
||||
_iotPlatformAggregationService = deviceAggregationService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取平台产品信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost(nameof(GetIoTPlatformProductInfoAsync))]
|
||||
[SwaggerOperation(summary: "获取平台产品信息", Tags = new[] { "AggregationIoTPlatform" })]
|
||||
public async Task<List<IoTPlatformProductInfoOutput>> GetIoTPlatformProductInfoAsync(IoTPlatformProductInfoInput input)
|
||||
{
|
||||
return await _iotPlatformAggregationService.GetIoTPlatformProductInfoAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取平台产品物模型属性信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost(nameof(GetIoTPlatformProductPropertyInfoAsync))]
|
||||
[SwaggerOperation(summary: "获取平台产品物模型属性信息", Tags = new[] { "AggregationIoTPlatform" })]
|
||||
public async Task<List<SelectResult>> GetIoTPlatformProductPropertyInfoAsync(IoTPlatformProductPropertyInfoInput input)
|
||||
{
|
||||
return await _iotPlatformAggregationService.GetIoTPlatformProductPropertyInfoAsync(input);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user