Browse Source

上传油枪信息、上传订单信息

DOVER-GLOBAL\11047086 6 months ago
parent
commit
954be5ae48
36 changed files with 1164 additions and 5 deletions
  1. 7 0
      FuelCloud/Fuel.Application/Class1.cs
  2. 87 0
      FuelCloud/Fuel.Application/EntityHelper.cs
  3. 13 0
      FuelCloud/Fuel.Application/Fuel.Application.csproj
  4. 18 0
      FuelCloud/Fuel.Application/INozzleRepository.cs
  5. 77 0
      FuelCloud/Fuel.Application/Repositories/NozzleRepository.cs
  6. 15 0
      FuelCloud/Fuel.Application/Service/INozzleService.cs
  7. 12 0
      FuelCloud/Fuel.Application/Service/ITransactionsService.cs
  8. 87 0
      FuelCloud/Fuel.Application/Service/NozzleService.cs
  9. 13 0
      FuelCloud/Fuel.Application/Service/TransactionsService.cs
  10. 7 0
      FuelCloud/Fuel.Domain/Class1.cs
  11. 2 2
      FuelCloud/Fuel.Domain/Fuel.Domain.csproj
  12. 7 0
      FuelCloud/Fuel.Infrastructure/Class1.cs
  13. 27 0
      FuelCloud/Fuel.Infrastructure/FreeSqlExtensions.cs
  14. 22 0
      FuelCloud/Fuel.Infrastructure/Fuel.Infrastructure.csproj
  15. 4 0
      FuelCloud/Fuel.Payment.Repositories/Fuel.Payment.Repositories.csproj
  16. 15 1
      FuelCloud/FuelCloud.sln
  17. 1 1
      FuelCloud/src/Fuel.Payment.Core/Fuel.Payment.Core.csproj
  18. 32 0
      FuelCloud/src/Fuel.Payment.Server/Controllers/NozzleController.cs
  19. 15 0
      FuelCloud/src/Fuel.Payment.Server/Controllers/Transactions.cs
  20. 3 1
      FuelCloud/src/Fuel.Payment.Server/Fuel.PaymentServer.csproj
  21. 12 0
      FuelCloud/src/Fuel.Payment.Server/Program.cs
  22. 3 0
      FuelCloud/src/Fuel.Payment.Server/appsettings.json
  23. 12 0
      FuelCloud/src/FuelServer.Core/Entity/Class1.cs
  24. 67 0
      FuelCloud/src/FuelServer.Core/Entity/businessunitinfo.cs
  25. 72 0
      FuelCloud/src/FuelServer.Core/Entity/configuration.cs
  26. 66 0
      FuelCloud/src/FuelServer.Core/Entity/miniprogramusers.cs
  27. 64 0
      FuelCloud/src/FuelServer.Core/Entity/nozzle.cs
  28. 30 0
      FuelCloud/src/FuelServer.Core/Entity/paytype.cs
  29. 45 0
      FuelCloud/src/FuelServer.Core/Entity/product.cs
  30. 54 0
      FuelCloud/src/FuelServer.Core/Entity/tanks.cs
  31. 141 0
      FuelCloud/src/FuelServer.Core/Entity/transactions.cs
  32. 54 0
      FuelCloud/src/FuelServer.Core/Entity/users.cs
  33. 14 0
      FuelCloud/src/FuelServer.Core/Fuel.Core.csproj
  34. 17 0
      FuelCloud/src/FuelServer.Core/Nozzle/Dto/NozzleInfo.cs
  35. 49 0
      FuelCloud/src/FuelServer.Core/Nozzle/Dto/UploadNozzle.cs
  36. BIN
      FuelCloud/src/smartfuel_lite - Shortcut.lnk

+ 7 - 0
FuelCloud/Fuel.Application/Class1.cs

@@ -0,0 +1,7 @@
+namespace Fuel.Application
+{
+    public class Class1
+    {
+
+    }
+}

+ 87 - 0
FuelCloud/Fuel.Application/EntityHelper.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application
+{
+    public class EntityHelper
+    {
+        public readonly IFreeSql _fsql;
+
+        public EntityHelper(IFreeSql fsql)
+        {
+            _fsql = fsql;
+        }
+        /// <summary>
+        /// 查询
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="predicate"></param>
+        /// <returns></returns>
+        public async Task<List<T>> GetEntitiesAsync<T>(Expression<Func<T, bool>> predicate) where T : class
+        {
+            try
+            {
+                // 查询满足条件的实体
+                return await _fsql.Select<T>().Where(predicate).ToListAsync();
+            }
+            catch (Exception ex)
+            {
+            }
+            return new List<T>();
+        }
+        /// <summary>
+        /// 插入
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="entity"></param>
+        /// <returns></returns>
+        public async Task<T> InsertEntityAsync<T>(T entity) where T : class
+        {
+            try
+            {
+                // 插入数据
+                _fsql.Insert(entity).ExecuteAffrows();
+
+                // 获取插入后的主键值
+                object insertedIdObj = _fsql.Ado.ExecuteScalar("SELECT LAST_INSERT_ID();");
+                int insertedId = Convert.ToInt32(insertedIdObj);
+
+                // 查询插入后的数据
+                return await GetInsertedEntityAsync<T>(insertedId);
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+        private async Task<T> GetInsertedEntityAsync<T>(int insertedId) where T : class
+        {
+            // 获取实体类型
+            Type entityType = typeof(T);
+
+            // 获取 Id 属性
+            PropertyInfo idProperty = entityType.GetProperty("Id");
+
+            if (idProperty == null)
+            {
+                throw new InvalidOperationException($"Entity type {entityType.Name} does not have an 'Id' property.");
+            }
+
+            // 构建查询条件
+            var parameter = Expression.Parameter(entityType, "n");
+            var propertyAccess = Expression.MakeMemberAccess(parameter, idProperty);
+            var constantValue = Expression.Constant(insertedId, typeof(int));
+            var equality = Expression.Equal(propertyAccess, constantValue);
+            var lambda = Expression.Lambda<Func<T, bool>>(equality, parameter);
+
+            // 查询插入后的数据
+            return await _fsql.Select<T>().Where(lambda).FirstAsync();
+        }
+    }
+}

+ 13 - 0
FuelCloud/Fuel.Application/Fuel.Application.csproj

@@ -0,0 +1,13 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\src\FuelServer.Core\Fuel.Core.csproj" />
+  </ItemGroup>
+
+</Project>

+ 18 - 0
FuelCloud/Fuel.Application/INozzleRepository.cs

@@ -0,0 +1,18 @@
+using Fuel.Core.Nozzle.Dto;
+using FuelServer.Core.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application
+{
+    public interface INozzleRepository
+    {
+        Task<bool> uploadNozzle(UploadNozzle uploadNozzle);
+        Task<List<nozzle>> AddNozzle(nozzle _nozzle);
+        Task<tanks> AddTanks(tanks _tanks);
+        Task<product> AddProduct(product _product);
+    }
+}

+ 77 - 0
FuelCloud/Fuel.Application/Repositories/NozzleRepository.cs

@@ -0,0 +1,77 @@
+using Fuel.Core.Nozzle.Dto;
+using FuelServer.Core.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application.Repositories
+{
+    public class NozzleRepository : INozzleRepository
+    {
+        private readonly IFreeSql _fsql;
+        public NozzleRepository(IFreeSql fsql)
+        {
+            _fsql = fsql;
+        }
+        public async Task<bool> uploadNozzle(UploadNozzle uploadNozzle)
+        {
+            bool result = false;
+            if (uploadNozzle.type == 1)
+            {
+
+            }
+            else if (uploadNozzle.type == 2)
+            {
+
+            }
+            else if (uploadNozzle.type == 3)
+            {
+
+            }
+            var sds = _fsql.Select<nozzle>().ToList();
+            return result;
+        }
+        public async Task<List<nozzle>> AddNozzle(nozzle _nozzle)
+        {
+            return _fsql.Insert(_nozzle).ExecuteInserted();
+        }
+        public async Task<tanks> AddTanks(tanks _tanks)
+        {
+            try
+            {
+                _fsql.Insert(_tanks).ExecuteAffrows();
+
+                object insertedIdObj = _fsql.Ado.ExecuteScalar("SELECT LAST_INSERT_ID();");
+                int insertedId = Convert.ToInt32(insertedIdObj);
+
+                // 查询插入后的数据
+                return _fsql.Select<tanks>().Where(n => n.Id == insertedId).First();
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+        public async Task<product> AddProduct(product _product)
+        {
+            try
+            {
+                _fsql.Insert(_product).ExecuteAffrows();
+
+                object insertedIdObj = _fsql.Ado.ExecuteScalar("SELECT LAST_INSERT_ID();");
+                int insertedId = Convert.ToInt32(insertedIdObj);
+
+                // 查询插入后的数据
+                return _fsql.Select<product>().Where(n => n.Id == insertedId).First();
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+    }
+}

+ 15 - 0
FuelCloud/Fuel.Application/Service/INozzleService.cs

@@ -0,0 +1,15 @@
+using Fuel.Core.Nozzle.Dto;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application.Service
+{
+    public interface INozzleService
+    {
+        Task<bool> uploadNozzle(UploadNozzle uploadNozzle);
+        Task<List<NozzleInfo>> GetNozzleInfo(int Nozzleid);
+    }
+}

+ 12 - 0
FuelCloud/Fuel.Application/Service/ITransactionsService.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application.Service
+{
+    public interface ITransactionsService
+    {
+    }
+}

+ 87 - 0
FuelCloud/Fuel.Application/Service/NozzleService.cs

@@ -0,0 +1,87 @@
+using Fuel.Core.Nozzle.Dto;
+using FuelServer.Core.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application.Service
+{
+    public class NozzleService : INozzleService
+    {
+        private readonly EntityHelper _entityHelper;
+        public NozzleService(EntityHelper entityHelper)
+        {
+            _entityHelper = entityHelper;
+        }
+        /// <summary>
+        /// 上传油枪
+        /// </summary>
+        /// <param name="uploadNozzle"></param>
+        /// <returns></returns>
+        public async Task<bool> uploadNozzle(UploadNozzle uploadNozzle)
+        {
+            Guid guid = Guid.Parse("12345678-9abc-def0-1234-56789abcdef0");
+            if (uploadNozzle.type == 1)
+            {
+                var isproduct = await _entityHelper.GetEntitiesAsync<product>(_ => _.Buid == guid && _.ProductName == uploadNozzle.ProductName);
+                var istanks = await _entityHelper.GetEntitiesAsync<tanks>(_ => _.Buid == guid && _.TankNumber == uploadNozzle.TankNumber);
+                var isnozzle = await _entityHelper.GetEntitiesAsync<nozzle>(_ => _.Buid == guid && _.ExternalGunNumber == uploadNozzle.ExternalGunNumber);
+                if (isproduct.Count > 0 || istanks.Count > 0 || isnozzle.Count > 0)
+                {
+                    return false;
+                }
+                product product = new product();
+                product.ProductPrice = uploadNozzle.ProductPrice;
+                product.ProductName = uploadNozzle.ProductName;
+                product.ProductCode = uploadNozzle.ProductCode;
+                product.Buid = guid;
+
+                var productid = await _entityHelper.InsertEntityAsync(product);
+
+                tanks tanks = new tanks();
+                tanks.Buid = guid;
+                tanks.TankNumber = uploadNozzle.TankNumber;
+                tanks.TankCapacity = uploadNozzle.TankCapacity;
+                tanks.ProductId = productid.Id;
+                tanks.ProductName = uploadNozzle.ProductName;
+
+                var tanksid = await _entityHelper.InsertEntityAsync(tanks);
+
+                nozzle nozzle = new nozzle();
+                nozzle.Buid = guid;
+                nozzle.PumpId = uploadNozzle.PumpID;
+                nozzle.TankId = tanksid.Id;
+                nozzle.InternalGunNumber = uploadNozzle.InternalGunNumber;
+                nozzle.ExternalGunNumber = uploadNozzle.ExternalGunNumber;
+                nozzle.ProductID = productid.Id;
+                await _entityHelper.InsertEntityAsync(nozzle);
+            }
+            else if (uploadNozzle.type == 2)
+            {
+
+            }
+            else if (uploadNozzle.type == 3)
+            {
+            }
+            return true;
+        }
+        public async Task<List<NozzleInfo>> GetNozzleInfo(int Nozzleid)
+        {
+            Guid guid = Guid.Parse("12345678-9abc-def0-1234-56789abcdef0");
+            return _entityHelper._fsql.Select<nozzle, tanks, product>()
+                    .LeftJoin((a, b, c) => a.TankId == b.Id)
+                    .LeftJoin((a, b, c) => a.ProductID == c.Id)
+                    .Where((a, b, c) => a.Buid == guid && a.ExternalGunNumber == Nozzleid)
+                    .ToList((a, b, c) => new NozzleInfo()
+                    {
+                        Nozzleid = a.ExternalGunNumber,
+                        ProductName = c.ProductName,
+                        ProductPrice = c.ProductPrice,
+                        Status = a.Status,
+                        TankNumber = b.TankNumber
+                    });
+        }
+    }
+}

+ 13 - 0
FuelCloud/Fuel.Application/Service/TransactionsService.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Application.Service
+{
+    public class TransactionsService
+    {
+
+    }
+}

+ 7 - 0
FuelCloud/Fuel.Domain/Class1.cs

@@ -0,0 +1,7 @@
+namespace Fuel.Domain
+{
+    public class Class1
+    {
+
+    }
+}

+ 2 - 2
FuelCloud/src/FuelServer.Core/FuelServer.Core.csproj → FuelCloud/Fuel.Domain/Fuel.Domain.csproj

@@ -1,7 +1,7 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net8.0</TargetFramework>
+    <TargetFramework>net6.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
   </PropertyGroup>

+ 7 - 0
FuelCloud/Fuel.Infrastructure/Class1.cs

@@ -0,0 +1,7 @@
+namespace Fuel.Infrastructure
+{
+    public class Class1
+    {
+
+    }
+}

+ 27 - 0
FuelCloud/Fuel.Infrastructure/FreeSqlExtensions.cs

@@ -0,0 +1,27 @@
+using FreeSql;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Configuration;
+using Fuel.Application;
+
+namespace Fuel.Infrastructure
+{
+    public static class FreeSqlExtensions
+    {
+        public static void AddFreeSql(this IServiceCollection services, IConfiguration configuration)
+        {
+            var connectionString = configuration.GetConnectionString("MysqlConnection");
+            var fsql = new FreeSqlBuilder()
+                .UseConnectionString(DataType.MySql, connectionString)
+                .UseAutoSyncStructure(true) // 自动同步数据库结构
+                .Build();
+
+            services.AddSingleton<IFreeSql>(fsql);
+            services.AddSingleton<EntityHelper>(sp => new EntityHelper(fsql));
+        }
+    }
+}

+ 22 - 0
FuelCloud/Fuel.Infrastructure/Fuel.Infrastructure.csproj

@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="FreeSql" Version="3.2.833" />
+    <PackageReference Include="FreeSql.Provider.MySql" Version="3.2.833" />
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Primitives" Version="9.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Fuel.Application\Fuel.Application.csproj" />
+    <ProjectReference Include="..\src\FuelServer.Core\Fuel.Core.csproj" />
+  </ItemGroup>
+
+</Project>

+ 4 - 0
FuelCloud/Fuel.Payment.Repositories/Fuel.Payment.Repositories.csproj

@@ -10,4 +10,8 @@
     <Folder Include="Impl\" />
   </ItemGroup>
 
+  <ItemGroup>
+    <PackageReference Include="FreeSql.Provider.MySql" Version="3.2.833" />
+  </ItemGroup>
+
 </Project>

+ 15 - 1
FuelCloud/FuelCloud.sln

@@ -25,7 +25,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeChatSdk", "ElectronicPaym
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "ElectronicPayment\Models\Models.csproj", "{9CF77A29-FBDE-4CF5-AF10-C8A97485937A}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FuelServer.Core", "src\FuelServer.Core\FuelServer.Core.csproj", "{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fuel.Core", "src\FuelServer.Core\Fuel.Core.csproj", "{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fuel.Infrastructure", "Fuel.Infrastructure\Fuel.Infrastructure.csproj", "{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fuel.Application", "Fuel.Application\Fuel.Application.csproj", "{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -73,6 +77,14 @@ Global
 		{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -89,6 +101,8 @@ Global
 		{6A8A2AF0-791D-4207-AB5B-99CAC28CEBD8} = {FF8B0E2F-823B-4ACF-ADAC-282CD8F2B3CF}
 		{9CF77A29-FBDE-4CF5-AF10-C8A97485937A} = {FF8B0E2F-823B-4ACF-ADAC-282CD8F2B3CF}
 		{AEDE8AC1-17AB-47A3-8CBA-36D32484B6ED} = {A70E5B56-8E5C-4EB2-92F0-66FA7E67A2D1}
+		{FB53499B-CA9D-4E75-9EDC-2A04DCD4C5D1} = {A70E5B56-8E5C-4EB2-92F0-66FA7E67A2D1}
+		{6DBC4319-6D95-482B-9DBD-2F48BA72B0D9} = {A70E5B56-8E5C-4EB2-92F0-66FA7E67A2D1}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {61A0BE4B-D15C-4489-B07B-A028AEC93C1D}

+ 1 - 1
FuelCloud/src/Fuel.Payment.Core/Fuel.Payment.Core.csproj

@@ -19,7 +19,7 @@
   <ItemGroup>
     <ProjectReference Include="..\..\ElectronicPayment\alipay-sdk-NET20161213174056\AopSdk.csproj" />
     <ProjectReference Include="..\..\ElectronicPayment\WeChatSdk\WeChatSdk.csproj" />
-    <ProjectReference Include="..\FuelServer.Core\FuelServer.Core.csproj" />
+    <ProjectReference Include="..\FuelServer.Core\Fuel.Core.csproj" />
   </ItemGroup>
 
 </Project>

+ 32 - 0
FuelCloud/src/Fuel.Payment.Server/Controllers/NozzleController.cs

@@ -0,0 +1,32 @@
+using Fuel.Application.Service;
+using Fuel.Core.Nozzle.Dto;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Fuel.PaymentServer.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class NozzleController : ControllerBase
+    {
+        private readonly INozzleService InozzleService;
+        public NozzleController(INozzleService nozzleService)
+        {
+            InozzleService = nozzleService;
+        }
+        [Route("uploadNozzle")]
+        [HttpPost]
+        public async Task<IActionResult> uploadNozzle(UploadNozzle uploadNozzle)
+        {
+            await InozzleService.uploadNozzle(uploadNozzle);
+            return Ok(0);
+        }
+        [Route("GetNozzleInfo")]
+        [HttpPost]
+        public async Task<List<NozzleInfo>> GetNozzleInfo(int Nozzleid)
+        {
+            var data = await InozzleService.GetNozzleInfo(Nozzleid);
+            return data;
+        }
+    }
+}

+ 15 - 0
FuelCloud/src/Fuel.Payment.Server/Controllers/Transactions.cs

@@ -0,0 +1,15 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Fuel.PaymentServer.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class Transactions : ControllerBase
+    {
+        public Transactions()
+        { 
+            
+        }
+    }
+}

+ 3 - 1
FuelCloud/src/Fuel.Payment.Server/Fuel.PaymentServer.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
+<Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
     <TargetFramework>net8.0</TargetFramework>
@@ -19,6 +19,8 @@
   </ItemGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\Fuel.Application\Fuel.Application.csproj" />
+    <ProjectReference Include="..\..\Fuel.Infrastructure\Fuel.Infrastructure.csproj" />
     <ProjectReference Include="..\Fuel.Payment.Core\Fuel.Payment.Core.csproj" />
     <ProjectReference Include="..\Fuel.Payment.Service\Fuel.Payment.Service.csproj" />
   </ItemGroup>

+ 12 - 0
FuelCloud/src/Fuel.Payment.Server/Program.cs

@@ -1,6 +1,11 @@
 
 
 using DFS.Core.Mvc;
+using FreeSql;
+using Fuel.Application;
+using Fuel.Application.Repositories;
+using Fuel.Application.Service;
+using Fuel.Infrastructure;
 using Fuel.Payment.Service.AliPaymentProcessor.Alipay;
 using Fuel.Payment.Service.AllInPayProcessor.AllInPay;
 using Fuel.Payment.Service.Factory;
@@ -23,10 +28,17 @@ AsyncPaymentProcessorFactory.Default.Regist(o => o.Channel == "ALI_ORDER_SCAN",
 AsyncPaymentProcessorFactory.Default.Regist(o => o.Channel == "UNION_MINI", new MiniUnionPayProcessor());
 AsyncPaymentProcessorFactory.Default.Regist(o => o.Channel == "UNION_SCAN", new UnionPayProcessor());
 // Add services to the container.
+// Ìí¼ÓFreeSQLÅäÖÃ
+builder.Services.AddFreeSql(builder.Configuration);
 
 //³õʼ»¯DFS Server
 builder.Services.AddMicService(builder.Environment);
 
+
+builder.Services.AddScoped<INozzleRepository, NozzleRepository>();
+builder.Services.AddScoped<INozzleService, NozzleService>();
+
+
 // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
 builder.Services.AddEndpointsApiExplorer();
 builder.Services.AddSwaggerGen();

+ 3 - 0
FuelCloud/src/Fuel.Payment.Server/appsettings.json

@@ -1,4 +1,7 @@
 {
+  "ConnectionStrings": {
+    "MysqlConnection": "Server=localhost; Port=3306; Database=fuellite; Uid=root; Pwd=HS1205; Charset=utf8mb4;"
+  },
   "Logging": {
     "LogLevel": {
       "Default": "Information",

+ 12 - 0
FuelCloud/src/FuelServer.Core/Entity/Class1.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FuelServer.Core.Entity
+{
+    internal class Class1
+    {
+    }
+}

+ 67 - 0
FuelCloud/src/FuelServer.Core/Entity/businessunitinfo.cs

@@ -0,0 +1,67 @@
+using FreeSql.DatabaseModel;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 站点表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class businessunitinfo {
+
+		[JsonProperty, Column(IsPrimary = true)]
+		public Guid Buid { get; set; }
+
+		/// <summary>
+		/// 油站地址
+		/// </summary>
+		[JsonProperty, Column(IsNullable = false)]
+		public string Address { get; set; }
+
+		/// <summary>
+		/// 小程序appid
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Appid { get; set; }
+
+		[JsonProperty, Column(StringLength = 100)]
+		public string CreateBy { get; set; }
+
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "CURRENT_TIMESTAMP")]
+		public DateTime CreateTime { get; set; }
+
+		/// <summary>
+		/// 油站经纬度
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public string GpsCoordinates { get; set; }
+
+		/// <summary>
+		/// 油站名称
+		/// </summary>
+		[JsonProperty, Column(IsNullable = false)]
+		public string Name { get; set; }
+
+		/// <summary>
+		/// 联系人
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Phone { get; set; }
+
+		/// <summary>
+		/// 小程序secret
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Secret { get; set; }
+
+	}
+
+}

+ 72 - 0
FuelCloud/src/FuelServer.Core/Entity/configuration.cs

@@ -0,0 +1,72 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 配置表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class configuration {
+
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		/// <summary>
+		/// buid
+		/// </summary>
+		[JsonProperty]
+		public Guid? Buid { get; set; }
+
+		/// <summary>
+		/// 支付方式类型
+		/// </summary>
+		[JsonProperty]
+		public int? payType { get; set; }
+
+		[JsonProperty, Column(StringLength = 100)]
+		public string CreateBy { get; set; }
+
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "CURRENT_TIMESTAMP")]
+		public DateTime CreateTime { get; set; }
+
+		/// <summary>
+		/// 是否启用
+		/// </summary>
+		[JsonProperty, Column(DbType = "tinyint(1)")]
+		public sbyte? Enabled { get; set; }
+
+		/// <summary>
+		/// 配置名称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Name { get; set; }
+
+		/// <summary>
+		/// 备注
+		/// </summary>
+		[JsonProperty, Column(StringLength = -1)]
+		public string remark { get; set; }
+
+		/// <summary>
+		/// 模板类型
+		/// </summary>
+		[JsonProperty]
+		public int? Type { get; set; }
+
+		/// <summary>
+		/// 配置内容
+		/// </summary>
+		[JsonProperty, Column(StringLength = -1)]
+		public string Value { get; set; }
+
+	}
+
+}

+ 66 - 0
FuelCloud/src/FuelServer.Core/Entity/miniprogramusers.cs

@@ -0,0 +1,66 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 小程序用户表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class miniprogramusers {
+
+		/// <summary>
+		/// 用户唯一标识符
+		/// </summary>
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		[JsonProperty]
+		public Guid Buid { get; set; }
+
+		/// <summary>
+		/// 用户地址
+		/// </summary>
+		[JsonProperty]
+		public string Address { get; set; }
+
+		/// <summary>
+		/// 微信OpenId
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public string OpenId { get; set; }
+
+		/// <summary>
+		/// 微信UnionId
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string UnionId { get; set; }
+
+		/// <summary>
+		/// 用户头像地址
+		/// </summary>
+		[JsonProperty]
+		public string UserAvatarUrl { get; set; }
+
+		/// <summary>
+		/// 用户昵称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string UserName { get; set; }
+
+		/// <summary>
+		/// 用户手机号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 20)]
+		public string UserPhoneNumber { get; set; }
+
+	}
+
+}

+ 64 - 0
FuelCloud/src/FuelServer.Core/Entity/nozzle.cs

@@ -0,0 +1,64 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 油枪表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class nozzle {
+
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		[JsonProperty]
+		public Guid? Buid { get; set; }
+
+		/// <summary>
+		/// 油品id
+		/// </summary>
+		[JsonProperty]
+		public int? ProductID { get; set; }
+
+		/// <summary>
+		/// 油罐ID
+		/// </summary>
+		[JsonProperty]
+		public int? TankId { get; set; }
+
+		/// <summary>
+		/// 外部枪号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50, IsNullable = false)]
+		public int? ExternalGunNumber { get; set; }
+
+		/// <summary>
+		/// 内部枪号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50, IsNullable = false)]
+		public int? InternalGunNumber { get; set; }
+
+
+		/// <summary>
+		/// 加油点
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public int? PumpId { get; set; }
+
+		/// <summary>
+		/// 1:在线、2:离线、3:正在加油
+		/// </summary>
+		[JsonProperty]
+		public int? Status { get; set; }
+
+	}
+
+}

+ 30 - 0
FuelCloud/src/FuelServer.Core/Entity/paytype.cs

@@ -0,0 +1,30 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 支付方式
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class paytype {
+
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		/// <summary>
+		/// 支付方式名称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Name { get; set; }
+
+	}
+
+}

+ 45 - 0
FuelCloud/src/FuelServer.Core/Entity/product.cs

@@ -0,0 +1,45 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 油品表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class product {
+
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		[JsonProperty]
+		public Guid Buid { get; set; }
+
+		/// <summary>
+		/// 油品码
+		/// </summary>
+		[JsonProperty, Column(StringLength = 20, IsNullable = false)]
+		public string ProductCode { get; set; }
+
+		/// <summary>
+		/// 油品名称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 20)]
+		public string ProductName { get; set; }
+
+		/// <summary>
+		/// 油品单价
+		/// </summary>
+		[JsonProperty]
+		public decimal? ProductPrice { get; set; }
+
+	}
+
+}

+ 54 - 0
FuelCloud/src/FuelServer.Core/Entity/tanks.cs

@@ -0,0 +1,54 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 油罐表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class tanks {
+
+		/// <summary>
+		/// 油罐唯一标识符
+		/// </summary>
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		[JsonProperty]
+		public Guid? Buid { get; set; }
+
+		/// <summary>
+		/// 油品ID
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50, IsNullable = false)]
+		public int? ProductId { get; set; }
+
+		/// <summary>
+		/// 油品名称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public string ProductName { get; set; }
+
+		/// <summary>
+		/// 罐容量
+		/// </summary>
+		[JsonProperty]
+		public decimal? TankCapacity { get; set; }
+
+		/// <summary>
+		/// 油罐号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50, IsNullable = false)]
+		public int? TankNumber { get; set; }
+
+	}
+
+}

+ 141 - 0
FuelCloud/src/FuelServer.Core/Entity/transactions.cs

@@ -0,0 +1,141 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 订单表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class transactions {
+
+		/// <summary>
+		/// 订单唯一标识符
+		/// </summary>
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		/// <summary>
+		/// 油站唯一标识符
+		/// </summary>
+		[JsonProperty]
+		public Guid Buid { get; set; }
+
+		/// <summary>
+		/// 用户ID
+		/// </summary>
+		[JsonProperty]
+		public int MiniProgramID { get; set; }
+
+		/// <summary>
+		/// 枪号
+		/// </summary>
+		[JsonProperty]
+		public int NozzleId { get; set; }
+
+		/// <summary>
+		/// 油品ID
+		/// </summary>
+		[JsonProperty]
+		public int ProductId { get; set; }
+
+		/// <summary>
+		/// 实际支付金额
+		/// </summary>
+		[JsonProperty]
+		public decimal ActualPaymentAmount { get; set; }
+
+		/// <summary>
+		/// 授权时间
+		/// </summary>
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "0000-00-00 00:00:00")]
+		public DateTime AuthorizationTime { get; set; }
+
+		[JsonProperty, Column(StringLength = 100)]
+		public string CreateBy { get; set; }
+
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "0000-00-00 00:00:00")]
+		public DateTime CreateTime { get; set; }
+
+		/// <summary>
+		/// 挂枪时间
+		/// </summary>
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "CURRENT_TIMESTAMP")]
+		public DateTime FuelItemTransactionEndTime { get; set; }
+
+		/// <summary>
+		/// 是否删除
+		/// </summary>
+		[JsonProperty, Column(DbType = "tinyint(1)")]
+		public sbyte? IsDeleted { get; set; } = 0;
+
+		/// <summary>
+		/// 订单状态
+		/// </summary>
+		[JsonProperty]
+		public transactionsORDERSTATUS OrderStatus { get; set; }
+
+		/// <summary>
+		/// 订单类型
+		/// </summary>
+		[JsonProperty]
+		public transactionsORDERTYPE OrderType { get; set; }
+
+		/// <summary>
+		/// 原金额
+		/// </summary>
+		[JsonProperty]
+		public decimal OriginalAmount { get; set; }
+
+		/// <summary>
+		/// 支付方式
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50)]
+		public string PaymentMethod { get; set; }
+
+		/// <summary>
+		/// 油品名称
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public string ProductName { get; set; }
+
+		/// <summary>
+		/// 升数
+		/// </summary>
+		[JsonProperty]
+		public decimal Qty { get; set; }
+
+		/// <summary>
+		/// 退款金额
+		/// </summary>
+		[JsonProperty]
+		public decimal? RefundAmount { get; set; }
+
+		/// <summary>
+		/// 订单流水号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 50, IsNullable = false)]
+		public string TransactionNumber { get; set; }
+
+		/// <summary>
+		/// 交易时间
+		/// </summary>
+		[JsonProperty, Column(DbType = "timestamp", InsertValueSql = "0000-00-00 00:00:00")]
+		public DateTime TransactionTime { get; set; }
+
+	}
+
+	public enum transactionsORDERSTATUS {
+		未支付 = 1, 已支付, 支付中, 退全款, 退余额, 卡支付
+	}
+	public enum transactionsORDERTYPE {
+		预支付 = 1, 后支付
+	}
+}

+ 54 - 0
FuelCloud/src/FuelServer.Core/Entity/users.cs

@@ -0,0 +1,54 @@
+using FreeSql.DatabaseModel;using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using FreeSql.DataAnnotations;
+
+namespace FuelServer.Core.Entity
+{
+
+	/// <summary>
+	/// 用户表
+	/// </summary>
+	[JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)]
+	public partial class users {
+
+		/// <summary>
+		/// 用户唯一标识符
+		/// </summary>
+		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
+		public int Id { get; set; }
+
+		[JsonProperty]
+		public Guid? Buid { get; set; }
+
+		/// <summary>
+		/// 用户账号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100, IsNullable = false)]
+		public string Account { get; set; }
+
+		/// <summary>
+		/// 用户邮箱
+		/// </summary>
+		[JsonProperty, Column(StringLength = 100)]
+		public string Email { get; set; }
+
+		/// <summary>
+		/// 用户密码
+		/// </summary>
+		[JsonProperty, Column(IsNullable = false)]
+		public string Password { get; set; }
+
+		/// <summary>
+		/// 用户手机号
+		/// </summary>
+		[JsonProperty, Column(StringLength = 20)]
+		public string PhoneNumber { get; set; }
+
+	}
+
+}

+ 14 - 0
FuelCloud/src/FuelServer.Core/Fuel.Core.csproj

@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="FreeSql" Version="3.2.833" />
+    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
+  </ItemGroup>
+
+</Project>

+ 17 - 0
FuelCloud/src/FuelServer.Core/Nozzle/Dto/NozzleInfo.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Core.Nozzle.Dto
+{
+    public class NozzleInfo
+    {
+        public int? Nozzleid { get; set; }
+        public int? TankNumber { get; set; }
+        public int? Status { get; set; }
+        public string ProductName { get; set; }
+        public decimal? ProductPrice { get; set; }
+    }
+}

+ 49 - 0
FuelCloud/src/FuelServer.Core/Nozzle/Dto/UploadNozzle.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fuel.Core.Nozzle.Dto
+{
+    public class UploadNozzle
+    {
+        /// <summary>
+        /// 加油点
+        /// </summary>
+        public int? PumpID { get; set; }
+        /// <summary>
+        /// 内部枪号
+        /// </summary>
+        public int? InternalGunNumber { get; set; }
+        /// <summary>
+        /// 外部枪号
+        /// </summary>
+        public int? ExternalGunNumber { get; set; }
+        /// <summary>
+        /// 油罐号
+        /// </summary>
+        public int? TankNumber { get; set; }
+        /// <summary>
+        /// 油罐容量
+        /// </summary>
+        public decimal? TankCapacity { get; set; }
+        /// <summary>
+        /// 油品名称
+        /// </summary>
+        public string ProductName { get; set; }
+        /// <summary>
+        /// 油品码
+        /// </summary>
+        public string ProductCode { get; set; }
+        /// <summary>
+        /// 油品单价
+        /// </summary>
+        public decimal? ProductPrice { get; set; }
+        /// <summary>
+        /// 1:上传      2:更新      3:上传
+        /// </summary>
+        public int type { get; set; }
+
+    }
+}

BIN
FuelCloud/src/smartfuel_lite - Shortcut.lnk