diff --git a/Entity/Api/Req/ChargePositionQueryReq.cs b/Entity/Api/Req/ChargePositionQueryReq.cs new file mode 100644 index 0000000..9cada61 --- /dev/null +++ b/Entity/Api/Req/ChargePositionQueryReq.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity.Api.Req +{ + /// + /// 充电仓信息:充电站查询 + /// + public class ChargePositionQueryReq + { + /// + /// 仓位编号 + /// + public string? BinNum { get; set; } + /// + /// 仓位名称 + /// + public string? BinName { get; set; } + + } +} diff --git a/Entity/Api/Req/RfidPreviewReq.cs b/Entity/Api/Req/RfidPreviewReq.cs new file mode 100644 index 0000000..35e1e6a --- /dev/null +++ b/Entity/Api/Req/RfidPreviewReq.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity.Api.Req +{ + public class RfidPreviewReq + { + /// + /// 车辆VIN码 + /// + public string strVelVin { get; set; } + /// + /// 车型号 + /// + public string strVelType { get; set; } + /// + /// 车辆MAC + /// + public string strVelMac { get; set; } + /// + /// 车牌号 + /// + public string strVelNo { get; set; } + } +} diff --git a/Entity/Api/Resp/RfidPreviewResp.cs b/Entity/Api/Resp/RfidPreviewResp.cs new file mode 100644 index 0000000..f25ea32 --- /dev/null +++ b/Entity/Api/Resp/RfidPreviewResp.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity.Api.Resp +{ + public class RfidPreviewResp + { + /// + /// 预览:生成 ASCLL + /// + public string GetAscllInfo { get; set; } + /// + /// 预览:解析后Rfid信息 + /// + public string AnalysisRfidInfo { get; set; } + } +} diff --git a/Entity/Api/Resp/StationBaseInfoResp.cs b/Entity/Api/Resp/StationBaseInfoResp.cs new file mode 100644 index 0000000..7c3b856 --- /dev/null +++ b/Entity/Api/Resp/StationBaseInfoResp.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Entity.Api.Resp +{ + /// + /// 站点基础信息 + /// + public class StationBaseInfoResp + { + /// + /// 换电站编码 + /// + public string FStationNo { get; set; } = null!; + /// + /// 换电站名称 + /// + public string FStationName { get; set; } = null!; + /// + /// 站类型 + /// + public string FStationType { get; set; } = null!; + /// + /// 换电站识别号 + /// + public string FStationSn { get; set; } = null!; + /// + /// 地理位置 + /// + public string FStationLocation { get; set; } = null!; + /// + /// 经度 + /// + public string FLongitude { get; set; } = null!; + /// + /// 纬度 + /// + public string FLatitude { get; set; } = null!; + /// + /// 区域编号 + /// + public string FAreaCode { get; set; } = null!; + /// + /// 区域名称 + /// + public string FAreaName { get; set; } = null!; + /// + /// 营运开始时间 + /// + public DateTime FOperatetionstime { get; set; } + /// + /// 营运结束时间 + /// + public DateTime FOperatetionetime { get; set; } + /// + /// 服务状态 + /// + public sbyte FSevstatus { get; set; } + /// + /// 运营状态:1营业状态 2暂停营业 3设备维护 4歇业状态 + /// + public sbyte FStatus { get; set; } + /// + /// 投放时间 + /// + public DateTime? FLaunchTime { get; set; } + /// + /// 联系方式 + /// + public string FContactWay { get; set; } + /// + /// 负责人 + /// + public string FPrincipal { get; set; } + /// + /// 所属运营企业 + /// + public string FStationCompany { get; set; } + /// + /// 所属运营企业统一社会信用代码 + /// + public string FSocialCreditCode { get; set; } = null!; + /// + /// 站控主机软件版本号 + /// + public string FStationSftVer { get; set; } + /// + /// 供应商代码 + /// + public string FSupplierCode { get; set; } = null!; + /// + /// 换电站基础信息版本号 + /// + public string FStationVersion { get; set; } + /// + /// 换电站硬件版本 + /// + public sbyte? FHardwareVersion { get; set; } + + + /// + /// 封面图片文件id + /// + public string FCover { get; set; } + + + + + + /// + /// 总体故障等级 + /// + public int? FFaultlevel { get; set; } + + /// + /// 加解锁方式 + /// + public sbyte? FLockType { get; set; } + + /// + /// 进入方式 + /// + public sbyte? FAccessType { get; set; } + /// + /// 举升方式 + /// + public sbyte? FRiseType { get; set; } + /// + /// 创建时间 + /// + public DateTime FCreateTime { get; set; } + /// + /// 修改时间 + /// + public DateTime? FModifyTime { get; set; } + /// + /// 配电容量(kVA) + /// + public int? FDistributionCapacity { get; set; } + /// + /// 总功率(kW) + /// + public int? FTotalPower { get; set; } + /// + /// 省份 + /// + public string FStationProvince { get; set; } + /// + /// 城市 + /// + public string FStationCity { get; set; } + /// + /// 组织机构ID + /// + public int? FOrganizationId { get; set; } + /// + /// 站控电脑MAC地址 + /// + public string FStationMac { get; set; } + } +} diff --git a/WebStarter/Controllers/BasicConfig/RfidReadWriteController.cs b/WebStarter/Controllers/BasicConfig/RfidReadWriteController.cs index aa845f8..ecdec67 100644 --- a/WebStarter/Controllers/BasicConfig/RfidReadWriteController.cs +++ b/WebStarter/Controllers/BasicConfig/RfidReadWriteController.cs @@ -1,47 +1,109 @@ -using Microsoft.AspNetCore.Mvc; +using Entity.Api.Req; +using Microsoft.AspNetCore.Mvc; +using System.ComponentModel; +using System.Text; +using System; +using Entity.Api.Resp; +using HybirdFrameworkCore.Entity; namespace WebStarter.Controllers.BasicConfig { - /// - /// 基础配置 RFID读写 - /// - [ApiController] - [Route("api/[controller]")] - public class RfidReadWriteController - { - /// - /// 预览 - /// 车型 的ASCLL、解析后信息 - /// - [HttpGet("UploadCloud/{id}")] - public void Preview() - { + ///// + ///// 基础配置 RFID读写 + ///// + //[ApiController] + //[Route("api/[controller]")] + //public class RfidReadWriteController + //{ + // /// + // /// 预览 + // /// 车型 的ASCLL、解析后信息 + // /// + // [HttpPost("Preview")] + // public async Task> Preview([FromBody] RfidPreviewReq rfidPreviewReq) + // { + // RfidPreviewResp rfidPreviewRes = new RfidPreviewResp + // { + // AnalysisRfidInfo = "", + // GetAscllInfo = "" + // }; + // //string strRfidRlt = ASCIIEncoding.ASCII.GetString(bytesRfid); + // return Result.Success(rfidPreviewRes); + // } - } + // /// + // /// RFID写值 + // /// + // [HttpGet("RfidWriteValue/{id}")] + // public async Task> RfidWriteValue() + // { + // //string strResult = ""; + // ////strHexVelNoRlt 16进制字符串 保存车辆信息 + // //string strHexVelNoRlt = ""; + // ////车辆VIN码 + // //string strVelVin = txtVelVin.Text.Trim(); + // ////车型号 + // //string strVelType = txtVelType.Text.Trim(); + // ////车辆MAC + // //string strVelMac = txtVelMac.Text.Trim(); + // ////车牌号 + // //string strVelNo = txtVelNo.Text.Trim(); - /// - /// RFID写值 - /// - [HttpGet("UploadCloud/{id}")] - public void RfidWriteValue() - { + // //if (!string.IsNullOrEmpty(strVelVin)) + // //{ + // // strResult += "C-" + strVelVin; + // //} + // //else + // //{ + // // strResult += "C-" + " "; + // //} + // //if (!string.IsNullOrEmpty(strVelType)) + // //{ + // // strResult += "&" + strVelType; + // //} + // //else + // //{ + // // strResult += "&" + " "; + // //} + // //if (!string.IsNullOrEmpty(strVelMac)) + // //{ + // // strResult += "&" + strVelMac.Replace(" ", ""); + // //} + // //else + // //{ + // // strResult += "&" + " "; + // //} + // //if (!string.IsNullOrEmpty(strVelNo)) + // //{ + // // Encoding toEcoding = Encoding.GetEncoding("gb2312"); + // // byte[] bytesVelNo = toEcoding.GetBytes(strVelNo); + // // strHexVelNoRlt = ByteConvert.BytesToHexStr(bytesVelNo); + // //} + // //txtStartRfidCode.Text = strResult; + // //bytesRfid = System.Text.ASCIIEncoding.ASCII.GetBytes(strResult); + // //byte[] bytesEpc = System.Text.ASCIIEncoding.ASCII.GetBytes(strHexVelNoRlt); - } - /// - /// RFID 识别 - /// - [HttpGet("UploadCloud/{id}")] - public void RfidRecognition() - { + // //_RfidRwTool.WriteRfidSingleTagResult(bytesRfid, bytesEpc); + // return Result.Success(); + // } + // /// + // /// RFID 识别 + // /// + // [HttpGet("RfidRecognition")] + // public async Task> RfidRecognition() + // { + // //TODO::识别RFID 信息 + // return Result.Success(); + // } + // /// + // /// 车型号返回 + // /// + // [HttpGet("VelType")] + // public async Task>> VelType() + // { + // List list = new List(); - } - /// - /// 车型号返回 - /// - [HttpGet("UploadCloud/{id}")] - public void ChargePositionDisable() - { - - } + // return Result>.Success(); + // } } } diff --git a/WebStarter/Controllers/BasicConfig/StationBasicInfoController.cs b/WebStarter/Controllers/BasicConfig/StationBasicInfoController.cs index 68860bd..7cb165a 100644 --- a/WebStarter/Controllers/BasicConfig/StationBasicInfoController.cs +++ b/WebStarter/Controllers/BasicConfig/StationBasicInfoController.cs @@ -1,4 +1,5 @@ -using Entity.DbModel.System.SysBaseObject; +using Entity.Api.Resp; +using Entity.DbModel.System.SysBaseObject; using HybirdFrameworkCore.Entity; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; @@ -15,28 +16,30 @@ namespace WebStarter.Controllers.BasicConfig [Route("api/[controller]")] public class StationBasicInfoController { - /// - /// 站点基础信息 - /// - [HttpPost("StationBaseInfo")] - public void StationBaseInfo() - { + ///// + ///// 站点基础信息 + ///// + //[HttpGet("StationBaseInfo")] + //public async Task> StationBaseInfo() + //{ + // //TODO:: 从SysConfig中获取站点基础信息 - } - /// - /// 站点编辑 - /// - [HttpPost("StationBaseInfo")] - public void StationInfoEditor() - { + // return Result.Success(); + //} + ///// + ///// 站点编辑 + ///// + //[HttpPost("StationInfoEditor")] + //public void StationInfoEditor( ) + //{ - } + //} - [HttpPost] - [Route("/api/sysFile/uploadAvatar")] - public async Task> UploadAvatar([Required] IFormFile file) - { - return Result.Success(); - } + //[HttpPost] + //[Route("/api/sysFile/uploadAvatar")] + //public async Task> UploadAvatar([Required] IFormFile file) + //{ + // return Result.Success(); + //} } } diff --git a/WebStarter/Controllers/ChargeMonitorController.cs b/WebStarter/Controllers/ChargeMonitorController.cs index 898355d..0f03e56 100644 --- a/WebStarter/Controllers/ChargeMonitorController.cs +++ b/WebStarter/Controllers/ChargeMonitorController.cs @@ -1,3 +1,4 @@ +using Entity.Api.Req; using HybirdFrameworkCore.Entity; using Microsoft.AspNetCore.Mvc; @@ -13,14 +14,14 @@ public class ChargeMonitorController - /// - /// 充电仓查询:条件:仓位编号 仓位名称 - /// - [HttpGet("UploadCloud/{id}")] - public void ChargePositionQuery() - { - - } + ///// + ///// 充电仓查询:条件:仓位编号 仓位名称 + ///// + //[HttpPost("ChargePositionQuery")] + //public void ChargePositionQuery([FromBody] ChargePositionQueryReq chargePositionQueryReq) + //{ + // //TODO:: 返回充电仓信息 + //} /// /// 充电仓 0:禁用 1:启用 diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index b480f9f..07f29a1 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -40,6 +40,8 @@ builder.Host.ConfigureContainer(cb => var mapper = new SysMenuMapper(); mapper.Register(TypeAdapterConfig.GlobalSettings); +//在 Autofac 容器中注册IHttpContextAccessor 服务 +builder.Services.AddHttpContextAccessor(); //跨域 builder.Services.AddCors(options => diff --git a/WebStarter/appsettings.json b/WebStarter/appsettings.json index 9be37bd..6751166 100644 --- a/WebStarter/appsettings.json +++ b/WebStarter/appsettings.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "master", "DbType": "MySql", - "SqlConnection": "server=localhost;Port=3306;Database=winformdevframework;Uid=root;Pwd=123456;Charset=utf8;" + "SqlConnection": "server=192.168.2.2;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;" }, "Update": { "AutoUpdate": "false", diff --git a/WebStarter/bin/Debug/net6.0/appsettings.json b/WebStarter/bin/Debug/net6.0/appsettings.json index 9be37bd..6751166 100644 --- a/WebStarter/bin/Debug/net6.0/appsettings.json +++ b/WebStarter/bin/Debug/net6.0/appsettings.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "master", "DbType": "MySql", - "SqlConnection": "server=localhost;Port=3306;Database=winformdevframework;Uid=root;Pwd=123456;Charset=utf8;" + "SqlConnection": "server=192.168.2.2;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;" }, "Update": { "AutoUpdate": "false", diff --git a/WebStarter/obj/Debug/net6.0/staticwebassets.build.json b/WebStarter/obj/Debug/net6.0/staticwebassets.build.json index 309b0b1..572be60 100644 --- a/WebStarter/obj/Debug/net6.0/staticwebassets.build.json +++ b/WebStarter/obj/Debug/net6.0/staticwebassets.build.json @@ -1,11 +1,19 @@ { "Version": 1, - "Hash": "7euZr+Skxn+CPwHhQ3H6LZuur9IzJqC+CYg6oY75X7A=", + "Hash": "FS59OvTZ9B6lpwaxIjb4jYpPMI2uWVuvwpvRJoWtEFc=", "Source": "WebStarter", "BasePath": "_content/WebStarter", "Mode": "Default", "ManifestType": "Build", "ReferencedProjectsConfiguration": [], - "DiscoveryPatterns": [], + "DiscoveryPatterns": [ + { + "Name": "WebStarter\\wwwroot", + "Source": "WebStarter", + "ContentRoot": "D:\\Desktop\\huannengMain\\WebStarter\\wwwroot\\", + "BasePath": "_content/WebStarter", + "Pattern": "**" + } + ], "Assets": [] } \ No newline at end of file