diff --git a/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml b/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml index e60456b5..7e3b6f68 100644 --- a/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml +++ b/projects/IoT.Shared/Areas/Admin/Views/Command/_Script.cshtml @@ -46,13 +46,19 @@ list['wind'] = form.find("[name = 'wind']:checked").val(); list['temperature'] = form.find("[name = 'temperature']").val(); list[event.target.name] = event.target.value; - code = 0; - for (var name in list) { - code += parseInt(list[name]); + var code = 0; + if (list['power'] === "1") { + code = 1; } + else { + for (var name in list) { + code += parseInt(list[name]); + } + } + $('#ircodeid').val(code); } - function CodeChange(e) { + function CodeChange(e) { var form = $('#ircodediv'); var list = {}; list['power'] = form.find("[name = 'power']:checked").val(); diff --git a/projects/IoTCenter/Application/Domain/Organ.cs b/projects/IoTCenter/Application/Domain/Organ.cs index 041ae4e8..8cad0096 100644 --- a/projects/IoTCenter/Application/Domain/Organ.cs +++ b/projects/IoTCenter/Application/Domain/Organ.cs @@ -14,5 +14,7 @@ namespace IoTCenter.Application.Domain public string Image { get; set; } public List OrganNodes { get; set; } = new List(); + + public List OrganUsers { get; set; } = new List(); } } \ No newline at end of file diff --git a/projects/IoTCenter/Application/Domain/OrganUser.cs b/projects/IoTCenter/Application/Domain/OrganUser.cs new file mode 100644 index 00000000..42dc11af --- /dev/null +++ b/projects/IoTCenter/Application/Domain/OrganUser.cs @@ -0,0 +1,16 @@ +using Application.Domain.Entities; +using Infrastructure.Domain; +using System; +using System.ComponentModel.DataAnnotations; + +namespace IoTCenter.Application.Domain +{ + [Display(Name = "机构用户")] + public class OrganUser : BaseEntity + { + public Guid OrganId { get; set; } + public Guid UserId { get; set; } + public Organ Organ { get; set; } + public User User { get; set; } + } +} diff --git a/projects/IoTCenter/DbConfig.cs b/projects/IoTCenter/DbConfig.cs index 962eb471..1030949e 100644 --- a/projects/IoTCenter/DbConfig.cs +++ b/projects/IoTCenter/DbConfig.cs @@ -34,6 +34,9 @@ namespace IoTCenter modelBuilder.Entity().HasIndex(o => new { o.CategoryId, o.NodeId }).IsUnique(); modelBuilder.Entity().Property(o => o.Number).IsRequired(); modelBuilder.Entity().HasIndex(o => o.Number).IsUnique(); + modelBuilder.Entity().HasOne(o => o.Organ).WithMany(o => o.OrganUsers).HasForeignKey(o => o.OrganId); + modelBuilder.Entity().HasOne(o => o.User).WithMany().HasForeignKey(o => o.UserId); + modelBuilder.Entity().HasIndex(o => new { o.OrganId, o.UserId }).IsUnique(); modelBuilder.Entity().HasOne(o => o.Organ).WithMany(o => o.OrganNodes).HasForeignKey(o => o.OrganId); modelBuilder.Entity().HasOne(o => o.Node).WithMany().HasForeignKey(o => o.NodeId); modelBuilder.Entity().HasIndex(o => new { o.OrganId, o.NodeId }).IsUnique(); diff --git a/projects/Version.cs b/projects/Version.cs index 8c2e695f..34e4dff7 100644 --- a/projects/Version.cs +++ b/projects/Version.cs @@ -1,4 +1,4 @@ using System.Reflection; [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0.604")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("1.0.0.609")] \ No newline at end of file diff --git a/publish/src/linux-x64/publish/conf/nginx.conf b/publish/src/linux-x64/publish/conf/nginx.conf index 37b11893..4753eaab 100644 --- a/publish/src/linux-x64/publish/conf/nginx.conf +++ b/publish/src/linux-x64/publish/conf/nginx.conf @@ -1,76 +1,78 @@ #user nobody; -worker_processes 1; +worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; - - events { - worker_connections 1024; + worker_connections 1024; } http { - include mime.types; - default_type application/octet-stream; + include mime.types; + default_type application/octet-stream; - sendfile on; + sendfile on; - keepalive_timeout 65; + keepalive_timeout 65; server { - listen 0.0.0.0:80; - server_name localhost; - - location / { - #proxy_set_header Host $host:$server_port; - if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { - proxy_pass http://localhost:5002; - break; - } - proxy_pass http://localhost:5001/; - } + listen 0.0.0.0:80; + server_name localhost; + + location / { + #proxy_set_header Host $host:$server_port; + if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { + proxy_pass http://localhost:5002; + break; + } + proxy_pass http://localhost:5001/; + } location ^~ /dfs/ { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://localhost:9000/; - } + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://localhost:9000/; + } location ^~ /live/ { - proxy_pass http://localhost:8080/live/; - } + proxy_pass http://localhost:8080/live/; + } location ^~ /video/ { - proxy_pass http://localhost:8080/video/; - } + proxy_pass http://localhost:8080/video/; + } + + location ^~ /influxdb/ { + proxy_pass http://localhost:8086/; + } location ^~ /UserCenter/ { - proxy_pass http://localhost:8010/UserCenter/; - } + proxy_pass http://localhost:8010/UserCenter/; + } location ^~ /IoTCenter/ { - proxy_pass http://localhost:8011/IoTCenter/; - } + proxy_pass http://localhost:8011/IoTCenter/; + } location ^~ /IoTCenter/hub { - proxy_pass http://localhost:8011/IoTCenter/hub; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } + proxy_pass http://localhost:8011/IoTCenter/hub; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } location ^~ /JobServer/ { - proxy_pass http://localhost:8013/JobServer/; - } + proxy_pass http://localhost:8013/JobServer/; + } - error_page 500 502 503 504 /50x.html; + error_page 500 502 503 504 /50x.html; location = /50x.html { - root html; + root html; } } } \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf index adb2b84d..e1885f2f 100644 --- a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf +++ b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.conf @@ -43,6 +43,10 @@ http { proxy_pass http://172.172.0.60:8080/video/; } + location ^~ /influxdb/ { + proxy_pass http://172.172.0.50:8086/; + } + location ^~ /UserCenter/ { proxy_pass http://172.172.0.70/UserCenter/; } diff --git a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.development.conf b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.development.conf index 8015a5e4..17e9da74 100644 --- a/publish/src/linux-x64/publish/docker/conf/nginx/nginx.development.conf +++ b/publish/src/linux-x64/publish/docker/conf/nginx/nginx.development.conf @@ -43,6 +43,10 @@ http { proxy_pass http://host.docker.internal:8080/video/; } + location ^~ /influxdb/ { + proxy_pass http://host.docker.internal:8086/; + } + location ^~ /UserCenter/ { proxy_pass http://host.docker.internal:8010/UserCenter/; }