Compare commits

..

3 Commits

Author SHA1 Message Date
陈益
1c86475c9c MySQL.Pomelo 2025-12-07 20:12:02 +08:00
陈益
1a4777f86f 升级为9.3.4 2025-12-07 13:21:07 +08:00
陈益
8fb245d8c6 忽略 2025-12-07 11:10:08 +08:00
35 changed files with 170 additions and 721 deletions

1
.gitignore vendored
View File

@ -60,4 +60,3 @@
/gateways/JiShe.IoT.WebGateway/bin/Debug/net10.0 /gateways/JiShe.IoT.WebGateway/bin/Debug/net10.0
/host/JiShe.IoT.HttpApi.Host/bin/Debug/net10.0 /host/JiShe.IoT.HttpApi.Host/bin/Debug/net10.0
/src/JiShe.IoT.Application/bin/Debug/net10.0 /src/JiShe.IoT.Application/bin/Debug/net10.0
/host/JiShe.IoT.HttpApi.Host/UploadFile/20251210/host/abp-file-management

View File

@ -1,12 +1,12 @@
# FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base # 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 WORKDIR /app
EXPOSE 10500 EXPOSE 10500
EXPOSE 443 EXPOSE 443
ENV TZ=Asia/Shanghai ENV TZ=Asia/Shanghai
ENV ASPNETCORE_ENVIRONMENT=Development 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 ["JiShe.IoT.Admin.sln", "."]
COPY ["Directory.Build.JiShe.targets", "."] COPY ["Directory.Build.JiShe.targets", "."]
COPY ["Directory.Build.Microsoft.targets", "."] COPY ["Directory.Build.Microsoft.targets", "."]

View File

@ -20,11 +20,8 @@
<PackageReference Update="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0"/> <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.Abstractions" Version="2.3.0"/>
<PackageReference Update="Microsoft.AspNetCore.Http.Features" 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.CSharp" Version="4.12.0"/>
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" /> <PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.12.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.NET.Test.Sdk" Version="17.8.0"/> <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -7,7 +7,7 @@
<VoloAbpVersion>9.3.4</VoloAbpVersion> <VoloAbpVersion>9.3.4</VoloAbpVersion>
<!--Dotnet 组件 版本--> <!--Dotnet 组件 版本-->
<DotnetInfoVersion>9.0.11</DotnetInfoVersion> <DotnetInfoVersion>9.0.6</DotnetInfoVersion>
<!--Dotnet 框架 版本--> <!--Dotnet 框架 版本-->
<DotnetTargetFrameworkVersion>net9.0</DotnetTargetFrameworkVersion> <DotnetTargetFrameworkVersion>net9.0</DotnetTargetFrameworkVersion>

View File

@ -23,22 +23,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<!-- Ocelot 网关--> <!-- Ocelot 网关-->
<PackageReference Update="Ocelot" Version="18.0.0"/> <PackageReference Update="Ocelot" Version="18.0.0"/>
<PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/> <PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/>
<PackageReference Update="Ocelot.Provider.Polly" 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"/> <PackageReference Update="xunit" Version="2.9.3"/>
@ -80,8 +69,8 @@
<!-- Magicodes 导入导出Excel--> <!-- Magicodes 导入导出Excel-->
<PackageReference Update="Magicodes.IE.Excel" Version="2.8.0"/> <PackageReference Update="Magicodes.IE.Excel" Version="2.7.5.2"/>
<PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.8.0"/> <PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.7.5.2"/>
<!-- MiniProfiler 查看接口耗时,sql耗时--> <!-- MiniProfiler 查看接口耗时,sql耗时-->
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.5.4"/> <PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.5.4"/>
@ -115,28 +104,8 @@
<PackageReference Update="Otp.NET" Version="1.4.0" /> <PackageReference Update="Otp.NET" Version="1.4.0" />
<PackageReference Update="QRCoder" Version="1.6.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--> <!--SixLabors.ImageSharp-->
<PackageReference Update="SixLabors.ImageSharp" Version="3.1.12" /> <PackageReference Update="SixLabors.ImageSharp" Version="3.1.12" />
<!--SkiaSharp-->
<PackageReference Update="SkiaSharp" Version="3.119.1" />
</ItemGroup> </ItemGroup>

View File

@ -44,7 +44,7 @@
"DefaultPartitions": 16, "DefaultPartitions": 16,
"DefaultBundles": 16, "DefaultBundles": 16,
"EnableAutoCreation": true, //Topic "EnableAutoCreation": true, //Topic
"TopicMode": "Static", //DynamicStatic "TopicMode": "Static", //Dynamic
"EnableTopicTypeFilter": true, //Topic "EnableTopicTypeFilter": true, //Topic
"AllowedTopicTypes": [ "Static" ], //Topic "AllowedTopicTypes": [ "Static" ], //Topic
"AllowedClusters": [ "pulsar-cluster-1" ], // "AllowedClusters": [ "pulsar-cluster-1" ], //

View File

@ -44,7 +44,7 @@
"DefaultPartitions": 16, "DefaultPartitions": 16,
"DefaultBundles": 16, "DefaultBundles": 16,
"EnableAutoCreation": false, //Topic "EnableAutoCreation": false, //Topic
"TopicMode": "Dynamic", //DynamicStatic "TopicMode": "Dynamic", //Dynamic
"EnableTopicTypeFilter": true, //Topic "EnableTopicTypeFilter": true, //Topic
"AllowedTopicTypes": [ "Dynamic" ], //Topic "AllowedTopicTypes": [ "Dynamic" ], //Topic
"AllowedClusters": [ "pulsar-cluster-1" ], // "AllowedClusters": [ "pulsar-cluster-1" ], //

View File

@ -268,7 +268,7 @@ services:
- pulsar-net - pulsar-net
admin-api-service: 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 container_name: admin-api
hostname: admin-api hostname: admin-api
restart: always restart: always

View File

@ -27,11 +27,6 @@ services:
timeout: 10s timeout: 10s
retries: 5 retries: 5
start_period: 60s start_period: 60s
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
bookie: bookie:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1 image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1
@ -70,11 +65,6 @@ services:
timeout: 10s timeout: 10s
retries: 5 retries: 5
start_period: 60s start_period: 60s
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
broker: broker:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1 image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.1.1
@ -145,11 +135,6 @@ services:
timeout: 10s timeout: 10s
retries: 5 retries: 5
start_period: 60s start_period: 60s
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
iotdb-standalone-service: iotdb-standalone-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/iotdb:2.0.5-standalone image: registry.cn-qingdao.aliyuncs.com/jisheyun/iotdb:2.0.5-standalone
@ -183,11 +168,6 @@ services:
- ./iotdb/logs:/iotdb/logs - ./iotdb/logs:/iotdb/logs
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "500m"
max-file: "5"
redis-service: redis-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21 image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21
@ -209,11 +189,6 @@ services:
tty: true tty: true
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
mysql-service: mysql-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6 image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6
@ -243,14 +218,9 @@ services:
tty: true tty: true
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
admin-api-service: 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 container_name: admin-api
hostname: admin-api hostname: admin-api
restart: always restart: always
@ -278,11 +248,6 @@ services:
condition: service_healthy condition: service_healthy
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
admin-web-service: admin-web-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949 image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949
@ -303,11 +268,6 @@ services:
condition: service_started condition: service_started
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "20m"
max-file: "2"
networks: networks:
pulsar-net: pulsar-net:

View File

@ -31,11 +31,6 @@ services:
- ./iotdb/logs:/iotdb/logs - ./iotdb/logs:/iotdb/logs
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "200m"
max-file: "5"
redis-service: redis-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21 image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21
@ -57,11 +52,6 @@ services:
tty: true tty: true
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
mysql-service: mysql-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6 image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6
@ -91,14 +81,9 @@ services:
tty: true tty: true
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
admin-api-service: 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 container_name: admin-api
hostname: admin-api hostname: admin-api
restart: always restart: always
@ -122,11 +107,6 @@ services:
condition: service_started condition: service_started
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
admin-web-service: admin-web-service:
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949 image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.1030.0949
@ -147,11 +127,6 @@ services:
condition: service_started condition: service_started
networks: networks:
- pulsar-net - pulsar-net
logging:
driver: "json-file"
options:
max-size: "20m"
max-file: "2"
networks: networks:
pulsar-net: pulsar-net:

View File

@ -85,7 +85,7 @@ services:
- pulsar-net - pulsar-net
admin-api-service: 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 container_name: admin-api
hostname: admin-api hostname: admin-api
restart: always restart: always

View File

@ -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 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';
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';

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18 # Visual Studio Version 18
VisualStudioVersion = 18.0.11217.181 VisualStudioVersion = 18.0.11217.181 d18.0
MinimumVisualStudioVersion = 10.0.40219.1 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}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JiShe.IoT.Domain", "src\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}"
EndProject EndProject
@ -291,12 +291,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DockerComposeShells", "Dock
DockerComposeShells\start-service-sub.sh = DockerComposeShells\start-service-sub.sh DockerComposeShells\start-service-sub.sh = DockerComposeShells\start-service-sub.sh
EndProjectSection EndProjectSection
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -900,9 +882,6 @@ Global
{6A26D2DE-215B-CB11-F882-3984B2EE7AA6} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E} {6A26D2DE-215B-CB11-F882-3984B2EE7AA6} = {72493AF2-CDAA-40A7-98AB-B8AA2B05965E}
{C51F35A8-5BF8-8E2F-96B2-B62E3BCF8273} = {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} {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 EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}

@ -1 +1 @@
Subproject commit 95a6f31a5a1546e612566198f63a2f5e6ce24748 Subproject commit 323492e10b2937a063c9e60b26bc40c6954503c7

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<packageSources> <packageSources>

View File

@ -13,7 +13,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" /> <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="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Volo.Abp.Account.Web" /> <PackageReference Include="Volo.Abp.Account.Web" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
@ -85,7 +85,10 @@
<Folder Include="UploadFile\" /> <Folder Include="UploadFile\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="configs\appsettings - 复制.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="configs\appsettings.Development.json"> <Content Update="configs\appsettings.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>

View File

@ -4,19 +4,19 @@
"CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200" "CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200"
}, },
"ConnectionStrings": { "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": { "Hangfire": {
"Redis": { "Redis": {
"Host": "192.168.111.174:30712,password=1q3J@BGf!yhTaD46nS#", "Host": "47.110.53.196:30712,password=1q3J@BGf!yhTaD46nS#",
"DB": "2" "DB": "2"
} }
}, },
"Redis": { "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": { "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, "EnableFilter": true,
"EnableAuthorization": false, "EnableAuthorization": false,
"SaslUserName": "lixiao", "SaslUserName": "lixiao",
@ -26,8 +26,8 @@
"TaskThreadCount": -1 "TaskThreadCount": -1
}, },
"Pulsar": { "Pulsar": {
"ServiceUrl": "pulsar://192.168.111.174:26974", //pulsar+ssl://iot-north-mq.heclouds.com:6651 pulsar://192.168.111.174:26974 "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://192.168.111.174:9094", "WebUrl": "http://47.110.53.196:9094",
"UserName": "admin", "UserName": "admin",
"TenantName": "1YMVZZkAkRArjxSD8457", "TenantName": "1YMVZZkAkRArjxSD8457",
"Namespace": "OneNET", "Namespace": "OneNET",
@ -39,14 +39,14 @@
"ConnectionTimeout": 30, "ConnectionTimeout": 30,
"OperationTimeout": 30, "OperationTimeout": 30,
"KeepAliveInterval": 30, "KeepAliveInterval": 30,
"TaskThreadCount": 1, "TaskThreadCount": 8,
"IsSubscriber": true, "IsSubscriber": true,
"DefaultPartitions": 16, "DefaultPartitions": 16,
"DefaultBundles": 16, "DefaultBundles": 16,
"EnableAutoCreation": true, //Topic "EnableAutoCreation": false, //Topic
"TopicMode": "Static", //DynamicStatic "TopicMode": "Dynamic", //Dynamic
"EnableTopicTypeFilter": true, //Topic "EnableTopicTypeFilter": true, //Topic
"AllowedTopicTypes": [ "Static" ], //Topic "AllowedTopicTypes": [ "Dynamic" ], //Topic
"AllowedClusters": [ "pulsar-cluster-1" ], // "AllowedClusters": [ "pulsar-cluster-1" ], //
"AdminRoles": [ "admin" ], "AdminRoles": [ "admin" ],
"EnableConsumerIdleCleanup": true, "EnableConsumerIdleCleanup": true,
@ -57,10 +57,10 @@
"IoTDBOptions": { "IoTDBOptions": {
"UserName": "root", "UserName": "root",
"Password": "Lixiao@1980", "Password": "Lixiao@1980",
//"TreeModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], //"TreeModelClusterList": [ "47.110.53.196: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" ], //"TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
"TreeModelClusterList": [ "192.168.111.174:30710" ], "TreeModelClusterList": [ "47.110.53.196:30710" ],
"TableModelClusterList": [ "192.168.111.174:30710" ], "TableModelClusterList": [ "47.110.53.196:30710" ],
"PoolSize": 32, "PoolSize": 32,
"DataBaseName": "jisheiotdata", "DataBaseName": "jisheiotdata",
"OpenDebugMode": true, "OpenDebugMode": true,
@ -97,7 +97,7 @@
} }
}, },
"FreeRedisOptions": { "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 "UseDistributedCache": true
}, },
"FreeSqlProviderOptions": { "FreeSqlProviderOptions": {

View File

@ -11,9 +11,19 @@ namespace JiShe.IoT.DeviceAggregation
public class DeviceCommandForApiInput:IdInput public class DeviceCommandForApiInput:IdInput
{ {
/// <summary> /// <summary>
/// 设备在物联网平台中属性设置的参数键值对 /// 设备在物联网平台中发送的命令内容JSON格式
/// </summary> /// </summary>
[Required(ErrorMessage = "命令内容不能为空")] [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; }
} }
} }

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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
);
}
}

View File

@ -45,10 +45,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
return handleResult; return handleResult;
} }
var messageBody = handleResult.Data; var messageBody = handleResult.Data;
if(messageBody== null || messageBody.Commands == null || messageBody.Commands.Count <= 0) string tempMessageBody = null;
{
return HttpDataResultExtensions.Failed("设备指令不能为空", -103, ResponeResultEnum.Fail);
}
//限定来源类型必须为业务系统 //限定来源类型必须为业务系统
if (messageBody.SourceType != DeviceTelemetrySourceTypeEnum.BusinessSystem) if (messageBody.SourceType != DeviceTelemetrySourceTypeEnum.BusinessSystem)
@ -63,7 +60,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
return HttpDataResultExtensions.Failed("设备不存在", -1041, ResponeResultEnum.Fail); 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发布通道 //将指令存储IoTDB数据库和Redis发布通道
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET) if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)

View File

@ -6,7 +6,6 @@ using JiShe.ServicePro.DataChannelManages;
using JiShe.ServicePro.DeviceManagement.DeviceInfos; using JiShe.ServicePro.DeviceManagement.DeviceInfos;
using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto; using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto;
using JiShe.ServicePro.DeviceManagement.Permissions; using JiShe.ServicePro.DeviceManagement.Permissions;
using JiShe.ServicePro.DeviceManagement.ThingModels;
using JiShe.ServicePro.Dto; using JiShe.ServicePro.Dto;
using JiShe.ServicePro.Enums; using JiShe.ServicePro.Enums;
using JiShe.ServicePro.FreeRedisProvider; using JiShe.ServicePro.FreeRedisProvider;
@ -30,9 +29,7 @@ namespace JiShe.IoT.DeviceAggregation
/// <param name="redisPubSubService">Redis发布订阅服务</param> /// <param name="redisPubSubService">Redis发布订阅服务</param>
/// <param name="ioTDBDataChannelManageService">数据通道</param> /// <param name="ioTDBDataChannelManageService">数据通道</param>
/// <param name="_ioTDBOptions">IoTDBOptions</param> /// <param name="_ioTDBOptions">IoTDBOptions</param>
/// <param name="oneNETProductService">OneNET产品服务</param> public class DeviceAggregationService(ILogger<DeviceAggregationService> logger, IDeviceAppService deviceAppService, IOneNETDeviceService oneNETDeviceService, IReliableRedisPubSubService redisPubSubService, IIoTDBDataChannelManageService ioTDBDataChannelManageService,IOptions<IoTDBOptions> _ioTDBOptions) : IoTAppService, IDeviceAggregationService
/// <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
{ {
IoTDBOptions ioTDBOptions = _ioTDBOptions.Value; IoTDBOptions ioTDBOptions = _ioTDBOptions.Value;
@ -291,45 +288,47 @@ namespace JiShe.IoT.DeviceAggregation
{ {
try try
{ {
if (input.CommandContent == null || input.CommandContent.Keys.Count <=0)
{
throw new UserFriendlyException($"指令参数异常");
}
var deviceInfo = await deviceAppService.FindByIdAsync(input); var deviceInfo = await deviceAppService.FindByIdAsync(input);
if (deviceInfo == null) if (deviceInfo == null)
{ {
throw new UserFriendlyException($"设备不存在"); throw new UserFriendlyException($"设备不存在");
} }
//将指令存储 //将指令存储
var receiveCommandInfoDto = new ReceiveCommandInfoDto() var commandRequest = new OpenApiRequest()
{ {
DeviceAddress = deviceInfo.DeviceAddress, Message = new ReceiveCommandInfoDto()
Commands = input.CommandContent, {
DeviceType = deviceInfo.DeviceType, DeviceAddress = deviceInfo.DeviceAddress,
SourceType = DeviceTelemetrySourceTypeEnum.AdminSystem, Commands = input.CommandContent.Deserialize<Dictionary<string,object>>(),
IoTPlatform = deviceInfo.IoTPlatform, 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) 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) else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
{ {
//await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName,commandRequest); await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName,commandRequest);
//return true; return true;
throw new UserFriendlyException($"发送设备指令信息失败CTWing暂未实现。");
} }
else else
{ {
throw new UserFriendlyException($"发送设备指令信息失败,未找到对应的产品配置信息。"); throw new UserFriendlyException($"创建设备失败,未找到对应的产品配置信息。");
} }
} }
catch (Exception) catch (Exception)
{ {
throw; throw;
} }
} }
@ -388,17 +387,15 @@ namespace JiShe.IoT.DeviceAggregation
try try
{ {
CreateDeviceInput createDeviceInput = input.Adapt<CreateDeviceInput>(); 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) if (productInfo == null)
{ {
throw new UserFriendlyException($"OneNET创建设备失败未找到对应的产品配置信息。"); throw new UserFriendlyException($"创建设备失败,未找到对应的产品配置信息。");
}
if (input.DeviceSourceTypeEnum == DeviceSourceTypeEnum.Workshop && !productInfo.IsEnabled) //车间生产推送,必须是已经启用的产品才可以
{
throw new UserFriendlyException($"车间生产推送OneNET创建设备失败产品未启用。");
} }
createDeviceInput.DeviceName = input.DeviceAddress; createDeviceInput.DeviceName = input.DeviceAddress;
@ -535,26 +532,35 @@ namespace JiShe.IoT.DeviceAggregation
public async Task<DeviceManagementInfoDto> RepushDeviceInfoToOneNET(DeviceManagementInfoDto input) public async Task<DeviceManagementInfoDto> RepushDeviceInfoToOneNET(DeviceManagementInfoDto input)
{ {
try try
{ {
var productInfo = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
.Where(e => e.IoTPlatformProductId == input.IoTPlatformProductId)
.FirstAsync();
if (productInfo == null)
{
throw new UserFriendlyException($"推送失败,未找到对应的产品配置信息。");
}
//检查OneNET平台设备是否已经存在 //检查OneNET平台设备是否已经存在
var oneNETDeviceInfoResult = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput() var oneNETDeviceInfoResult = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput()
{ {
DeviceName = input.IoTPlatformDeviceOpenInfo, DeviceName = input.IoTPlatformDeviceOpenInfo,
ProductId = input.IoTPlatformProductId, ProductId = productInfo.IoTPlatformProductId,
OneNETAccountId = input.IoTPlatformAccountId, OneNETAccountId = productInfo.OneNETAccountId,
}); });
if (oneNETDeviceInfoResult != null && oneNETDeviceInfoResult.Code == ServicePro.Enums.ResponeResultEnum.Success) 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平台 //推送至OneNET平台
var pushResult = await oneNETDeviceService.CreateDeviceInfoAsync(new CreateDeviceInfoInput() var pushResult = await oneNETDeviceService.CreateDeviceInfoAsync(new CreateDeviceInfoInput()
{ {
DeviceName = input.IoTPlatformDeviceOpenInfo, DeviceName = input.IoTPlatformDeviceOpenInfo,
ProductId = input.IoTPlatformProductId, ProductId = productInfo.IoTPlatformProductId,
OneNETAccountId = input.IoTPlatformAccountId, OneNETAccountId = productInfo.OneNETAccountId,
Description = input.DeviceAddress, Description = input.DeviceAddress,
}); });
@ -583,13 +589,23 @@ namespace JiShe.IoT.DeviceAggregation
public async Task<bool> DeleteDeviceInfoToOneNET(DeviceManagementInfoDto input) public async Task<bool> DeleteDeviceInfoToOneNET(DeviceManagementInfoDto input)
{ {
try try
{ {
var productInfo = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
.Where(e => e.IoTPlatformProductId == input.IoTPlatformProductId)
.FirstAsync();
if (productInfo == null)
{
throw new UserFriendlyException($"删除失败,未找到对应的产品配置信息。");
}
//删除OneNET平台设备信息 //删除OneNET平台设备信息
var deleteResult = await oneNETDeviceService.DeleteDeviceInfoAsync(new DeleteDeviceInfoInput() var deleteResult = await oneNETDeviceService.DeleteDeviceInfoAsync(new DeleteDeviceInfoInput()
{ {
DeviceName = input.IoTPlatformDeviceOpenInfo, DeviceName = input.IoTPlatformDeviceOpenInfo,
ProductId = input.IoTPlatformProductId, ProductId = productInfo.IoTPlatformProductId,
OneNETAccountId = input.IoTPlatformAccountId, OneNETAccountId = productInfo.OneNETAccountId,
}); });
if (deleteResult == null || deleteResult.Code != ServicePro.Enums.ResponeResultEnum.Success) if (deleteResult == null || deleteResult.Code != ServicePro.Enums.ResponeResultEnum.Success)
@ -618,39 +634,13 @@ namespace JiShe.IoT.DeviceAggregation
/// 发送OneNET平台设备指令 /// 发送OneNET平台设备指令
/// </summary> /// </summary>
/// <param name="deviceInfo"></param> /// <param name="deviceInfo"></param>
/// <param name="input"></param> /// <param name="packetTaskInfo"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="UserFriendlyException"></exception> /// <exception cref="UserFriendlyException"></exception>
public async Task<bool> DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, ReceiveCommandInfoDto input) public async Task<bool> DeviceCommandInfoToOneNET(DeviceManagementInfoDto deviceInfo, DeviceTelemetryPacketTaskInfo packetTaskInfo)
{ {
try 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() var deviceOnlineStatus = await oneNETDeviceService.DeviceInfoDetailAsync(new DeviceInfoDetailInput()
{ {

View File

@ -52,8 +52,8 @@ namespace JiShe.IoT
DeviceType = $"{commandIssueInfo.DeviceType}", DeviceType = $"{commandIssueInfo.DeviceType}",
DeviceAddress = commandIssueInfo.DeviceAddress, DeviceAddress = commandIssueInfo.DeviceAddress,
IssueRawMessage = input.Serialize(), IssueRawMessage = input.Serialize(),
IssuePayload = messageBody,
IoTDataType = IoTDBDataTypeConst.Command, IoTDataType = IoTDBDataTypeConst.Command,
TelemetryType = (int)commandIssueInfo.TelemetryType,
TelemetrySource = (int)commandIssueInfo.SourceType, TelemetrySource = (int)commandIssueInfo.SourceType,
IoTPlatform = (int)commandIssueInfo.IoTPlatform, IoTPlatform = (int)commandIssueInfo.IoTPlatform,
IoTPlatformProductId = deviceInfo.IoTPlatformProductId, IoTPlatformProductId = deviceInfo.IoTPlatformProductId,
@ -61,6 +61,7 @@ namespace JiShe.IoT
IoTPlatformAccountId = deviceInfo.IoTPlatformAccountId, IoTPlatformAccountId = deviceInfo.IoTPlatformAccountId,
AccountPhoneNumber = deviceInfo.AccountPhoneNumber, AccountPhoneNumber = deviceInfo.AccountPhoneNumber,
IoTPlatformProductName = deviceInfo.IoTPlatformProductName, IoTPlatformProductName = deviceInfo.IoTPlatformProductName,
IssuePayload = messageBody,
RetryCount = 0, RetryCount = 0,
IssueStatus = (int)DeviceCommandIssueStatusEnum.Unprocessed, IssueStatus = (int)DeviceCommandIssueStatusEnum.Unprocessed,
LastIssueTime = DateTime.Now LastIssueTime = DateTime.Now

View File

@ -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;
}
}
}
}

View File

@ -38,7 +38,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" /> <PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,14 +1,14 @@
{ {
"ConnectionStrings": { "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": { "IoTDBOptions": {
"UserName": "root", "UserName": "root",
"Password": "Lixiao@1980", "Password": "Lixiao@1980",
//"TreeModelClusterList": [ "192.168.111.174:6667", "47.110.60.222:6667", "47.110.62.104:6667" ], //"TreeModelClusterList": [ "47.110.53.196: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" ], //"TableModelClusterList": [ "47.110.53.196:6667", "47.110.60.222:6667", "47.110.62.104:6667" ],
"TreeModelClusterList": [ "192.168.111.174:30710" ], "TreeModelClusterList": [ "47.110.53.196:30710" ],
"TableModelClusterList": [ "192.168.111.174:30710" ], "TableModelClusterList": [ "47.110.53.196:30710" ],
"PoolSize": 32, "PoolSize": 32,
"DataBaseName": "jisheiotdata", "DataBaseName": "jisheiotdata",
"OpenDebugMode": false, "OpenDebugMode": false,

View File

@ -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\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\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\frameworks\src\JiShe.ServicePro.Core\JiShe.ServicePro.Core.csproj" />
<ProjectReference Include="..\..\JiShe.ServicePro\shared\JiShe.ServicePro.Shared.DynamicAnalyzerEngine\JiShe.ServicePro.Shared.DynamicAnalyzerEngine.csproj" />
</ItemGroup> </ItemGroup>
@ -40,11 +39,10 @@
<PackageReference Include="JiShe.ServicePro.Core" /> <PackageReference Include="JiShe.ServicePro.Core" />
<PackageReference Include="JiShe.ServicePro.CTWingManagement.Domain.Shared" /> <PackageReference Include="JiShe.ServicePro.CTWingManagement.Domain.Shared" />
<PackageReference Include="JiShe.ServicePro.OneNETManagement.Domain.Shared" /> <PackageReference Include="JiShe.ServicePro.OneNETManagement.Domain.Shared" />
<PackageReference Include="JiShe.ServicePro.Shared.DynamicAnalyzerEngine" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Core" /> <PackageReference Include="Volo.Abp.Core" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -7,9 +7,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj" /> <ProjectReference Include="..\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL.Pomelo" /> <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>
<ItemGroup Condition=" '$(Configuration)' == 'Debug'" Label="Debug"> <ItemGroup Condition=" '$(Configuration)' == 'Debug'" Label="Debug">

View File

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace JiShe.IoT.Migrations namespace JiShe.IoT.Migrations
{ {
[DbContext(typeof(IoTDbContext))] [DbContext(typeof(IoTDbContext))]
[Migration("20251222073841_InitialCreate")] [Migration("20251207055002_InitialCreate")]
partial class InitialCreate partial class InitialCreate
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -22,7 +22,7 @@ namespace JiShe.IoT.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("ProductVersion", "9.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 64); .HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
@ -887,6 +887,7 @@ namespace JiShe.IoT.Migrations
.HasComment("函数解析标记默认为false 不能解析"); .HasComment("函数解析标记默认为false 不能解析");
b.Property<string>("FunctionScript") b.Property<string>("FunctionScript")
.IsRequired()
.HasColumnType("text") .HasColumnType("text")
.HasComment("脚本函数体"); .HasComment("脚本函数体");
@ -926,6 +927,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -1011,6 +1016,7 @@ namespace JiShe.IoT.Migrations
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType") b.Property<string>("IoTPlatformRawFieldDataType")
.IsRequired()
.HasMaxLength(20) .HasMaxLength(20)
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型"); .HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
@ -1021,10 +1027,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(64)") .HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件名称"); .HasComment("物联网平台中对应的产品物模型属性或者事件名称");
b.Property<Guid>("IoTPlatformThingModelDataId")
.HasColumnType("char(36)")
.HasComment("系统中平台端物模型数据Id");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit(1)") .HasColumnType("bit(1)")
@ -1043,14 +1045,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<int>("NativeSkipNumber")
.HasColumnType("int")
.HasComment("正序跳过数量");
b.Property<int>("NativeTakeNumber")
.HasColumnType("int")
.HasComment("正序获取数量");
b.Property<int?>("OSACreatorId") b.Property<int?>("OSACreatorId")
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权创建者Id"); .HasComment("旧系统授权创建者Id");
@ -1063,21 +1057,13 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
b.Property<int?>("ReversalSkipNumber") b.Property<int>("SkipNumber")
.HasColumnType("int") .HasColumnType("int")
.HasComment("反转跳过数量"); .HasComment("跳过数量");
b.Property<int?>("ReversalTakeNumber")
.HasColumnType("int")
.HasComment("反转获取数量");
b.Property<string>("StandardFieldDisplayName") b.Property<string>("StandardFieldDisplayName")
.IsRequired() .IsRequired()
@ -1097,6 +1083,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型"); .HasComment("标准物模型字段值类型");
b.Property<int>("TakeNumber")
.HasColumnType("int")
.HasComment("获取数量");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
@ -1167,15 +1157,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
b.Property<string>("IoTPlatformRawFieldExtension")
.HasColumnType("text")
.HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
b.Property<string>("IoTPlatformRawFieldName") b.Property<string>("IoTPlatformRawFieldName")
.IsRequired() .IsRequired()
.HasMaxLength(64) .HasMaxLength(64)
@ -1188,10 +1169,6 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<sbyte>("IsSpecialIdentifier")
.HasColumnType("tinyint(1)")
.HasComment("是否是特殊物模型标识符");
b.Property<sbyte>("IsValueNeedConvert") b.Property<sbyte>("IsValueNeedConvert")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换"); .HasComment("是否需要值类型转换");

View File

@ -984,8 +984,9 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
ScriptName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称") ScriptName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称")
.Annotation("MySql:CharSet", "utf8mb4"), .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"), .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 不能解析"), FunctionAnalysisFlag = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "函数解析标记默认为false 不能解析"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
@ -1021,12 +1022,11 @@ namespace JiShe.IoT.Migrations
IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型"), IoTPlatform = table.Column<int>(type: "int", nullable: false, comment: "物联网平台类型"),
IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") IoTPlatformProductId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id")
.Annotation("MySql:CharSet", "utf8mb4"), .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: "物联网平台中对应产品物模型属性或者事件类型") FiledType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称") IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .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"), .Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
@ -1035,11 +1035,8 @@ namespace JiShe.IoT.Migrations
StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"), IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"),
NativeSkipNumber = table.Column<int>(type: "int", nullable: false, comment: "正序跳过数量"), SkipNumber = table.Column<int>(type: "int", nullable: false, comment: "跳过数量"),
NativeTakeNumber = table.Column<int>(type: "int", nullable: false, comment: "正序获取数量"), TakeNumber = 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: "反转获取数量"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
@ -1077,8 +1074,6 @@ namespace JiShe.IoT.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称") IoTPlatformRawFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .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: "管理后台产品标准的物模型属性或者事件名称") StandardFieldName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
StandardFieldValueType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型") 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: "管理后台产品标准的物模型属性或者事件名称") StandardFieldDisplayName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称")
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
IsValueNeedConvert = table.Column<sbyte>(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"), 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) ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),

View File

@ -19,7 +19,7 @@ namespace JiShe.IoT.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("ProductVersion", "9.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 64); .HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
@ -884,6 +884,7 @@ namespace JiShe.IoT.Migrations
.HasComment("函数解析标记默认为false 不能解析"); .HasComment("函数解析标记默认为false 不能解析");
b.Property<string>("FunctionScript") b.Property<string>("FunctionScript")
.IsRequired()
.HasColumnType("text") .HasColumnType("text")
.HasComment("脚本函数体"); .HasComment("脚本函数体");
@ -923,6 +924,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低位反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
@ -1008,6 +1013,7 @@ namespace JiShe.IoT.Migrations
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType") b.Property<string>("IoTPlatformRawFieldDataType")
.IsRequired()
.HasMaxLength(20) .HasMaxLength(20)
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型"); .HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
@ -1018,10 +1024,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(64)") .HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件名称"); .HasComment("物联网平台中对应的产品物模型属性或者事件名称");
b.Property<Guid>("IoTPlatformThingModelDataId")
.HasColumnType("char(36)")
.HasComment("系统中平台端物模型数据Id");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit(1)") .HasColumnType("bit(1)")
@ -1040,14 +1042,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<int>("NativeSkipNumber")
.HasColumnType("int")
.HasComment("正序跳过数量");
b.Property<int>("NativeTakeNumber")
.HasColumnType("int")
.HasComment("正序获取数量");
b.Property<int?>("OSACreatorId") b.Property<int?>("OSACreatorId")
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权创建者Id"); .HasComment("旧系统授权创建者Id");
@ -1060,21 +1054,13 @@ namespace JiShe.IoT.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("旧系统授权最后修改者Id"); .HasComment("旧系统授权最后修改者Id");
b.Property<int>("ParsingSequence")
.HasColumnType("int")
.HasComment("解析顺序1234或者3412(高低反转)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("备注"); .HasComment("备注");
b.Property<int?>("ReversalSkipNumber") b.Property<int>("SkipNumber")
.HasColumnType("int") .HasColumnType("int")
.HasComment("反转跳过数量"); .HasComment("跳过数量");
b.Property<int?>("ReversalTakeNumber")
.HasColumnType("int")
.HasComment("反转获取数量");
b.Property<string>("StandardFieldDisplayName") b.Property<string>("StandardFieldDisplayName")
.IsRequired() .IsRequired()
@ -1094,6 +1080,10 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(20)") .HasColumnType("varchar(20)")
.HasComment("标准物模型字段值类型"); .HasComment("标准物模型字段值类型");
b.Property<int>("TakeNumber")
.HasColumnType("int")
.HasComment("获取数量");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("char(36)") .HasColumnType("char(36)")
.HasColumnName("TenantId") .HasColumnName("TenantId")
@ -1164,15 +1154,6 @@ namespace JiShe.IoT.Migrations
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasComment("物联网平台中对应的产品Id"); .HasComment("物联网平台中对应的产品Id");
b.Property<string>("IoTPlatformRawFieldDataType")
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasComment("物联网平台中对应的产品物模型属性或者事件数据类型");
b.Property<string>("IoTPlatformRawFieldExtension")
.HasColumnType("text")
.HasComment("物联网平台中对应产品物模型标识符扩展,用于扩展结构体类型");
b.Property<string>("IoTPlatformRawFieldName") b.Property<string>("IoTPlatformRawFieldName")
.IsRequired() .IsRequired()
.HasMaxLength(64) .HasMaxLength(64)
@ -1185,10 +1166,6 @@ namespace JiShe.IoT.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<sbyte>("IsSpecialIdentifier")
.HasColumnType("tinyint(1)")
.HasComment("是否是特殊物模型标识符");
b.Property<sbyte>("IsValueNeedConvert") b.Property<sbyte>("IsValueNeedConvert")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasComment("是否需要值类型转换"); .HasComment("是否需要值类型转换");

View File

@ -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);
}
}
}