From ca7bbaba6c528ca4b4d1813cd797194a41315f47 Mon Sep 17 00:00:00 2001 From: chencaixia Date: Mon, 15 Sep 2025 14:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IParkingLotDataService.cs | 1 + .../ParkingLotDataService.cs | 85 ++++++++++++++++- .../DB/WeiCloudDbAxyjptContext.cs | 2 +- .../ParkingLotEntity/EntityCreate.txt | 5 +- .../ParkingLotEntity/ParkingLotEntity.csproj | 1 + .../ParkingAccessRecordDto.cs | 94 +++++++++++++++++++ .../ParkingLotModels/DoorControlState.cs | 44 +++++++++ .../ParkingLotModels/DoorInfo.cs | 41 ++++++++ .../ParkingLotModels/WeiCloudFusionContext.cs | 80 ++++++++++++++-- .../Controllers/ParkLotInfoController.cs | 15 ++- .../ParkingLotService.API/appsettings.json | 6 +- 11 files changed, 354 insertions(+), 20 deletions(-) create mode 100644 WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorControlState.cs create mode 100644 WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorInfo.cs diff --git a/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/IParkingLotDataService.cs b/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/IParkingLotDataService.cs index 86b07f0..8dea314 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/IParkingLotDataService.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/IParkingLotDataService.cs @@ -19,6 +19,7 @@ namespace ParkLotInfoService Task PostDoorControlRecord(DoorStateRecordDto dto); Task PostDoorEqState(DoorEqStateDto dto); Task> PushLifangDoorData(string tppic, string address,string token); + Task> PostDoorData(); #endregion } } diff --git a/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/ParkingLotDataService.cs b/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/ParkingLotDataService.cs index b594916..6e1b076 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/ParkingLotDataService.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkLotInfoService/ParkingLotDataService.cs @@ -3,11 +3,14 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using ParkingLotEntity.DB; using ParkingLotEntity.ParkingLotModelDto; using ParkingLotEntity.ParkingLotModelDto.BaseModels; using ParkingLotEntity.ParkingLotModels; using Pipelines.Sockets.Unofficial.Arenas; +using System.Collections; +using System.Collections.Generic; using System.Net.NetworkInformation; using System.Text; using System.Text.Encodings.Web; @@ -255,7 +258,7 @@ namespace ParkLotInfoService projectId = long.Parse(proStr); } - DoorStateRecord door = new DoorStateRecord() { Id = UidGenerator.Uid(), DoorId = dto.doorId, State = (short)dto.typeId, StateTime = DateTime.Parse(dto.date), DoorName = dto.doorName, StateDesc = dto.typeName, CreateTime = DateTime.Now, ProjectId = projectId }; + DoorStateRecord door = new DoorStateRecord() { Id = UidGenerator.Uid(), DoorId = dto.doorId, State = (short)dto.typeId, StateTime =string.IsNullOrEmpty(dto.date)?DateTime.Now: DateTime.Parse(dto.date), DoorName = dto.doorName, StateDesc = dto.typeName, CreateTime = DateTime.Now, ProjectId = projectId }; _context.DoorStateRecords.Add(door); _logger.LogError(this.GetType().FullName + " PostDoorControlRecord 入库前", string.Format("入库请求;{0}", _context.DoorStateRecords.Count())); var res = await _context.SaveChangesAsync(); @@ -296,14 +299,17 @@ namespace ParkLotInfoService { projectId = long.Parse(proStr); } + //入库 + _context.DoorControlStates.Add(new DoorControlState() { Id = UidGenerator.Uid(), DeviceId = dto.deviceld, Type = (short)dto.type, StateTime = string.IsNullOrEmpty(dto.date) ? DateTime.Now :Convert.ToDateTime(dto.date),CreateTime=DateTime.Now,DeviceName=dto.deviceName,TypeName=dto.typeName,ProjectId=projectId }); + var res = await _context.SaveChangesAsync(); //门禁的设备状态写入redis //找出所有的门禁设备 var data = await _dBContext.PtThings.ToListAsync(); var eqPthings = await _dBContext.PtThings.Where(a => a.ParamCode == "AccessControl").Select(d => d.Id).ToListAsync(); if (eqPthings == null || eqPthings.Count == 0) { return result; } - - var doorlocks = await _dBContext.PtThingMapLabels.Where(m => eqPthings.Contains(m.ThingId) && m.LabelCode.Contains("安消门禁Id_")).Select(d => new { Id = d.ThingId, DeciveId = int.Parse(d.LabelCode.Substring(d.LabelCode.LastIndexOf("_") + 1)) }).ToListAsync(); + var datda= await _dBContext.PtThingMapLabels.Where(m => eqPthings.Contains(m.ThingId) && m.LabelCode.Contains("安消门禁Id_")).Select(d => new { Id = d.ThingId, DeciveId = d.LabelCode }).ToListAsync(); + var doorlocks = await _dBContext.PtThingMapLabels.Where(m => eqPthings.Contains(m.ThingId) && m.LabelCode.Contains("安消门禁DevId_")).Select(d => new { Id = d.ThingId, DeciveId = int.Parse(d.LabelCode.Substring(d.LabelCode.LastIndexOf("_") + 1)) }).ToListAsync(); if (doorlocks == null || doorlocks.Count == 0) { return result; @@ -331,7 +337,7 @@ namespace ParkLotInfoService } catch (Exception ex) { - _logger.LogError(this.GetType().FullName + " PostDoorControlRecord", string.Format("抛出了异常信息: 请求超时,请求失败;{0}", ex.Message)); + _logger.LogError(this.GetType().FullName + " PostDoorEqState", string.Format("抛出了异常信息: 请求超时,请求失败;{0}", ex.Message)); } return result; } @@ -534,7 +540,7 @@ namespace ParkLotInfoService if (resModel == null || resModel.Suc != 200) { result.Code = RequestBackStatuEnum.diy.Value; - result.Msg = "下空失败!"; + result.Msg = "订阅失败!"; } result.Data = resModel; } @@ -557,7 +563,76 @@ namespace ParkLotInfoService // _logger.LogError(this.GetType().FullName + " PushLifangDoorRecord ", string.Format("抛出了异常信息:{0}", ex)); // } //} + public async Task> PostDoorData() + { + ApiResultresult = new ApiResult() { Code = RequestBackStatuEnum.success.Value, Msg = "接口请求成功!" }; + //获取所有门禁接口名 + string api = "custom/v1/getDoor"; + long projectId = 0; + List < Record >records = new List(); + try + { + string token = await GetLifangDoorLockToken(); + var parm = new DoorInfoParmDto(); /*{ pageSize = 200, pageNumber = 0 };*/ + parm.pageNumber = 1; + parm.pageSize = 20; + //项目id + string proStr = _configuration["PorjectId"]; + if (!string.IsNullOrEmpty(proStr)) + { + long.TryParse(proStr, out projectId); + } + var doors=await _context.DoorInfos.ToListAsync(); + if (doors != null && doors.Count > 0) + { + _context.DoorInfos.RemoveRange(doors); + } + for (int i = 0; i <= 50; i++) + { + parm.pageNumber = i; + var res = await GetDoorsRecord(api, parm, token); + if (res == null || res.Count == 0) + { + continue; + } + records.AddRange(res); + } + foreach (var item in records) + { + DoorInfo door = new DoorInfo() { Id = UidGenerator.Uid(), DoorId = item.doorId, DoorName = item.doorName, DeviceSysId =(short)item.deviceSysId, AreaIdList= item.areaIdList==null?string.Empty: string.Join(",", item.areaIdList), DevType=(short)item.devType,ChannelNo=(short)item.channelNo}; + _context.DoorInfos.Add(door); + } + var resData = await _context.SaveChangesAsync(); + result.Data = resData; + } + catch (Exception ex) + { + _logger.LogError(this.GetType().FullName + " PostDoorData ", string.Format("抛出了异常信息:{0}", ex)); + } + return result; + } + private async Task> GetDoorsRecord(string api, DoorInfoParmDto parm, string token) + { + Listrecords = new List(); + var res = await GetLifangDoorLockPostData(api, parm, token); + if (string.IsNullOrEmpty(res)) + { + return records; + } + var resModel = JsonConvert.DeserializeObject(res); + if (resModel == null || resModel.suc != 200 || resModel.obj == null) + { + return records; + } + //var obj = resModel.obj; + //var data = JsonConvert.DeserializeObject(obj); + if (resModel.obj.records == null || resModel.obj.records.Count == 0) + { + return records; + } + return resModel.obj.records; + } #endregion 门禁 } } \ No newline at end of file diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/DB/WeiCloudDbAxyjptContext.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/DB/WeiCloudDbAxyjptContext.cs index 85476f2..df44da4 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/DB/WeiCloudDbAxyjptContext.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/DB/WeiCloudDbAxyjptContext.cs @@ -550,7 +550,7 @@ public partial class WeiCloudDbAxyjptContext : DbContext protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. - => optionsBuilder.UseMySql("server=v4.weienergy.cn;database=WeiCloudDB.AXYJPT;user=root;password=Zrhdb#2019;port=3307", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.18-mysql")); + => optionsBuilder.UseMySql("server=172.17.76.210;uid=root;pwd=Zrhdb##2022;port=3306;database=WeiCloudDB.AXTYGLY_Back93;", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.18-mysql")); protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/EntityCreate.txt b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/EntityCreate.txt index 0588d38..e13a6b9 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/EntityCreate.txt +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/EntityCreate.txt @@ -1 +1,4 @@ -Scaffold-DbContext "Server=v4.weienergy.cn;Database=WeiCloud.Fusion;User=root;Password=Zrhdb#2019;Port=3307;" Pomelo.EntityFrameworkCore.MySql -OutputDir ParkingLotModels -Force \ No newline at end of file +Scaffold-DbContext "Server=v4.weienergy.cn;Database=WeiCloud.Fusion;User=root;Password=Zrhdb#2019;Port=3307;" Pomelo.EntityFrameworkCore.MySql -OutputDir ParkingLotModels -Force + + +Scaffold-DbContext "Server=demo.weienergy.cn;Database=WeiCloud.Fusion;User=root;Password=Zrhdb##2022;Port=3306;" Pomelo.EntityFrameworkCore.MySql -OutputDir ParkingLotModels -Force \ No newline at end of file diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotEntity.csproj b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotEntity.csproj index 654d6ce..a70dbd3 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotEntity.csproj +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotEntity.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + bin\Release\net8.0\ diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModelDto/ParkingAccessRecordDto.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModelDto/ParkingAccessRecordDto.cs index c703032..d759fa3 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModelDto/ParkingAccessRecordDto.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModelDto/ParkingAccessRecordDto.cs @@ -202,6 +202,54 @@ namespace ParkingLotEntity.ParkingLotModelDto } #endregion #region 门禁 + public class DoorInfoDto + { + public long Id { get; set; } + + /// + /// 房门所在区域id + /// + public List? AreaIdList { get; set; } + + /// + /// 通道编号 + /// + public short ChannelNo { get; set; } + + /// + /// 0:门禁设备 1 :人脸机 + /// + public short DevType { get; set; } + + /// + /// 设备系统编号 + /// + public short DeviceSysId { get; set; } + + /// + /// 房门id + /// + public int DoorId { get; set; } + + /// + /// 房门名称 + /// + public string? DoorName { get; set; } + /// + /// 项目id + /// + public long ProjectId { get; set; } + } + public class DootCollectDto + { + public int countId { get; set; } + public int current { get; set; } + public bool hitCount { get; set; } + /// + /// 查询出来的数据 + /// + public List records { get; set; } + } ///// ///// 门禁记录对象 ///// @@ -334,5 +382,51 @@ namespace ParkingLotEntity.ParkingLotModelDto public string address { get; set; } = string.Empty; public int expire { get; set; } } + + /// + /// 门禁信息请求参数 + /// + public class DoorInfoParmDto + { + public int pageNumber { get; set; } + public int pageSize { get; set; } + //public int DoorId { get; set; } + //public int StationId { get; set; } + } + /// + /// 门禁信息 + /// + public class DoorResponseDto + { + public ObjData obj { get; set; } + public string ret { get; set; } + public int suc { get; set; } + } + + public class ObjData + { + public int? countId { get; set; } + public int current { get; set; } + public bool hitCount { get; set; } + public int? maxLimit { get; set; } + public bool optimizeCountSql { get; set; } + public object[] orders { get; set; } + public int pages { get; set; } + public List records { get; set; } + public bool searchCount { get; set; } + public int size { get; set; } + public int total { get; set; } + } + + public class Record + { + public int[] areaIdList { get; set; } + public int channelNo { get; set; } + public int companyId { get; set; } + public int devType { get; set; } + public int deviceSysId { get; set; } + public int doorId { get; set; } + public string doorName { get; set; } + } #endregion } diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorControlState.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorControlState.cs new file mode 100644 index 0000000..575a9ab --- /dev/null +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorControlState.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; + +namespace ParkingLotEntity.ParkingLotModels; + +public partial class DoorControlState +{ + public long Id { get; set; } + + /// + /// 状态 + /// + public short Type { get; set; } + + /// + /// 状态文本 + /// + public string? TypeName { get; set; } + + /// + /// 门禁id + /// + public int DeviceId { get; set; } + + /// + /// 门禁名称 + /// + public string? DeviceName { get; set; } + + /// + /// 状态时间 + /// + public DateTime StateTime { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 项目id + /// + public long ProjectId { get; set; } +} diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorInfo.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorInfo.cs new file mode 100644 index 0000000..415bbc4 --- /dev/null +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/DoorInfo.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; + +namespace ParkingLotEntity.ParkingLotModels; + +public partial class DoorInfo +{ + public long Id { get; set; } + + /// + /// 房门所在区域id + /// + public string? AreaIdList { get; set; } + + /// + /// 通道编号 + /// + public short ChannelNo { get; set; } + + /// + /// 0:门禁设备 1 :人脸机 + /// + public short DevType { get; set; } + + /// + /// 设备系统编号 + /// + public short DeviceSysId { get; set; } + + /// + /// 房门id + /// + public int DoorId { get; set; } + + /// + /// 房门名称 + /// + public string? DoorName { get; set; } + + public long ProjectId { get; set; } +} diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/WeiCloudFusionContext.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/WeiCloudFusionContext.cs index e6c5fdc..30bdd10 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/WeiCloudFusionContext.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotEntity/ParkingLotModels/WeiCloudFusionContext.cs @@ -16,13 +16,17 @@ public partial class WeiCloudFusionContext : DbContext { } + public virtual DbSet DoorControlStates { get; set; } + + public virtual DbSet DoorInfos { get; set; } + public virtual DbSet DoorStateRecords { get; set; } public virtual DbSet ParkingAccessRecords { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. - => optionsBuilder.UseMySql("server=172.17.76.210;database=WeiCloud.Fusion;user=root;password=Zrhdb##2022;port=3306;default command timeout=100;CharSet=utf8;SslMode=None;allowPublicKeyRetrieval=true", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.18-mysql")); + => optionsBuilder.UseMySql("server=172.17.76.210;database=WeiCloud.Fusion;user=root;password=Zrhdb##2022;port=3306", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.29-mysql")); protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -30,6 +34,74 @@ public partial class WeiCloudFusionContext : DbContext .UseCollation("utf8mb4_0900_ai_ci") .HasCharSet("utf8mb4"); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PRIMARY"); + + entity.ToTable("door_control_state"); + + entity.Property(e => e.Id) + .ValueGeneratedNever() + .HasColumnName("id"); + entity.Property(e => e.CreateTime) + .HasComment("创建时间") + .HasColumnType("datetime") + .HasColumnName("create_time"); + entity.Property(e => e.DeviceId) + .HasComment("门禁id") + .HasColumnName("device_id"); + entity.Property(e => e.DeviceName) + .HasMaxLength(50) + .HasComment("门禁名称") + .HasColumnName("device_name"); + entity.Property(e => e.ProjectId) + .HasComment("项目id") + .HasColumnName("project_id"); + entity.Property(e => e.StateTime) + .HasComment("状态时间") + .HasColumnType("datetime") + .HasColumnName("state_time"); + entity.Property(e => e.Type) + .HasComment("状态") + .HasColumnName("type"); + entity.Property(e => e.TypeName) + .HasMaxLength(50) + .HasComment("状态文本") + .HasColumnName("type_name"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Id).HasName("PRIMARY"); + + entity.ToTable("door_info"); + + entity.Property(e => e.Id) + .ValueGeneratedNever() + .HasColumnName("id"); + entity.Property(e => e.AreaIdList) + .HasMaxLength(100) + .HasComment("房门所在区域id") + .HasColumnName("area_id_list"); + entity.Property(e => e.ChannelNo) + .HasComment("通道编号") + .HasColumnName("channel_No"); + entity.Property(e => e.DevType) + .HasComment("0:门禁设备 1 :人脸机") + .HasColumnName("dev_type"); + entity.Property(e => e.DeviceSysId) + .HasComment("设备系统编号") + .HasColumnName("device_sysId"); + entity.Property(e => e.DoorId) + .HasComment("房门id") + .HasColumnName("door_id"); + entity.Property(e => e.DoorName) + .HasMaxLength(50) + .HasComment("房门名称") + .HasColumnName("door_name"); + entity.Property(e => e.ProjectId).HasColumnName("project_id"); + }); + modelBuilder.Entity(entity => { entity.HasKey(e => e.Id).HasName("PRIMARY"); @@ -38,7 +110,6 @@ public partial class WeiCloudFusionContext : DbContext entity.Property(e => e.Id) .ValueGeneratedNever() - .HasColumnType("bigint(20)") .HasColumnName("id"); entity.Property(e => e.CreateTime) .HasDefaultValueSql("CURRENT_TIMESTAMP") @@ -47,7 +118,6 @@ public partial class WeiCloudFusionContext : DbContext .HasColumnName("create_time"); entity.Property(e => e.DoorId) .HasComment("门id") - .HasColumnType("int(11)") .HasColumnName("door_id"); entity.Property(e => e.DoorName) .HasMaxLength(50) @@ -55,11 +125,9 @@ public partial class WeiCloudFusionContext : DbContext .HasColumnName("door_name"); entity.Property(e => e.ProjectId) .HasComment("项目id") - .HasColumnType("bigint(20)") .HasColumnName("project_id"); entity.Property(e => e.State) .HasComment("0关 1进开门 2出开门 3报警开门 4报警关门 5进出开门 6门未关 7关(出) 8关(进) 9按钮开门 10紧急关门 11紧急开门 12遥控开门 13遥控关门 14布防关(出) 15布防关(进) 16紧急关(出) 17紧急关(进) 18常闭关(出) 19常闭关(进) 20防撬关(出) 21防撬关(进) 22门开(遥控关) 23门开(紧急关) 24常开 25常闭 26布防 27自动布防 28手动布防 29权限不足 33自控 99未知状态") - .HasColumnType("smallint(6)") .HasColumnName("state"); entity.Property(e => e.StateDesc) .HasMaxLength(50) @@ -79,7 +147,6 @@ public partial class WeiCloudFusionContext : DbContext entity.Property(e => e.Id) .ValueGeneratedNever() - .HasColumnType("bigint(20)") .HasColumnName("id"); entity.Property(e => e.CarCode) .HasMaxLength(50) @@ -123,7 +190,6 @@ public partial class WeiCloudFusionContext : DbContext .HasColumnName("passTime"); entity.Property(e => e.ProjectId) .HasComment("项目id") - .HasColumnType("bigint(20)") .HasColumnName("project_id"); }); diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/Controllers/ParkLotInfoController.cs b/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/Controllers/ParkLotInfoController.cs index ad2b8dc..94d06a4 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/Controllers/ParkLotInfoController.cs +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/Controllers/ParkLotInfoController.cs @@ -26,7 +26,7 @@ namespace ParkingLotService.API.Controllers /// [HttpPost] public async Task> PostParkingLots(ParkingAccessRecordDto dto) - { + { return await _parkingLotDataService.PostParkingLots(dto); } /// @@ -47,7 +47,7 @@ namespace ParkingLotService.API.Controllers /// [HttpGet] public async Task> DoorLockSendCommand(int doorId, string command) - { + { return await _parkingLotDataService.DoorLockSendCommand(doorId, command); } /// @@ -57,7 +57,7 @@ namespace ParkingLotService.API.Controllers /// [HttpPost] public async Task PostDoorEqState(DoorEqStateDto dto) - { + { return await _parkingLotDataService.PostDoorEqState(dto); } /// @@ -70,5 +70,14 @@ namespace ParkingLotService.API.Controllers { return await _parkingLotDataService.PostDoorControlRecord(dto); } + /// + /// 提交门禁信息 + /// + /// + [HttpGet] + public async Task> PostDoorData() + { + return await _parkingLotDataService.PostDoorData(); + } } } diff --git a/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/appsettings.json b/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/appsettings.json index aa00d98..2906202 100644 --- a/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/appsettings.json +++ b/WeiCloud.Fusion/ParkingLotService/ParkingLotService.API/appsettings.json @@ -7,9 +7,9 @@ }, "RedisPrefix": "AXYJPT_", // "XX.V6_", // //, "TenantType": "false", - "RedisNodes": "Zrhredis#2019@v4.weienergy.cn:6380", + "RedisNodes": "Zrhredis#123456@demo.weienergy.cn:6379", "WeiCloudFusionDBConn": "demo.weienergy.cn;uid=root;pwd=Zrhdb##2022;port=3306;database=WeiCloud.Fusion;default command timeout=100;CharSet=utf8;SslMode=None;allowPublicKeyRetrieval=true", - "WeiCloudDBConn": "server=demo.weienergy.cn;uid=root;pwd=Zrhdb##2022;port=3306;database=WeiCloudDB.AXYJPT;default command timeout=100;CharSet=utf8;SslMode=None;allowPublicKeyRetrieval=true", + "WeiCloudDBConn": "server=demo.weienergy.cn;uid=root;pwd=Zrhdb##2022;port=3306;database=WeiCloudDB.AXTYGLY_Back93;default command timeout=100;CharSet=utf8;SslMode=None;allowPublicKeyRetrieval=true", "AllowedHosts": "*", "ThirdApi": { "LifangParkLotApiAddress": "http://demo.weienergy.cn:15231/Parking/Handheld/", //"192.168.21.22:9988/Parking/Handheld/", @@ -21,6 +21,6 @@ "Uuid": 121111, "Expire": 7200 //单位秒 }, - "PorjectId": "530522108656160", + "PorjectId": "544005232179744", "MyApiAddress": "https://demo.weienergy.cn/axparting" // "http://192.168.21.22:9988/Parking/Handheld/"//本项目的地址,需要提供给第三方 }