devin.zhu@doverfs.com 1 жил өмнө
parent
commit
e5c00c4dd2

+ 1 - 1
IMES-Middleware-Platform/src/hosts/IMES-Middleware-Platform.Host/Configs/appconfig.json

@@ -42,7 +42,7 @@
     "projects": [
       {
         "name": "IMES_Middleware_Platform",
-        "code": "app",
+        "code": "middle",
         "version": "v3.7.0",
         "description": "IMES_Middleware_Platform"
       }

+ 1 - 0
IMES-Middleware-Platform/src/hosts/IMES-Middleware-Platform.Host/Program.cs

@@ -18,6 +18,7 @@ new HostApp(new HostAppOptions()
     ConfigurePreServices = context =>
     {
         var dbConfig = ConfigHelper.Get<DbConfig>("dbconfig", context.Environment.EnvironmentName);
+        dbConfig.SyncStructure = false;
         if (dbConfig.Key.NotNull())
         {
             DbKeys.AppDb = dbConfig.Key;

+ 18 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Core/Consts/MiddleAppConfig.cs

@@ -0,0 +1,18 @@
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ZhonTai.Admin.Core.Configs;
+
+namespace IMES_Middleware_Platform.Api.Core.Consts
+{
+    public class MiddleAppConfig : AppConfig
+    {
+        /// <summary>
+        /// 开启开发测试
+        /// </summary>
+        public bool IsDevLogin { get; set; }
+    }
+}

+ 30 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Core/Service/IAssociationService.cs

@@ -0,0 +1,30 @@
+using IMES_Middleware_Platform.Api.Services.Association;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Core.Service_Middleware_Platform.Api.Core
+{
+    /// <summary>
+    /// 协会服务
+    /// </summary>
+    public interface IAssociationService
+    {
+        /// <summary>
+        /// 搜索油站信息
+        /// </summary>
+        /// <param name="areaType">区域</param>
+        /// <param name="search"></param>
+        /// <returns></returns>
+        Task<LocalApiDto> GetAllStation(string areaType, string search);
+
+        /// <summary>
+        /// 获取用户Token信息
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        Task<UserResponseDto>GetToken(UserLogin user);
+    }
+}

+ 81 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/IMES_Middleware_Platform.Api.xml

@@ -39,6 +39,11 @@
             数据库注册键
             </summary>
         </member>
+        <member name="P:IMES_Middleware_Platform.Api.Core.Consts.MiddleAppConfig.IsDevLogin">
+            <summary>
+            开启开发测试
+            </summary>
+        </member>
         <member name="T:IMES_Middleware_Platform.Api.Core.Handlers.AppCustomTaskHandler">
             <summary>
             模块自定义任务处理器
@@ -94,6 +99,62 @@
             模块仓储
             </summary>
         </member>
+        <member name="T:IMES_Middleware_Platform.Api.Services.Association.BaseQueryDto">
+            <summary>
+            协会基础父类
+            </summary>
+        </member>
+        <member name="T:IMES_Middleware_Platform.Api.Services.Association.BaseResDto">
+            <summary>
+             失败响应
+            </summary>
+        </member>
+        <member name="T:IMES_Middleware_Platform.Api.Services.Association.LocalApiDto">
+            <summary>
+            报表统计
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.LocalApiDto.AllStationCount">
+            <summary>
+            油站数量
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.LocalApiDto.AllDispenserCount">
+            <summary>
+            油机数量
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.LocalApiDto.AllNozzleCount">
+            <summary>
+            油枪数量
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.Areacount.Area">
+            <summary>
+            省份
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.Areacount.StationCount">
+            <summary>
+            油站
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.Areacount.DispenserCount">
+            <summary>
+            油机数量
+            </summary>
+        </member>
+        <member name="P:IMES_Middleware_Platform.Api.Services.Association.Areacount.NozzleCount">
+            <summary>
+            油枪数量
+            </summary>
+        </member>
+        <member name="M:IMES_Middleware_Platform.Api.Services.Association.UserLogin.TestLogin">
+            <summary>
+            启用测试账户信息
+            </summary>
+            <returns></returns>
+        </member>
         <member name="T:IMES_Middleware_Platform.Api.Services.Module.IModuleService">
             <summary>
             模块接口
@@ -198,6 +259,26 @@
             名称
             </summary>
         </member>
+        <member name="T:Core.Service_Middleware_Platform.Api.Core.IAssociationService">
+            <summary>
+            协会服务
+            </summary>
+        </member>
+        <member name="M:Core.Service_Middleware_Platform.Api.Core.IAssociationService.GetAllStation(System.String,System.String)">
+            <summary>
+            搜索油站信息
+            </summary>
+            <param name="areaType">区域</param>
+            <param name="search"></param>
+            <returns></returns>
+        </member>
+        <member name="M:Core.Service_Middleware_Platform.Api.Core.IAssociationService.GetToken(IMES_Middleware_Platform.Api.Services.Association.UserLogin)">
+            <summary>
+            获取用户Token信息
+            </summary>
+            <param name="user"></param>
+            <returns></returns>
+        </member>
         <member name="M:ZhonTai.Admin.Repositories.CustomSyncData.InitModuleAsync(IFreeSql,FreeSql.IRepositoryUnitOfWork,ZhonTai.Admin.Core.Configs.DbConfig)">
             <summary>
             初始化模块

+ 36 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Services/Association/AssociationService.cs

@@ -0,0 +1,36 @@
+using Core.Service_Middleware_Platform.Api.Core;
+using IMES_Middleware_Platform.Api.Core.Consts;
+using Microsoft.Extensions.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ZhonTai.Admin.Core.Configs;
+using ZhonTai.Common.Helpers;
+
+namespace IMES_Middleware_Platform.Api.Services.Association
+{
+    public class AssociationService : IAssociationService
+    {
+        private readonly IConfiguration _configuration;
+        public AssociationService(IConfiguration configuration)
+        {
+            _configuration = configuration;
+        }
+        public Task<LocalApiDto> GetAllStation(string areaType, string search)
+        {
+            throw new NotImplementedException();
+        }
+
+        public Task<UserResponseDto> GetToken(UserLogin user)
+        {
+            var middleAppConfig = ConfigHelper.Get<MiddleAppConfig>("appconfig");
+            if (middleAppConfig.IsDevLogin)
+            {
+                user = user.TestLogin();
+            }
+            throw new ArgumentNullException();
+        }
+    }
+}

+ 32 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Services/Association/BaseDto.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IMES_Middleware_Platform.Api.Services.Association
+{
+    /// <summary>
+    /// 协会基础父类
+    /// </summary>
+    public class BaseQueryDto
+    {
+    }
+
+
+    /// <summary>
+    ///  失败响应
+    /// </summary>
+    public class BaseResDto
+    {
+
+        public string code { get; set; }
+
+        public string message { get; set; }
+
+        public string path { get; set; }
+
+    }
+
+
+}

+ 55 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Services/Association/LocalApiDto.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IMES_Middleware_Platform.Api.Services.Association
+{
+   
+    /// <summary>
+    /// 报表统计
+    /// </summary>
+    public class LocalApiDto
+    {
+        /// <summary>
+        /// 油站数量
+        /// </summary>
+        public int AllStationCount { get; set; }
+
+        /// <summary>
+        /// 油机数量
+        /// </summary>
+        public int AllDispenserCount { get; set; }
+
+        /// <summary>
+        /// 油枪数量
+        /// </summary>
+        public int AllNozzleCount { get; set; }
+        public Areacount[] AreaCounts { get; set; }
+    }
+
+    public class Areacount
+    {
+        /// <summary>
+        /// 省份
+        /// </summary>
+        public string Area { get; set; }
+
+        /// <summary>
+        /// 油站
+        /// </summary>
+        public int StationCount { get; set; }
+
+        /// <summary>
+        /// 油机数量
+        /// </summary>
+        public int DispenserCount { get; set; }
+
+        /// <summary>
+        /// 油枪数量
+        /// </summary>
+        public int NozzleCount { get; set; }
+    }
+
+}

+ 53 - 0
IMES-Middleware-Platform/src/platform/IMES-Middleware-Platform.Api/Services/Association/UserDto.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IMES_Middleware_Platform.Api.Services.Association
+{
+    public class UserLogin
+    {
+        public string Email { get; set; }
+        public string Mobile { get; set; }
+        public string Name { get; set; }
+        public string Password { get; set; }
+
+        /// <summary>
+        /// 启用测试账户信息
+        /// </summary>
+        /// <returns></returns>
+        public UserLogin TestLogin() {
+            return new UserLogin() {
+                Email = "15626196105",
+                Mobile = "15626196105",
+                Name = "15626196105",
+                Password = "Qq15626196105"
+            };
+        }
+    }
+   
+
+
+
+    public class UserResponseDto
+    {
+        public object IdentityName { get; set; }
+        public string Mobile { get; set; }
+        public object PhotoId { get; set; }
+        public bool Admin { get; set; }
+        public string Token { get; set; }
+        public string Password { get; set; }
+        public long CreatedDate { get; set; }
+        public int CreatedBy { get; set; }
+        public object IdentityId { get; set; }
+        public bool Disable { get; set; }
+        public string Name { get; set; }
+        public long ModifiedDate { get; set; }
+        public int ModifiedBy { get; set; }
+        public int Id { get; set; }
+        public int Age { get; set; }
+        public string Email { get; set; }
+    }
+
+}