Ver Fonte

主账户列表优化获取用户信息

Your Name há 3 meses atrás
pai
commit
3fd509ce29
60 ficheiros alterados com 4411 adições e 104 exclusões
  1. BIN
      .vs/smartfueltool/DesignTimeBuild/.dtbcache.v2
  2. BIN
      .vs/smartfueltool/v17/.futdcache.v2
  3. 69 1
      src/MS.DbContexts/AccountingContext.cs
  4. 5 2
      src/MS.DbContexts/AuthContext.cs
  5. 14 0
      src/MS.DbContexts/MSDbContext.cs
  6. 28 0
      src/MS.Entities/AccountingService_Models/CardInvoice.cs
  7. 20 0
      src/MS.Entities/AccountingService_Models/Trxtable.cs
  8. 14 0
      src/MS.Entities/AccountingService_Models/UserIdAndName.cs
  9. 19 0
      src/MS.Entities/AccountingService_Models/UserMessages.cs
  10. 135 0
      src/MS.Entities/Models/NozzleTransaction.cs
  11. 10 0
      src/MS.Entities/Models/PosTrxMopsDto.cs
  12. 27 0
      src/MS.Entities/Models/PosTrxUnLock.cs
  13. 18 0
      src/MS.Models/DiscountsInfo.cs
  14. 11 0
      src/MS.Models/TransactionStatusDto.cs
  15. 17 0
      src/MS.Models/UploadTrx.cs
  16. 420 7
      src/MS.Services/Account/AccountService.cs
  17. 14 0
      src/MS.Services/Account/IAccountService.cs
  18. 82 0
      src/MS.Services/Account/Sample.cs
  19. 2 0
      src/MS.Services/MS.Services.csproj
  20. 4 1
      src/MS.Services/PosTrxService/IPosTrxLineItemsService.cs
  21. 1 0
      src/MS.Services/PosTrxService/IPosTrxService.cs
  22. 376 2
      src/MS.Services/PosTrxService/PosTrxLineItemsService.cs
  23. 52 58
      src/MS.Services/PosTrxService/PosTrxService.cs
  24. 1 1
      src/MS.UnitOfWork/Repository/IRepository.cs
  25. 112 1
      src/MS.WebApi/Controllers/AccountController.cs
  26. 15 0
      src/MS.WebApi/Controllers/FixFuelItemTagController.cs
  27. 24 0
      src/MS.WebApi/Controllers/TransactionStatusController.cs
  28. 28 14
      src/MS.WebApi/Initialize/Startup.cs
  29. 1 0
      src/MS.WebApi/MS.WebApi.csproj
  30. 23 0
      src/MS.WebApi/Models/PosTrxUnLock.cs
  31. 43 0
      src/MS.WebApi/Models/TransactionServiceDatabase_NewThu04130311PMContext.cs
  32. 76 0
      src/MS.WebApi/Models2/AccountInfo.cs
  33. 24 0
      src/MS.WebApi/Models2/AccountType.cs
  34. 1814 0
      src/MS.WebApi/Models2/AccountingService_Sun_0230AMMon03180930AMContext.cs
  35. 31 0
      src/MS.WebApi/Models2/BlackCardInfo.cs
  36. 126 0
      src/MS.WebApi/Models2/BusinessUnitInfo.cs
  37. 58 0
      src/MS.WebApi/Models2/CardInfo.cs
  38. 27 0
      src/MS.WebApi/Models2/CardRepLossInfo.cs
  39. 19 0
      src/MS.WebApi/Models2/ChangeHistory.cs
  40. 28 0
      src/MS.WebApi/Models2/FleetCardRechargeHistory.cs
  41. 23 0
      src/MS.WebApi/Models2/FlywaySchemaHistory.cs
  42. 51 0
      src/MS.WebApi/Models2/GrayInfo.cs
  43. 16 0
      src/MS.WebApi/Models2/ImageInfo.cs
  44. 28 0
      src/MS.WebApi/Models2/InvoiceInfo.cs
  45. 56 0
      src/MS.WebApi/Models2/MembershipGroup.cs
  46. 24 0
      src/MS.WebApi/Models2/MembershipGrowthRules.cs
  47. 42 0
      src/MS.WebApi/Models2/MembershipLevelInfo.cs
  48. 84 0
      src/MS.WebApi/Models2/OfflineTransactionInfo.cs
  49. 30 0
      src/MS.WebApi/Models2/RechargePaymentHistory.cs
  50. 23 0
      src/MS.WebApi/Models2/SmsInfo.cs
  51. 43 0
      src/MS.WebApi/Models2/TransactionInfo.cs
  52. 20 0
      src/MS.WebApi/Models2/Trxtable.cs
  53. 69 0
      src/MS.WebApi/Models2/UserInfo.cs
  54. 18 0
      src/MS.WebApi/Models2/UserInfoMembershipGroups.cs
  55. 21 0
      src/MS.WebApi/Models2/UserMessages.cs
  56. 10 10
      src/MS.WebApi/appsettings.json
  57. 13 6
      src/MS.WebCore/Core/RedisExample.cs
  58. 24 0
      src/MS.WebCore/Dto/PosTrxUnLockDto.cs
  59. 27 0
      src/QuartzSettings/logs/logs.txt
  60. 1 1
      src/QuartzSettings/task_job.json

BIN
.vs/smartfueltool/DesignTimeBuild/.dtbcache.v2


BIN
.vs/smartfueltool/v17/.futdcache.v2


+ 69 - 1
src/MS.DbContexts/AccountingContext.cs

@@ -24,7 +24,9 @@ namespace MS.DbContexts
         public DbSet<CardSummary> cardSummaries { get; set; }
         public DbSet<ChangeHistory> changeHistories { get; set; }
         public DbSet<GroupedAccountIdTotal> groupedAccountIdTotals { get; set; }
-        
+
+        public DbSet<CardInvoice> cardInvoices { get; set; }
+
         public virtual DbSet<AccountInfo> AccountInfo { get; set; }
         public virtual DbSet<AccountType> AccountType { get; set; }
         public virtual DbSet<BlackCardInfo> BlackCardInfo { get; set; }
@@ -46,6 +48,9 @@ namespace MS.DbContexts
         public virtual DbSet<TransactionInfo> TransactionInfo { get; set; }
         public virtual DbSet<UserInfo> UserInfo { get; set; }
         public virtual DbSet<UserInfoMembershipGroups> UserInfoMembershipGroups { get; set; }
+        public virtual DbSet<Trxtable> Trxtable { get; set; }
+        public virtual DbSet<UserIdAndName> UserIdAndNames { get; set; }
+        public virtual DbSet<UserMessages> UserMessages { get; set; }
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             base.OnConfiguring(optionsBuilder);
@@ -69,6 +74,8 @@ namespace MS.DbContexts
 .HasNoKey(); // 标记为无主键实体
             modelBuilder.Entity<AccountRechargeTotal>()
 .HasNoKey(); // 标记为无主键实体
+            modelBuilder.Entity<UserIdAndName>()
+.HasNoKey(); // 标记为无主键实体
 
 
             modelBuilder.Entity<AccountInfo>(entity =>
@@ -250,6 +257,67 @@ namespace MS.DbContexts
                     .HasColumnName("name")
                     .HasMaxLength(255);
             });
+            modelBuilder.Entity<Trxtable>(entity =>
+            {
+
+                entity.ToTable("trxtable");
+
+                // 设置Id为主键
+                entity.HasKey(e => e.Id);
+
+                // 配置Id属性
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedOnAdd();  // 自增主键
+                entity.Property(e => e.Buid).HasColumnName("buid");
+
+                entity.Property(e => e.Cardno)
+                    .HasColumnName("cardno")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Mon).HasColumnName("mon");
+
+                entity.Property(e => e.Nozno).HasColumnName("nozno");
+
+                entity.Property(e => e.Opercardno)
+                    .HasColumnName("opercardno")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ttc)
+                    .HasColumnName("ttc")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ttctime).HasColumnName("ttctime");
+            });
+
+            modelBuilder.Entity<UserMessages>(entity =>
+            {
+                entity.ToTable("user_messages");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .HasDefaultValueSql("uuid_generate_v4()");
+
+                entity.Property(e => e.AccountId).HasColumnName("account_id");
+
+                entity.Property(e => e.AccountType)
+                    .HasColumnName("account_type")
+                    .HasMaxLength(50);
+
+                entity.Property(e => e.CreatedAt)
+                    .HasColumnName("created_at")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.IsSmsSent).HasColumnName("is_sms_sent");
+
+                entity.Property(e => e.MessageContent).HasColumnName("message_content");
+
+                entity.Property(e => e.PhoneNumber)
+                    .HasColumnName("phone_number")
+                    .HasMaxLength(20);
+
+                entity.Property(e => e.SentTime).HasColumnName("sent_time");
+            });
 
             modelBuilder.Entity<BlackCardInfo>(entity =>
             {

+ 5 - 2
src/MS.DbContexts/AuthContext.cs

@@ -17,6 +17,7 @@ namespace MS.DbContexts
         {
         }
         public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => builder.AddDebug().AddConsole());
+        public virtual DbSet<BusinessUnits> BusinessUnits { get; set; }
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             base.OnConfiguring(optionsBuilder);
@@ -37,12 +38,14 @@ namespace MS.DbContexts
         .Ignore(u => u.AspNetUserRoles);
             modelBuilder.Entity<AspNetRoles>()
         .Ignore(r => r.AspNetUserRoles);
+            modelBuilder.Entity<AspNetUserRoles>()
+   .HasNoKey();
             //    modelBuilder.Entity<IdentityUserBusiUnitM2m>()
             //.HasNoKey();
             //    modelBuilder.Entity<AspNetUsers>()
             //.Ignore(u => u.IdentityUserBusiUnitM2m);
-       //     modelBuilder.Entity<IdentityUserBusiUnitM2m>()
-       //.HasKey(e => new { e.ServiceIdentityUserId, e.BusinessUnitId });
+            //     modelBuilder.Entity<IdentityUserBusiUnitM2m>()
+            //.HasKey(e => new { e.ServiceIdentityUserId, e.BusinessUnitId });
             base.OnModelCreating(modelBuilder);
         }
     }

+ 14 - 0
src/MS.DbContexts/MSDbContext.cs

@@ -22,6 +22,10 @@ namespace MS.DbContexts
         public DbSet<NozzleAssignments> NozzleAssignments { get; set; }
         public DbSet<PosTrxes> posTrxes { get; set; }
         public DbSet<PosTrxMopsDto> posTrxMopsDtos { get; set; }
+        public DbSet<NozzleTransaction> nozzleTransactions { get; set; }
+        public DbSet<FuelDetailsDto> fuelDetailsDtos { get; set; }
+        public DbSet<PumpVolumeSummary> pumpVolumeSummaries { get; set; }
+        public DbSet<PumpTransactionSummary> pumpTransactionSummaries { get; set; }
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             base.OnConfiguring(optionsBuilder);
@@ -45,8 +49,18 @@ namespace MS.DbContexts
              .Ignore(p => p.Currency);
             modelBuilder.Entity<PosItems>()
           .HasKey(p => p.Id);
+            modelBuilder.Entity<PosTrxUnLock>()
+    .HasKey(p => p.Id);
             modelBuilder.Entity<PosTrxMopsDto>()
   .HasNoKey(); // 标记为无主键实体
+            modelBuilder.Entity<NozzleTransaction>()
+.HasNoKey(); // 标记为无主键实体
+            modelBuilder.Entity<PumpTransactionSummary>()
+.HasNoKey(); // 标记为无主键实体
+            modelBuilder.Entity<PumpVolumeSummary>()
+.HasNoKey(); // 标记为无主键实体
+            modelBuilder.Entity<FuelDetailsDto>()
+.HasNoKey(); // 标记为无主键实体
             base.OnModelCreating(modelBuilder);
         }
 

+ 28 - 0
src/MS.Entities/AccountingService_Models/CardInvoice.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Entities.AccountingService_Models
+{
+    public class CardInvoice
+    {
+        public Guid Id { get; set; }
+        /// <summary>
+        /// 手机号
+        /// </summary>
+        public string offline_phone_no { get; set; }
+        /// <summary>
+        /// 可开票余额
+        /// </summary>
+        public int? invoice_balance { get; set; }
+        /// <summary>
+        /// 开票金额
+        /// </summary>
+        public int? amount { get; set; }
+        /// <summary>
+        /// 半年前可开票金额
+        /// </summary>
+        public int? halfayearamount { get; set; }
+        public string card_no { get; set; }
+    }
+}

+ 20 - 0
src/MS.Entities/AccountingService_Models/Trxtable.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace MS.Entities.AccountingService_Models
+{
+    public partial class Trxtable
+    {
+        [Key]
+        public int Id { get; set; }
+        public string Ttc { get; set; }
+        public DateTime? Ttctime { get; set; }
+        public string Opercardno { get; set; }
+        public string Cardno { get; set; }
+        public int? Nozno { get; set; }
+        public int? Mon { get; set; }
+        public Guid? Buid { get; set; }
+    }
+}

+ 14 - 0
src/MS.Entities/AccountingService_Models/UserIdAndName.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Entities.AccountingService_Models
+{
+    public class UserIdAndName
+    {
+        public string Id { get; set; }
+        public string UserName { get; set; }
+        public string PhoneNo { get; set; }
+        public string AccountType { get; set; }
+    }
+}

+ 19 - 0
src/MS.Entities/AccountingService_Models/UserMessages.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Entities.AccountingService_Models
+{
+    public partial class UserMessages
+    {
+        public Guid Id { get; set; }
+        public string PhoneNumber { get; set; }
+        public Guid? AccountId { get; set; }
+        public int? IsSmsSent { get; set; }
+        public DateTime? SentTime { get; set; }
+        public string AccountType { get; set; }
+        public string MessageContent { get; set; }
+        public DateTime? CreatedAt { get; set; }
+        public string card_no { get; set; }
+    }
+}

+ 135 - 0
src/MS.Entities/Models/NozzleTransaction.cs

@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Entities.Models
+{
+    public class NozzleTransaction
+    {
+        /// <summary>
+        /// 油枪
+        /// </summary>
+        public int FuelItemSoldOnPumpNozzleId { get; set; }
+        /// <summary>
+        /// 商品名称
+        /// </summary>
+        public string ItemName { get; set; }
+        /// <summary>
+        /// 商品单价
+        /// </summary>
+        public decimal? ItemPrice { get; set; }
+        /// <summary>
+        /// 销售升数
+        /// </summary>
+        public decimal? VolumeOnPos { get; set; }
+
+        /// <summary>
+        /// 回灌
+        /// </summary>
+        public decimal? PumpTestVolume { get; set; }
+        /// <summary>
+        /// 自用
+        /// </summary>
+        public decimal? SelfUseVolume { get; set; }
+        /// <summary>
+        /// 应收款
+        /// </summary>
+        public decimal? TotalPaid { get; set; }
+        /// <summary>
+        /// 实收款
+        /// </summary>
+        public decimal? TotalNetAmount { get; set; }
+        /// <summary>
+        /// 起泵数
+        /// </summary>
+        public decimal? VolumeOnPumpStart { get; set; }
+        /// <summary>
+        /// 止泵数
+        /// </summary>
+        public decimal? VolumeOnPumpEnd { get; set; }
+        /// <summary>
+        /// 分组id
+        /// </summary>
+        public Guid GroupId { get; set; }
+        /// <summary>
+        /// 分组名称
+        /// </summary>
+        public string GroupName { get; set; }
+        /// <summary>
+        /// 分组类型
+        /// </summary>
+        public int? GroupType { get; set; }
+        /// <summary>
+        /// 父分组
+        /// </summary>
+        public string ParentGroupName { get; set; }
+        /// <summary>
+        /// 支付类型id
+        /// </summary>
+        public int? PaymentId { get; set; }
+        /// <summary>
+        /// 支付类型名称
+        /// </summary>
+        public string DisplayName { get; set; }
+        /// <summary>
+        /// 支付类型名称
+        /// </summary>
+        public string MopName { get; set; }
+        /// <summary>
+        /// 订单类型
+        /// </summary>
+        public int? TransactionType { get; set; }
+    }
+
+    public class FuelDetailsDto
+    {
+        public int? FuelItemSoldOnPumpNozzleId { get; set; }
+        /// <summary>
+        /// 商品名称
+        /// </summary>
+        public string ItemName { get; set; }
+        /// <summary>
+        /// 商品单价
+        /// </summary>
+        public decimal? ItemPrice { get; set; }
+    }
+    public class PumpVolumeSummary
+    {
+        public int FuelItemSoldOnPumpNozzleId { get; set; }
+        /// <summary>
+        /// 起泵数
+        /// </summary>
+        public decimal? VolumeOnPumpStart { get; set; }
+        /// <summary>
+        /// 止泵数
+        /// </summary>
+        public decimal? VolumeOnPumpEnd { get; set; }
+    }
+    public class PumpTransactionSummary
+    {
+        public int FuelItemSoldOnPumpNozzleId { get; set; } // 假设这是整数类型  
+
+        // 将数值聚合字段作为字符串处理(尽管这通常不是最佳实践)  
+        public decimal? VolumeOnPos { get; set; }
+        public decimal? PumpTestVolume { get; set; }
+        public decimal? SelfUseVolume { get; set; }
+        public decimal? TotalPaid { get; set; }
+        public decimal? TotalNetAmount { get; set; }
+
+        // 其他非聚合的字符串字段  
+        public Guid GroupId { get; set; }
+        public string GroupName { get; set; }
+        public int? GroupType { get; set; }
+        public string ParentGroupName { get; set; }
+        public int? PaymentId { get; set; } // 假设这是来自h表的PaymentId,作为字符串处理  
+        public string DisplayName { get; set; }
+        public string MopName { get; set; }
+        public int? TransactionType { get; set; }
+
+        // 构造函数(可选,用于初始化)  
+        public PumpTransactionSummary()
+        {
+            // 可以在这里设置默认值,但通常对于字符串来说,null是默认值  
+        }
+    }
+}

+ 10 - 0
src/MS.Entities/Models/PosTrxMopsDto.cs

@@ -9,5 +9,15 @@ namespace MS.Entities.Models
         public string ResultCode { get; set; }
         public string ResultMessage { get; set; }
         public int? orderType { get; set; }
+        public Guid? Id { get; set; }
+        /// <summary>
+        /// amount that the customer finally needs to pay
+        /// </summary>
+        public decimal NetAmount { get; set; }
+
+        /// <summary>
+        /// total amount without discount deducted yet.
+        /// </summary>
+        public decimal GrossAmount { get; set; }
     }
 }

+ 27 - 0
src/MS.Entities/Models/PosTrxUnLock.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace MS.Entities.Models
+{
+    public partial class PosTrxUnLock
+    {
+        [Key]
+        public Guid Id { get; set; }
+        public string userName { get; set; }
+        public string alias { get; set; }
+        public decimal? ttc { get; set; }
+        public decimal? releaseToken { get; set; }
+        public int nozzleNum { get; set; }
+        public DateTime? endTime { get; set; }
+        public string oilName { get; set; }
+        public decimal? volume { get; set; }
+        public decimal? amount { get; set; }
+        public DateTime? unLockTime { get; set; }
+        public string sn { get; set; }
+        public int? type { get; set; }
+        public string Comment { get; set; }
+        public DateTime? cancellation { get; set; }
+    }
+}

+ 18 - 0
src/MS.Models/DiscountsInfo.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Models
+{
+    public class DiscountsInfo
+    {
+        /// <summary>
+        /// 原金额
+        /// </summary>
+        public decimal grossamount { get; set; }
+        /// <summary>
+        /// 实际支付金额
+        /// </summary>
+        public decimal amount { get; set; }
+    }
+}

+ 11 - 0
src/MS.Models/TransactionStatusDto.cs

@@ -10,5 +10,16 @@ namespace MS.Models
         public string ResultMessage { get; set; }
         public string FuelItemFdcTransactionSeqNo { get; set; }
         public int? orderType { get; set; }
+        public Guid? Id { get; set; }
+        /// <summary>
+        /// amount that the customer finally needs to pay
+        /// </summary>
+        public decimal netAmount { get; set; }
+
+        /// <summary>
+        /// total amount without discount deducted yet.
+        /// </summary>
+        public decimal amount { get; set; }
+        public decimal discount { get; set; }
     }
 }

+ 17 - 0
src/MS.Models/UploadTrx.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.Models
+{
+    public class UploadTrx
+    {
+        public string TTc { get; set; }
+        public DateTime TTCTime { get; set; }
+        public string  OperCardNo { get; set; }
+        public string CardNo { get; set; }
+        public int NozNo { get; set; }
+        public int MON { get; set; }
+        public string buid { get; set; }
+    }
+}

+ 420 - 7
src/MS.Services/Account/AccountService.cs

@@ -1,4 +1,6 @@
-using AutoMapper;
+using AlibabaCloud.SDK.Dysmsapi20170525.Models;
+using AutoMapper;
+using Microsoft.AspNetCore.Routing.Template;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Metadata.Internal;
 using Microsoft.Extensions.Localization;
@@ -10,8 +12,10 @@ using MS.DbContexts;
 using MS.Entities;
 using MS.Entities.AccountingService_Models;
 using MS.Entities.AuthService_Models;
+using MS.Entities.Models;
 using MS.Models;
 using MS.Models.ViewModel;
+using MS.Services.Account;
 using MS.UnitOfWork;
 using MS.WebCore;
 using MS.WebCore.Core;
@@ -683,7 +687,7 @@ select
             {
                 redisExample.DeleteData(value);
             }
-            return Task.CompletedTask; 
+            return Task.CompletedTask;
         }
         public async Task AddCarRedisAsync()
         {
@@ -697,8 +701,8 @@ select
             {
                 foreach (var kvp in hashValues)
                 {
-                  await  AddEmployeeCardMonthlySummaryToRedisAsync(kvp.Key, date, "0");
-                  await AddEmployeeCardMonthlySummaryToRedisAsync(kvp.Key, date, "1");
+                    await AddEmployeeCardMonthlySummaryToRedisAsync(kvp.Key, date, "0");
+                    await AddEmployeeCardMonthlySummaryToRedisAsync(kvp.Key, date, "1");
                 }
             }
         }
@@ -803,7 +807,7 @@ select
                 ", buid, sqljoin, date, enddate);
 
 
-                sql = string.Format(sql, buid, sqlJoin); 
+                sql = string.Format(sql, buid, sqlJoin);
 
                 var chunkAccountRecharges = _AccountingContext.DbContext.accountRechargeTotals
                     .FromSqlRaw(sql)
@@ -870,7 +874,7 @@ select
 
             List<AccountRechargeTotal> allCarRecharges = new List<AccountRechargeTotal>(); // 替换YourResultType为实际类型  
 
-             totalChunks = (car_ids.Count + chunkSize - 1) / chunkSize;
+            totalChunks = (car_ids.Count + chunkSize - 1) / chunkSize;
 
             for (int i = 0; i < totalChunks; i++)
             {
@@ -880,7 +884,7 @@ select
                 List<string> chunkCardIds = car_ids.GetRange(startIndex, endIndex - startIndex);
                 string sqlJoin = string.Join(",", chunkCardIds.Select(id => string.Format("'{0}'", id)));
 
-                 sql = @"  
+                sql = @"  
         SELECT trx.card_no as account_id, (array_agg(trx.card_balance ORDER BY trx.transaction_time DESC))[1] as amount   
         FROM public.offline_transaction_info trx   
         WHERE trx.business_unit_info_id = @BuId  
@@ -1283,6 +1287,415 @@ SELECT subquery.belong_to,subquery.accountId, count(*) count from (SELECT trx.ac
                 return businessUnitInfos.Select(p => p.Id.ToString()).ToList();
             }
             return null;
+        }
+        public async Task<ExecuteResult> GetTransactioninfo(string trx_sequence_no,
+            string nozzle_no,
+            string business_unit_info_id,
+            string transaction_time)
+        {
+            ExecuteResult<OfflineTransactionInfo> result = new ExecuteResult<OfflineTransactionInfo>();
+            DateTime dateTime = DateTime.Parse(transaction_time);
+            // 获取dateTime前10分钟的时间  
+            DateTime tenMinutesBefore = dateTime.AddMinutes(-10);
+
+            // 获取dateTime后10分钟的时间  
+            DateTime tenMinutesAfter = dateTime.AddMinutes(10);
+            string sql = string.Format(@"select * from offline_transaction_info oti 
+where trx_sequence_no = '{0}'
+and nozzle_no  = '{1}'
+and business_unit_info_id = '{2}'
+and transaction_time  >= '{3}'
+and transaction_time  <= '{4}'", trx_sequence_no, nozzle_no, business_unit_info_id, tenMinutesBefore, tenMinutesAfter);
+            var list = _AccountingContext.DbContext.OfflineTransactionInfo
+            .FromSqlRaw(sql)
+              .ToList();
+            result.SetData(list);
+            return result;
+        }
+        public async Task<ExecuteResult> GetBusinessUnits(string guid)
+        {
+            ExecuteResult<BusinessUnits> result = new ExecuteResult<BusinessUnits>();
+            string sql = string.Format(@"select c.* from public.""BusinessUnits"" a left join public.""BusinessUnits"" b on a.""ParentBusinessUnitId""  = b.""Id"" 
+left join public.""BusinessUnits"" c on b.""Id""  = c.""ParentBusinessUnitId"" 
+where a.""Id""  = '{0}'", guid);
+            var list = _AuthContext.DbContext.BusinessUnits
+            .FromSqlRaw(sql)
+              .ToList();
+            result.SetData(list);
+            return result;
+        }
+        public async Task<ExecuteResult> CardInvoiceClearWarnAsync()
+        {
+            try
+            {
+                //Sample.Sendsms("17620434972","");
+                DateTime now = DateTime.Now;
+                string time = now.AddDays(7).ToString("yyyy-MM-dd 23:59:59");
+                string sixMonthsAgo = now.AddMonths(-6).ToString("yyyy-MM-dd HH:mm:ss");//半年前
+                string sixMonthsAndSevenDaysAgo = now.AddMonths(-6).AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");//半年前往前推7天
+                string sql = string.Format(@"
+select 
+a.id ,b.card_no,a.offline_phone_no,d.invoice_balance / 100 invoice_balance,
+COALESCE(f.amount, 0) amount,
+(sum(case when c.transaction_type = 0 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 7 then c.amount else 0 end) / 100 ) -
+(sum(case when c.transaction_type = 1 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 5 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 8 then c.amount else 0 end) / 100 ) halfayearamount
+from account_info a left join card_info b 
+on a.id = b.account_info_id 
+left join offline_transaction_info c on c.account_info_id  = a.id 
+left join user_info d on d.id  = a.user_info_id 
+left join (
+select user_info_id ,(sum(amount) / 100) amount from invoice_info
+where bu_info_id  = 'c75b2e74-d51e-42ae-bc89-2d39312c9c30'
+group by user_info_id
+)  f on f.user_info_id  = d.id  
+where a.account_type_id  = 'bb7e7fe3-1a3b-41a7-97af-785cb04f7f19'
+and a.business_unit_info_id = 'c75b2e74-d51e-42ae-bc89-2d39312c9c30'
+and b.card_type  = 1
+and d.invoice_balance  > 0
+and c.transaction_time <= '{0}'
+and a.offline_phone_no = '13560073220'
+group by a.id,a.offline_phone_no ,b.card_no,d.invoice_balance,f.amount
+", sixMonthsAndSevenDaysAgo);
+                var list = _AccountingContext.DbContext.cardInvoices
+                .FromSqlRaw(sql)
+                  .ToList();
+                List<UserMessages> users = new List<UserMessages>();
+                foreach (var item in list)
+                {
+                    int invoice_balance = item.invoice_balance ?? 0;//开票余额
+                    int amount = item.amount ?? 0;// 开票金额
+                    int halfayearamount = item.halfayearamount ?? 0;//半年前可开票金额
+
+                    int balance = invoice_balance - halfayearamount - amount;
+                    int sendbalance = 0;
+                    if (balance <= 0)
+                    {
+                        sendbalance = invoice_balance;
+                    }
+                    else if (balance > 0)
+                    {
+                        sendbalance = balance;
+                    }
+                    //              string TemplateParam = string.Format(
+                    //    "{\"card_no\":\"{0}\",\"balance\":\"{1}\",\"DateTime\":\"{2}\"}",
+                    //    item.offline_phone_no,
+                    //    sendbalance.ToString(),  
+                    //    time                   
+                    //);
+                    var templateParam = new
+                    {
+                        card_no = item.card_no,
+                        balance = sendbalance,
+                        DateTime = time
+                    };
+
+                    string TemplateParamjson = JsonConvert.SerializeObject(templateParam);
+                    UserMessages userMessages = new UserMessages();
+                    userMessages.PhoneNumber = item.offline_phone_no;
+                    userMessages.AccountId = item.Id;
+                    userMessages.AccountType = "IC卡";
+                    userMessages.IsSmsSent = 0;
+                    userMessages.MessageContent = TemplateParamjson;
+                    userMessages.card_no = item.card_no;
+                    users.Add(userMessages);
+                    //_AccountingContext.GetRepository<UserMessages>().Insert(userMessages);
+                    //await _AccountingContext.SaveChangesAsync();//提交
+                }
+                _AccountingContext.GetRepository<UserMessages>().Insert(users);
+                await _AccountingContext.SaveChangesAsync();//提交
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+        /// <summary>
+        /// 电子账户
+        /// </summary>
+        /// <returns></returns>
+        public async Task<ExecuteResult> ElectronicAccountInvoiceClearAsync()
+        {
+            try
+            {
+                 DateTime now = DateTime.Now;
+                string time = now.AddDays(7).ToString("yyyy-MM-dd 23:59:59");
+                string sixMonthsAgo = now.AddMonths(-6).ToString("yyyy-MM-dd HH:mm:ss");//半年前
+                string sixMonthsAndSevenDaysAgo = now.AddMonths(-6).AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");//半年前往前推7天
+                string sql = string.Format(@"
+select  b.id ,'' as card_no,c.phone_no as offline_phone_no ,c.invoice_balance  / 100 invoice_balance,COALESCE(e.amount, 0) amount,
+sum(a.recharge_amount) / 100 halfayearamount
+from recharge_payment_history a 
+left join account_info b on a.account_info_id  = b.id 
+left join user_info c on c.id  = b.user_info_id 
+left join (
+select user_info_id ,(sum(amount) / 100) amount from invoice_info
+where bu_info_id  = 'c75b2e74-d51e-42ae-bc89-2d39312c9c30'
+group by user_info_id
+) e on e.user_info_id = c.id 
+where
+b.account_type_id   = 'b172f61e-ce2e-40e4-940c-bd07e15e311e'
+and b.business_unit_info_id  = 'c75b2e74-d51e-42ae-bc89-2d39312c9c30'
+and c.invoice_balance  > 0
+and a.transaction_date  <= '{0}'
+and c.phone_no  = '13560073220'
+group by b.id,c.phone_no ,c.invoice_balance ,e.amount
+", sixMonthsAndSevenDaysAgo);
+                var list = _AccountingContext.DbContext.cardInvoices
+                .FromSqlRaw(sql)
+                  .ToList();
+                List<UserMessages> users = new List<UserMessages>();
+                foreach (var item in list)
+                {
+                    int invoice_balance = item.invoice_balance ?? 0;//开票余额
+                    int amount = item.amount ?? 0;// 开票金额
+                    int halfayearamount = item.halfayearamount ?? 0;//半年前可开票金额
+                    int balance = invoice_balance - halfayearamount - amount;
+                    int sendbalance = 0;
+                    if (balance <= 0)
+                    {
+                        sendbalance = invoice_balance;
+                    }
+                    else if (balance > 0)
+                    {
+                        sendbalance = balance;
+                    }
+                    var templateParam = new
+                    {
+                        phone = item.offline_phone_no,
+                        balance = sendbalance,
+                        DateTime = time
+                    };
+                    string TemplateParamjson = JsonConvert.SerializeObject(templateParam);
+                    UserMessages userMessages = new UserMessages();
+                    userMessages.PhoneNumber = item.offline_phone_no;
+                    userMessages.AccountId = item.Id;
+                    userMessages.AccountType = "电子账户";
+                    userMessages.IsSmsSent = 0;
+                    userMessages.MessageContent = TemplateParamjson;
+                    userMessages.card_no = item.card_no;
+                    users.Add(userMessages);
+                }
+                _AccountingContext.GetRepository<UserMessages>().Insert(users);
+                await _AccountingContext.SaveChangesAsync();//提交
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+        public async Task SendSms()
+        {
+            //SMS_475590084 实体卡
+            //SMS_475470121  电子账户
+            List<UserMessages> users = new List<UserMessages>();
+            var userMessages = _AccountingContext.GetRepository<UserMessages>().GetAll().Where(_ => _.IsSmsSent == 0).ToList();
+            string TemplateCode = "";
+            foreach (var userMessage in userMessages)
+            {
+                if (userMessage.AccountType == "IC卡")
+                {
+                    TemplateCode = "SMS_475590084";
+                } else  if (userMessage.AccountType == "电子账户")
+                {
+                    TemplateCode = "SMS_475470121";
+                }
+                var issend = Sample.Sendsms(userMessage.PhoneNumber, userMessage.MessageContent, TemplateCode);
+                if (issend)
+                {
+                    userMessage.SentTime = DateTime.Now;
+                    userMessage.IsSmsSent = 1;
+                    users.Add(userMessage);
+                }
+            }
+            _AccountingContext.GetRepository<UserMessages>().Update(users);
+            await _AccountingContext.SaveChangesAsync();//提交
+        }
+
+        public async Task<ExecuteResult> CardInvoiceClearAsync()
+        {
+            try
+            {
+                //Sample.Sendsms("17620434972","");
+                DateTime now = DateTime.Now;
+                string time = now.AddDays(7).ToString("yyyy-MM-dd 23:59:59");
+                string sixMonthsAndSevenDaysAgo = now.AddMonths(-6).ToString("yyyy-MM-dd");//半年前
+                string sql = string.Format(@"
+select 
+a.id ,b.card_no,a.offline_phone_no,d.invoice_balance / 100 invoice_balance,
+COALESCE(f.amount, 0) amount,
+(sum(case when c.transaction_type = 0 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 7 then c.amount else 0 end) / 100 ) -
+(sum(case when c.transaction_type = 1 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 5 then c.amount else 0 end) / 100 ) +
+(sum(case when c.transaction_type = 8 then c.amount else 0 end) / 100 ) halfayearamount
+from account_info a left join card_info b 
+on a.id = b.account_info_id 
+left join offline_transaction_info c on c.account_info_id  = a.id 
+left join user_info d on d.id  = a.user_info_id 
+left join (
+select user_info_id ,(sum(amount) / 100) amount from invoice_info
+where bu_info_id  = '7f22747b-0779-4045-be3b-6d884fb42a35'
+group by user_info_id
+)  f on f.user_info_id  = d.id  
+where a.account_type_id  = 'bb7e7fe3-1a3b-41a7-97af-785cb04f7f19'
+and a.business_unit_info_id = '7f22747b-0779-4045-be3b-6d884fb42a35'
+and b.card_type  = 1
+and d.invoice_balance  > 0
+and c.transaction_time <= '{0}'
+and a.offline_phone_no = '13560073220'
+group by a.id,a.offline_phone_no ,b.card_no,d.invoice_balance,f.amount
+", sixMonthsAndSevenDaysAgo);
+                var list = _AccountingContext.DbContext.cardInvoices
+                .FromSqlRaw(sql)
+                  .ToList();
+                List<UserMessages> users = new List<UserMessages>();
+                List<UserInfo> userInfo = new List<UserInfo>();
+                foreach (var item in list)
+                {
+                    int invoice_balance = item.invoice_balance ?? 0;//开票余额
+                    int amount = item.amount ?? 0;// 开票金额
+                    int halfayearamount = item.halfayearamount ?? 0;//半年前可开票金额
+
+                    int balance = invoice_balance - halfayearamount - amount;
+                    int sendbalance = 0;
+                    if (balance <= 0)
+                    {
+                        sendbalance = invoice_balance;
+                    }
+                    else if (balance > 0)
+                    {
+                        sendbalance = balance;
+                    }
+                    var user = _AccountingContext.GetRepository<UserInfo>().FromSql(
+                        string.Format("select a.* from user_info a left join account_info b on a.id = b.user_info_id where b.id  = '{0}'", item.Id)
+                        )
+                        .ToListAsync().Result.First();
+                    user.InvoiceBalance = user.InvoiceBalance - sendbalance;
+                    userInfo.Add(user);
+
+                    //              string TemplateParam = string.Format(
+                    //    "{\"card_no\":\"{0}\",\"balance\":\"{1}\",\"DateTime\":\"{2}\"}",
+                    //    item.offline_phone_no,
+                    //    sendbalance.ToString(),  
+                    //    time                   
+                    //);
+                    var templateParam = new
+                    {
+                        card_no = item.card_no,
+                        balance = sendbalance,
+                        DateTime = time
+                    };
+
+                    string TemplateParamjson = JsonConvert.SerializeObject(templateParam);
+                    UserMessages userMessages = new UserMessages();
+                    userMessages.PhoneNumber = item.offline_phone_no;
+                    userMessages.AccountId = item.Id;
+                    userMessages.AccountType = "IC卡";
+                    userMessages.IsSmsSent = 0;
+                    userMessages.MessageContent = TemplateParamjson;
+                    userMessages.card_no = item.card_no;
+                    users.Add(userMessages);
+                    //_AccountingContext.GetRepository<UserMessages>().Insert(userMessages);
+                    //await _AccountingContext.SaveChangesAsync();//提交
+                }
+                _AccountingContext.GetRepository<UserMessages>().Insert(users);
+                //await _AccountingContext.SaveChangesAsync();//提交
+                _AccountingContext.GetRepository<UserInfo>().Update(userInfo);
+                await _AccountingContext.SaveChangesAsync();//提交
+
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+        }
+
+        public async Task Upload(List<UploadTrx> uploadTrxes)
+        {
+            try
+            {
+                var businessUnitInfos = await _AccountingContext.GetRepository<Trxtable>().GetAll().ToListAsync();
+                List<Trxtable> trxtables = new List<Trxtable>();
+                Trxtable trxtable = new Trxtable();
+                foreach (var trx in uploadTrxes)
+                {
+                    Guid buid = Guid.Parse(trx.buid);
+                    trxtable = new Trxtable();
+                    trxtable.Ttc = trx.TTc;
+                    trxtable.Ttctime = trx.TTCTime;
+                    trxtable.Mon = trx.MON;
+                    trxtable.Cardno = trx.CardNo.Trim();
+                    trxtable.Opercardno = trx.OperCardNo.Trim();
+                    trxtable.Nozno = trx.NozNo;
+                    trxtable.Buid = buid;
+                    trxtables.Add(trxtable);
+                    _AccountingContext.GetRepository<Trxtable>().Insert(trxtable);
+                }
+                // _AccountingContext.GetRepository<Trxtable>().Insert(trxtables);
+                await _AccountingContext.SaveChangesAsync();//提交
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+//        public async Task<List<UserIdAndName>> userIdAndName(string Buid)
+//        {
+//            var user = await _AccountingContext.GetRepository<UserIdAndName>().FromSql(
+//                        string.Format(@"SELECT CAST(ui.id AS TEXT) as id, ui.user_name as userName, ui.phone_no as phoneNo, at2.name as AccountType FROM public.user_info ui left join public.account_info ai 
+//on ui.id  = ai.user_info_id 
+//left join account_type at2  on ai.account_type_id  = at2.id  where ui.creation_date is not null and ui.business_unit_info_id IN (
+//select b.id from public.business_unit_info a left join  public.business_unit_info b on 
+//a.business_unit_info_id  = b.business_unit_info_id 
+//where a.id  = '{0}'
+//)", Buid)
+//                        )
+//                        .ToListAsync();
+//            return user;
+//        }
+        public async Task<List<UserIdAndName>> userIdAndName(string Buid, int page = 1, int pageSize = 1000)
+        {
+            string sql = string.Format(@"
+        SELECT 
+            CAST(ui.id AS TEXT) as id, 
+            ui.user_name as userName, 
+            ui.phone_no as phoneNo, 
+            at2.name as AccountType 
+        FROM public.user_info ui 
+        LEFT JOIN public.account_info ai ON ui.id = ai.user_info_id 
+        LEFT JOIN account_type at2 ON ai.account_type_id = at2.id 
+        WHERE ui.creation_date IS NOT NULL 
+          AND ui.business_unit_info_id IN (
+            SELECT b.id 
+            FROM public.business_unit_info a 
+            LEFT JOIN public.business_unit_info b ON a.business_unit_info_id = b.business_unit_info_id 
+            WHERE a.id = '{0}'
+          )
+        ORDER BY ui.id  
+        OFFSET {1} ROWS 
+        FETCH NEXT {2} ROWS ONLY",Buid,page, pageSize); 
+
+
+            var user = _AccountingContext.DbContext.UserIdAndNames
+      .FromSqlRaw(sql)
+        .ToList();
+
+            return user;
+        }
+        /// <summary>
+        /// 更新redis缓存,发券时获取用户信息
+        /// </summary>
+        /// <returns></returns>
+        public async Task AddRedisuserIdAndName(string buid)
+        { 
+            
         }
         /// <summary>
         /// 获取卡片类型    4 cpu卡,1感应卡

+ 14 - 0
src/MS.Services/Account/IAccountService.cs

@@ -1,4 +1,6 @@
 using MS.Component.Jwt.UserClaim;
+using MS.Entities.AccountingService_Models;
+using MS.Models;
 using MS.Models.ViewModel;
 using MS.WebCore.Core;
 using System.Collections.Generic;
@@ -24,5 +26,17 @@ namespace MS.Services
         Task ClearhashValues(string key);
         void Getdate(string buid, string date, string Car);
         Task addredis(string buid);
+        Task<ExecuteResult> GetTransactioninfo(string trx_sequence_no,
+           string nozzle_no,
+           string business_unit_info_id,
+           string transaction_time);
+        Task<ExecuteResult> GetBusinessUnits(string guid);
+        Task<ExecuteResult> CardInvoiceClearWarnAsync();
+        Task<ExecuteResult> CardInvoiceClearAsync();
+
+        Task<ExecuteResult> ElectronicAccountInvoiceClearAsync();
+        Task Upload(List<UploadTrx> uploadTrxes);
+        Task SendSms();
+        Task<List<UserIdAndName>> userIdAndName(string Buid, int page = 1, int pageSize = 1000);
     }
 }

+ 82 - 0
src/MS.Services/Account/Sample.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tea;
+
+namespace MS.Services.Account
+{
+    public class Sample
+    {
+        /// <term><b>Description:</b></term>
+        /// <description>
+        /// <para>使用AK&amp;SK初始化账号Client</para>
+        /// </description>
+        /// 
+        /// <returns>
+        /// Client
+        /// </returns>
+        /// 
+        /// <term><b>Exception:</b></term>
+        /// Exception
+        public static AlibabaCloud.SDK.Dysmsapi20170525.Client CreateClient()
+        {
+            // 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。
+            // 建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378671.html。
+            AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config
+            {
+                // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
+                AccessKeyId = "LTAI5tCFq4rVZhTzWn1tzB3Z",
+                // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
+                AccessKeySecret = "ttXVG93sNzbYYXvQUcE2x8QOBC8TEE",
+            };
+            // Endpoint 请参考 https://api.aliyun.com/product/Dysmsapi
+            config.Endpoint = "dysmsapi.aliyuncs.com";
+            return new AlibabaCloud.SDK.Dysmsapi20170525.Client(config);
+        }
+
+        public static bool Sendsms(string PhoneNumbers,string TemplateParam,string TemplateCode)
+        {
+            AlibabaCloud.SDK.Dysmsapi20170525.Client client = CreateClient();
+            AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest sendSmsRequest = new AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest
+            {
+                PhoneNumbers = PhoneNumbers,
+                SignName = "华信实业",
+                TemplateCode = TemplateCode,
+                TemplateParam = TemplateParam,
+            };
+            AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions();
+            try
+            {
+                AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsResponse resp = client.SendSmsWithOptions(sendSmsRequest, runtime);
+                AlibabaCloud.TeaConsole.Client.Log(AlibabaCloud.TeaUtil.Common.ToJSONString(resp));
+                if (resp.StatusCode == 200 && resp.Body.Code == "OK")
+                {
+                    return true;
+                }
+            }
+            catch (TeaException error)
+            {
+                // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
+                // 错误 message
+               // Console.WriteLine(error.Message);
+                // 诊断地址
+               // Console.WriteLine(error.Data["Recommend"]);
+                AlibabaCloud.TeaUtil.Common.AssertAsString(error.Message);
+            }
+            catch (Exception _error)
+            {
+                TeaException error = new TeaException(new Dictionary<string, object>
+                {
+                    { "message", _error.Message }
+                });
+                // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
+                // 错误 message
+               // Console.WriteLine(error.Message);
+                // 诊断地址
+               // Console.WriteLine(error.Data["Recommend"]);
+                AlibabaCloud.TeaUtil.Common.AssertAsString(error.Message);
+            }
+            return false;
+        }
+    }
+}

+ 2 - 0
src/MS.Services/MS.Services.csproj

@@ -5,6 +5,8 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.1.0" />
+    <PackageReference Include="AlibabaCloud.TeaConsole" Version="0.1.0" />
     <PackageReference Include="NPOI" Version="2.5.2" />
     <PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
     <PackageReference Include="System.IO" Version="4.3.0" />

+ 4 - 1
src/MS.Services/PosTrxService/IPosTrxLineItemsService.cs

@@ -8,6 +8,9 @@ namespace MS.Services.PosTrxService
 {
     public interface IPosTrxLineItemsService : IBaseService
     {
-          Task<ExecuteResult> fixFuelItemTagAsync(string startTime);
+        Task<ExecuteResult> fixFuelItemTagAsync(string startTime);
+        Task<ExecuteResult> NozzleDataAsync(string buid, string datetime);
+        Task<ExecuteResult> InsertNozzleDataRedis();
+        Task<ExecuteResult> fixFuelItemTag2Async(string startTime, string endTime, string buid);
     }
 }

+ 1 - 0
src/MS.Services/PosTrxService/IPosTrxService.cs

@@ -20,5 +20,6 @@ namespace MS.Services.PosTrxService
                                                          string currentBuId);
 
         Task<ExecuteResult> GetTransactionStatus(string SeqNo, string NozzleId, string sn,string FuelItemFdcReleaseTokenAttribute,string FuelItemOriginalGrossAmount, DateTime? FuelItemTransactionEndTime = null);
+        Task<ExecuteResult> RemarkUnlockTransaction(string userName, string alias, decimal? ttc, decimal? releaseToken, int nozzleNum, DateTime? endTime , string oilName, decimal? volume, decimal? amount, DateTime? unLockTime, string sn, string Comment, DateTime? cancellation);
     }
 }

+ 376 - 2
src/MS.Services/PosTrxService/PosTrxLineItemsService.cs

@@ -18,6 +18,7 @@ using NPOI.SS.Formula.Functions;
 using Org.BouncyCastle.Tsp;
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Text;
@@ -32,6 +33,7 @@ namespace MS.Services.PosTrxService
         private readonly IHttpContextAccessor _httpContextAccessor;
         private readonly JsonSerializerOptions _jsonSerializerOptions;
         Logger logger = LogManager.GetCurrentClassLogger();
+        public RedisExample redisExample = new RedisExample();
         public PosTrxLineItemsService(IUnitOfWork<MSDbContext> unitOfWork, IMapper mapper, IdWorker idWorker, IClaimsAccessor claimsAccessor, IStringLocalizer localizer, IHttpContextAccessor httpContextAccessor, IUnitOfWork<AccountingContext> AccountingContext, IUnitOfWork<SQLiteContext> SQLiteContext, IUnitOfWork<AuthContext> AuthContext) : base(unitOfWork, mapper, idWorker, claimsAccessor, localizer, AccountingContext, SQLiteContext, AuthContext)
         {
             _httpContextAccessor = httpContextAccessor;
@@ -44,7 +46,7 @@ namespace MS.Services.PosTrxService
         {
 
             DateTime dateTime = string.IsNullOrEmpty(startTime) ? DateTime.Now : DateTime.Parse(startTime);
-            DateTime enddateTime = string.IsNullOrEmpty(startTime) ? DateTime.Now.AddDays(-2) : DateTime.Parse(startTime).AddDays(-2);
+            DateTime enddateTime = string.IsNullOrEmpty(startTime) ? DateTime.Now.AddHours(-5) : DateTime.Parse(startTime).AddHours(-5);
             //            var query = _unitOfWork.GetRepository<PosTrxes>().FromSql(string.Format(@"select a.* FROM public.""PosTrxes"" a 
             //left join public.""PosTrxLineItems"" b on a.""Id""  = b.""PosTrxId"" 
             //left join public.""PosTrxMops"" c on a.""Id""  = c.""PosTrxId"" 
@@ -109,13 +111,17 @@ namespace MS.Services.PosTrxService
                             .Where(a => a.UserSubIdentities.Any(b => b.Identity == SequenceNo.card_no && b.Type == FuelItemTagDto.SmartFuelIcCardSystemName)).FirstOrDefault();
                             string AspNetUsersjson = SerializeObject(AspNetUsers);
                             MS.WebCore.Logger.Logger.WriteLog("FuelItemFdcTransactionSeqNo:" + trxitem.FuelItemFdcTransactionSeqNo + "AspNetUsers: " + AspNetUsersjson);
+                            if (AspNetUsers == null)
+                            {
+                                continue;
+                            }
                             var tagInfo = new FuelItemTagDto()
                             {
                                 TagLinkedServiceIdentityUser = new UserInfos
                                 {
                                     Id = Guid.Parse(AspNetUsers.Id),
                                     UserName = AspNetUsers.UserName,
-                                    Alias = BuidUploadOrNot(item.TargetBusinessUnitId.ToString()) ? "" : AspNetUsers.Alias,
+                                    Alias = AspNetUsers.Alias,
                                     RestrictedInBusinessUnits = { }
                                 },
                                 TagSystemName = FuelItemTagDto.SmartFuelIcCardSystemName,
@@ -210,6 +216,32 @@ namespace MS.Services.PosTrxService
                   .FirstOrDefault();
             return results;
         }
+        public MyTransaction findCardInfoByBusinessUnitInfoAndSequenceNo_2(string businessUnitId, string trxSequenceNo, string nozzleNo, DateTime dateTime, bool operatorIcCard)
+        {
+            DateTime requestDateTimeStart = dateTime.AddMilliseconds(-2 * 24 * 60 * 60 * 1000);
+            DateTime requestDateTimeEnd = dateTime.AddMilliseconds(3 * 24 * 60 * 60 * 1000);
+
+            string requestDateTimeStartString = requestDateTimeStart.ToString("yyyy-MM-dd HH:mm:ss");
+            string requestDateTimeEndString = requestDateTimeEnd.ToString("yyyy-MM-dd HH:mm:ss");
+            string car = operatorIcCard ? " trx.opercardno = ci.card_no" : "trx.cardno = ci.id";
+            var sql = string.Format(@"
+        SELECT trx.ttc trx_sequence_no, trx.ttctime transaction_time, ci.card_no, ci.card_type, ci.card_class, ci.holder,
+          ai.offline_account_id, ai.belong_to, trx.nozno nozzle_no 
+          FROM public.card_info ci 
+          LEFT JOIN public.trxtable trx ON trx.cardno = ci.card_no
+          LEFT JOIN public.account_info ai ON ai.id = ci.account_info_id 
+          WHERE trx.buid = '{0}'
+          AND trx.ttc = '{1}'
+          AND trx.nozno = '{2}'
+          AND trx.ttctime > '{3}' 
+          AND trx.ttctime < '{4}'
+          order by trx.ttctime desc", businessUnitId, trxSequenceNo, nozzleNo, requestDateTimeStartString, requestDateTimeEndString);
+
+            var results = _AccountingContext.DbContext.TransactionInfoDtos
+                .FromSqlRaw(sql)
+                  .FirstOrDefault();
+            return results;
+        }
         public MyTransaction findOperatorCardInfoByBusinessUnitInfoAndSequenceNo(string businessUnitId, string trxSequenceNo, string nozzleNo, DateTime dateTime)
         {
             DateTime requestDateTimeStart = dateTime.AddMilliseconds(-2 * 24 * 60 * 60 * 1000);
@@ -244,5 +276,347 @@ namespace MS.Services.PosTrxService
             string mopjson = JsonConvert.SerializeObject(obj, settings);
             return mopjson;
         }
+        public DateTime GetDate(List<KeyValuePair<string, string>> hashValues)
+        {
+            string date = string.Empty;
+            List<DateTime> dates = new List<DateTime>();
+            foreach (var kvp in hashValues)
+            {
+                DateTime dateTime1 = DateTime.Parse(kvp.Key);
+                dates.Add(dateTime1);
+            }
+            DateTime maxPlusOneMonth = dates.Max().AddMonths(1);
+            return maxPlusOneMonth;
+        }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <returns></returns>
+        public async Task<ExecuteResult> InsertNozzleDataRedis()
+        {
+            var buidlist = redisExample.GetListFromRedis("TargetBusinessUnitId");
+            foreach (var i in buidlist)
+            {
+                List<KeyValuePair<string, string>> hashValues = redisExample.GetListValues("NozzleData:" + i);
+                string date = string.Empty;
+                DateTime now = DateTime.Now;
+                if (hashValues.Count > 0)
+                {
+                    var maxPlusOneMonth = GetDate(hashValues);//
+                    date = maxPlusOneMonth.ToString("yyyy-MM-dd");
+                    // 检查年份和月份是否相同  
+                    bool isInCurrentMonth = maxPlusOneMonth.Year == now.Year && maxPlusOneMonth.Month == now.Month;
+                    if (!isInCurrentMonth)
+                    {
+                        await NozzleDataAsync(i, date);
+                    }
+                }
+                else
+                {
+                    List<KeyValuePair<string, string>> buiddate = redisExample.GetListValues("BUID" + i);
+                    if (buiddate.Count > 0)
+                    {
+                        var maxPlusOneMonth = GetDate(buiddate);//
+                        date = maxPlusOneMonth.ToString("yyyy-MM-dd");
+                        bool isInCurrentMonth = maxPlusOneMonth.Year == now.Year && maxPlusOneMonth.Month == now.Month;
+                        if (!isInCurrentMonth)
+                        {
+                            await NozzleDataAsync(i, date);
+                        }
+                    }
+                    else
+                    {
+                        date = "2022-01-01";
+                    }
+                    await NozzleDataAsync(i, date);
+                }
+                redisExample.AddToHash("BUID:"+i, date, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
+            }
+            // var hashkey = redisExample.HashKeyExists(key, date);
+            return null;
+        }
+        /// <summary>
+        /// 收支与灌存、油枪报表按月缓存redis
+        /// </summary>
+        /// <returns></returns>
+        public async Task<ExecuteResult> NozzleDataAsync(string buid, string datetime)
+        {
+            _unitOfWork.DbContext.Database.SetCommandTimeout(180);
+            DateTime today = DateTime.Parse(datetime);
+            DateTime firstDayOfLastMonth = new DateTime(today.Year, today.Month, 1).AddMonths(-1);
+            DateTime lastDayOfLastMonth = firstDayOfLastMonth.AddDays(DateTime.DaysInMonth(firstDayOfLastMonth.Year, firstDayOfLastMonth.Month) - 1);
+            string formattedFirstDay = firstDayOfLastMonth.ToString("yyyy-MM-dd 00:00:00", CultureInfo.InvariantCulture);//获取上个月最后一天
+            string formattedLastDay = lastDayOfLastMonth.ToString("yyyy-MM-dd 23:59:59", CultureInfo.InvariantCulture);//获取上个月第一天
+            string sql = string.Format(@"select  b.""FuelItemSoldOnPumpNozzleId"",c.""ItemName"" ,b.""ItemPrice"" from
+ (
+select a.""ShiftId"",a.""Id"" from ""PosTrxes"" a left join ""PosTrxLineItems"" b on a.""Id""  = b.""PosTrxId"" 
+where a.""CreatedDateTime""  <= '{0}'
+and a.""TransactionType""  = 6
+and a.""TargetBusinessUnitId""  = '{1}'
+order by a.""ShiftId""  desc
+limit 1
+) d 
+left join ""PosTrxes"" a on d.""Id"" = a.""Id"" 
+left join ""PosTrxLineItems"" b on a.""Id""  = b.""PosTrxId"" 
+left join ""PosItems"" c on b.""PosItemId""  = c.""Id"" 
+order by b.""FuelItemSoldOnPumpNozzleId"" ", formattedFirstDay, buid);
+            var fuelDetails = _unitOfWork.DbContext.fuelDetailsDtos
+                                .FromSqlRaw(sql)
+                                .ToList();//枪号、油品名称、单价
+
+            sql = string.Format(@"  SELECT  
+        b.""FuelItemSoldOnPumpNozzleId"",  
+         MAX(CASE WHEN a.""CreatedDateTime"" <= '{0}' THEN ""FuelItemPumpTotalizerVolume"" END) AS VolumeOnPumpStart,  
+        MAX(CASE WHEN a.""CreatedDateTime"" <= '{1}' THEN ""FuelItemPumpTotalizerVolume"" END) AS VolumeOnPumpEnd  
+    FROM  
+        ""PosTrxes"" a  
+    JOIN  
+        ""PosTrxLineItems"" b ON a.""Id"" = b.""PosTrxId""  
+          left join ""PosItems"" c on b.""PosItemId""  = c.""Id"" 
+    WHERE  
+        a.""TargetBusinessUnitId"" = '{2}'  
+         AND ((a.""CreatedDateTime"" >= '{3}'  and a.""CreatedDateTime"" <= '{0}' )
+        or (a.""CreatedDateTime"" >= '{4}'  and a.""CreatedDateTime"" <= '{1}' ))
+        AND a.""TransactionStatus"" = 1  
+        AND (b.""FuelItemSoldOnPumpNozzleId"" IS NOT NULL  and b.""FuelItemSoldOnPumpNozzleId""  > 0)
+        AND b.""Voided"" = FALSE  
+        group by          b.""FuelItemSoldOnPumpNozzleId"""
+        , firstDayOfLastMonth.ToString("yyyy-MM-dd 00:00:00")
+        , lastDayOfLastMonth.ToString("yyyy-MM-dd 23:59:59")
+        , buid
+        , firstDayOfLastMonth.AddDays(-2).ToString("yyyy-MM-dd 00:00:00")
+        , lastDayOfLastMonth.AddDays(-2).ToString("yyyy-MM-dd 23:59:59")
+        );
+            var startEndPumpPair = _unitOfWork.DbContext.pumpVolumeSummaries
+                              .FromSqlRaw(sql)
+                              .ToList();//获取起止泵数,获取范围使用开始时间与结束时间共同往前推4天,只查8天。
+
+            sql = string.Format(@"
+        SELECT  
+    (case when b.""FuelItemSoldOnPumpNozzleId"" > 0 then b.""FuelItemSoldOnPumpNozzleId"" else 0 end) FuelItemSoldOnPumpNozzleId,  
+   -- d.""PaymentId"" ,
+   -- b.""GrossAmount"",
+     --b.""NetAmount"",
+    --b.""Qty""
+    SUM(CASE WHEN d.""PaymentId"" NOT IN (12, 30) THEN b.""Qty"" ELSE 0 END) AS VolumeOnPos,  
+    SUM(CASE WHEN d.""PaymentId"" = 12 THEN b.""Qty"" ELSE 0 END) AS PumpTestVolume,  
+    SUM(CASE WHEN d.""PaymentId"" = 30 THEN b.""Qty"" ELSE 0 END) AS SelfUseVolume,
+    SUM(CASE WHEN (b.""GrossAmount"" IS NOT null and d.""PaymentId"" not in(12,30)) THEN b.""GrossAmount"" ELSE 0 END) AS TotalPaid,  
+    SUM(CASE WHEN (b.""NetAmount"" IS NOT null and d.""PaymentId"" not in(12,30)) THEN b.""NetAmount"" ELSE 0 END) AS TotalNetAmount,
+    j.""Id"" GroupId,
+    j.""Name"" GroupName,
+    j.""GroupType"" GroupType,
+    k.""Name"" ParentGroupName,
+    h.""PaymentId"" ,
+    h.""DisplayName"" DisplayName,
+    h.""Name"" MopName,
+    a.""TransactionType"" 
+FROM  
+     (select * from ""PosTrxes""
+   where ""TargetBusinessUnitId"" = '{0}'  
+   and ""CreatedDateTime"" >='{1}'  
+   and ""CreatedDateTime"" <= '{2}'  
+   AND ""TransactionStatus"" = 1 ) a  
+LEFT JOIN ""PosTrxLineItems"" b ON a.""Id"" = b.""PosTrxId""  
+LEFT JOIN ""PosTrxMops"" c ON c.""PosTrxId"" = a.""Id""  
+LEFT JOIN ""PosMops"" d ON c.""PosMopId"" = d.""Id""  
+left join ""PosItems"" e on b.""PosItemId""  = e.""Id"" 
+left join ""PosItemAndGroup_M2M"" f on e.""Id""  = f.""PosItem_Id"" 
+left join ""PosItemGroups"" j on f.""PosItemGroup_Id""  = j.""Id"" 
+left join ""PosItemGroups"" k on j.""ParentGroupId""  = k.""Id"" 
+left join ""Mops"" h on d.""PaymentId"" = h.""PaymentId"" 
+WHERE  
+  c.""ResultMessage"" = 'OK'
+    AND b.""Voided"" = FALSE  
+    and d.""PaymentId"" is not null
+GROUP BY  
+   b.""FuelItemSoldOnPumpNozzleId"",
+   b.""FuelItemSoldOnPumpNozzleId"",
+     j.""Id"" ,
+    j.""Name"" ,
+    j.""GroupType"" ,
+    k.""Name"" ,
+    h.""PaymentId"" ,
+    h.""DisplayName"" ,
+    h.""Name"",
+     a.""TransactionType"" 
+", buid, firstDayOfLastMonth, lastDayOfLastMonth.ToString("yyyy-MM-dd 23:59:59"));
+            var salesFinanceInfo = _unitOfWork.DbContext.pumpTransactionSummaries
+                             .FromSqlRaw(sql)
+                             .ToList();//获取销售升数、回灌、自用、应收款、实收款
+
+            List<NozzleTransaction> list = new List<NozzleTransaction>();
+            foreach (var n in salesFinanceInfo)
+            {
+                NozzleTransaction nozzle = new NozzleTransaction();
+                nozzle.FuelItemSoldOnPumpNozzleId = n.FuelItemSoldOnPumpNozzleId;
+
+                nozzle.ItemName = fuelDetails.FirstOrDefault(_ => _.FuelItemSoldOnPumpNozzleId == n.FuelItemSoldOnPumpNozzleId)?.ItemName ?? "";
+
+                nozzle.ItemPrice = fuelDetails.FirstOrDefault(_ => _.FuelItemSoldOnPumpNozzleId == n.FuelItemSoldOnPumpNozzleId)?.ItemPrice ?? 00.0M;
+                nozzle.VolumeOnPos = n.VolumeOnPos;//销售升数
+                nozzle.PumpTestVolume = n.PumpTestVolume;//回灌
+                nozzle.SelfUseVolume = n.SelfUseVolume;//自用
+                nozzle.TotalPaid = n.TotalPaid;//应收款
+                nozzle.TotalNetAmount = n.TotalNetAmount;//实收款
+                nozzle.VolumeOnPumpStart =
+                    startEndPumpPair.FirstOrDefault(_ => _.FuelItemSoldOnPumpNozzleId == n.FuelItemSoldOnPumpNozzleId)
+                    ?.VolumeOnPumpStart;//起泵数
+                nozzle.VolumeOnPumpEnd =
+                    startEndPumpPair.FirstOrDefault(_ => _.FuelItemSoldOnPumpNozzleId == n.FuelItemSoldOnPumpNozzleId)
+                    ?.VolumeOnPumpEnd;//止泵数
+                nozzle.GroupId = n.GroupId;//分组id
+                nozzle.GroupName = n.GroupName;//分组名称
+                nozzle.GroupType = n.GroupType;//分组类型
+                nozzle.ParentGroupName = n.ParentGroupName;//父分组
+                nozzle.PaymentId = n.PaymentId;//支付类型id
+                nozzle.DisplayName = n.DisplayName;//支付类型名称
+                nozzle.MopName = n.MopName;//支付类型名称
+                nozzle.TransactionType = n.TransactionType;//订单类型
+                list.Add(nozzle);
+            }
+            if (list.Count > 0)
+            {
+                string json = JsonConvert.SerializeObject(list);
+                string key = "NozzleData" + ":" + buid;
+                redisExample.AddToHash(key, datetime, json);
+            }
+            return null;
+        }
+        public async Task<ExecuteResult> fixFuelItemTag2Async(string startTime,string endTime,string buid)
+        {
+            Guid TargetBusinessUnitId = Guid.Parse(buid);
+            DateTime dateTime =  DateTime.Parse(startTime);
+            DateTime enddateTime = DateTime.Parse(endTime);
+            //            var query = _unitOfWork.GetRepository<PosTrxes>().FromSql(string.Format(@"select a.* FROM public.""PosTrxes"" a 
+            //left join public.""PosTrxLineItems"" b on a.""Id""  = b.""PosTrxId"" 
+            //left join public.""PosTrxMops"" c on a.""Id""  = c.""PosTrxId"" 
+            //left join public.""PosMops"" d on c.""PosMopId""  = d.""Id"" 
+            //where b.""FuelItemTag""  is null
+            //and b.""Id"" = '1aa78939-7aa7-42b3-92fc-e2f8e934ddbd'
+            //and a.""CreatedDateTime""  >=  '{0}' ", "2023-03-01")).Include(a => a.PosTrxLineItems)
+            //.Include(a => a.PosTrxMops)
+            //.ThenInclude(a => a.PosMop).ToList();
+            //var query = _unitOfWork.GetRepository<PosTrxes>().GetAll().Include(a => a.PosTrxLineItems)
+            //    .Include.ToList();
+            //Guid guid_ = new Guid("000147d3-dd35-4c8a-a354-42be800ca57d");
+            var query = _unitOfWork.GetRepository<PosTrxes>().GetAll().Include(a => a.PosTrxLineItems)
+.Include(a => a.PosTrxMops)
+.ThenInclude(a => a.PosMop).Where(a => a.CreatedDateTime >= dateTime && a.CreatedDateTime <= enddateTime
+&& a.TargetBusinessUnitId == TargetBusinessUnitId
+&& a.PosTrxLineItems.Any(b => b.FuelItemTag == null) //&& a.Id == guid_
+ ).ToList();
+
+            //            var query = _unitOfWork.GetRepository<PosTrxes>().GetAll().Include(a => a.PosTrxLineItems)
+            //.Include(a => a.PosTrxMops)
+            //.ThenInclude(a => a.PosMop).Where(a => a.PosTrxLineItems.Any(b => b.FuelItemTag == null) && a.Id == guid_
+            //).ToList();
+
+            foreach (var item in query)
+            {
+                var posTrxLineItems = item.PosTrxLineItems;
+                var Mop = item.PosTrxMops?.FirstOrDefault()?.PosMop;
+                var PosTrxMops = item.PosTrxMops;
+                var fuelItemsFromRealPump = posTrxLineItems.Where(i => !string.IsNullOrEmpty(i.FuelItemFdcTransactionSeqNo) &&
+                                                          i.FuelItemSoldOnPumpNozzleId != null);
+                if (Mop == null)
+                    continue;
+
+                //string mopjson = SerializeObject(Mop);
+                //MS.WebCore.Logger.Logger.WriteLog("Mop:" + JsonConvert.SerializeObject(mopjson));
+                if (fuelItemsFromRealPump.Any())
+                {
+                    MyTransaction SequenceNo;
+                    foreach (var trxitem in fuelItemsFromRealPump)
+                    {
+                        if (!string.IsNullOrEmpty(trxitem.FuelItemTag) || trxitem.FuelItemFdcTransactionSeqNo == null)
+                            continue;
+                        MS.WebCore.Logger.Logger.WriteLog("FuelItemFdcTransactionSeqNo2:" + trxitem.FuelItemFdcTransactionSeqNo);
+                        SequenceNo = findCardInfoByBusinessUnitInfoAndSequenceNo_2(item.TargetBusinessUnitId.ToString(), trxitem.FuelItemFdcTransactionSeqNo, trxitem.FuelItemSoldOnPumpNozzleId.ToString(), item.CreatedDateTime, Mop.PaymentId == 4);
+                        if (SequenceNo != null)
+                        {
+                            MS.WebCore.Logger.Logger.WriteLog("FuelItemFdcTransactionSeqNo2:" + trxitem.FuelItemFdcTransactionSeqNo + "card_no:" + SequenceNo.card_no);
+                            var carno = SequenceNo.card_no;
+                            if (carno.Length <= 8)//感应卡
+                            {
+                                if (SequenceNo.card_type != 1)
+                                    continue;
+                            }
+                            else //CPU卡
+                            {
+                                if (SequenceNo.card_type != 4)
+                                    continue;
+                            }
+
+                            var AspNetUsers = _AuthContext.GetRepository<AspNetUsers>().GetAll()
+                            .Include(a => a.UserSubIdentities)
+                            .Where(a => a.UserSubIdentities.Any(b => b.Identity == SequenceNo.card_no && b.Type == FuelItemTagDto.SmartFuelIcCardSystemName)).FirstOrDefault();
+                            string AspNetUsersjson = SerializeObject(AspNetUsers);
+                            MS.WebCore.Logger.Logger.WriteLog("FuelItemFdcTransactionSeqNo2:" + trxitem.FuelItemFdcTransactionSeqNo + "AspNetUsers: " + AspNetUsersjson);
+                            if (AspNetUsers == null)
+                            {
+                                continue;
+                            }
+                            var tagInfo = new FuelItemTagDto()
+                            {
+                                TagLinkedServiceIdentityUser = new UserInfos
+                                {
+                                    Id = Guid.Parse(AspNetUsers.Id),
+                                    UserName = AspNetUsers.UserName,
+                                    Alias =  AspNetUsers.Alias,
+                                    RestrictedInBusinessUnits = { }
+                                },
+                                TagSystemName = FuelItemTagDto.SmartFuelIcCardSystemName,
+                                TagId = SequenceNo.card_no,
+                                TagType = FuelItemTagDto.SmartFuelIcCardTagName,
+                                Detail = "This Fuel Item from real pump is authorized by an attandant's smartFuel IC card"
+                            };
+                            trxitem.FuelItemTag = JsonConvert.SerializeObject(tagInfo);
+                            _unitOfWork.GetRepository<PosTrxLineItems>().Update(trxitem);
+                            await _unitOfWork.SaveChangesAsync();//提交
+                            MS.WebCore.Logger.Logger.WriteLog("FuelItemFdcTransactionSeqNo2:" + trxitem.FuelItemFdcTransactionSeqNo + "FuelItemTag:" + trxitem.Id.ToString());
+                        }
+                        else if (Mop.PaymentId == 4)
+                        {
+                            var entity = _unitOfWork.GetRepository<NozzleAssignments>().GetAll()
+                                .Where(a => a.NozzleId == trxitem.FuelItemSoldOnPumpNozzleId && a.TargetBusinessUnitId == item.TargetBusinessUnitId)
+                                .FirstOrDefault();
+                            if (entity != null)
+                            {
+                                var AspNetUsersV2 = _AuthContext.GetRepository<AspNetUsers>().GetAll()
+                                .Include(a => a.UserSubIdentities)
+                                .Include(a => a.IdentityUserBusiUnitM2m)
+                                .Where(a => a.IdentityUserBusiUnitM2m
+                                .Any(b => b.BusinessUnitId == item.TargetBusinessUnitId)
+                                && a.UserName == entity.OperatorName)
+                                .FirstOrDefault();
+                                if (AspNetUsersV2 != null)
+                                {
+                                    var tagInfo = new FuelItemTagDto()
+                                    {
+                                        TagLinkedServiceIdentityUser = new UserInfos
+                                        {
+                                            Id = Guid.Parse(AspNetUsersV2.Id),
+                                            UserName = AspNetUsersV2.UserName,
+                                            Alias = BuidUploadOrNot(item.TargetBusinessUnitId.ToString()) ? "" : AspNetUsersV2.Alias
+                                        },
+                                        TagSystemName = FuelItemTagDto.SmartFuelIcCardSystemName,
+                                        TagId = AspNetUsersV2.UserSubIdentities?.FirstOrDefault().Identity,
+                                        TagType = FuelItemTagDto.SmartFuelIcCardTagName,
+                                        Detail = "This Fuel Item from real pump is authorized by IC card"
+                                    };
+                                    trxitem.FuelItemTag = JsonConvert.SerializeObject(tagInfo);
+                                    _unitOfWork.GetRepository<PosTrxLineItems>().Update(trxitem);
+                                    await _unitOfWork.SaveChangesAsync();//提交
+                                    MS.WebCore.Logger.Logger.WriteLog("FuelItemTag:" + trxitem.Id.ToString());
+                                }
+                            }
+                        }
+                    }
+
+                }
+            }
+            return null;
+        }
     }
 }

+ 52 - 58
src/MS.Services/PosTrxService/PosTrxService.cs

@@ -322,8 +322,8 @@ WHERE
         }
         public async Task<ExecuteResult> GetTransactionStatus(string SeqNo, string NozzleId, string sn, string FuelItemFdcReleaseTokenAttribute, string FuelItemOriginalGrossAmount, DateTime? FuelItemTransactionEndTime = null)
         {
-          //  MS.WebCore.Logger.Logger.WriteLog(string.Format(@" GetTransactionStatus:SeqNo {0} NozzleId{1}
-         //  sn {2} "));
+            //  MS.WebCore.Logger.Logger.WriteLog(string.Format(@" GetTransactionStatus:SeqNo {0} NozzleId{1}
+            //  sn {2} "));
             ExecuteResult<TransactionStatusDto> result = new ExecuteResult<TransactionStatusDto>();
             string _startTime = DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss");
             string where = string.Empty;
@@ -335,8 +335,8 @@ WHERE
             {
                 where += string.Format(@" and ptli.""FuelItemOriginalGrossAmount""  = '{0}'", FuelItemOriginalGrossAmount);
             }
-            
-       
+
+
 
             try
             {
@@ -344,7 +344,7 @@ WHERE
                       .Where(a => a.HardwareIdentity == sn).FirstOrDefault();
                 var buid = SiteDevices.AsSubjectOfBusinessUnitId;
 
-                if (FuelItemTransactionEndTime != null && buid != null &&  buid.ToString() != "5914f34a-b69d-42b9-9fd4-0b8f6fba715e")
+                if (FuelItemTransactionEndTime != null && buid != null && buid.ToString() != "5914f34a-b69d-42b9-9fd4-0b8f6fba715e")
                 {
                     string sdate = FuelItemTransactionEndTime.Value.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss");
                     string edate = FuelItemTransactionEndTime.Value.AddSeconds(-2).ToString("yyyy-MM-dd HH:mm:ss");
@@ -356,32 +356,36 @@ WHERE
                     where += string.Format(@" and a.""CreatedDateTime"" >= '{0}'", _startTime);
                 }
 
-//                var  nozzles = await _unitOfWork.GetRepository<PosTrxMops>().FromSql(string.Format(@"	select ptm.""ResultCode"" ,ptm.""ResultMessage""
-//,a.""orderType"" from ""PosTrxes"" as a join ""PosTrxLineItems"" ptli on a.""Id"" = ptli.""PosTrxId"" 
-//left join ""PosTrxMops"" ptm ON  a
-//.""Id"" = ptm.""PosTrxId"" where ptli.""FuelItemFdcTransactionSeqNo""='{0}'
-//and a.""TargetBusinessUnitId""='{1}'  and ptli.""FuelItemSoldOnPumpNozzleId"" = '{2}'   and ptli.""Voided"" = false 
-//and ptli.""FuelItemOriginalGrossAmount""  > 0 {4}"
-//, SeqNo, buid, NozzleId, _startTime, where))//and ptli.""Voided"" = false 
-//                .GroupBy(_ => new { _.ResultCode, _.ResultMessage,_.order })
-//                  .Select(_ => new TransactionStatusDto
-//                  {
-//                      ResultCode = _.Key.ResultCode,
-//                      ResultMessage = _.Key.ResultMessage,
-//                      orderType = _.Key
-//                  })?.ToListAsync();
+                //                var  nozzles = await _unitOfWork.GetRepository<PosTrxMops>().FromSql(string.Format(@"	select ptm.""ResultCode"" ,ptm.""ResultMessage""
+                //,a.""orderType"" from ""PosTrxes"" as a join ""PosTrxLineItems"" ptli on a.""Id"" = ptli.""PosTrxId"" 
+                //left join ""PosTrxMops"" ptm ON  a
+                //.""Id"" = ptm.""PosTrxId"" where ptli.""FuelItemFdcTransactionSeqNo""='{0}'
+                //and a.""TargetBusinessUnitId""='{1}'  and ptli.""FuelItemSoldOnPumpNozzleId"" = '{2}'   and ptli.""Voided"" = false 
+                //and ptli.""FuelItemOriginalGrossAmount""  > 0 {4}"
+                //, SeqNo, buid, NozzleId, _startTime, where))//and ptli.""Voided"" = false 
+                //                .GroupBy(_ => new { _.ResultCode, _.ResultMessage,_.order })
+                //                  .Select(_ => new TransactionStatusDto
+                //                  {
+                //                      ResultCode = _.Key.ResultCode,
+                //                      ResultMessage = _.Key.ResultMessage,
+                //                      orderType = _.Key
+                //                  })?.ToListAsync();
                 var nozzles = _unitOfWork.DbContext.posTrxMopsDtos
            .FromSqlRaw(string.Format(@"	select ptm.""ResultCode"" ,ptm.""ResultMessage""
-,a.""orderType"" from ""PosTrxes"" as a join ""PosTrxLineItems"" ptli on a.""Id"" = ptli.""PosTrxId"" 
+,a.""orderType"",a.""Id"",a.""GrossAmount"",a.""NetAmount"" from ""PosTrxes"" as a join ""PosTrxLineItems"" ptli on a.""Id"" = ptli.""PosTrxId"" 
 left join ""PosTrxMops"" ptm ON  a
 .""Id"" = ptm.""PosTrxId"" where ptli.""FuelItemFdcTransactionSeqNo""='{0}'
 and a.""TargetBusinessUnitId""='{1}'  and ptli.""FuelItemSoldOnPumpNozzleId"" = '{2}'   and ptli.""Voided"" = false 
 and ptli.""FuelItemOriginalGrossAmount""  > 0 {4}"
-, SeqNo, buid, NozzleId, _startTime, where)).GroupBy(_ => new { _.ResultCode, _.ResultMessage, _.orderType }).Select(_ => new TransactionStatusDto
+, SeqNo, buid, NozzleId, _startTime, where)).GroupBy(_ => new { _.ResultCode, _.ResultMessage, _.orderType, _.Id, _.GrossAmount, _.NetAmount }).Select(_ => new TransactionStatusDto
 {
     ResultCode = _.Key.ResultCode,
     ResultMessage = _.Key.ResultMessage,
-    orderType = _.Key.orderType
+    orderType = _.Key.orderType,
+    Id = _.Key.Id,
+    amount = _.Key.GrossAmount,
+    netAmount = _.Key.NetAmount,
+    discount = _.Key.GrossAmount - _.Key.NetAmount
 })?.ToList();
                 result.SetData(nozzles);
             }
@@ -393,7 +397,32 @@ and ptli.""FuelItemOriginalGrossAmount""  > 0 {4}"
             }
             return result;
         }
-
+        public async Task<ExecuteResult> RemarkUnlockTransaction(string userName, string alias, decimal? ttc, decimal? releaseToken, int nozzleNum, DateTime? endTime, string oilName, decimal? volume, decimal? amount, DateTime? unLockTime, string sn, string Comment, DateTime? cancellation)
+        {
+            try
+            {
+                PosTrxUnLock posTrxUnLock = new PosTrxUnLock();
+                posTrxUnLock.userName = userName;
+                posTrxUnLock.alias = alias;
+                posTrxUnLock.ttc = ttc;
+                posTrxUnLock.releaseToken = releaseToken;
+                posTrxUnLock.nozzleNum = nozzleNum;
+                posTrxUnLock.endTime = endTime;
+                posTrxUnLock.volume = volume;
+                posTrxUnLock.amount = amount;
+                posTrxUnLock.unLockTime = unLockTime;
+                posTrxUnLock.sn = sn;
+                posTrxUnLock.Comment = Comment;
+                posTrxUnLock.cancellation = cancellation;
+                posTrxUnLock.type = null;
+                _unitOfWork.GetRepository<PosTrxUnLock>().Insert(posTrxUnLock);
+                await _unitOfWork.SaveChangesAsync();//提交
+            }
+            catch (Exception ex)
+            {
+            }
+            return null;
+        }
         //public void ExportToExcel(List<NozzleTotalizerDto> nozzleTotalizers, string filePath)
         //{
         //    IWorkbook workbook = new XSSFWorkbook();
@@ -480,40 +509,5 @@ and ptli.""FuelItemOriginalGrossAmount""  > 0 {4}"
 
             return resultStream;
         }
-        //public async Task<MemoryStream> ExportToExcelAsync<T>(List<T> data)
-        //{
-        //    using (var package = new ExcelPackage())
-        //    {
-        //        var worksheet = package.Workbook.Worksheets.Add("Sheet1");
-
-        //        // 写入表头
-        //        var properties = typeof(T).GetProperties();
-        //        for (int i = 0; i < properties.Length; i++)
-        //        {
-        //            var property = properties[i];
-        //            worksheet.Cells[1, i + 1].Value = property.Name;
-        //        }
-
-        //        // 写入数据
-        //        for (int i = 0; i < data.Count; i++)
-        //        {
-        //            var item = data[i];
-        //            for (int j = 0; j < properties.Length; j++)
-        //            {
-        //                var property = properties[j];
-        //                var value = property.GetValue(item);
-        //                worksheet.Cells[i + 2, j + 1].Value = value;
-        //            }
-        //        }
-
-        //        // 根据需要设置其他样式或格式
-
-        //        // 保存为Excel文件
-        //        var stream = new MemoryStream();
-        //        package.SaveAs(stream);
-        //        stream.Position = 0;
-        //        return stream;
-        //    }
-        //}
     }
 }

+ 1 - 1
src/MS.UnitOfWork/Repository/IRepository.cs

@@ -344,7 +344,7 @@ namespace MS.UnitOfWork
         /// Inserts a range of entities synchronously.
         /// </summary>
         /// <param name="entities">The entities to insert.</param>
-        void Insert(IEnumerable<TEntity> entities);
+         void Insert(IEnumerable<TEntity> entities);
 
 
         /// <summary>

+ 112 - 1
src/MS.WebApi/Controllers/AccountController.cs

@@ -1,12 +1,23 @@
-using Microsoft.AspNetCore.Authorization;
+using CsvHelper;
+using CsvHelper.Configuration;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using MS.Component.Jwt.UserClaim;
+using MS.Entities.AccountingService_Models;
+using MS.Entities.Core;
+using MS.Models;
 using MS.Models.ViewModel;
 using MS.Services;
 using MS.WebCore.Core;
+using MySqlX.XDevAPI.Common;
 using NPOI.SS.Formula.Functions;
+using Renci.SshNet.Messages;
 using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
 using System.Threading.Tasks;
 
 namespace MS.WebApi.Controllers
@@ -106,5 +117,105 @@ namespace MS.WebApi.Controllers
             await _accountService.AddCarRedisAsync();
             return true;
         }
+
+        /// <summary>
+        /// 获取交易信息
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetTransactioninfo")]
+        [HttpPost]
+        [AllowAnonymous]
+        public async Task<ExecuteResult> GetTransactioninfo(string trx_sequence_no,
+            string nozzle_no,
+            string business_unit_info_id,
+            string transaction_time)
+        {
+            return await _accountService.GetTransactioninfo(trx_sequence_no, nozzle_no, business_unit_info_id, transaction_time);
+        }
+        [Route("GetBusinessUnits")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<ExecuteResult> GetBusinessUnits(string guid)
+        {
+            return await _accountService.GetBusinessUnits(guid);
+        }
+        /// <summary>
+        /// 实体卡开票余额清零提醒
+        /// </summary>
+        /// <returns></returns>
+        [Route("CardInvoiceClearWarn")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<ExecuteResult> CardInvoiceClearWarnAsync()
+        {
+            return await _accountService.CardInvoiceClearWarnAsync();
+        }
+        /// <summary>
+        /// 实体卡开票余额清零提醒
+        /// </summary>
+        /// <returns></returns>
+        [Route("CardInvoiceClear")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<ExecuteResult> CardInvoiceClearAsync()
+        {
+            return await _accountService.CardInvoiceClearAsync();
+        }
+        /// <summary>
+        /// 电子账户开票余额清零
+        /// </summary>
+        /// <returns></returns>
+        [Route("ElectronicAccountInvoiceClear")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<ExecuteResult> ElectronicAccountInvoiceClearAsync()
+        {
+            return await _accountService.ElectronicAccountInvoiceClearAsync();
+        }
+        /// <summary>
+        /// 短信发送
+        /// </summary>
+        /// <returns></returns>
+        [Route("SendSms")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task SendSms()
+        {
+             await _accountService.SendSms();
+        }
+        [HttpPost("upload")]
+        public async Task<IActionResult> Upload(IFormFile file)
+        {
+            if (file == null || file.Length == 0)
+                return BadRequest("No file uploaded.");
+
+            if (!Path.GetExtension(file.FileName).Equals(".csv", StringComparison.OrdinalIgnoreCase))
+                return BadRequest("Only .csv files are allowed.");
+
+            var people = new List<UploadTrx>();
+
+            using (var reader = new StreamReader(file.OpenReadStream()))
+            using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
+            {
+                var config = new CsvConfiguration(CultureInfo.InvariantCulture)
+                {
+                    HasHeaderRecord = true, // 指定第一行是标题行
+                    MissingFieldFound = null, // 处理缺失字段
+                    BadDataFound = null // 处理错误数据
+                };
+                people = csv.GetRecords<UploadTrx>().ToList();
+            }
+            await _accountService.Upload(people);
+            // 返回读取的数据
+            return Ok();
+        }
+        [Route("userIdAndName")]
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<IActionResult> userIdAndName(string Buid, int page = 1, int pageSize = 1000)
+        {
+            var data = await _accountService.userIdAndName(Buid, page, pageSize);
+            return Ok(new { statusCode = "OK", message = "OK", result = data });
+        }
     }
 }

+ 15 - 0
src/MS.WebApi/Controllers/FixFuelItemTagController.cs

@@ -27,5 +27,20 @@ namespace MS.WebApi.Controllers
         {
             return await _PosTrxLineItemsService.fixFuelItemTagAsync(startTime);
         }
+        [Route("NozzleData")]
+        [EnableCors("AllowSpecificOrigin")]
+        [HttpPost]
+        public async Task<ExecuteResult> NozzleDataAsync()
+        {
+            return await _PosTrxLineItemsService.InsertNozzleDataRedis();
+            // return await _PosTrxLineItemsService.NozzleDataAsync(buid,datetime);
+        }
+        [Route("fixFuelItemTag2")]
+        [EnableCors("AllowSpecificOrigin")]
+        [HttpPost]
+        public async Task<ExecuteResult> fixFuelItemTag2Async(string startTime, string endTime, string buid)
+        {
+            return await _PosTrxLineItemsService.fixFuelItemTag2Async(startTime, endTime, buid);
+        }
     }
 }

+ 24 - 0
src/MS.WebApi/Controllers/TransactionStatusController.cs

@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
 using MS.Services;
 using MS.Services.PosTrxService;
 using MS.WebCore.Core;
+using MS.WebCore.Dto;
 using System;
 using System.Threading.Tasks;
 
@@ -29,5 +30,28 @@ namespace MS.WebApi.Controllers
             }
             return await _PosTrxService.GetTransactionStatus( SeqNo,  NozzleId,  sn, FuelItemFdcReleaseTokenAttribute, FuelItemOriginalGrossAmount, FuelItemTransactionEndTime);
         }
+        [Route("RemarkUnlockTransaction")]
+        [EnableCors("AllowSpecificOrigin")]
+        [HttpPost]
+        public async Task<ExecuteResult> RemarkUnlockTransaction(PosTrxUnLockDto posTrxUnLock)
+        {
+         var dfsd =   HttpContext.Connection.RemoteIpAddress;
+            DateTime? endTime = null;
+            DateTime? unLockTime = null;
+            DateTime? cancellation = null;
+            if (!string.IsNullOrEmpty(posTrxUnLock.endTime))
+            {
+                endTime = DateTime.Parse(posTrxUnLock.endTime);
+            }
+            if (!string.IsNullOrEmpty(posTrxUnLock.unLockTime))
+            {
+                unLockTime = DateTime.Parse(posTrxUnLock.unLockTime);
+            }
+            if (!string.IsNullOrEmpty(posTrxUnLock.cancellation))
+            {
+                cancellation = DateTime.Parse(posTrxUnLock.cancellation);
+            }
+            return await _PosTrxService.RemarkUnlockTransaction(posTrxUnLock.userName, posTrxUnLock.alias, posTrxUnLock.ttc, posTrxUnLock.releaseToken, posTrxUnLock.nozzleNum , endTime, posTrxUnLock.oilName ,  posTrxUnLock.volume , posTrxUnLock.amount , unLockTime, posTrxUnLock.sn, posTrxUnLock.Comment, cancellation);
+        }
     }
 }

+ 28 - 14
src/MS.WebApi/Initialize/Startup.cs

@@ -2,6 +2,7 @@ using Autofac;
 using GZY.Quartz.MUI.Extensions;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
@@ -18,6 +19,9 @@ using MS.WebApi.waynedbModels;
 using MS.WebCore;
 using MS.WebCore.MultiLanguages;
 using Npgsql.EntityFrameworkCore.PostgreSQL;
+using System;
+using System.IO;
+using System.Text.Json;
 
 namespace MS.WebApi
 {
@@ -60,21 +64,20 @@ namespace MS.WebApi
 
             services.AddCors(options =>
             {
-                //options.AddPolicy("AllowSpecificOrigin",
-                //    builder => builder.WithOrigins("http://tkhs.net.cn:8091")//http://ipos.biz:8091
-                //                      .AllowAnyHeader()
-                //                      .AllowAnyMethod()
-                //                      .AllowCredentials()
-
-                //                      );
-                //    //options.AddPolicy("AllowAllOrigins", 
-                //    //    builder => builder.SetIsOriginAllowed(_ => true)
-                //    //.AllowAnyHeader()
-                //    //.AllowAnyMethod()
-                //    //.AllowCredentials()
-                //    //);
+                options.AddPolicy("AllowAll", policy =>
+                {
+                    policy.AllowAnyOrigin()    // 允许所有来源(生产环境应指定具体域名)
+                          .AllowAnyMethod()    // 允许所有 HTTP 方法
+                          .AllowAnyHeader()    // 允许所有请求头
+                          .SetPreflightMaxAge(TimeSpan.FromSeconds(86400)); // 预检请求缓存时间
+                });
             });
-
+            services.AddControllers()
+    .AddJsonOptions(options =>
+    {
+        options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; // 支持 camelCase
+        options.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
+    });
             services.AddQuartzUI();
             services
                 .AddControllers(options =>
@@ -119,6 +122,17 @@ namespace MS.WebApi
             app.UseQuartz(); //定时任务
             app.UseMultiLanguage(Configuration);//添加多语言本地化支持
 
+            app.UseCors("AllowAll");
+            app.Use(async (context, next) =>
+            {
+                context.Response.Headers["Referrer-Policy"] = "strict-origin-when-cross-origin";
+                context.Request.EnableBuffering(); // 允许多次读取
+                var requestBody = await new StreamReader(context.Request.Body).ReadToEndAsync();
+                Console.WriteLine($"Request Body: {requestBody}");
+                context.Request.Body.Position = 0; // 重置流的位置
+                await next();
+            });
+
             app.UseRouting();
 
             app.UseCors(WebCoreExtensions.MyAllowSpecificOrigins);//添加跨域

+ 1 - 0
src/MS.WebApi/MS.WebApi.csproj

@@ -6,6 +6,7 @@
 
   <ItemGroup>
     <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="5.0.1" />
+    <PackageReference Include="CsvHelper" Version="33.0.1" />
     <PackageReference Include="GZY.Quartz.MUI" Version="1.1.5" />
     <PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.14" />

+ 23 - 0
src/MS.WebApi/Models/PosTrxUnLock.cs

@@ -0,0 +1,23 @@
+using System;
+
+namespace MS.WebApi.Models
+{
+    public partial class PosTrxUnLock
+    {
+        public Guid Id { get; set; }
+        public string UserName { get; set; }
+        public int? Ttc { get; set; }
+        public string Alias { get; set; }
+        public int? ReleaseToken { get; set; }
+        public int? NozzleNum { get; set; }
+        public DateTime? EndTime { get; set; }
+        public string OilName { get; set; }
+        public decimal? Volume { get; set; }
+        public decimal? Amount { get; set; }
+        public DateTime? UnLockTime { get; set; }
+        public string Sn { get; set; }
+        public int? Type { get; set; }
+        public string Comment { get; set; }
+        public DateTime? Cancellation { get; set; }
+    }
+}

+ 43 - 0
src/MS.WebApi/Models/TransactionServiceDatabase_NewThu04130311PMContext.cs

@@ -33,6 +33,7 @@ namespace MS.WebApi.Models
         public virtual DbSet<PosTrxPromotions> PosTrxPromotions { get; set; }
         public virtual DbSet<PosTrxes> PosTrxes { get; set; }
         public virtual DbSet<ShortCodes> ShortCodes { get; set; }
+        public virtual DbSet<PosTrxUnLock> PosTrxUnLock { get; set; }
 
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
@@ -81,6 +82,48 @@ namespace MS.WebApi.Models
 
                 entity.Property(e => e.Id).ValueGeneratedNever();
             });
+            modelBuilder.Entity<PosTrxUnLock>(entity =>
+            {
+                entity.Property(e => e.Id).HasDefaultValueSql("uuid_generate_v4()");
+
+                entity.Property(e => e.Alias)
+                    .HasColumnName("alias")
+                    .HasMaxLength(30);
+
+                entity.Property(e => e.Amount)
+                    .HasColumnName("amount")
+                    .HasColumnType("numeric(12,3)");
+
+                entity.Property(e => e.Cancellation).HasColumnName("cancellation");
+
+                entity.Property(e => e.EndTime).HasColumnName("endTime");
+
+                entity.Property(e => e.NozzleNum).HasColumnName("nozzleNum");
+
+                entity.Property(e => e.OilName)
+                    .HasColumnName("oilName")
+                    .HasMaxLength(30);
+
+                entity.Property(e => e.ReleaseToken).HasColumnName("releaseToken");
+
+                entity.Property(e => e.Sn)
+                    .HasColumnName("sn")
+                    .HasMaxLength(50);
+
+                entity.Property(e => e.Ttc).HasColumnName("ttc");
+
+                entity.Property(e => e.Type).HasColumnName("type");
+
+                entity.Property(e => e.UnLockTime).HasColumnName("unLockTime");
+
+                entity.Property(e => e.UserName)
+                    .HasColumnName("userName")
+                    .HasMaxLength(30);
+
+                entity.Property(e => e.Volume)
+                    .HasColumnName("volume")
+                    .HasColumnType("numeric(12,3)");
+            });
 
             modelBuilder.Entity<PosItemAndGroupM2m>(entity =>
             {

+ 76 - 0
src/MS.WebApi/Models2/AccountInfo.cs

@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class AccountInfo
+    {
+        public AccountInfo()
+        {
+            CardInfo = new HashSet<CardInfo>();
+            InverseAccountInfoNavigation = new HashSet<AccountInfo>();
+            RechargePaymentHistory = new HashSet<RechargePaymentHistory>();
+            TransactionInfo = new HashSet<TransactionInfo>();
+        }
+
+        public Guid Id { get; set; }
+        public int? AccountId { get; set; }
+        public string AccountNo { get; set; }
+        public string AccountPin { get; set; }
+        public int? AccountState { get; set; }
+        public int? AmountLimit { get; set; }
+        public int? Balance { get; set; }
+        public int? CardClass { get; set; }
+        public int? CardType { get; set; }
+        public int? Cash { get; set; }
+        public DateTime? CreationDate { get; set; }
+        public int? DailyAmountLimit { get; set; }
+        public int? DiscountType { get; set; }
+        public DateTime? ExpirationDate { get; set; }
+        public string GasLiterLimit { get; set; }
+        public string Holder { get; set; }
+        public int? MonthlyAmountLimit { get; set; }
+        public string OperatorNo { get; set; }
+        public int? PinTryLimit { get; set; }
+        public int? UserId { get; set; }
+        public DateTime? ValidationDate { get; set; }
+        public Guid? AccountInfoId { get; set; }
+        public Guid? AccountTypeId { get; set; }
+        public Guid? UserInfoId { get; set; }
+        public string BelongTo { get; set; }
+        public string EnableSms { get; set; }
+        public string OfflineAccountId { get; set; }
+        public int? OfflineDepositBalance { get; set; }
+        public string OfflinePhoneNo { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+        public long? RechargeTotal { get; set; }
+        public short? AcctSno { get; set; }
+        public string Address { get; set; }
+        public short? AcctType { get; set; }
+        public string FuelNo { get; set; }
+        public int? Gift { get; set; }
+        public string CertfType { get; set; }
+        public string CertfNo { get; set; }
+        public int? TMac { get; set; }
+        public short? Sno { get; set; }
+        public long? Gid { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public short? UploadFlag { get; set; }
+        public DateTime? LastModified { get; set; }
+        public string PhysicalCardUserInfo { get; set; }
+
+        public virtual AccountInfo AccountInfoNavigation { get; set; }
+        public virtual AccountType AccountType { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+        public virtual BusinessUnitInfo BusinessUnitInfo { get; set; }
+        public virtual UserInfo UserInfo { get; set; }
+        public virtual ICollection<CardInfo> CardInfo { get; set; }
+        public virtual ICollection<AccountInfo> InverseAccountInfoNavigation { get; set; }
+        public virtual ICollection<RechargePaymentHistory> RechargePaymentHistory { get; set; }
+        public virtual ICollection<TransactionInfo> TransactionInfo { get; set; }
+    }
+}

+ 24 - 0
src/MS.WebApi/Models2/AccountType.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class AccountType
+    {
+        public AccountType()
+        {
+            AccountInfo = new HashSet<AccountInfo>();
+        }
+
+        public Guid Id { get; set; }
+        public int AccountType1 { get; set; }
+        public string MembershipDescription { get; set; }
+        public string Name { get; set; }
+
+        public virtual ICollection<AccountInfo> AccountInfo { get; set; }
+    }
+}

+ 1814 - 0
src/MS.WebApi/Models2/AccountingService_Sun_0230AMMon03180930AMContext.cs

@@ -0,0 +1,1814 @@
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class AccountingService_Sun_0230AMMon03180930AMContext : DbContext
+    {
+        public AccountingService_Sun_0230AMMon03180930AMContext()
+        {
+        }
+
+        public AccountingService_Sun_0230AMMon03180930AMContext(DbContextOptions<AccountingService_Sun_0230AMMon03180930AMContext> options)
+            : base(options)
+        {
+        }
+
+        public virtual DbSet<AccountInfo> AccountInfo { get; set; }
+        public virtual DbSet<AccountType> AccountType { get; set; }
+        public virtual DbSet<BlackCardInfo> BlackCardInfo { get; set; }
+        public virtual DbSet<BusinessUnitInfo> BusinessUnitInfo { get; set; }
+        public virtual DbSet<CardInfo> CardInfo { get; set; }
+        public virtual DbSet<CardRepLossInfo> CardRepLossInfo { get; set; }
+        public virtual DbSet<ChangeHistory> ChangeHistory { get; set; }
+        public virtual DbSet<FleetCardRechargeHistory> FleetCardRechargeHistory { get; set; }
+        public virtual DbSet<FlywaySchemaHistory> FlywaySchemaHistory { get; set; }
+        public virtual DbSet<GrayInfo> GrayInfo { get; set; }
+        public virtual DbSet<ImageInfo> ImageInfo { get; set; }
+        public virtual DbSet<InvoiceInfo> InvoiceInfo { get; set; }
+        public virtual DbSet<MembershipGroup> MembershipGroup { get; set; }
+        public virtual DbSet<MembershipGrowthRules> MembershipGrowthRules { get; set; }
+        public virtual DbSet<MembershipLevelInfo> MembershipLevelInfo { get; set; }
+        public virtual DbSet<OfflineTransactionInfo> OfflineTransactionInfo { get; set; }
+        public virtual DbSet<RechargePaymentHistory> RechargePaymentHistory { get; set; }
+        public virtual DbSet<SmsInfo> SmsInfo { get; set; }
+        public virtual DbSet<TransactionInfo> TransactionInfo { get; set; }
+        public virtual DbSet<Trxtable> Trxtable { get; set; }
+        public virtual DbSet<UserInfo> UserInfo { get; set; }
+        public virtual DbSet<UserInfoMembershipGroups> UserInfoMembershipGroups { get; set; }
+        public virtual DbSet<UserMessages> UserMessages { get; set; }
+
+        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        {
+            if (!optionsBuilder.IsConfigured)
+            {
+#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
+                optionsBuilder.UseNpgsql("Host=47.101.220.106;Port=5432;Database=AccountingService_Sun_0230AMMon03180930AM;Username=postgres;Password=Postgres3141");
+            }
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            modelBuilder.HasPostgresExtension("dblink")
+                .HasPostgresExtension("uuid-ossp");
+
+            modelBuilder.Entity<AccountInfo>(entity =>
+            {
+                entity.ToTable("account_info");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("account_info_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.BelongTo })
+                    .HasName("account_info_bu_and_belong_to");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.OfflineAccountId })
+                    .HasName("account_info_offline_account_id");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AccountId).HasColumnName("account_id");
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.AccountNo)
+                    .HasColumnName("account_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AccountPin)
+                    .HasColumnName("account_pin")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AccountState).HasColumnName("account_state");
+
+                entity.Property(e => e.AccountTypeId).HasColumnName("account_type_id");
+
+                entity.Property(e => e.AcctSno).HasColumnName("acct_sno");
+
+                entity.Property(e => e.AcctType).HasColumnName("acct_type");
+
+                entity.Property(e => e.Address)
+                    .HasColumnName("address")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.AmountLimit).HasColumnName("amount_limit");
+
+                entity.Property(e => e.Balance).HasColumnName("balance");
+
+                entity.Property(e => e.BelongTo)
+                    .HasColumnName("belong_to")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.CardClass).HasColumnName("card_class");
+
+                entity.Property(e => e.CardType).HasColumnName("card_type");
+
+                entity.Property(e => e.Cash).HasColumnName("cash");
+
+                entity.Property(e => e.CertfNo)
+                    .HasColumnName("certf_no")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.CertfType)
+                    .HasColumnName("certf_type")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.CreationDate).HasColumnName("creation_date");
+
+                entity.Property(e => e.DailyAmountLimit).HasColumnName("daily_amount_limit");
+
+                entity.Property(e => e.DiscountType).HasColumnName("discount_type");
+
+                entity.Property(e => e.EnableSms)
+                    .HasColumnName("enable_sms")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ExpirationDate).HasColumnName("expiration_date");
+
+                entity.Property(e => e.FuelNo)
+                    .HasColumnName("fuel_no")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.GasLiterLimit)
+                    .HasColumnName("gas_liter_limit")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.Gift).HasColumnName("gift");
+
+                entity.Property(e => e.Holder)
+                    .HasColumnName("holder")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.MonthlyAmountLimit).HasColumnName("monthly_amount_limit");
+
+                entity.Property(e => e.OfflineAccountId)
+                    .HasColumnName("offline_account_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.OfflineDepositBalance).HasColumnName("offline_deposit_balance");
+
+                entity.Property(e => e.OfflinePhoneNo)
+                    .HasColumnName("offline_phone_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.OperatorNo)
+                    .HasColumnName("operator_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PhysicalCardUserInfo)
+                    .HasColumnName("physical_card_user_info")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PinTryLimit).HasColumnName("pin_try_limit");
+
+                entity.Property(e => e.RechargeTotal).HasColumnName("recharge_total");
+
+                entity.Property(e => e.Sno).HasColumnName("sno");
+
+                entity.Property(e => e.TMac).HasColumnName("t_mac");
+
+                entity.Property(e => e.UploadFlag).HasColumnName("upload_flag");
+
+                entity.Property(e => e.UserId).HasColumnName("user_id");
+
+                entity.Property(e => e.UserInfoId).HasColumnName("user_info_id");
+
+                entity.Property(e => e.ValidationDate).HasColumnName("validation_date");
+
+                entity.HasOne(d => d.AccountInfoNavigation)
+                    .WithMany(p => p.InverseAccountInfoNavigation)
+                    .HasForeignKey(d => d.AccountInfoId)
+                    .HasConstraintName("fkbrnpgdi1yxogfv0s8btdq8hls");
+
+                entity.HasOne(d => d.AccountType)
+                    .WithMany(p => p.AccountInfo)
+                    .HasForeignKey(d => d.AccountTypeId)
+                    .HasConstraintName("fkr9nd5vvqy3s90103qlb38tsjf");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.AccountInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("account_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BusinessUnitInfo)
+                    .WithMany(p => p.AccountInfoBusinessUnitInfo)
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fkke7sdylmdqsbs9tr8r9gcmg6p");
+
+                entity.HasOne(d => d.UserInfo)
+                    .WithMany(p => p.AccountInfo)
+                    .HasForeignKey(d => d.UserInfoId)
+                    .HasConstraintName("fk48ykkq9kivu155t7ee6svwx9h");
+            });
+
+            modelBuilder.Entity<AccountType>(entity =>
+            {
+                entity.ToTable("account_type");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AccountType1).HasColumnName("account_type");
+
+                entity.Property(e => e.MembershipDescription)
+                    .HasColumnName("membership_description")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Name)
+                    .HasColumnName("name")
+                    .HasMaxLength(255);
+            });
+
+            modelBuilder.Entity<BlackCardInfo>(entity =>
+            {
+                entity.ToTable("black_card_info");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("black_card_info_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AcctGid).HasColumnName("acct_gid");
+
+                entity.Property(e => e.AcctId)
+                    .HasColumnName("acct_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BlackCardType).HasColumnName("black_card_type");
+
+                entity.Property(e => e.BlackDate).HasColumnName("black_date");
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardType).HasColumnName("card_type");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.IsDeleted)
+                    .HasColumnName("is_deleted")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.Reason)
+                    .HasColumnName("reason")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.UploadFlag).HasColumnName("upload_flag");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.BlackCardInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("black_card_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.BlackCardInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("black_card_info_bu_info_id_fkey");
+            });
+
+            modelBuilder.Entity<BusinessUnitInfo>(entity =>
+            {
+                entity.ToTable("business_unit_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AreaType)
+                    .HasColumnName("area_type")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BuAddress)
+                    .HasColumnName("bu_address")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BuName)
+                    .HasColumnName("bu_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BuNo).HasColumnName("bu_no");
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.CStore).HasColumnName("c_store");
+
+                entity.Property(e => e.CanCount).HasColumnName("can_count");
+
+                entity.Property(e => e.CanVolume).HasColumnName("can_volume");
+
+                entity.Property(e => e.CarWash).HasColumnName("car_wash");
+
+                entity.Property(e => e.Character)
+                    .HasColumnName("character")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ComCount).HasColumnName("com_count");
+
+                entity.Property(e => e.DeviceSn)
+                    .HasColumnName("device_sn")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.DispenserCount).HasColumnName("dispenser_count");
+
+                entity.Property(e => e.Email)
+                    .HasColumnName("email")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.EmployeeCount).HasColumnName("employee_count");
+
+                entity.Property(e => e.Fax)
+                    .HasColumnName("fax")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.GpsCoordinates)
+                    .HasColumnName("gps_coordinates")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.IcCardType)
+                    .HasColumnName("ic_card_type")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.ImageLoyaltyRedemption).HasColumnName("image_loyalty_redemption");
+
+                entity.Property(e => e.ImageMain).HasColumnName("image_main");
+
+                entity.Property(e => e.ImageMembershipCard).HasColumnName("image_membership_card");
+
+                entity.Property(e => e.LinkMan)
+                    .HasColumnName("link_man")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MembershipDescription).HasColumnName("membership_description");
+
+                entity.Property(e => e.MembershipPrivacy).HasColumnName("membership_privacy");
+
+                entity.Property(e => e.MembershipStatement).HasColumnName("membership_statement");
+
+                entity.Property(e => e.MerchantId)
+                    .HasColumnName("merchant_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MerchantIpAddress)
+                    .HasColumnName("merchant_ip_address")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MerchantKey)
+                    .HasColumnName("merchant_key")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MerchantSubId)
+                    .HasColumnName("merchant_sub_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MiniprogramAppSecret)
+                    .HasColumnName("miniprogram_app_secret")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.MiniprogramAppid)
+                    .HasColumnName("miniprogram_appid")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Mobile)
+                    .HasColumnName("mobile")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.NozzleCount).HasColumnName("nozzle_count");
+
+                entity.Property(e => e.OfflineTransferCount).HasColumnName("offline_transfer_count");
+
+                entity.Property(e => e.Online)
+                    .HasColumnName("online")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.OperationDate).HasColumnName("operation_date");
+
+                entity.Property(e => e.ParentBuId).HasColumnName("parent_bu_id");
+
+                entity.Property(e => e.ParkingCount).HasColumnName("parking_count");
+
+                entity.Property(e => e.Password)
+                    .HasColumnName("password")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Phone)
+                    .HasColumnName("phone")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PosCount).HasColumnName("pos_count");
+
+                entity.Property(e => e.PostCode)
+                    .HasColumnName("post_code")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ReferenceBuId).HasColumnName("reference_bu_id");
+
+                entity.Property(e => e.Road)
+                    .HasColumnName("road")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.RoadCount).HasColumnName("road_count");
+
+                entity.Property(e => e.ScaleType)
+                    .HasColumnName("scale_type")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ServiceProviderId)
+                    .HasColumnName("service_provider_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.SmsEnabled)
+                    .HasColumnName("sms_enabled")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.SmsMsgTemplate)
+                    .HasColumnName("sms_msg_template")
+                    .HasColumnType("character varying")
+                    .HasDefaultValueSql("''::character varying");
+
+                entity.Property(e => e.SmsPrimarySite)
+                    .HasColumnName("sms_primary_site")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.SmsRemainingCount)
+                    .HasColumnName("sms_remaining_count")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.SmsSentCount)
+                    .HasColumnName("sms_sent_count")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.UserName)
+                    .HasColumnName("user_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Wc).HasColumnName("wc");
+
+                entity.Property(e => e.WxNotifyPaymentUrl)
+                    .HasColumnName("wx_notify_payment_url")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.WxNotifyRechargeUrl)
+                    .HasColumnName("wx_notify_recharge_url")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.WxNotifyShortCodeUrl)
+                    .HasColumnName("wx_notify_short_code_url")
+                    .HasMaxLength(255);
+
+                entity.HasOne(d => d.BusinessUnitInfoNavigation)
+                    .WithMany(p => p.InverseBusinessUnitInfoNavigation)
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fk75f37nhfy18ie24he2a0iqoba");
+
+                entity.HasOne(d => d.ParentBu)
+                    .WithMany(p => p.InverseParentBu)
+                    .HasForeignKey(d => d.ParentBuId)
+                    .HasConstraintName("business_unit_info_parent_bu_id_fkey");
+            });
+
+            modelBuilder.Entity<CardInfo>(entity =>
+            {
+                entity.ToTable("card_info");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("card_info_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.HasIndex(e => new { e.AccountId, e.Id })
+                    .HasName("card_info_account_id_id_idx");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.CardNo, e.Holder, e.CardType })
+                    .HasName("card_info_card_no_holder_card_type");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AccountId)
+                    .HasColumnName("account_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.ActivationDate).HasColumnName("activation_date");
+
+                entity.Property(e => e.BLimitCar).HasColumnName("b_limit_car");
+
+                entity.Property(e => e.Balance).HasColumnName("balance");
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.CarLicenseNo)
+                    .HasColumnName("car_license_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardClass).HasColumnName("card_class");
+
+                entity.Property(e => e.CardId).HasColumnName("card_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardSno).HasColumnName("card_sno");
+
+                entity.Property(e => e.CardStatus).HasColumnName("card_status");
+
+                entity.Property(e => e.CardType).HasColumnName("card_type");
+
+                entity.Property(e => e.CreationDate).HasColumnName("creation_date");
+
+                entity.Property(e => e.Ctc).HasColumnName("ctc");
+
+                entity.Property(e => e.CtcFlag).HasColumnName("ctc_flag");
+
+                entity.Property(e => e.CtcTime)
+                    .HasColumnName("ctc_time")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.DMaxPay).HasColumnName("d_max_pay");
+
+                entity.Property(e => e.DepositBalance).HasColumnName("deposit_balance");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.EnableSms)
+                    .HasColumnName("enable_sms")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.ExpirationDate).HasColumnName("expiration_date");
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.Holder)
+                    .HasColumnName("holder")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.LimitTimes).HasColumnName("limit_times");
+
+                entity.Property(e => e.LmtGood).HasColumnName("lmt_good");
+
+                entity.Property(e => e.LmtOil)
+                    .HasColumnName("lmt_oil")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.MMaxPay).HasColumnName("m_max_pay");
+
+                entity.Property(e => e.OnceMaxPay).HasColumnName("once_max_pay");
+
+                entity.Property(e => e.OperatorNo)
+                    .HasColumnName("operator_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PhoneNo)
+                    .HasColumnName("phone_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PointsAwardedTotal).HasColumnName("points_awarded_total");
+
+                entity.Property(e => e.RechargeTotal).HasColumnName("recharge_total");
+
+                entity.Property(e => e.Sno).HasColumnName("sno");
+
+                entity.Property(e => e.Tmac).HasColumnName("tmac");
+
+                entity.Property(e => e.UploadFlag).HasColumnName("upload_flag");
+
+                entity.Property(e => e.UserNo)
+                    .HasColumnName("user_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.UserPin)
+                    .HasColumnName("user_pin")
+                    .HasColumnType("character varying");
+
+                entity.HasOne(d => d.AccountInfo)
+                    .WithMany(p => p.CardInfo)
+                    .HasForeignKey(d => d.AccountInfoId)
+                    .HasConstraintName("fkhy8g8ddgv03kw51l2qnca3n5u");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.CardInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("card_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BusinessUnitInfo)
+                    .WithMany(p => p.CardInfoBusinessUnitInfo)
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fkdoganwfsp7k6vwdohfms42c9x");
+            });
+
+            modelBuilder.Entity<CardRepLossInfo>(entity =>
+            {
+                entity.ToTable("card_rep_loss_info");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("card_rep_loss_info_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.LossTime).HasColumnName("loss_time");
+
+                entity.Property(e => e.OperationType).HasColumnName("operation_type");
+
+                entity.Property(e => e.OperatorNo)
+                    .HasColumnName("operator_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Reason)
+                    .HasColumnName("reason")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Sno).HasColumnName("sno");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.CardRepLossInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("card_rep_loss_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.CardRepLossInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("card_rep_loss_info_bu_info_id_fkey");
+            });
+
+            modelBuilder.Entity<ChangeHistory>(entity =>
+            {
+                entity.ToTable("change_history");
+
+                entity.Property(e => e.Id).HasColumnName("id");
+
+                entity.Property(e => e.BuId).HasColumnName("bu_id");
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.RecordId).HasColumnName("record_id");
+
+                entity.Property(e => e.TableName).HasColumnName("table_name");
+            });
+
+            modelBuilder.Entity<FleetCardRechargeHistory>(entity =>
+            {
+                entity.ToTable("fleet_card_recharge_history");
+
+                entity.HasIndex(e => e.BuId)
+                    .HasName("fleet_card_recharge_history_bu_id");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("fleet_card_recharge_history_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.Property(e => e.Id).HasColumnName("id");
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.AccountName)
+                    .HasColumnName("account_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AccountNo)
+                    .HasColumnName("account_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Acknowledged)
+                    .HasColumnName("acknowledged")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.Amount).HasColumnName("amount");
+
+                entity.Property(e => e.BatchNo).HasColumnName("batch_no");
+
+                entity.Property(e => e.BuId).HasColumnName("bu_id");
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.CardHolder)
+                    .HasColumnName("card_holder")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardInfoId).HasColumnName("card_info_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CreationTime)
+                    .HasColumnName("creation_time")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.Deleted)
+                    .HasColumnName("deleted")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+            });
+
+            modelBuilder.Entity<FlywaySchemaHistory>(entity =>
+            {
+                entity.HasKey(e => e.InstalledRank)
+                    .HasName("flyway_schema_history_pk");
+
+                entity.ToTable("flyway_schema_history");
+
+                entity.HasIndex(e => e.Success)
+                    .HasName("flyway_schema_history_s_idx");
+
+                entity.Property(e => e.InstalledRank)
+                    .HasColumnName("installed_rank")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.Checksum).HasColumnName("checksum");
+
+                entity.Property(e => e.Description)
+                    .IsRequired()
+                    .HasColumnName("description")
+                    .HasMaxLength(200);
+
+                entity.Property(e => e.ExecutionTime).HasColumnName("execution_time");
+
+                entity.Property(e => e.InstalledBy)
+                    .IsRequired()
+                    .HasColumnName("installed_by")
+                    .HasMaxLength(100);
+
+                entity.Property(e => e.InstalledOn)
+                    .HasColumnName("installed_on")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.Script)
+                    .IsRequired()
+                    .HasColumnName("script")
+                    .HasMaxLength(1000);
+
+                entity.Property(e => e.Success).HasColumnName("success");
+
+                entity.Property(e => e.Type)
+                    .IsRequired()
+                    .HasColumnName("type")
+                    .HasMaxLength(20);
+
+                entity.Property(e => e.Version)
+                    .HasColumnName("version")
+                    .HasMaxLength(50);
+            });
+
+            modelBuilder.Entity<GrayInfo>(entity =>
+            {
+                entity.ToTable("gray_info");
+
+                entity.HasIndex(e => e.LastModified)
+                    .HasName("gray_info_last_modified")
+                    .HasSortOrder(new[] { SortOrder.Descending });
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.CardBalance).HasColumnName("card_balance");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CommId)
+                    .HasColumnName("comm_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ctc).HasColumnName("ctc");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.EndPump).HasColumnName("end_pump");
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.Gmac).HasColumnName("gmac");
+
+                entity.Property(e => e.IsDeleted)
+                    .HasColumnName("is_deleted")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.Money).HasColumnName("money");
+
+                entity.Property(e => e.NozzleNo).HasColumnName("nozzle_no");
+
+                entity.Property(e => e.PayTerminalId).HasColumnName("pay_terminal_id");
+
+                entity.Property(e => e.PaymodeId).HasColumnName("paymode_id");
+
+                entity.Property(e => e.Price).HasColumnName("price");
+
+                entity.Property(e => e.PsamAsn)
+                    .HasColumnName("psam_asn")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PsamTac).HasColumnName("psam_tac");
+
+                entity.Property(e => e.PsamTid)
+                    .HasColumnName("psam_tid")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PsamTtc)
+                    .HasColumnName("psam_ttc")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PumpNo).HasColumnName("pump_no");
+
+                entity.Property(e => e.PumpType).HasColumnName("pump_type");
+
+                entity.Property(e => e.RealMoney).HasColumnName("real_money");
+
+                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");
+
+                entity.Property(e => e.Sno).HasColumnName("sno");
+
+                entity.Property(e => e.Tac).HasColumnName("tac");
+
+                entity.Property(e => e.Tmac).HasColumnName("tmac");
+
+                entity.Property(e => e.TrdType).HasColumnName("trd_type");
+
+                entity.Property(e => e.Ttc).HasColumnName("ttc");
+
+                entity.Property(e => e.TtcTime).HasColumnName("ttc_time");
+
+                entity.Property(e => e.TtcTimeEnd).HasColumnName("ttc_time_end");
+
+                entity.Property(e => e.UploadFlag).HasColumnName("upload_flag");
+
+                entity.Property(e => e.Volume).HasColumnName("volume");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.GrayInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("gray_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.GrayInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("gray_info_bu_info_id_fkey");
+            });
+
+            modelBuilder.Entity<ImageInfo>(entity =>
+            {
+                entity.ToTable("image_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.Image).HasColumnName("image");
+
+                entity.Property(e => e.ImageName)
+                    .HasColumnName("image_name")
+                    .HasMaxLength(255);
+            });
+
+            modelBuilder.Entity<InvoiceInfo>(entity =>
+            {
+                entity.ToTable("invoice_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.Amount).HasColumnName("amount");
+
+                entity.Property(e => e.Balance).HasColumnName("balance");
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Comments)
+                    .HasColumnName("comments")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.IssuedTimestamp).HasColumnName("issued_timestamp");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.PhoneNo)
+                    .HasColumnName("phone_no")
+                    .HasMaxLength(255)
+                    .HasDefaultValueSql("''::character varying");
+
+                entity.Property(e => e.UserInfoId).HasColumnName("user_info_id");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.InvoiceInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("invoice_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.InvoiceInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("invoice_info_bu_info_id_fkey");
+
+                entity.HasOne(d => d.UserInfo)
+                    .WithMany(p => p.InvoiceInfo)
+                    .HasForeignKey(d => d.UserInfoId)
+                    .HasConstraintName("invoice_info_user_info_id_fkey");
+            });
+
+            modelBuilder.Entity<MembershipGroup>(entity =>
+            {
+                entity.ToTable("membership_group");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.ConfigAppliedItems)
+                    .HasColumnName("config_applied_items")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigCreationTimeFrom).HasColumnName("config_creation_time_from");
+
+                entity.Property(e => e.ConfigCreationTimeTo).HasColumnName("config_creation_time_to");
+
+                entity.Property(e => e.ConfigEAccountBalanceFrom)
+                    .HasColumnName("config_e_account_balance_from")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.ConfigEAccountBalanceTo)
+                    .HasColumnName("config_e_account_balance_to")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.ConfigEndTimeOfDay)
+                    .HasColumnName("config_end_time_of_day")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigGender).HasColumnName("config_gender");
+
+                entity.Property(e => e.ConfigLevel)
+                    .HasColumnName("config_level")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigPhysicalCard).HasColumnName("config_physical_card");
+
+                entity.Property(e => e.ConfigRfmFrequencyFrom).HasColumnName("config_rfm_frequency_from");
+
+                entity.Property(e => e.ConfigRfmFrequencyTo).HasColumnName("config_rfm_frequency_to");
+
+                entity.Property(e => e.ConfigRfmMonetaryAbove).HasColumnName("config_rfm_monetary_above");
+
+                entity.Property(e => e.ConfigRfmMonetaryBelow).HasColumnName("config_rfm_monetary_below");
+
+                entity.Property(e => e.ConfigRfmRecencyBefore).HasColumnName("config_rfm_recency_before");
+
+                entity.Property(e => e.ConfigSpecifiedDateOfMonth)
+                    .HasColumnName("config_specified_date_of_month")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigSpecifiedDateOfMonthCount).HasColumnName("config_specified_date_of_month_count");
+
+                entity.Property(e => e.ConfigSpecifiedDayOfWeek)
+                    .HasColumnName("config_specified_day_of_week")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigSpecifiedDayOfWeekCount).HasColumnName("config_specified_day_of_week_count");
+
+                entity.Property(e => e.ConfigStartTimeOfDay)
+                    .HasColumnName("config_start_time_of_day")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.ConfigTimeOfDayCount).HasColumnName("config_time_of_day_count");
+
+                entity.Property(e => e.CreationTime).HasColumnName("creation_time");
+
+                entity.Property(e => e.Description)
+                    .HasColumnName("description")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.GroupId)
+                    .HasColumnName("group_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.GroupMemberLimit).HasColumnName("group_member_limit");
+
+                entity.Property(e => e.GroupName)
+                    .HasColumnName("group_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.GroupStatus)
+                    .HasColumnName("group_status")
+                    .HasDefaultValueSql("1");
+
+                entity.Property(e => e.GroupType).HasColumnName("group_type");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.LastRefreshTime).HasColumnName("last_refresh_time");
+
+                entity.Property(e => e.MembershipLevel).HasColumnName("membership_level");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.MembershipGroupBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("membership_group_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.MembershipGroupBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("membership_group_bu_info_id_fkey");
+
+                entity.HasOne(d => d.MembershipLevelNavigation)
+                    .WithMany(p => p.MembershipGroup)
+                    .HasForeignKey(d => d.MembershipLevel)
+                    .HasConstraintName("membership_group_membership_level_fkey");
+            });
+
+            modelBuilder.Entity<MembershipGrowthRules>(entity =>
+            {
+                entity.ToTable("membership_growth_rules");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.GrowthType).HasColumnName("growth_type");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.ValidBegin).HasColumnName("valid_begin");
+
+                entity.Property(e => e.ValidEnd).HasColumnName("valid_end");
+
+                entity.Property(e => e.ValidateType).HasColumnName("validate_type");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.MembershipGrowthRulesBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("membership_growth_rules_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.MembershipGrowthRulesBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("membership_growth_rules_bu_info_id_fkey");
+            });
+
+            modelBuilder.Entity<MembershipLevelInfo>(entity =>
+            {
+                entity.ToTable("membership_level_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.LevelName)
+                    .HasColumnName("level_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.LevelRetainCondition).HasColumnName("level_retain_condition");
+
+                entity.Property(e => e.LevelUpCondition).HasColumnName("level_up_condition");
+
+                entity.Property(e => e.MembershipLevelId)
+                    .HasColumnName("membership_level_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.NextLevelId).HasColumnName("next_level_id");
+
+                entity.Property(e => e.UpperLevelId).HasColumnName("upper_level_id");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.MembershipLevelInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("membership_level_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.MembershipLevelInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("membership_level_info_bu_info_id_fkey");
+
+                entity.HasOne(d => d.NextLevel)
+                    .WithMany(p => p.InverseNextLevel)
+                    .HasForeignKey(d => d.NextLevelId)
+                    .HasConstraintName("membership_level_info_next_level_id_fkey");
+
+                entity.HasOne(d => d.UpperLevel)
+                    .WithMany(p => p.InverseUpperLevel)
+                    .HasForeignKey(d => d.UpperLevelId)
+                    .HasConstraintName("membership_level_info_upper_level_id_fkey");
+            });
+
+            modelBuilder.Entity<OfflineTransactionInfo>(entity =>
+            {
+                entity.HasNoKey();
+
+                entity.ToTable("offline_transaction_info");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.TransactionTime })
+                    .HasName("offline_transaction_info_business_unit_info_id_idx");
+
+                entity.Property(e => e.AccountId)
+                    .HasColumnName("account_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.Amount).HasColumnName("amount");
+
+                entity.Property(e => e.Balance).HasColumnName("balance");
+
+                entity.Property(e => e.BarCode)
+                    .HasColumnName("bar_code")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.BillNo).HasColumnName("bill_no");
+
+                entity.Property(e => e.BillType).HasColumnName("bill_type");
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.CarId)
+                    .HasColumnName("car_id")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.CarLicenseNo)
+                    .HasColumnName("car_license_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardBalance).HasColumnName("card_balance");
+
+                entity.Property(e => e.CardInfoId).HasColumnName("card_info_id");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardSequenceNo).HasColumnName("card_sequence_no");
+
+                entity.Property(e => e.CardType).HasColumnName("card_type");
+
+                entity.Property(e => e.CommId)
+                    .HasColumnName("comm_id")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.Comments)
+                    .HasColumnName("comments")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ctc).HasColumnName("ctc");
+
+                entity.Property(e => e.DisIntegral).HasColumnName("dis_integral");
+
+                entity.Property(e => e.DisMoney).HasColumnName("dis_money");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.EmployeeNo)
+                    .HasColumnName("employee_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.EndTotalizer).HasColumnName("end_totalizer");
+
+                entity.Property(e => e.FuelName)
+                    .HasColumnName("fuel_name")
+                    .HasColumnType("character varying")
+                    .HasDefaultValueSql("''::character varying");
+
+                entity.Property(e => e.Gid).HasColumnName("gid");
+
+                entity.Property(e => e.Gmac).HasColumnName("gmac");
+
+                entity.Property(e => e.GrossAmount).HasColumnName("gross_amount");
+
+                entity.Property(e => e.Id).HasColumnName("id");
+
+                entity.Property(e => e.Integral).HasColumnName("integral");
+
+                entity.Property(e => e.InvoiceIssued).HasColumnName("invoice_issued");
+
+                entity.Property(e => e.InvoiceType).HasColumnName("invoice_type");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.LineNo)
+                    .HasColumnName("line_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Mileage).HasColumnName("mileage");
+
+                entity.Property(e => e.NozzleNo).HasColumnName("nozzle_no");
+
+                entity.Property(e => e.OperCardNo)
+                    .HasColumnName("oper_card_no")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.Operator)
+                    .HasColumnName("operator")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PayModeId).HasColumnName("pay_mode_id");
+
+                entity.Property(e => e.PayModeNo)
+                    .HasColumnName("pay_mode_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PayTemId).HasColumnName("pay_tem_id");
+
+                entity.Property(e => e.PaymentId).HasColumnName("payment_id");
+
+                entity.Property(e => e.PosId).HasColumnName("pos_id");
+
+                entity.Property(e => e.Price).HasColumnName("price");
+
+                entity.Property(e => e.ProductId)
+                    .HasColumnName("product_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PsamAsn)
+                    .HasColumnName("psam_asn")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.PsamTac).HasColumnName("psam_tac");
+
+                entity.Property(e => e.PsamTid)
+                    .HasColumnName("psam_tid")
+                    .HasColumnType("character varying");
+
+                entity.Property(e => e.PsamTtc).HasColumnName("psam_ttc");
+
+                entity.Property(e => e.PumpNo).HasColumnName("pump_no");
+
+                entity.Property(e => e.PumpType).HasColumnName("pump_type");
+
+                entity.Property(e => e.ReceiptNo).HasColumnName("receipt_no");
+
+                entity.Property(e => e.RechargeType).HasColumnName("recharge_type");
+
+                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");
+
+                entity.Property(e => e.ShiftId).HasColumnName("shift_id");
+
+                entity.Property(e => e.SmsSent)
+                    .HasColumnName("sms_sent")
+                    .HasDefaultValueSql("false");
+
+                entity.Property(e => e.Sno).HasColumnName("sno");
+
+                entity.Property(e => e.SubTransactionType).HasColumnName("sub_transaction_type");
+
+                entity.Property(e => e.Tac).HasColumnName("tac");
+
+                entity.Property(e => e.Tmac).HasColumnName("tmac");
+
+                entity.Property(e => e.TransactionTime).HasColumnName("transaction_time");
+
+                entity.Property(e => e.TransactionType).HasColumnName("transaction_type");
+
+                entity.Property(e => e.TrxEndTime).HasColumnName("trx_end_time");
+
+                entity.Property(e => e.TrxOriginalId)
+                    .HasColumnName("trx_original_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.TrxSequenceNo)
+                    .HasColumnName("trx_sequence_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.TrxStartTime).HasColumnName("trx_start_time");
+
+                entity.Property(e => e.Ttc).HasColumnName("ttc");
+
+                entity.Property(e => e.Volume).HasColumnName("volume");
+
+                entity.HasOne(d => d.AccountInfo)
+                    .WithMany()
+                    .HasForeignKey(d => d.AccountInfoId)
+                    .HasConstraintName("fk23gjts31sw86t9b674iadlyaj");
+
+                entity.HasOne(d => d.BusinessUnitInfo)
+                    .WithMany()
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fk14c59inbbebmk3gbmnthp3jb6");
+
+                entity.HasOne(d => d.CardInfo)
+                    .WithMany()
+                    .HasForeignKey(d => d.CardInfoId)
+                    .HasConstraintName("fk1f9j7u7gbj0wy2juhw14bn0lp");
+            });
+
+            modelBuilder.Entity<RechargePaymentHistory>(entity =>
+            {
+                entity.ToTable("recharge_payment_history");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AccountBalance).HasColumnName("account_balance");
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.LoyaltyPointsAwarded).HasColumnName("loyalty_points_awarded");
+
+                entity.Property(e => e.LoyaltyPointsBalance).HasColumnName("loyalty_points_balance");
+
+                entity.Property(e => e.OperatorNo)
+                    .HasColumnName("operator_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PaymentAmount).HasColumnName("payment_amount");
+
+                entity.Property(e => e.RechargeAmount).HasColumnName("recharge_amount");
+
+                entity.Property(e => e.TransactionDate).HasColumnName("transaction_date");
+
+                entity.Property(e => e.TransactionType).HasColumnName("transaction_type");
+
+                entity.Property(e => e.TrxOriginalId)
+                    .HasColumnName("trx_original_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.TrxSequenceNo)
+                    .HasColumnName("trx_sequence_no")
+                    .HasMaxLength(255);
+
+                entity.HasOne(d => d.AccountInfo)
+                    .WithMany(p => p.RechargePaymentHistory)
+                    .HasForeignKey(d => d.AccountInfoId)
+                    .HasConstraintName("fk9ig9ho56ln4hmphmtdxofebfd");
+
+                entity.HasOne(d => d.BusinessUnitInfo)
+                    .WithMany(p => p.RechargePaymentHistory)
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fknkbj1nmk3hp0aloybvvf0dfqi");
+            });
+
+            modelBuilder.Entity<SmsInfo>(entity =>
+            {
+                entity.ToTable("sms_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.BuInfoCreatedId).HasColumnName("bu_info_created_id");
+
+                entity.Property(e => e.BuInfoId).HasColumnName("bu_info_id");
+
+                entity.Property(e => e.CreationDate)
+                    .HasColumnName("creation_date")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.ExpirationDate).HasColumnName("expiration_date");
+
+                entity.Property(e => e.LastModified)
+                    .HasColumnName("last_modified")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.RechargeAmount).HasColumnName("recharge_amount");
+
+                entity.HasOne(d => d.BuInfoCreated)
+                    .WithMany(p => p.SmsInfoBuInfoCreated)
+                    .HasForeignKey(d => d.BuInfoCreatedId)
+                    .HasConstraintName("sms_info_bu_info_created_id_fkey");
+
+                entity.HasOne(d => d.BuInfo)
+                    .WithMany(p => p.SmsInfoBuInfo)
+                    .HasForeignKey(d => d.BuInfoId)
+                    .HasConstraintName("sms_info_bu_info_id_fkey");
+            });
+
+            modelBuilder.Entity<TransactionInfo>(entity =>
+            {
+                entity.ToTable("transaction_info");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.AccountInfoId).HasColumnName("account_info_id");
+
+                entity.Property(e => e.Amount).HasColumnName("amount");
+
+                entity.Property(e => e.CarLicenseNo)
+                    .HasColumnName("car_license_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardBalance).HasColumnName("card_balance");
+
+                entity.Property(e => e.CardNo)
+                    .HasColumnName("card_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CardType).HasColumnName("card_type");
+
+                entity.Property(e => e.DiscountNo).HasColumnName("discount_no");
+
+                entity.Property(e => e.EmployeeNo)
+                    .HasColumnName("employee_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.LineNo)
+                    .HasColumnName("line_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Mileage).HasColumnName("mileage");
+
+                entity.Property(e => e.NozzleNo).HasColumnName("nozzle_no");
+
+                entity.Property(e => e.Operator)
+                    .HasColumnName("operator")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PayModeId).HasColumnName("pay_mode_id");
+
+                entity.Property(e => e.PayModeNo)
+                    .HasColumnName("pay_mode_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PaymentId).HasColumnName("payment_id");
+
+                entity.Property(e => e.PosId).HasColumnName("pos_id");
+
+                entity.Property(e => e.Price).HasColumnName("price");
+
+                entity.Property(e => e.ProductId)
+                    .HasColumnName("product_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PumpNo).HasColumnName("pump_no");
+
+                entity.Property(e => e.PumpType).HasColumnName("pump_type");
+
+                entity.Property(e => e.ReceiptNo).HasColumnName("receipt_no");
+
+                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");
+
+                entity.Property(e => e.ShiftId).HasColumnName("shift_id");
+
+                entity.Property(e => e.TransactionType).HasColumnName("transaction_type");
+
+                entity.Property(e => e.TrxOriginalId)
+                    .HasColumnName("trx_original_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.TrxSequenceNo)
+                    .HasColumnName("trx_sequence_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Volume).HasColumnName("volume");
+
+                entity.HasOne(d => d.AccountInfo)
+                    .WithMany(p => p.TransactionInfo)
+                    .HasForeignKey(d => d.AccountInfoId)
+                    .HasConstraintName("fks1xvhy67lr9k1i7r3fbwmo36o");
+            });
+
+            modelBuilder.Entity<Trxtable>(entity =>
+            {
+                entity.HasNoKey();
+
+                entity.ToTable("trxtable");
+
+                entity.Property(e => e.Buid).HasColumnName("buid");
+
+                entity.Property(e => e.Cardno)
+                    .HasColumnName("cardno")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Mon).HasColumnName("mon");
+
+                entity.Property(e => e.Nozno).HasColumnName("nozno");
+
+                entity.Property(e => e.Opercardno)
+                    .HasColumnName("opercardno")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ttc)
+                    .HasColumnName("ttc")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Ttctime).HasColumnName("ttctime");
+            });
+
+            modelBuilder.Entity<UserInfo>(entity =>
+            {
+                entity.ToTable("user_info");
+
+                entity.HasIndex(e => e.BusinessUnitInfoId)
+                    .HasName("user_info_bu_id");
+
+                entity.HasIndex(e => e.Id)
+                    .HasName("user_info_id");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.PhoneNo })
+                    .HasName("user_info_bu_id_phone_no");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.UserName })
+                    .HasName("user_info_bu_id_user_name");
+
+                entity.HasIndex(e => new { e.BusinessUnitInfoId, e.UserNo })
+                    .HasName("user_info_bu_id_user_no");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .ValueGeneratedNever();
+
+                entity.Property(e => e.Address)
+                    .HasColumnName("address")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.AliPayId)
+                    .HasColumnName("ali_pay_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Amount).HasColumnName("amount");
+
+                entity.Property(e => e.Birthday).HasColumnName("birthday");
+
+                entity.Property(e => e.BuId)
+                    .HasColumnName("bu_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BuString)
+                    .HasColumnName("bu_string")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.BusinessUnitInfoId).HasColumnName("business_unit_info_id");
+
+                entity.Property(e => e.CertificateNo)
+                    .HasColumnName("certificate_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CertificateType)
+                    .HasColumnName("certificate_type")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.CreationDate).HasColumnName("creation_date");
+
+                entity.Property(e => e.EnableSms).HasColumnName("enable_sms");
+
+                entity.Property(e => e.FuelNo)
+                    .HasColumnName("fuel_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Gender)
+                    .HasColumnName("gender")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Gift).HasColumnName("gift");
+
+                entity.Property(e => e.InvoiceBalance).HasColumnName("invoice_balance");
+
+                entity.Property(e => e.LastActiveDate).HasColumnName("last_active_date");
+
+                entity.Property(e => e.LastLevelUpTime).HasColumnName("last_level_up_time");
+
+                entity.Property(e => e.LastMembershipLevel).HasColumnName("last_membership_level");
+
+                entity.Property(e => e.MembershipLevel).HasColumnName("membership_level");
+
+                entity.Property(e => e.MembershipPoints)
+                    .HasColumnName("membership_points")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.NextLevelUpDateTime).HasColumnName("next_level_up_date_time");
+
+                entity.Property(e => e.OfflineTransferRemaining).HasColumnName("offline_transfer_remaining");
+
+                entity.Property(e => e.PassCode)
+                    .HasColumnName("pass_code")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Password)
+                    .HasColumnName("password")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.PhoneNo)
+                    .HasColumnName("phone_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.Portrait)
+                    .HasColumnName("portrait")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.RechargeTotal).HasColumnName("recharge_total");
+
+                entity.Property(e => e.TotalSpending)
+                    .HasColumnName("total_spending")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.TotalVolume)
+                    .HasColumnName("total_volume")
+                    .HasDefaultValueSql("0");
+
+                entity.Property(e => e.UnionId)
+                    .HasColumnName("union_id")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.UserId).HasColumnName("user_id");
+
+                entity.Property(e => e.UserInfoId).HasColumnName("user_info_id");
+
+                entity.Property(e => e.UserName)
+                    .HasColumnName("user_name")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.UserNo)
+                    .HasColumnName("user_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.UserState).HasColumnName("user_state");
+
+                entity.Property(e => e.UserType).HasColumnName("user_type");
+
+                entity.Property(e => e.VehicleLicenseNo)
+                    .HasColumnName("vehicle_license_no")
+                    .HasMaxLength(255);
+
+                entity.Property(e => e.VehicleModel)
+                    .HasColumnName("vehicle_model")
+                    .HasMaxLength(255);
+
+                entity.HasOne(d => d.BusinessUnitInfo)
+                    .WithMany(p => p.UserInfo)
+                    .HasForeignKey(d => d.BusinessUnitInfoId)
+                    .HasConstraintName("fksxb41p6dxyhjqm7r10vlxfd6g");
+
+                entity.HasOne(d => d.LastMembershipLevelNavigation)
+                    .WithMany(p => p.UserInfoLastMembershipLevelNavigation)
+                    .HasForeignKey(d => d.LastMembershipLevel)
+                    .HasConstraintName("user_info_last_membership_level_fkey");
+
+                entity.HasOne(d => d.MembershipLevelNavigation)
+                    .WithMany(p => p.UserInfoMembershipLevelNavigation)
+                    .HasForeignKey(d => d.MembershipLevel)
+                    .HasConstraintName("user_info_membership_level_fkey");
+
+                entity.HasOne(d => d.UserInfoNavigation)
+                    .WithMany(p => p.InverseUserInfoNavigation)
+                    .HasForeignKey(d => d.UserInfoId)
+                    .HasConstraintName("fk5ua5b6b1a136mgeuapq75epg");
+            });
+
+            modelBuilder.Entity<UserInfoMembershipGroups>(entity =>
+            {
+                entity.HasKey(e => new { e.UserInfoId, e.MembershipGroupId })
+                    .HasName("user_info_membership_groups_pkey");
+
+                entity.ToTable("user_info_membership_groups");
+
+                entity.Property(e => e.UserInfoId).HasColumnName("user_info_id");
+
+                entity.Property(e => e.MembershipGroupId).HasColumnName("membership_group_id");
+
+                entity.HasOne(d => d.MembershipGroup)
+                    .WithMany(p => p.UserInfoMembershipGroups)
+                    .HasForeignKey(d => d.MembershipGroupId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("user_info_membership_groups_membership_group_id_fkey");
+
+                entity.HasOne(d => d.UserInfo)
+                    .WithMany(p => p.UserInfoMembershipGroups)
+                    .HasForeignKey(d => d.UserInfoId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("user_info_membership_groups_user_info_id_fkey");
+            });
+
+            modelBuilder.Entity<UserMessages>(entity =>
+            {
+                entity.ToTable("user_messages");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .HasDefaultValueSql("uuid_generate_v4()");
+
+                entity.Property(e => e.AccountId).HasColumnName("account_id");
+
+                entity.Property(e => e.AccountType)
+                    .HasColumnName("account_type")
+                    .HasMaxLength(50);
+
+                entity.Property(e => e.CreatedAt)
+                    .HasColumnName("created_at")
+                    .HasDefaultValueSql("now()");
+
+                entity.Property(e => e.IsSmsSent).HasColumnName("is_sms_sent");
+
+                entity.Property(e => e.MessageContent).HasColumnName("message_content");
+
+                entity.Property(e => e.PhoneNumber)
+                    .HasColumnName("phone_number")
+                    .HasMaxLength(20);
+
+                entity.Property(e => e.SentTime).HasColumnName("sent_time");
+            });
+
+            modelBuilder.HasSequence("change_history_id_seq");
+
+            modelBuilder.HasSequence("fleet_card_recharge_history_id_seq");
+
+            OnModelCreatingPartial(modelBuilder);
+        }
+
+        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+    }
+}

+ 31 - 0
src/MS.WebApi/Models2/BlackCardInfo.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class BlackCardInfo
+    {
+        public Guid Id { get; set; }
+        public long? Gid { get; set; }
+        public string CardNo { get; set; }
+        public DateTime? BlackDate { get; set; }
+        public long? AcctGid { get; set; }
+        public string AcctId { get; set; }
+        public short? CardType { get; set; }
+        public short? DiscountNo { get; set; }
+        public string Reason { get; set; }
+        public short? UploadFlag { get; set; }
+        public short? BlackCardType { get; set; }
+        public bool? IsDeleted { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+    }
+}

+ 126 - 0
src/MS.WebApi/Models2/BusinessUnitInfo.cs

@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class BusinessUnitInfo
+    {
+        public BusinessUnitInfo()
+        {
+            AccountInfoBuInfoCreated = new HashSet<AccountInfo>();
+            AccountInfoBusinessUnitInfo = new HashSet<AccountInfo>();
+            BlackCardInfoBuInfo = new HashSet<BlackCardInfo>();
+            BlackCardInfoBuInfoCreated = new HashSet<BlackCardInfo>();
+            CardInfoBuInfoCreated = new HashSet<CardInfo>();
+            CardInfoBusinessUnitInfo = new HashSet<CardInfo>();
+            CardRepLossInfoBuInfo = new HashSet<CardRepLossInfo>();
+            CardRepLossInfoBuInfoCreated = new HashSet<CardRepLossInfo>();
+            GrayInfoBuInfo = new HashSet<GrayInfo>();
+            GrayInfoBuInfoCreated = new HashSet<GrayInfo>();
+            InverseBusinessUnitInfoNavigation = new HashSet<BusinessUnitInfo>();
+            InverseParentBu = new HashSet<BusinessUnitInfo>();
+            InvoiceInfoBuInfo = new HashSet<InvoiceInfo>();
+            InvoiceInfoBuInfoCreated = new HashSet<InvoiceInfo>();
+            MembershipGroupBuInfo = new HashSet<MembershipGroup>();
+            MembershipGroupBuInfoCreated = new HashSet<MembershipGroup>();
+            MembershipGrowthRulesBuInfo = new HashSet<MembershipGrowthRules>();
+            MembershipGrowthRulesBuInfoCreated = new HashSet<MembershipGrowthRules>();
+            MembershipLevelInfoBuInfo = new HashSet<MembershipLevelInfo>();
+            MembershipLevelInfoBuInfoCreated = new HashSet<MembershipLevelInfo>();
+            RechargePaymentHistory = new HashSet<RechargePaymentHistory>();
+            SmsInfoBuInfo = new HashSet<SmsInfo>();
+            SmsInfoBuInfoCreated = new HashSet<SmsInfo>();
+            UserInfo = new HashSet<UserInfo>();
+        }
+
+        public Guid Id { get; set; }
+        public string AreaType { get; set; }
+        public string BuAddress { get; set; }
+        public string BuName { get; set; }
+        public int? BuNo { get; set; }
+        public bool? CStore { get; set; }
+        public int? CanCount { get; set; }
+        public int? CanVolume { get; set; }
+        public bool? CarWash { get; set; }
+        public string Character { get; set; }
+        public int? ComCount { get; set; }
+        public int? DispenserCount { get; set; }
+        public string Email { get; set; }
+        public int? EmployeeCount { get; set; }
+        public string Fax { get; set; }
+        public string ImageLoyaltyRedemption { get; set; }
+        public string ImageMain { get; set; }
+        public string ImageMembershipCard { get; set; }
+        public string LinkMan { get; set; }
+        public string MembershipDescription { get; set; }
+        public string MembershipPrivacy { get; set; }
+        public string MembershipStatement { get; set; }
+        public string MerchantId { get; set; }
+        public string MerchantIpAddress { get; set; }
+        public string MerchantKey { get; set; }
+        public string MerchantSubId { get; set; }
+        public string MiniprogramAppid { get; set; }
+        public string MiniprogramAppSecret { get; set; }
+        public string Mobile { get; set; }
+        public int? NozzleCount { get; set; }
+        public string Online { get; set; }
+        public DateTime? OperationDate { get; set; }
+        public int? ParkingCount { get; set; }
+        public string Phone { get; set; }
+        public int? PosCount { get; set; }
+        public string PostCode { get; set; }
+        public string ReferenceBuId { get; set; }
+        public string Road { get; set; }
+        public int? RoadCount { get; set; }
+        public string ScaleType { get; set; }
+        public string ServiceProviderId { get; set; }
+        public bool? Wc { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+        public string DeviceSn { get; set; }
+        public string Password { get; set; }
+        public string UserName { get; set; }
+        public string WxNotifyPaymentUrl { get; set; }
+        public string WxNotifyRechargeUrl { get; set; }
+        public string WxNotifyShortCodeUrl { get; set; }
+        public string GpsCoordinates { get; set; }
+        public short? IcCardType { get; set; }
+        public bool? SmsPrimarySite { get; set; }
+        public bool? SmsEnabled { get; set; }
+        public int? SmsSentCount { get; set; }
+        public int? SmsRemainingCount { get; set; }
+        public string SmsMsgTemplate { get; set; }
+        public Guid? ParentBuId { get; set; }
+        public int? OfflineTransferCount { get; set; }
+
+        public virtual BusinessUnitInfo BusinessUnitInfoNavigation { get; set; }
+        public virtual BusinessUnitInfo ParentBu { get; set; }
+        public virtual ICollection<AccountInfo> AccountInfoBuInfoCreated { get; set; }
+        public virtual ICollection<AccountInfo> AccountInfoBusinessUnitInfo { get; set; }
+        public virtual ICollection<BlackCardInfo> BlackCardInfoBuInfo { get; set; }
+        public virtual ICollection<BlackCardInfo> BlackCardInfoBuInfoCreated { get; set; }
+        public virtual ICollection<CardInfo> CardInfoBuInfoCreated { get; set; }
+        public virtual ICollection<CardInfo> CardInfoBusinessUnitInfo { get; set; }
+        public virtual ICollection<CardRepLossInfo> CardRepLossInfoBuInfo { get; set; }
+        public virtual ICollection<CardRepLossInfo> CardRepLossInfoBuInfoCreated { get; set; }
+        public virtual ICollection<GrayInfo> GrayInfoBuInfo { get; set; }
+        public virtual ICollection<GrayInfo> GrayInfoBuInfoCreated { get; set; }
+        public virtual ICollection<BusinessUnitInfo> InverseBusinessUnitInfoNavigation { get; set; }
+        public virtual ICollection<BusinessUnitInfo> InverseParentBu { get; set; }
+        public virtual ICollection<InvoiceInfo> InvoiceInfoBuInfo { get; set; }
+        public virtual ICollection<InvoiceInfo> InvoiceInfoBuInfoCreated { get; set; }
+        public virtual ICollection<MembershipGroup> MembershipGroupBuInfo { get; set; }
+        public virtual ICollection<MembershipGroup> MembershipGroupBuInfoCreated { get; set; }
+        public virtual ICollection<MembershipGrowthRules> MembershipGrowthRulesBuInfo { get; set; }
+        public virtual ICollection<MembershipGrowthRules> MembershipGrowthRulesBuInfoCreated { get; set; }
+        public virtual ICollection<MembershipLevelInfo> MembershipLevelInfoBuInfo { get; set; }
+        public virtual ICollection<MembershipLevelInfo> MembershipLevelInfoBuInfoCreated { get; set; }
+        public virtual ICollection<RechargePaymentHistory> RechargePaymentHistory { get; set; }
+        public virtual ICollection<SmsInfo> SmsInfoBuInfo { get; set; }
+        public virtual ICollection<SmsInfo> SmsInfoBuInfoCreated { get; set; }
+        public virtual ICollection<UserInfo> UserInfo { get; set; }
+    }
+}

+ 58 - 0
src/MS.WebApi/Models2/CardInfo.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class CardInfo
+    {
+        public Guid Id { get; set; }
+        public string AccountId { get; set; }
+        public short? CardStatus { get; set; }
+        public int? CtcFlag { get; set; }
+        public string CtcTime { get; set; }
+        public short? CardClass { get; set; }
+        public string CardNo { get; set; }
+        public short? CardSno { get; set; }
+        public short? CardType { get; set; }
+        public string CarLicenseNo { get; set; }
+        public long? Gid { get; set; }
+        public string Holder { get; set; }
+        public int? PointsAwardedTotal { get; set; }
+        public DateTime? CreationDate { get; set; }
+        public int? Balance { get; set; }
+        public string OperatorNo { get; set; }
+        public DateTime? ExpirationDate { get; set; }
+        public string PhoneNo { get; set; }
+        public int? DepositBalance { get; set; }
+        public DateTime? ActivationDate { get; set; }
+        public string UserNo { get; set; }
+        public Guid? AccountInfoId { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+        public long? CardId { get; set; }
+        public long? RechargeTotal { get; set; }
+        public int? Ctc { get; set; }
+        public short? DMaxPay { get; set; }
+        public short? MMaxPay { get; set; }
+        public short? OnceMaxPay { get; set; }
+        public short? BLimitCar { get; set; }
+        public string EnableSms { get; set; }
+        public string UserPin { get; set; }
+        public short? Sno { get; set; }
+        public string LmtOil { get; set; }
+        public bool? LmtGood { get; set; }
+        public short? DiscountNo { get; set; }
+        public short? LimitTimes { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public short? UploadFlag { get; set; }
+        public long? Tmac { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual AccountInfo AccountInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+        public virtual BusinessUnitInfo BusinessUnitInfo { get; set; }
+    }
+}

+ 27 - 0
src/MS.WebApi/Models2/CardRepLossInfo.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class CardRepLossInfo
+    {
+        public Guid Id { get; set; }
+        public long? Gid { get; set; }
+        public string CardNo { get; set; }
+        public short? OperationType { get; set; }
+        public string OperatorNo { get; set; }
+        public int? Sno { get; set; }
+        public DateTime? LossTime { get; set; }
+        public string Reason { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+    }
+}

+ 19 - 0
src/MS.WebApi/Models2/ChangeHistory.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class ChangeHistory
+    {
+        public long Id { get; set; }
+        public short? TableName { get; set; }
+        public Guid? RecordId { get; set; }
+        public Guid? BuId { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public DateTime? LastModified { get; set; }
+    }
+}

+ 28 - 0
src/MS.WebApi/Models2/FleetCardRechargeHistory.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class FleetCardRechargeHistory
+    {
+        public long Id { get; set; }
+        public string AccountNo { get; set; }
+        public string AccountName { get; set; }
+        public string CardNo { get; set; }
+        public string CardHolder { get; set; }
+        public int? Amount { get; set; }
+        public Guid? AccountInfoId { get; set; }
+        public Guid? CardInfoId { get; set; }
+        public Guid? BuId { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public DateTime? LastModified { get; set; }
+        public DateTime? CreationTime { get; set; }
+        public bool? Deleted { get; set; }
+        public bool? Acknowledged { get; set; }
+        public int BatchNo { get; set; }
+    }
+}

+ 23 - 0
src/MS.WebApi/Models2/FlywaySchemaHistory.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class FlywaySchemaHistory
+    {
+        public int InstalledRank { get; set; }
+        public string Version { get; set; }
+        public string Description { get; set; }
+        public string Type { get; set; }
+        public string Script { get; set; }
+        public int? Checksum { get; set; }
+        public string InstalledBy { get; set; }
+        public DateTime InstalledOn { get; set; }
+        public int ExecutionTime { get; set; }
+        public bool Success { get; set; }
+    }
+}

+ 51 - 0
src/MS.WebApi/Models2/GrayInfo.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class GrayInfo
+    {
+        public Guid Id { get; set; }
+        public long? Gid { get; set; }
+        public int? Sno { get; set; }
+        public short? PumpType { get; set; }
+        public string CardNo { get; set; }
+        public short? PaymodeId { get; set; }
+        public short? TrdType { get; set; }
+        public string CommId { get; set; }
+        public long? Price { get; set; }
+        public int? Volume { get; set; }
+        public long? Money { get; set; }
+        public long? RealMoney { get; set; }
+        public long? CardBalance { get; set; }
+        public int? Ctc { get; set; }
+        public DateTime? TtcTime { get; set; }
+        public DateTime? TtcTimeEnd { get; set; }
+        public long? Ttc { get; set; }
+        public int? SequenceNo { get; set; }
+        public short? NozzleNo { get; set; }
+        public short? PumpNo { get; set; }
+        public long? PayTerminalId { get; set; }
+        public long? EndPump { get; set; }
+        public int? DiscountNo { get; set; }
+        public string PsamAsn { get; set; }
+        public long? PsamTac { get; set; }
+        public string PsamTid { get; set; }
+        public string PsamTtc { get; set; }
+        public long? Tac { get; set; }
+        public long? Gmac { get; set; }
+        public long? Tmac { get; set; }
+        public short? UploadFlag { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+        public bool? IsDeleted { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+    }
+}

+ 16 - 0
src/MS.WebApi/Models2/ImageInfo.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class ImageInfo
+    {
+        public Guid Id { get; set; }
+        public byte[] Image { get; set; }
+        public string ImageName { get; set; }
+    }
+}

+ 28 - 0
src/MS.WebApi/Models2/InvoiceInfo.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class InvoiceInfo
+    {
+        public Guid Id { get; set; }
+        public string CardNo { get; set; }
+        public int? Amount { get; set; }
+        public int? Balance { get; set; }
+        public DateTime? IssuedTimestamp { get; set; }
+        public string Comments { get; set; }
+        public Guid? UserInfoId { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+        public string PhoneNo { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+        public virtual UserInfo UserInfo { get; set; }
+    }
+}

+ 56 - 0
src/MS.WebApi/Models2/MembershipGroup.cs

@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class MembershipGroup
+    {
+        public MembershipGroup()
+        {
+            UserInfoMembershipGroups = new HashSet<UserInfoMembershipGroups>();
+        }
+
+        public Guid Id { get; set; }
+        public string GroupName { get; set; }
+        public string GroupId { get; set; }
+        public DateTime? CreationTime { get; set; }
+        public string Description { get; set; }
+        public int? GroupMemberLimit { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+        public Guid? MembershipLevel { get; set; }
+        public short? GroupType { get; set; }
+        public short? ConfigGender { get; set; }
+        public string ConfigLevel { get; set; }
+        public DateTime? ConfigCreationTimeFrom { get; set; }
+        public DateTime? ConfigCreationTimeTo { get; set; }
+        public bool? ConfigPhysicalCard { get; set; }
+        public string ConfigAppliedItems { get; set; }
+        public string ConfigStartTimeOfDay { get; set; }
+        public string ConfigEndTimeOfDay { get; set; }
+        public short? ConfigTimeOfDayCount { get; set; }
+        public string ConfigSpecifiedDateOfMonth { get; set; }
+        public short? ConfigSpecifiedDateOfMonthCount { get; set; }
+        public string ConfigSpecifiedDayOfWeek { get; set; }
+        public short? ConfigSpecifiedDayOfWeekCount { get; set; }
+        public long? ConfigEAccountBalanceFrom { get; set; }
+        public long? ConfigEAccountBalanceTo { get; set; }
+        public short? ConfigRfmRecencyBefore { get; set; }
+        public short? ConfigRfmFrequencyFrom { get; set; }
+        public short? ConfigRfmFrequencyTo { get; set; }
+        public int? ConfigRfmMonetaryAbove { get; set; }
+        public int? ConfigRfmMonetaryBelow { get; set; }
+        public DateTime? LastRefreshTime { get; set; }
+        public short? GroupStatus { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+        public virtual MembershipLevelInfo MembershipLevelNavigation { get; set; }
+        public virtual ICollection<UserInfoMembershipGroups> UserInfoMembershipGroups { get; set; }
+    }
+}

+ 24 - 0
src/MS.WebApi/Models2/MembershipGrowthRules.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class MembershipGrowthRules
+    {
+        public Guid Id { get; set; }
+        public short? GrowthType { get; set; }
+        public short? ValidateType { get; set; }
+        public DateTime? ValidBegin { get; set; }
+        public DateTime? ValidEnd { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+    }
+}

+ 42 - 0
src/MS.WebApi/Models2/MembershipLevelInfo.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class MembershipLevelInfo
+    {
+        public MembershipLevelInfo()
+        {
+            InverseNextLevel = new HashSet<MembershipLevelInfo>();
+            InverseUpperLevel = new HashSet<MembershipLevelInfo>();
+            MembershipGroup = new HashSet<MembershipGroup>();
+            UserInfoLastMembershipLevelNavigation = new HashSet<UserInfo>();
+            UserInfoMembershipLevelNavigation = new HashSet<UserInfo>();
+        }
+
+        public Guid Id { get; set; }
+        public string MembershipLevelId { get; set; }
+        public string LevelName { get; set; }
+        public int? LevelUpCondition { get; set; }
+        public int? LevelRetainCondition { get; set; }
+        public Guid? UpperLevelId { get; set; }
+        public Guid? NextLevelId { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+        public virtual MembershipLevelInfo NextLevel { get; set; }
+        public virtual MembershipLevelInfo UpperLevel { get; set; }
+        public virtual ICollection<MembershipLevelInfo> InverseNextLevel { get; set; }
+        public virtual ICollection<MembershipLevelInfo> InverseUpperLevel { get; set; }
+        public virtual ICollection<MembershipGroup> MembershipGroup { get; set; }
+        public virtual ICollection<UserInfo> UserInfoLastMembershipLevelNavigation { get; set; }
+        public virtual ICollection<UserInfo> UserInfoMembershipLevelNavigation { get; set; }
+    }
+}

+ 84 - 0
src/MS.WebApi/Models2/OfflineTransactionInfo.cs

@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class OfflineTransactionInfo
+    {
+        public Guid Id { get; set; }
+        public string AccountId { get; set; }
+        public int? Amount { get; set; }
+        public int? Balance { get; set; }
+        public string CarLicenseNo { get; set; }
+        public int? CardBalance { get; set; }
+        public string CardNo { get; set; }
+        public int? CardType { get; set; }
+        public string Comments { get; set; }
+        public int? DiscountNo { get; set; }
+        public string EmployeeNo { get; set; }
+        public int? GrossAmount { get; set; }
+        public short? InvoiceIssued { get; set; }
+        public string LineNo { get; set; }
+        public int? Mileage { get; set; }
+        public int? NozzleNo { get; set; }
+        public string Operator { get; set; }
+        public int? PayModeId { get; set; }
+        public string PayModeNo { get; set; }
+        public int? PaymentId { get; set; }
+        public int? PosId { get; set; }
+        public int? Price { get; set; }
+        public string ProductId { get; set; }
+        public int? PumpNo { get; set; }
+        public int? PumpType { get; set; }
+        public short? RechargeType { get; set; }
+        public int? SequenceNo { get; set; }
+        public DateTime? TransactionTime { get; set; }
+        public int? TransactionType { get; set; }
+        public DateTime? TrxEndTime { get; set; }
+        public string TrxOriginalId { get; set; }
+        public string TrxSequenceNo { get; set; }
+        public DateTime? TrxStartTime { get; set; }
+        public int? Volume { get; set; }
+        public Guid? AccountInfoId { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+        public Guid? CardInfoId { get; set; }
+        public long? ShiftId { get; set; }
+        public int? SubTransactionType { get; set; }
+        public long? EndTotalizer { get; set; }
+        public long? ReceiptNo { get; set; }
+        public int? CardSequenceNo { get; set; }
+        public short? InvoiceType { get; set; }
+        public string CommId { get; set; }
+        public string BarCode { get; set; }
+        public string FuelName { get; set; }
+        public long? Gid { get; set; }
+        public int? Sno { get; set; }
+        public string CarId { get; set; }
+        public int? Ctc { get; set; }
+        public long? PayTemId { get; set; }
+        public int? BillNo { get; set; }
+        public string PsamAsn { get; set; }
+        public string PsamTid { get; set; }
+        public long? Tac { get; set; }
+        public int? Integral { get; set; }
+        public int? Ttc { get; set; }
+        public short? BillType { get; set; }
+        public int? DisMoney { get; set; }
+        public int? DisIntegral { get; set; }
+        public long? PsamTac { get; set; }
+        public long? PsamTtc { get; set; }
+        public long? Gmac { get; set; }
+        public long? Tmac { get; set; }
+        public bool? SmsSent { get; set; }
+        public DateTime? LastModified { get; set; }
+        public string OperCardNo { get; set; }
+
+        public virtual AccountInfo AccountInfo { get; set; }
+        public virtual BusinessUnitInfo BusinessUnitInfo { get; set; }
+        public virtual CardInfo CardInfo { get; set; }
+    }
+}

+ 30 - 0
src/MS.WebApi/Models2/RechargePaymentHistory.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class RechargePaymentHistory
+    {
+        public Guid Id { get; set; }
+        public int? AccountBalance { get; set; }
+        public int? DiscountNo { get; set; }
+        public int? LoyaltyPointsAwarded { get; set; }
+        public int? LoyaltyPointsBalance { get; set; }
+        public string OperatorNo { get; set; }
+        public int? PaymentAmount { get; set; }
+        public int? RechargeAmount { get; set; }
+        public DateTime? TransactionDate { get; set; }
+        public int? TransactionType { get; set; }
+        public string TrxOriginalId { get; set; }
+        public string TrxSequenceNo { get; set; }
+        public Guid? AccountInfoId { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+
+        public virtual AccountInfo AccountInfo { get; set; }
+        public virtual BusinessUnitInfo BusinessUnitInfo { get; set; }
+    }
+}

+ 23 - 0
src/MS.WebApi/Models2/SmsInfo.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class SmsInfo
+    {
+        public Guid Id { get; set; }
+        public DateTime? CreationDate { get; set; }
+        public DateTime? ExpirationDate { get; set; }
+        public int? RechargeAmount { get; set; }
+        public Guid? BuInfoCreatedId { get; set; }
+        public Guid? BuInfoId { get; set; }
+        public DateTime? LastModified { get; set; }
+
+        public virtual BusinessUnitInfo BuInfo { get; set; }
+        public virtual BusinessUnitInfo BuInfoCreated { get; set; }
+    }
+}

+ 43 - 0
src/MS.WebApi/Models2/TransactionInfo.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class TransactionInfo
+    {
+        public Guid Id { get; set; }
+        public int? Amount { get; set; }
+        public string CarLicenseNo { get; set; }
+        public int? CardBalance { get; set; }
+        public string CardNo { get; set; }
+        public int? CardType { get; set; }
+        public int? DiscountNo { get; set; }
+        public string EmployeeNo { get; set; }
+        public string LineNo { get; set; }
+        public int? Mileage { get; set; }
+        public int? NozzleNo { get; set; }
+        public string Operator { get; set; }
+        public int? PayModeId { get; set; }
+        public string PayModeNo { get; set; }
+        public int? PaymentId { get; set; }
+        public int? PosId { get; set; }
+        public int? Price { get; set; }
+        public string ProductId { get; set; }
+        public int? PumpNo { get; set; }
+        public int? PumpType { get; set; }
+        public int? ReceiptNo { get; set; }
+        public int? SequenceNo { get; set; }
+        public int? ShiftId { get; set; }
+        public int? TransactionType { get; set; }
+        public string TrxOriginalId { get; set; }
+        public string TrxSequenceNo { get; set; }
+        public int? Volume { get; set; }
+        public Guid? AccountInfoId { get; set; }
+
+        public virtual AccountInfo AccountInfo { get; set; }
+    }
+}

+ 20 - 0
src/MS.WebApi/Models2/Trxtable.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class Trxtable
+    {
+        public string Ttc { get; set; }
+        public DateTime? Ttctime { get; set; }
+        public string Opercardno { get; set; }
+        public string Cardno { get; set; }
+        public int? Nozno { get; set; }
+        public int? Mon { get; set; }
+        public Guid? Buid { get; set; }
+    }
+}

+ 69 - 0
src/MS.WebApi/Models2/UserInfo.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class UserInfo
+    {
+        public UserInfo()
+        {
+            AccountInfo = new HashSet<AccountInfo>();
+            InverseUserInfoNavigation = new HashSet<UserInfo>();
+            InvoiceInfo = new HashSet<InvoiceInfo>();
+            UserInfoMembershipGroups = new HashSet<UserInfoMembershipGroups>();
+        }
+
+        public Guid Id { get; set; }
+        public string Address { get; set; }
+        public int? Amount { get; set; }
+        public DateTime? Birthday { get; set; }
+        public string BuId { get; set; }
+        public string BuString { get; set; }
+        public string CertificateNo { get; set; }
+        public string CertificateType { get; set; }
+        public DateTime? CreationDate { get; set; }
+        public bool? EnableSms { get; set; }
+        public string FuelNo { get; set; }
+        public string Gender { get; set; }
+        public int? Gift { get; set; }
+        public DateTime? LastActiveDate { get; set; }
+        public string PassCode { get; set; }
+        public string Password { get; set; }
+        public string PhoneNo { get; set; }
+        public string Portrait { get; set; }
+        public int? RechargeTotal { get; set; }
+        public string UnionId { get; set; }
+        public int? UserId { get; set; }
+        public string UserName { get; set; }
+        public string UserNo { get; set; }
+        public int? UserState { get; set; }
+        public int? UserType { get; set; }
+        public string VehicleLicenseNo { get; set; }
+        public string VehicleModel { get; set; }
+        public Guid? BusinessUnitInfoId { get; set; }
+        public Guid? UserInfoId { get; set; }
+        public string MembershipPoints { get; set; }
+        public Guid? MembershipLevel { get; set; }
+        public Guid? LastMembershipLevel { get; set; }
+        public DateTime? NextLevelUpDateTime { get; set; }
+        public long? TotalVolume { get; set; }
+        public long? TotalSpending { get; set; }
+        public string AliPayId { get; set; }
+        public DateTime? LastLevelUpTime { get; set; }
+        public int? InvoiceBalance { get; set; }
+        public int? OfflineTransferRemaining { get; set; }
+
+        public virtual BusinessUnitInfo BusinessUnitInfo { get; set; }
+        public virtual MembershipLevelInfo LastMembershipLevelNavigation { get; set; }
+        public virtual MembershipLevelInfo MembershipLevelNavigation { get; set; }
+        public virtual UserInfo UserInfoNavigation { get; set; }
+        public virtual ICollection<AccountInfo> AccountInfo { get; set; }
+        public virtual ICollection<UserInfo> InverseUserInfoNavigation { get; set; }
+        public virtual ICollection<InvoiceInfo> InvoiceInfo { get; set; }
+        public virtual ICollection<UserInfoMembershipGroups> UserInfoMembershipGroups { get; set; }
+    }
+}

+ 18 - 0
src/MS.WebApi/Models2/UserInfoMembershipGroups.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class UserInfoMembershipGroups
+    {
+        public Guid UserInfoId { get; set; }
+        public Guid MembershipGroupId { get; set; }
+
+        public virtual MembershipGroup MembershipGroup { get; set; }
+        public virtual UserInfo UserInfo { get; set; }
+    }
+}

+ 21 - 0
src/MS.WebApi/Models2/UserMessages.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
+// If you have enabled NRTs for your project, then un-comment the following line:
+// #nullable disable
+
+namespace MS.WebApi.Models2
+{
+    public partial class UserMessages
+    {
+        public Guid Id { get; set; }
+        public string PhoneNumber { get; set; }
+        public Guid? AccountId { get; set; }
+        public int? IsSmsSent { get; set; }
+        public DateTime? SentTime { get; set; }
+        public string AccountType { get; set; }
+        public string MessageContent { get; set; }
+        public DateTime? CreatedAt { get; set; }
+    }
+}

+ 10 - 10
src/MS.WebApi/appsettings.json

@@ -1,11 +1,11 @@
 {
   "ConectionStrings": {
     //"MSDbContext": "Server=pgm-wz9hvfon1ng52i39194070.pg.rds.aliyuncs.com;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141"
-    //"MSDbContext": "Server=47.101.220.106;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
-    //"AccountingService": "Server=47.101.220.106;database=AccountingService_Sun_0230AMMon03180930AM;port=5432;User Id=postgres;Password=Postgres3141",
-    //"AuthServiceDatabase": "Server=47.101.220.106;database=AuthServiceDatabase_NewThu04130311PM;port=5432;User Id=postgres;Password=Postgres3141",
-    //"StockdbDatabase": "Server=47.101.220.106;user=root;database=stockdb;port=3307;password=Wayne@123;SslMode=None",
-    //"WaynedbDatabase": "Server=47.101.220.106;user=root;database=waynedb;port=3307;password=Wayne@123;SslMode=None"
+    "MSDbContext": "Server=47.101.220.106;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
+    "AccountingService": "Server=47.101.220.106;database=AccountingService_Sun_0230AMMon03180930AM;port=5432;User Id=postgres;Password=Postgres3141;CommandTimeout=300;",
+    "AuthServiceDatabase": "Server=47.101.220.106;database=AuthServiceDatabase_NewThu04130311PM;port=5432;User Id=postgres;Password=Postgres3141",
+    "StockdbDatabase": "Server=47.101.220.106;user=root;database=stockdb;port=3307;password=Wayne@123;SslMode=None",
+    "WaynedbDatabase": "Server=47.101.220.106;user=root;database=waynedb;port=3307;password=Wayne@123;SslMode=None"
 
     //"MSDbContext": "Server=pgm-wz9hvfon1ng52i39194070.pg.rds.aliyuncs.com;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
     //"AccountingService": "Server=pgm-wz9hvfon1ng52i39194070.pg.rds.aliyuncs.com;database=AccountingService;port=5432;User Id=postgres;Password=Postgres3141",
@@ -13,11 +13,11 @@
     //"StockdbDatabase": "Server=localhost;user=root;database=stockdb;port=3307;password=Wayne@123;SslMode=None",
     //"WaynedbDatabase": "Server=localhost;user=root;database=waynedb;port=3307;password=Wayne@123;SslMode=None"
 
-    "MSDbContext": "Server=47.97.120.160;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
-    "AccountingService": "Server=47.97.120.160;database=AccountingService;port=5432;User Id=postgres;Password=Postgres3141",
-    "AuthServiceDatabase": "Server=47.97.120.160;database=AuthServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
-    "StockdbDatabase": "Server=47.97.120.160;user=root;database=stockdb;port=3307;password=Wayne@123;SslMode=None",
-    "WaynedbDatabase": "Server=47.97.120.160;user=root;database=waynedb;port=3307;password=Wayne@123;SslMode=None"
+    //"MSDbContext": "Server=47.97.120.160;database=TransactionServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
+    //"AccountingService": "Server=47.97.120.160;database=AccountingService;port=5432;User Id=postgres;Password=Postgres3141",
+    //"AuthServiceDatabase": "Server=47.97.120.160;database=AuthServiceDatabase;port=5432;User Id=postgres;Password=Postgres3141",
+    //"StockdbDatabase": "Server=47.97.120.160;user=root;database=stockdb;port=3307;password=Wayne@123;SslMode=None",
+    //"WaynedbDatabase": "Server=47.97.120.160;user=root;database=waynedb;port=3307;password=Wayne@123;SslMode=None"
   },
   "SiteSetting": {
     "WorkerId": 1, //for snowflake workerid

+ 13 - 6
src/MS.WebCore/Core/RedisExample.cs

@@ -4,6 +4,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Net;
+using System.Reflection;
 using System.Text;
 
 namespace MS.WebCore.Core
@@ -12,14 +13,14 @@ namespace MS.WebCore.Core
     {
         private static ConnectionMultiplexer redisConnection;
         private static IDatabase redisDb;
-       // string connectionString = "localhost,password=DFS2024@,db=0,connectTimeout=5000";
-        string connectionString = "localhost,password=DFS2024@";
+        //string connectionString = "localhost,password=DFS2024@,db=0,connectTimeout=5000";
+        //string connectionString = "localhost,password=DFS2024@";
 
-        public RedisExample()
+        public RedisExample(int dbIndex = 0)
         {
-
-            redisConnection = ConnectionMultiplexer.Connect(connectionString);
-           // redisConnection = ConnectionMultiplexer.Connect("localhost");
+            //string connectionString = $"localhost,db={dbIndex},connectTimeout=5000";
+            //redisConnection = ConnectionMultiplexer.Connect(connectionString);
+            redisConnection = ConnectionMultiplexer.Connect("localhost");
             redisDb = redisConnection.GetDatabase();
         }
 
@@ -130,6 +131,12 @@ namespace MS.WebCore.Core
 
             return result;
         }
+        public  List<string> GetListFromRedis(string listKey)
+        {
+            var redisValues = redisDb.ListRange(listKey);
+            return redisValues.Select(value => value.ToString()).ToList();
+        }
+
         public void AddToList(string key, string value)
         {
             RedisType keyType = redisDb.KeyType(key);

+ 24 - 0
src/MS.WebCore/Dto/PosTrxUnLockDto.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MS.WebCore.Dto
+{
+    public class PosTrxUnLockDto
+    {
+        public string userName { get; set; }
+        public string alias { get; set; }
+        public decimal? ttc { get; set; }
+        public decimal? releaseToken { get; set; }
+        public int nozzleNum { get; set; }
+        public string endTime { get; set; }
+        public string oilName { get; set; }
+        public decimal? volume { get; set; }
+        public decimal? amount { get; set; }
+        public string unLockTime { get; set; }
+        public string sn { get; set; }
+        public int? type { get; set; }
+        public string Comment { get; set; }
+        public string cancellation { get; set; }
+    }
+}

+ 27 - 0
src/QuartzSettings/logs/logs.txt

@@ -2064,3 +2064,30 @@
 {"TaskName":"111","GroupName":"111","BeginDate":"2024-05-27T21:19:21.7030678+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
 {"TaskName":"测试","GroupName":"测试","BeginDate":"2024-05-27T21:19:38.8719008+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
 {"TaskName":"111","GroupName":"111","BeginDate":"2024-05-27T21:19:38.9039453+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-05-30T14:35:18.3684063+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-05-30T14:35:18.4133396+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-05-30T15:00:15.1204309+08:00","EndDate":"2024-05-30T15:01:55.1618234+08:00","Msg":"The operation was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-05-30T15:00:30.1525616+08:00","EndDate":"2024-05-30T15:03:30.6231869+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-05-30T15:01:45.3238943+08:00","EndDate":"2024-05-30T15:04:00.6628704+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-05-30T15:18:06.7776208+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-05-30T15:18:06.8202651+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T11:52:26.4808389+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-10T11:52:26.5167135+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T11:56:31.8219831+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-10T11:56:31.8480366+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-10T12:00:10.1619571+08:00","EndDate":"2024-07-10T12:00:11.2063065+08:00","Msg":"true","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T12:00:10.1743056+08:00","EndDate":"2024-07-10T12:00:12.0140674+08:00","Msg":"{\"status\":501,\"data\":\"\\u670D\\u52A1\\u5668\\u51FA\\u9519\"}","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T12:00:10.1672649+08:00","EndDate":"2024-07-10T12:00:12.018156+08:00","Msg":"{\"status\":501,\"data\":\"\\u670D\\u52A1\\u5668\\u51FA\\u9519\"}","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T12:30:16.1143809+08:00","EndDate":"2024-07-10T12:32:46.6121831+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T12:30:31.1811641+08:00","EndDate":"2024-07-10T12:33:01.6257978+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T13:00:30.1417443+08:00","EndDate":"2024-07-10T13:03:00.5380128+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-10T13:00:15.0858434+08:00","EndDate":"2024-07-10T13:04:00.7055517+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T13:02:15.4538535+08:00","EndDate":"2024-07-10T13:04:30.7934971+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T13:30:16.0653917+08:00","EndDate":"2024-07-10T13:32:46.4945484+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T13:30:31.1435644+08:00","EndDate":"2024-07-10T13:33:01.5387277+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-10T13:37:49.0582482+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-10T13:37:49.0904929+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-18T14:23:24.7867248+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"111","GroupName":"111","BeginDate":"2024-07-18T14:23:24.8213898+08:00","EndDate":null,"Msg":"任务初始化启动成功:6","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-18T14:30:16.1576164+08:00","EndDate":"2024-07-18T14:32:46.6010474+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}
+{"TaskName":"测试","GroupName":"测试","BeginDate":"2024-07-18T14:30:31.180838+08:00","EndDate":"2024-07-18T14:33:01.6096908+08:00","Msg":"A task was canceled.","id":0,"timeflag":null,"changetime":null}

+ 1 - 1
src/QuartzSettings/task_job.json

@@ -1 +1 @@
-[{"TaskName":"测试","GroupName":"测试","Interval":"1-2 0/30 * * * ? ","ApiUrl":"http://localhost:8721/api/membershipGroup/UpdateAsync","Describe":null,"LastRunTime":"2023-05-30T11:00:50","Status":6,"TaskType":2,"ApiRequestType":"POST","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":1,"timeflag":null,"changetime":null},{"TaskName":"111","GroupName":"111","Interval":"0 0 0/1 * * ? ","ApiUrl":"http://localhost:8721/api/Account/AddEmployeeRedisAsync?buid=c75b2e74-d51e-42ae-bc89-2d39312c9c30&date=2020-09-01&Car=0","Describe":null,"LastRunTime":"2024-04-28T01:56:19","Status":6,"TaskType":2,"ApiRequestType":"GET","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":2,"timeflag":null,"changetime":null},{"TaskName":"永利加油站","GroupName":"\t 永利加油站","Interval":"* 0/24 * * * ? ","ApiUrl":"http://tkhs.net.cn:8721/api/Account/addredis?buid=c75b2e74-d51e-42ae-bc89-2d39312c9c30","Describe":null,"LastRunTime":null,"Status":4,"TaskType":2,"ApiRequestType":"GET","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":3,"timeflag":null,"changetime":null}]
+[{"TaskName":"永利加油站","GroupName":"\t 永利加油站","Interval":"* 0/24 * * * ? ","ApiUrl":"http://tkhs.net.cn:8721/api/Account/addredis?buid=c75b2e74-d51e-42ae-bc89-2d39312c9c30","Describe":null,"LastRunTime":null,"Status":4,"TaskType":2,"ApiRequestType":"GET","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":3,"timeflag":null,"changetime":null},{"TaskName":"测试","GroupName":"测试","Interval":"1-2 0/30 * * * ? ","ApiUrl":"http://localhost:8721/api/membershipGroup/UpdateAsync","Describe":null,"LastRunTime":"2023-05-30T11:00:50","Status":4,"TaskType":2,"ApiRequestType":"POST","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":1,"timeflag":null,"changetime":null},{"TaskName":"111","GroupName":"111","Interval":"0 0 0/1 * * ? ","ApiUrl":"http://localhost:8721/api/Account/AddEmployeeRedisAsync?buid=c75b2e74-d51e-42ae-bc89-2d39312c9c30&date=2020-09-01&Car=0","Describe":null,"LastRunTime":"2024-04-28T01:56:19","Status":4,"TaskType":2,"ApiRequestType":"GET","ApiAuthKey":null,"ApiAuthValue":null,"ApiParameter":null,"DllClassName":null,"DllActionName":null,"id":2,"timeflag":null,"changetime":null}]