Forráskód Böngészése

Merge branch 'feature-运营中心' into develop

lichunlei 2 éve
szülő
commit
3fd031a692
87 módosított fájl, 5676 hozzáadás és 225 törlés
  1. 446 49
      AppStart/Helper/AlipayPayBack2Service.cs
  2. 3 3
      AppStart/Helper/LeaderPrizeService.cs
  3. 83 0
      AppStart/Helper/Operate/OperateAmountService.cs
  4. 48 0
      AppStart/Helper/Operate/OperateStockService.cs
  5. 90 0
      AppStart/Helper/OperatePrizeService.cs
  6. 121 0
      AppStart/Helper/OperateService.cs
  7. 0 1
      AppStart/Helper/SetDepositPostService.cs
  8. 210 17
      AppStart/Helper/StatService.cs
  9. 9 13
      AppStart/Helper/SycnSpServer/SycnSpTradeService.cs
  10. 10 0
      AppStart/PublicFunction.cs
  11. 154 116
      AppStart/Timer/StoreApplyHelper.cs
  12. 26 1
      Controllers/HomeController.cs
  13. 22 0
      Models/HelpProfitMerTradeMonthSummay.cs
  14. 20 0
      Models/Leaders.cs
  15. 1 0
      Models/MachineApply.cs
  16. 1 0
      Models/Orders.cs
  17. 1 0
      Models/PosCouponRecord.cs
  18. 1 0
      Models/PosCoupons.cs
  19. 4 0
      Models/PosMachinesTwo.cs
  20. 1 0
      Models/StoreBalance.cs
  21. 1 0
      Models/StoreChangeHistory.cs
  22. 4 0
      Models/StoreHouse.cs
  23. 1 0
      Models/StoreStockChange.cs
  24. 1 0
      Models/UserAccount.cs
  25. 6 0
      Models/Users.cs
  26. 129 0
      Models/WebCMSEntities.cs
  27. 25 0
      OpModels/ActMerDaySummary.cs
  28. 25 0
      OpModels/ActMerMonthSummary.cs
  29. 26 0
      OpModels/Advertisment.cs
  30. 27 0
      OpModels/AmountRecord.cs
  31. 30 0
      OpModels/Col.cs
  32. 26 0
      OpModels/MachineApplyOpRecord.cs
  33. 11 0
      OpModels/MenuRight.cs
  34. 28 0
      OpModels/MsgBlackList.cs
  35. 34 0
      OpModels/MsgPersonal.cs
  36. 37 0
      OpModels/MsgPlacard.cs
  37. 25 0
      OpModels/MsgPlacardRead.cs
  38. 31 0
      OpModels/MsgPush.cs
  39. 38 0
      OpModels/MsgSms.cs
  40. 27 0
      OpModels/MsgSmsSet.cs
  41. 29 0
      OpModels/MsgTemplate.cs
  42. 11 0
      OpModels/OperateForCode.cs
  43. 26 0
      OpModels/OperateLog.cs
  44. 23 0
      OpModels/OperateRightList.cs
  45. 24 0
      OpModels/PageInfo.cs
  46. 25 0
      OpModels/PosCouponDaySummary.cs
  47. 24 0
      OpModels/PosCouponForOp.cs
  48. 25 0
      OpModels/PosCouponMonthSummary.cs
  49. 31 0
      OpModels/PosCouponOrders.cs
  50. 26 0
      OpModels/PosCouponRecord.cs
  51. 20 0
      OpModels/PosCoupons.cs
  52. 21 0
      OpModels/PosMachines.cs
  53. 45 0
      OpModels/PublicAccountSet.cs
  54. 19 0
      OpModels/RightDic.cs
  55. 25 0
      OpModels/SendDaySummary.cs
  56. 25 0
      OpModels/SendMonthSummary.cs
  57. 22 0
      OpModels/StoreActMerDaySummary.cs
  58. 22 0
      OpModels/StoreActMerMonthSummary.cs
  59. 23 0
      OpModels/StoreForOperate.cs
  60. 27 0
      OpModels/StoreMachineApply.cs
  61. 22 0
      OpModels/StoreSendDaySummary.cs
  62. 22 0
      OpModels/StoreSendMonthSummary.cs
  63. 35 0
      OpModels/SysAdmin.cs
  64. 24 0
      OpModels/SysAdminRole.cs
  65. 13 0
      OpModels/SysLog.cs
  66. 41 0
      OpModels/SystemSet.cs
  67. 26 0
      OpModels/UploadParams.cs
  68. 32 0
      OpModels/UserAccount.cs
  69. 33 0
      OpModels/UserAccountRecord.cs
  70. 42 0
      OpModels/UserCashRecord.cs
  71. 2885 0
      OpModels/WebCMSEntities.cs
  72. 22 0
      PxcModels/HelpProfitMerTradeMonthSummay.cs
  73. 20 0
      PxcModels/Leaders.cs
  74. 1 0
      PxcModels/MachineApply.cs
  75. 1 0
      PxcModels/Orders.cs
  76. 1 0
      PxcModels/PosCouponRecord.cs
  77. 1 0
      PxcModels/PosCoupons.cs
  78. 4 0
      PxcModels/PosMachinesTwo.cs
  79. 1 0
      PxcModels/StoreBalance.cs
  80. 1 0
      PxcModels/StoreChangeHistory.cs
  81. 4 0
      PxcModels/StoreHouse.cs
  82. 1 0
      PxcModels/StoreStockChange.cs
  83. 1 0
      PxcModels/UserAccount.cs
  84. 6 0
      PxcModels/Users.cs
  85. 129 0
      PxcModels/WebCMSEntities.cs
  86. 27 21
      Startup.cs
  87. 5 4
      appsettings.json

+ 446 - 49
AppStart/Helper/AlipayPayBack2Service.cs

@@ -205,10 +205,28 @@ namespace MySystem
                         {
                             //充值盟主储备金
                             OpReserve(db, order, order.UserId, order.TotalPrice, 1);
+                            Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
+                            if(pro.ProductId == 27)
+                            {
+                                OperateReserveBackFor(db, user.Id, order.TotalPrice);
+                                decimal Prize = decimal.Parse(function.CheckNum(PublicFunction.GetPublicParam(db, "BigLeaderPrize")));
+                                if(Prize > 0)
+                                {
+                                    LeaderRecommendPrize(db, order, user.Id, Prize, 122);
+                                }
+                            }
+
                         }
                         if (pro.ProductId == 28) //购买小盟主,给上级大盟主返储备金
                         {
                             LeaderBack(db, order);
+                            Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
+                            OperateReserveBackFor(db, user.Id, order.TotalPrice);
+                            decimal Prize = decimal.Parse(function.CheckNum(PublicFunction.GetPublicParam(db, "SmallLeaderPrize")));
+                            if(Prize > 0)
+                            {
+                                LeaderRecommendPrize(db, order, user.Id, Prize, 123);
+                            }
                         }
                     }
 
@@ -225,29 +243,22 @@ namespace MySystem
                             {
                                 bool directPrize = false; //直推奖标记
                                 bool bigLeaderPrize = false; //大盟主券标记
+                                bool operateFlag = false; //运营中心标记
                                 bool buyPrize = false; //返100购机奖励标记
+                                bool operatePrize = false; //返100购机奖励标记-运营中心
                                 int leaderFlag = 0; //返600备用金标记
-                                if(user.LeaderLevel > 0)
+                                if(user.LeaderLevel > 0 || user.UserType == 1) //盟主或运营中心
                                 {
-                                    UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId) ?? new UserAccount();
-                                    if(order.PayMode == 4)
+                                    if(user.LeaderLevel > 0)
                                     {
+                                        UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId) ?? new UserAccount();
                                         if(acccount.LeaderReserve >= order.TotalPrice)
                                         {
-                                            //扣减备用金
-                                            OpReserve(db, order, order.UserId, order.TotalPrice, 2, 0, "商城购机(储备金支付)");
-                                            //返回到余额
-                                            // OpAccount(db, order, order.UserId, order.TotalPrice / pro.ProductCount, pro.ProductCount);
-                                        }
-                                    }
-                                    else
-                                    {
-                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount)
-                                        {
-                                            //扣减备用金
-                                            OpReserve(db, order, order.UserId, 400 * pro.ProductCount, 2, 0, "商城购机");
-                                            //返回到余额
-                                            OpLeaderAccount(db, order, order.UserId, 400, pro.ProductCount);
+                                            if(order.PayMode == 4)
+                                            {
+                                                //扣减备用金
+                                                OpReserve(db, order, order.UserId, order.TotalPrice, 0, 0, "商城购机(储备金支付)");
+                                            }
                                         }
                                     }
                                     //获得100元奖励
@@ -265,7 +276,76 @@ namespace MySystem
                                         }
                                     }
                                     db.SaveChanges();
-                                    if(user.LeaderLevel == 2)
+                                    if(order.PayMode == 4 && user.LeaderLevel > 0) //使用盟主储蓄金,并且是盟主
+                                    {
+                                        if(user.UserType == 1)
+                                        {
+                                            if(couponIds.Count > 0)
+                                            {
+                                                UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == user.Id) ?? new UserAccount();
+                                                foreach(int couponId in couponIds)
+                                                {
+                                                    PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                    if(coupon != null)
+                                                    {
+                                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                        {
+                                                            coupon.LeaderUserId = user.Id;
+                                                        }
+                                                        coupon.OpId = user.Id;
+                                                    }
+                                                }
+                                            }
+                                            db.SaveChanges();
+                                        }
+                                        else
+                                        {
+                                            //寻找最近运营中心额度大于0的运营中心
+                                            int PUserId = user.Id;
+                                            bool OperateFlag = true;
+                                            while(PUserId > 0)
+                                            {
+                                                Users puser = db.Users.FirstOrDefault(m => m.Id == PUserId);
+                                                if(puser != null)
+                                                {
+                                                    if(puser.UserType == 1 && OperateFlag == true) //运营中心
+                                                    {
+                                                        if(couponIds.Count > 0)
+                                                        {
+                                                            UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId) ?? new UserAccount();
+                                                            foreach(int couponId in couponIds)
+                                                            {
+                                                                PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                                if(coupon != null)
+                                                                {
+                                                                    if(acccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                                    {
+                                                                        coupon.LeaderUserId = user.Id;
+                                                                    }
+                                                                    coupon.OpId = puser.Id;
+                                                                }
+                                                            }
+                                                            db.SaveChanges();
+                                                            if(acccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                            {
+                                                                //扣减备用金
+                                                                OpReserve(db, order, order.UserId, 400 * pro.ProductCount, 2, 0, "商城购机");
+                                                                //返回到余额
+                                                                OpLeaderAccount(db, order, order.UserId, 400, pro.ProductCount);
+                                                            }
+                                                            OperateFlag = false;
+                                                        }
+                                                    }
+                                                    PUserId = puser.ParentUserId;
+                                                }
+                                                else
+                                                {
+                                                    PUserId = 0;
+                                                }
+                                            }
+                                        }
+                                    }
+                                    else if(order.PayMode == 4 && user.UserType == 1) //使用盟主储蓄金,并且是运营中心
                                     {
                                         if(couponIds.Count > 0)
                                         {
@@ -274,36 +354,117 @@ namespace MySystem
                                                 PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
                                                 if(coupon != null)
                                                 {
-                                                    coupon.LeaderUserId = user.Id;
+                                                    coupon.OpId = user.Id;
                                                 }
                                             }
-                                            db.SaveChanges();
                                         }
+                                        db.SaveChanges();
+                                        //寻找最近储蓄金充足的大盟主
+                                        int PUserId = user.Id;
+                                        bool LeaderFlag = true;
+                                        while(PUserId > 0)
+                                        {
+                                            Users puser = db.Users.FirstOrDefault(m => m.Id == PUserId);
+                                            if(puser != null)
+                                            {
+                                                if(puser.LeaderLevel == 2 && LeaderFlag == true) //大盟主
+                                                {
+                                                    if(couponIds.Count > 0)
+                                                    {
+                                                        UserAccount pacccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
+                                                        foreach(int couponId in couponIds)
+                                                        {
+                                                            PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                            if(coupon != null && pacccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                            {
+                                                                coupon.LeaderUserId = puser.Id;
+                                                            }
+                                                        }
+                                                        db.SaveChanges();
+                                                        UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId) ?? new UserAccount();
+                                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                        {
+                                                            //扣减备用金
+                                                            OpReserve(db, order, order.UserId, 400 * pro.ProductCount, 2, 0, "商城购机");
+                                                            //返回到余额
+                                                            OpLeaderAccount(db, order, order.UserId, 400, pro.ProductCount);
+                                                        }
+                                                        LeaderFlag = false;
+                                                    }
+                                                }
+                                                PUserId = puser.ParentUserId;
+                                            }
+                                            else
+                                            {
+                                                PUserId = 0;
+                                            }
+                                        }
+                                    }
+                                    else
+                                    {
+                                        //寻找最近储蓄金充足的大盟主及最近运营中心额度大于0的运营中心(含自身)
+                                        int PUserId = user.Id;
+                                        int LeaderFlag = 0;
+                                        bool OperateFlag = true;
+                                        while(PUserId > 0)
+                                        {
+                                            Users puser = db.Users.FirstOrDefault(m => m.Id == PUserId);
+                                            if(puser != null)
+                                            {
+                                                if(puser.LeaderLevel > 0 && puser.LeaderLevel > LeaderFlag && LeaderFlag < 2) //大盟主
+                                                {
+                                                    if(couponIds.Count > 0)
+                                                    {
+                                                        if(puser.LeaderLevel == 2)
+                                                        {
+                                                            UserAccount pacccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
+                                                            foreach(int couponId in couponIds)
+                                                            {
+                                                                PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                                if(coupon != null && pacccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                                {
+                                                                    coupon.LeaderUserId = puser.Id;
+                                                                }
+                                                            }
+                                                            db.SaveChanges();
+                                                        }
+                                                        UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
+                                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount)
+                                                        {
+                                                            //扣减备用金
+                                                            OpReserve(db, order, puser.Id, 400 * pro.ProductCount, 2, 0, "商城购机");
+                                                            //返回到余额
+                                                            OpLeaderAccount(db, order, puser.Id, 400, pro.ProductCount);
+                                                            LeaderFlag = puser.LeaderLevel;
+                                                        }
+                                                    }
+                                                }
+                                                if(puser.UserType == 1 && OperateFlag == true) //运营中心
+                                                {
+                                                    if(couponIds.Count > 0)
+                                                    {
+                                                        foreach(int couponId in couponIds)
+                                                        {
+                                                            PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                            if(coupon != null)
+                                                            {
+                                                                coupon.OpId = puser.Id;
+                                                            }
+                                                        }
+                                                        db.SaveChanges();
+                                                        OperateFlag = false;
+                                                    }
+                                                }
+                                                PUserId = puser.ParentUserId;
+                                            }
+                                            else
+                                            {
+                                                PUserId = 0;
+                                            }
+                                        }
+                                        //运营中心返额度(下单人自己是运营中心)
+                                        OperateReserveBackFor(db, order.UserId, order.TotalPrice);
                                     }
-                                    // else
-                                    // {
-                                    //     int PUserId = user.ParentUserId;
-                                    //     while(PUserId > 0)
-                                    //     {
-                                    //         Users puser = db.Users.FirstOrDefault(m => m.Id == PUserId) ?? new Users();
-                                    //         if(puser.LeaderLevel == 2)
-                                    //         {
-                                    //             UserAccount acc = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
-                                    //             if(acc.LeaderReserve >= order.TotalPrice)
-                                    //             {
-                                    //                 //扣减备用金
-                                    //                 OpReserve(db, order, puser.Id, order.TotalPrice, 2, order.UserId, "购机奖励");
-                                    //                 //返回到余额
-                                    //                 OpLeaderAccount(db, order, puser.Id, order.TotalPrice / pro.ProductCount, pro.ProductCount);
-                                    //             }
-                                    //             PUserId = 0;
-                                    //         }
-                                    //         else
-                                    //         {
-                                    //             PUserId = puser.ParentUserId;
-                                    //         }
-                                    //     }
-                                    // }
                                     return;
                                 }
                                 int ParentUserId = user.ParentUserId;
@@ -365,7 +526,7 @@ namespace MySystem
                                             OpAccount(db, order, puser.Id, 100, pro.ProductCount);
                                             buyPrize = true;
                                         }
-                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount && leaderFlag == 0)
+                                        if(acccount.LeaderReserve >= 400 * pro.ProductCount && puser.LeaderLevel > leaderFlag && leaderFlag < 2)
                                         {
                                             //扣减备用金
                                             OpReserve(db, order, puser.Id, 400 * pro.ProductCount, 2, order.UserId, "购机奖励");
@@ -388,8 +549,34 @@ namespace MySystem
                                             bigLeaderPrize = true;
                                         }
                                     }
+                                    if(puser.UserType == 1)
+                                    {
+                                        UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
+                                        if(!operatePrize)
+                                        {
+                                            //购机奖励
+                                            ChangeAccount(db, order, puser.Id, 100 * pro.ProductCount, 120);
+                                            operatePrize = true;
+                                        }
+                                        //标记标签
+                                        if(couponIds.Count > 0 && !operateFlag)
+                                        {
+                                            foreach(int couponId in couponIds)
+                                            {
+                                                PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
+                                                if(coupon != null)
+                                                {
+                                                    coupon.OpId= puser.Id;
+                                                }
+                                            }
+                                            db.SaveChanges();
+                                            operateFlag = true;
+                                        }
+                                    }
                                     ParentUserId = puser.ParentUserId;
                                 }
+                                //运营中心返额度
+                                OperateReserveBackFor(db, order.UserId, order.TotalPrice);
                             }
                         }
                         function.WriteLog("\r\n\r\n", "推荐下单奖励监控日志");
@@ -450,15 +637,16 @@ namespace MySystem
                             {
                                 OpReserve(db, order, LeaderUserId, order.TotalPrice, 2, 0, "推荐小盟主");
                                 OpLeaderAccount(db, order, LeaderUserId, order.TotalPrice);
+                                LeaderUserId = 0;
                             }
                             else
                             {
-                                decimal LeaderReserve = account.LeaderReserve;
-                                OpReserve(db, order, LeaderUserId, LeaderReserve, 2, 0, "推荐小盟主");
-                                OpLeaderAccount(db, order, LeaderUserId, LeaderReserve);
+                                LeaderUserId = user.ParentUserId;
+                                // decimal LeaderReserve = account.LeaderReserve;
+                                // OpReserve(db, order, LeaderUserId, LeaderReserve, 2, 0, "推荐小盟主");
+                                // OpLeaderAccount(db, order, LeaderUserId, LeaderReserve);
                             }
                         }
-                        LeaderUserId = 0;
                     }
                     else
                     {
@@ -558,6 +746,43 @@ namespace MySystem
             }).Entity;
             db.SaveChanges();
         }
+        public void ChangeAccount(WebCMSEntities db, Orders order, int UserId, decimal Money, int ChangeType = 0)
+        {
+            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+            if (account == null)
+            {
+                account = db.UserAccount.Add(new UserAccount()
+                {
+                    Id = UserId,
+                    UserId = UserId,
+                }).Entity;
+                db.SaveChanges();
+            }
+            decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
+            decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
+            decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+            account.BalanceAmount += Money;
+            account.TotalAmount += Money;
+            decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
+            decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
+            decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+            UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
+            {
+                CreateDate = DateTime.Now,
+                UpdateDate = DateTime.Now,
+                UserId = UserId, //创客
+                ChangeType = ChangeType, //变动类型
+                ChangeAmount = Money, //变更金额
+                BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
+                AfterTotalAmount = AfterTotalAmount, //变更后总金额
+                BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
+                AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
+                BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                QueryCount = order.Id,
+            }).Entity;
+            db.SaveChanges();
+        }
         //操作盟主可提现余额
         public void OpLeaderAccount(WebCMSEntities db, Orders order, int UserId, decimal Money, int Count = 1)
         {
@@ -637,6 +862,178 @@ namespace MySystem
             RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
         }
 
+
+        //操作运营中心额度
+        public void OperateReserveBackFor(WebCMSEntities maindb, int UserId, decimal Money)
+        {
+            OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
+            while(UserId > 0)
+            {
+                Users user = maindb.Users.FirstOrDefault(m => m.Id == UserId);
+                if(user != null)
+                {
+                    bool sys = db.SysAdmin.Any(m => m.UserId == UserId);
+                    if(sys)
+                    {
+                        OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new OpModels.UserAccount();
+                        if(account.TotalAmt <= 0)
+                        {
+                            return;
+                        }
+                        if(account.TotalAmt < Money)
+                        {
+                            Money = account.TotalAmt;
+                        }
+                        if(Money > 0)
+                        {
+                            OperateAmountChange(db, UserId, Money, 2, 1, "商城购机");
+                            OperateAmountChange(db, UserId, Money, 1, 2, "商城购机");
+                        }
+                        UserId = 0;
+                    }
+                    else
+                    {
+                        UserId = user.ParentUserId;
+                    }
+                }
+                else
+                {
+                    UserId = 0;
+                }
+            }
+            db.Dispose();
+        }
+        public void OperateReserveBack(int UserId, decimal Money)
+        {
+            OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
+            OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new OpModels.UserAccount();
+            if(account.TotalAmt <= 0)
+            {
+                return;
+            }
+            if(account.TotalAmt < Money)
+            {
+                Money = account.TotalAmt;
+            }
+            if(Money > 0)
+            {
+                OperateAmountChange(db, UserId, Money, 2, 1, "商城购机");
+                OperateAmountChange(db, UserId, Money, 1, 2, "商城购机");
+            }
+            db.Dispose();
+        }
+        public void ActReserveBack(int UserId, decimal OpReserve1, decimal OpReserve2, decimal OpReserve3)
+        {
+            OpModels.WebCMSEntities db = new OpModels.WebCMSEntities();
+            if(OpReserve1 > 0) OperateAmountChange(db, UserId, OpReserve1, 1, 1, "机具激活", true);
+            if(OpReserve2 > 0) OperateAmountChange(db, UserId, OpReserve1, 1, 2, "机具激活", true);
+            if(OpReserve3 > 0) OperateAmountChange(db, UserId, OpReserve1, 1, 3, "机具激活", true);
+            db.Dispose();
+        }
+        public void OperateAmountChange(OpModels.WebCMSEntities db, int UserId, decimal Money, int OperateType, int AmountType, string Remark = "", bool record = false)
+        {
+            OpModels.UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+            if (account == null)
+            {
+                account = db.UserAccount.Add(new OpModels.UserAccount()
+                {
+                    Id = UserId,
+                    UserId = UserId,
+                }).Entity;
+                db.SaveChanges();
+            }
+            decimal BeforeAmount = 0; //变更前总金额
+            decimal AfterAmount = 0; //变更后总金额
+            if(OperateType == 1)
+            {
+                if(AmountType == 1)
+                {
+                    BeforeAmount = account.TotalAmt;
+                    account.TotalAmt += Money;
+                    AfterAmount = account.TotalAmt;
+                }
+                else if(AmountType == 2)
+                {
+                    BeforeAmount = account.ValidForGetAmount;
+                    account.ValidForGetAmount += Money;
+                    AfterAmount = account.ValidForGetAmount;
+                }
+                else
+                {
+                    BeforeAmount = account.ValidAmount;
+                    account.ValidAmount += Money;
+                    AfterAmount = account.ValidAmount;
+                }
+            }
+            else
+            {
+                if(AmountType == 1)
+                {
+                    BeforeAmount = account.TotalAmt;
+                    account.TotalAmt -= Money;
+                    AfterAmount = account.TotalAmt;
+                }
+                else if(AmountType == 2)
+                {
+                    BeforeAmount = account.ValidForGetAmount;
+                    account.ValidForGetAmount -= Money;
+                    AfterAmount = account.ValidForGetAmount;
+                }
+                else
+                {
+                    BeforeAmount = account.ValidAmount;
+                    account.ValidAmount -= Money;
+                    AfterAmount = account.ValidAmount;
+                }
+            }
+            if(record)
+            {
+                OpModels.AmountRecord add = db.AmountRecord.Add(new OpModels.AmountRecord()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    OperateType = OperateType,
+                    AfterAmount = AfterAmount,
+                    BeforeAmount = BeforeAmount,
+                    UseAmount = Money,
+                    UserId = UserId,
+                    SeoDescription = Remark,
+                    Version = AmountType,
+                }).Entity;
+            }
+            db.SaveChanges();
+        }
+
+        #endregion
+
+
+        #region 盟主推荐奖励
+
+        public void LeaderRecommendPrize(WebCMSEntities db, Orders order, int UserId, decimal Money, int ChangeType)
+        {
+            while(UserId > 0)
+            {
+                Users user = db.Users.FirstOrDefault(m => m.Id == UserId);
+                if(user != null)
+                {
+                    if(user.UserType == 1 || user.LeaderLevel > 0)
+                    {
+                        ChangeAccount(db, order, UserId, Money, ChangeType);
+                        UserId = 0;
+                    }
+                    else
+                    {
+                        UserId = user.ParentUserId;
+                    }
+                }
+                else
+                {
+                    UserId = 0;
+                }
+            }
+            db.Dispose();
+        }
+
         #endregion
 
     }

+ 3 - 3
AppStart/Helper/LeaderPrizeService.cs

@@ -50,8 +50,8 @@ namespace MySystem
                             decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
                             decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
                             decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
-                            account.BalanceAmount += 5;
-                            account.TotalAmount += 5;
+                            account.BalanceAmount += 10;
+                            account.TotalAmount += 10;
                             decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
                             decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
                             decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
@@ -61,7 +61,7 @@ namespace MySystem
                                 UpdateDate = DateTime.Now,
                                 UserId = LeaderUserId, //创客
                                 ChangeType = 116, //变动类型
-                                ChangeAmount = 5, //变更金额
+                                ChangeAmount = 10, //变更金额
                                 BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
                                 AfterTotalAmount = AfterTotalAmount, //变更后总金额
                                 BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额

+ 83 - 0
AppStart/Helper/Operate/OperateAmountService.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using LitJson;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.OpModels;
+
+namespace MySystem
+{
+    public class OperateAmountService
+    {
+        public readonly static OperateAmountService Instance = new OperateAmountService();
+        private OperateAmountService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(dosomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void dosomething()
+        {
+            while (true)
+            {
+                string data = RedisDbconn.Instance.RPop<string>("OperateAmountQueue");
+                if (!string.IsNullOrEmpty(data))
+                {
+                    try
+                    {
+                        WebCMSEntities db = new WebCMSEntities();
+                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + data + "\r\n\r\n", "运营中心返额度日志");
+                        JsonData jsonObj = JsonMapper.ToObject(data);
+                        int UserId = int.Parse(function.CheckInt(jsonObj["UserId"].ToString())); //运营中心所属人创客Id
+                        int DataId = int.Parse(function.CheckInt(jsonObj["DataId"].ToString())); //机具Id或机具券Id
+                        int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString())); //1-机具,2-机具券
+                        decimal Amount = decimal.Parse(function.CheckNum(jsonObj["Amount"].ToString()));
+                        
+                        UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+                        if (account == null)
+                        {
+                            account = db.UserAccount.Add(new UserAccount()
+                            {
+                                Id = UserId,
+                                UserId = UserId,
+                            }).Entity;
+                            db.SaveChanges();
+                        }
+                        decimal BeforeAmount = account.ValidAmount; //变更前总金额
+                        account.ValidAmount += Amount;
+                        decimal AfterAmount = account.ValidAmount; //变更后总金额
+                        AmountRecord add = db.AmountRecord.Add(new AmountRecord()
+                        {
+                            CreateDate = DateTime.Now,
+                            UpdateDate = DateTime.Now,
+                            OperateType = 1,
+                            AfterAmount = AfterAmount,
+                            BeforeAmount = BeforeAmount,
+                            UseAmount = Amount,
+                            UserId = UserId,
+                            ApplyId = DataId,
+                            SeoDescription = Kind == 1 ? "机具激活返还" : "机具券兑换返还",
+                        }).Entity;
+                        db.SaveChanges();
+
+                        db.Dispose();
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "运营中心返额度异常");
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(5000);
+                }
+            }
+        }
+    }
+}

+ 48 - 0
AppStart/Helper/Operate/OperateStockService.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using LitJson;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.OpModels;
+
+namespace MySystem
+{
+    public class OperateStockService
+    {
+        public readonly static OperateStockService Instance = new OperateStockService();
+        private OperateStockService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(dosomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void dosomething()
+        {
+            while (true)
+            {
+                try
+                {
+                    string sql = "";
+                    string conn = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                    DataTable dt = CustomerSqlConn.dtable("select UserId,sum(LaveNum)+(select count(Id) from PreSendStockDetail where FromUserId=s.UserId and `Status`>=0 and `Status`<=1 and ApplyFlag=0) from StoreHouse s where `Status`>-1 group by UserId", conn);
+                    foreach(DataRow dr in dt.Rows)
+                    {
+                        sql += "update Users set StoreStock=" + dr[1].ToString() + " where Id=" + dr["UserId"].ToString() + ";";
+                    }
+                    CustomerSqlConn.op(sql, conn);
+                }
+                catch (Exception ex)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "运营中心返额度异常");
+                }
+                Thread.Sleep(600000);
+            }
+        }
+    }
+}

+ 90 - 0
AppStart/Helper/OperatePrizeService.cs

@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using LitJson;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.PxcModels;
+
+namespace MySystem
+{
+    public class OperatePrizeService
+    {
+        public readonly static OperatePrizeService Instance = new OperatePrizeService();
+        private OperatePrizeService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(dosomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void dosomething()
+        {
+            while (true)
+            {
+                string data = RedisDbconn.Instance.RPop<string>("OperatePrizeQueue");
+                if (!string.IsNullOrEmpty(data))
+                {
+                    try
+                    {
+                        int PosId = int.Parse(function.CheckInt(data));
+                        WebCMSEntities db = new WebCMSEntities();
+                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
+                        if (pos != null)
+                        {
+                            int OpId = pos.OpId;
+                            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == OpId);
+                            if (account == null)
+                            {
+                                account = db.UserAccount.Add(new UserAccount()
+                                {
+                                    Id = OpId,
+                                    UserId = OpId,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
+                            decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
+                            decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                            account.BalanceAmount += 5;
+                            account.TotalAmount += 5;
+                            decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
+                            decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
+                            decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                            UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
+                            {
+                                CreateDate = DateTime.Now,
+                                UpdateDate = DateTime.Now,
+                                UserId = OpId, //创客
+                                ChangeType = 121, //变动类型
+                                ChangeAmount = 5, //变更金额
+                                BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
+                                AfterTotalAmount = AfterTotalAmount, //变更后总金额
+                                BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
+                                AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
+                                BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                                AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                                QueryCount = PosId,
+                            }).Entity;
+                            db.SaveChanges();
+                        }
+                        db.Dispose();
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "运营中心奖励异常");
+                    }
+                    Thread.Sleep(100);
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+        }
+    }
+}

+ 121 - 0
AppStart/Helper/OperateService.cs

@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.PxcModels;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 运营中心定时程序
+    /// </summary>
+    public class OperateService
+    {
+        public readonly static OperateService Instance = new OperateService();
+        private OperateService()
+        { }
+
+
+        #region 每天统计一次数据
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 4)
+                {
+                    try
+                    {
+                        string Month = DateTime.Now.ToString("yyyyMM");
+                        string Date = DateTime.Now.ToString("yyyyMMdd");
+                        string check = function.ReadInstance("/Operate/" + Month + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/Operate/", "" + Month + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
+
+                            //统计发货量
+                            Dictionary<int, int> OpData = new Dictionary<int, int>();
+                            if(DateTime.Now.Day == 1)
+                            {
+                                var list = opdb.SendMonthSummary.Select(m => new { m.TradeMonth, m.OpId, m.SendCount }).Where(m => m.TradeMonth == Month).ToList();
+                                foreach(var sub in list)
+                                {
+                                    if(OpData.ContainsKey(sub.OpId))
+                                    {
+                                        OpData[sub.OpId] += sub.SendCount;
+                                    }
+                                    else
+                                    {
+                                        OpData.Add(sub.OpId, sub.SendCount);
+                                    }
+                                }
+                                foreach(int OpId in OpData.Keys)
+                                {
+                                    Users user = db.Users.FirstOrDefault(m => m.Id == OpId);
+                                    if(user != null)
+                                    {
+                                        user.ThisMonthSend = OpData[OpId];
+                                    }
+                                }
+                                db.SaveChanges();
+                            }
+                            OpData.Clear();
+                            var datelist = opdb.SendDaySummary.Select(m => new { m.TradeDate, m.OpId, m.SendCount }).Where(m => m.TradeDate == Date).ToList();
+                            foreach(var sub in datelist)
+                            {
+                                if(OpData.ContainsKey(sub.OpId))
+                                {
+                                    OpData[sub.OpId] += sub.SendCount;
+                                }
+                                else
+                                {
+                                    OpData.Add(sub.OpId, sub.SendCount);
+                                }
+                            }
+                            foreach(int OpId in OpData.Keys)
+                            {
+                                Users user = db.Users.FirstOrDefault(m => m.Id == OpId);
+                                if(user != null)
+                                {
+                                    user.ThisMonthSend += OpData[OpId];
+                                }
+                            }
+                            db.SaveChanges();
+
+                            //统计库存
+                            Dictionary<int, int> StoreList = db.StoreHouse.Select(m => new { m.UserId, m.LaveNum }).Where(m => m.LaveNum > 0).GroupBy(m => m.UserId).Select(m => new { UserId = m.Key, Count = m.Count() }).ToDictionary(m => m.UserId, m => m.Count);
+                            foreach(int UserId in StoreList.Keys)
+                            {
+                                Users user = db.Users.FirstOrDefault(m => m.Id == UserId);
+                                if(user != null)
+                                {
+                                    user.StoreStock += StoreList[UserId];
+                                }
+                            }
+                            db.SaveChanges();
+
+                            opdb.Dispose();
+                            db.Dispose();
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "运营中心重置本月发货量异常");
+                    }
+                }
+                Thread.Sleep(800000);
+            }
+        }
+        #endregion
+    }
+}

+ 0 - 1
AppStart/Helper/SetDepositPostService.cs

@@ -125,7 +125,6 @@ namespace MySystem
                                         // 大POS
                                         // 大POS标准0.6:713806109336940544 
                                         // 大POS优惠0.6:713806774515802112 
-                                        // S0大pos不加:698228081038991360
 
                                         // 电签POS
                                         // 电签标准0.6:712391426860134400 

+ 210 - 17
AppStart/Helper/StatService.cs

@@ -33,8 +33,8 @@ namespace MySystem
                         StartEverDay(doDate);
                         // StartEverDayV2(doDate);
                         StatMerchantTrade(doDate);
-                        dosomething4(doDate);
-                        ListenFluxRecord(doDate);
+                        // dosomething4(doDate);
+                        // ListenFluxRecord(doDate);
                     }
                     // string Msg = "success";
                     // jobInfo.Status = Msg == "success" ? 1 : 0;
@@ -326,7 +326,7 @@ namespace MySystem
                 {
                     amt = 20;
                 }
-                else if(DateTime.Now > DateTime.Parse("2022-12-01 00:00:00") && DateTime.Now < DateTime.Parse("2023-01-01 00:00:00"))
+                else if(DateTime.Now > DateTime.Parse("2022-12-01 00:00:00") && DateTime.Now < DateTime.Parse("2023-03-01 00:00:00"))
                 {
                     amt = 10;
                 }
@@ -813,7 +813,7 @@ namespace MySystem
                                                 // 开机奖励详情
                                                 RedisDbconn.Instance.AddList("OpenRewardDetail:" + puser.Id + ":" + pos.BrandId + ":" + dateString, detail);
 
-                                                Prize -= 10;
+                                                Prize = 0;
                                             }
                                         }
                                     }
@@ -827,6 +827,189 @@ namespace MySystem
             db.Dispose();
         }
 
+        //实时获取开机奖励
+        public void StartOpenReward()
+        {
+            Thread th = new Thread(StartOpenRewardDo);
+            th.IsBackground = true;
+            th.Start();
+        }
+        public void StartOpenRewardDo()
+        {
+            string content = RedisDbconn.Instance.RPop<string>("OpenRewardQueue");
+            if(!string.IsNullOrEmpty(content))
+            {
+                try
+                {
+                    int PosId = int.Parse(content);
+                    WebCMSEntities db = new WebCMSEntities();
+                    List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.Id == PosId && m.ActivationState == 1 && !string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && m.CreditTrade >= 1000).ToList();
+                    foreach (PosMachinesTwo pos in posList)
+                    {
+                        if (pos.BindingTime > DateTime.Now.AddDays(-30))
+                        {
+                            decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
+                            if (ActPrize > 0)
+                            {
+                                PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
+                                if (merchant != null)
+                                {
+                                    Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
+                                    if (user != null)
+                                    {
+                                        if (!string.IsNullOrEmpty(user.ParentNav))
+                                        {
+                                            decimal Prize = 20;
+                                            string[] ParentNavs = user.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                                            for (int i = ParentNavs.Length - 1; i >= 0; i--)
+                                            {
+                                                int UserId = int.Parse(ParentNavs[i]);
+                                                Users puser = db.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1);
+                                                if (puser != null && Prize > 0)
+                                                {
+                                                    int machineCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.PosSnType == 0 && m.ActivationState == 0); //判断是否拥有3台购买机
+                                                    int ActiveCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.ActivationState == 1); //判断是否拥有3台激活机(不限购买或赠送)
+                                                    int couponCount = db.PosCoupons.Count(m => m.UserId == puser.Id && m.IsUse == 0); //判断是否拥有3张券
+                                                    // int BigCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.BrandId == 3); //判断是否拥有2台大机
+                                                    // int BigActiveCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.ActivationState == 1 && m.BrandId == 3); //判断是否拥有2台激活大机(不限购买或赠送)
+                                                    if (machineCount + ActiveCount + couponCount >= 3)
+                                                    {
+                                                        int pTopUserId = 0;
+                                                        if (!string.IsNullOrEmpty(puser.ParentNav))
+                                                        {
+                                                            pTopUserId = int.Parse(puser.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
+                                                        }
+                                                        Users machineUser = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
+                                                        OpenRewardDetail detail = db.OpenRewardDetail.Add(new OpenRewardDetail()
+                                                        {
+                                                            CreateDate = DateTime.Now,
+                                                            UpdateDate = DateTime.Now,
+                                                            TradeMonth = DateTime.Now.ToString("yyyyMM"), //交易月
+                                                            TradeDate = DateTime.Now, //达标日期
+                                                            UserId = puser.Id, //创客
+                                                            BrandId = pos.BrandId, //品牌
+                                                            ProductName = RelationClass.GetKqProductsInfo(pos.BrandId), //产品名称
+                                                            MerchantId = pos.BindMerchantId, //商户
+                                                            DirectUserId = merchant.UserId, //商户直属人
+                                                            SnNo = pos.PosSn, //SN号
+                                                            MerNo = merchant.KqMerNo, //渠道商户号
+                                                            SnType = pos.PosSnType, //机具类型
+                                                            StandardDate = pos.ActivationTime, //商户的激活日期
+                                                            SnStoreId = pos.StoreId, //SN仓库
+                                                            MerBuddyType = puser.MerchantType, //商户创客类型
+                                                            RewardType = 1, //奖励类型 1-开机直接奖励,2-开机间接奖励
+                                                            RewardTips = "开机奖励", //奖励描述
+                                                            CreditTradeAmt = pos.CreditTrade, //贷记卡交易总金额
+                                                            DebitTradeAmt = pos.DebitCardTrade, //借记卡交易总金额
+                                                            CreditRewardAmount = Prize, //贷记卡交易奖励金额
+                                                            RewardDesc = "开机奖励", //奖励描述
+                                                            TopUserId = pTopUserId, //顶级创客
+                                                            SeoTitle = machineUser.RealName,
+                                                        }).Entity;
+                                                        db.OpenReward.Add(new OpenReward()
+                                                        {
+                                                            CreateDate = DateTime.Now,
+                                                            UpdateDate = DateTime.Now,
+                                                            TradeMonth = DateTime.Now.ToString("yyyyMM"), //交易月
+                                                            TradeDate = DateTime.Now, //达标日期
+                                                            UserId = puser.Id, //创客
+                                                            BrandId = pos.BrandId, //品牌
+                                                            RewardType = 2, //奖励类型
+                                                            CreditTradeAmt = pos.CreditTrade, //贷记卡交易总金额
+                                                            DebitTradeAmt = pos.DebitCardTrade, //借记卡交易总金额
+                                                            CreditRewardAmount = Prize, //贷记卡交易奖励金额
+                                                            RewardDesc = "开机奖励", //奖励描述
+                                                            TopUserId = pTopUserId, //顶级创客
+                                                        });
+                                                        string IdBrand = puser.Id + "_" + pos.BrandId;
+                                                        UserMachineData userData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == IdBrand);
+                                                        if (userData == null)
+                                                        {
+                                                            userData = db.UserMachineData.Add(new UserMachineData()
+                                                            {
+                                                                IdBrand = IdBrand,
+                                                            }).Entity;
+                                                            db.SaveChanges();
+                                                        }
+                                                        userData.OpenProfit += Prize;
+                                                        db.SaveChanges();
+                                                        //账户入库
+                                                        UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id);
+                                                        if (account == null)
+                                                        {
+                                                            account = db.UserAccount.Add(new UserAccount()
+                                                            {
+                                                                Id = puser.Id,
+                                                                UserId = puser.Id,
+                                                            }).Entity;
+                                                            db.SaveChanges();
+                                                        }
+                                                        //收支明细入库
+                                                        decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
+                                                        decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
+                                                        decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                                                        account.BalanceAmount += Prize;
+                                                        account.TotalAmount += Prize;
+                                                        decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
+                                                        decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
+                                                        decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                                                        UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
+                                                        {
+                                                            CreateDate = DateTime.Now,
+                                                            UpdateDate = DateTime.Now,
+                                                            UserId = puser.Id, //创客
+                                                            ChangeType = 50, //变动类型
+                                                            ProductType = pos.BrandId, //产品类型
+                                                            ChangeAmount = Prize, //变更金额
+                                                            BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
+                                                            AfterTotalAmount = AfterTotalAmount, //变更后总金额
+                                                            BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
+                                                            AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
+                                                            BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                                                            AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                                                        }).Entity;
+                                                        db.SaveChanges();
+
+                                                        string dateString = DateTime.Now.ToString("yyyyMMdd");
+                                                        string monthString = DateTime.Now.ToString("yyyyMM");
+                                                        // 开机奖励列表
+                                                        List<string> dates = RedisDbconn.Instance.GetList<string>("OpenRewardDay:" + puser.Id + ":" + pos.BrandId);
+                                                        if (!dates.Contains(dateString))
+                                                        {
+                                                            RedisDbconn.Instance.AddList("OpenRewardDay:" + puser.Id + ":" + pos.BrandId, dateString);
+                                                        }
+                                                        RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + dateString, Prize);
+
+                                                        List<string> months = RedisDbconn.Instance.GetList<string>("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId);
+                                                        if (!months.Contains(monthString))
+                                                        {
+                                                            RedisDbconn.Instance.AddList("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId, monthString);
+                                                        }
+                                                        RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + monthString, Prize);
+
+                                                        // 开机奖励详情
+                                                        RedisDbconn.Instance.AddList("OpenRewardDetail:" + puser.Id + ":" + pos.BrandId + ":" + dateString, detail);
+
+                                                        Prize = 0;
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                    // }
+                                }
+                            }
+                        }
+                    }
+                    db.Dispose();
+                }
+                catch(Exception ex)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "实时获取开机奖励异常");
+                }
+            }
+        }
+
         public void dosomething42(string date)
         {
             WebCMSEntities db = new WebCMSEntities();
@@ -1000,20 +1183,30 @@ namespace MySystem
 
 
         // 4. 前一天的流量卡记录和匹配
-        public void ListenFluxRecord(string date)
+        public void ListenFluxRecord()
         {
-            Thread th = new Thread(CheckFluxForTrade);
+            Thread th = new Thread(ListenFluxRecordD0);
             th.IsBackground = true;
-            th.Start(date);
+            th.Start();
         }
-        public void doFluxRecord(string date)
+        public void ListenFluxRecordD0()
+        {
+            while(true)
+            {
+                if(DateTime.Now.Hour > 0)
+                {
+                    CheckFluxForTrade();
+                }
+                Thread.Sleep(600000);
+            }
+        }
+        public void doFluxRecord()
         {
             function.WriteLog(DateTime.Now.ToString(), "执行流量费返佣");
             SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
             WebCMSEntities db = new WebCMSEntities();
-            DateTime yesterday = DateTime.Parse(date + " 00:00:00");
-            DateTime today = DateTime.Parse(DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00");
-            List<SpModels.TradeFluxRecord> trades = spdb.TradeFluxRecord.Where(m => m.CreateDate >= yesterday && m.CreateDate < today && m.Status == 1).ToList();
+            DateTime start = DateTime.Now.AddDays(-1);
+            List<SpModels.TradeFluxRecord> trades = spdb.TradeFluxRecord.Where(m => m.CreateDate >= start && m.Status == 1).ToList();
             foreach (SpModels.TradeFluxRecord trade in trades)
             {
                 try
@@ -1173,15 +1366,13 @@ namespace MySystem
             db.Dispose();
             function.WriteLog(DateTime.Now.ToString() + "\n", "执行流量费返佣");
         }
-        public void CheckFluxForTrade(object sender)
+        public void CheckFluxForTrade()
         {
-            string date = sender.ToString();
             function.WriteLog(DateTime.Now.ToString(), "扫描金控交易记录中的流量费");
             SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
-            DateTime start = DateTime.Parse(date + " 00:00:00");
-            DateTime end = start.AddDays(1);
+            DateTime start = DateTime.Now.AddDays(-1);
             int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
-            var list = spdb.TradeRecord.Select(m => new { m.Id, m.CreateDate, m.ProductType }).Where(m => m.Id >= StartId && m.CreateDate > start && m.CreateDate < end && m.ProductType == "1").OrderBy(m => m.CreateDate);
+            var list = spdb.TradeRecord.Select(m => new { m.Id, m.CreateDate, m.ProductType, m.Status }).Where(m => m.Id >= StartId && m.Status == 2 && m.CreateDate > start && m.ProductType == "1").OrderBy(m => m.CreateDate);
             foreach (var sub in list.ToList())
             {
                 try
@@ -1210,6 +1401,8 @@ namespace MySystem
                                 spdb.SaveChanges();
                             }
                         }
+                        trade.Status = 3;
+                        spdb.SaveChanges();
                     }
                 }
                 catch (Exception ex)
@@ -1220,7 +1413,7 @@ namespace MySystem
             spdb.Dispose();
             function.WriteLog(DateTime.Now.ToString() + "\n", "扫描金控交易记录中的流量费");
 
-            doFluxRecord(date);
+            doFluxRecord();
         }
 
 

+ 9 - 13
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -264,21 +264,8 @@ namespace MySystem
                                         {
                                             pos.DebitCardTrade += TradeAmount;
                                         }
-                                        // if (pos.CreditTrade < CheckMoney)
-                                        // {
-                                        //     decimal deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                                        //     if (deposit > 0 && pos.IsPurchase != 1)
-                                        //     {
-                                        //         pos.IsPurchase = 0;
-                                        //     }
-                                        // }
                                         if (pos.CreditTrade >= CheckMoney && pos.ActivationState == 0 && pos.TransferTime < pos.BindingTime && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
                                         {
-                                            // decimal deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                                            // if (deposit == 0 && pos.IsPurchase != 1)
-                                            // {
-                                            //     pos.IsPurchase = 0;
-                                            // }
                                             pos.ActivationState = 1;
                                             pos.ActivationTime = DateTime.Now;
                                             PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
@@ -291,12 +278,21 @@ namespace MySystem
                                                 // 推荐王逻辑(激活)
                                                 string SendData = "{\"Kind\":\"3\",\"Data\":{\"UserId\":\"" + pos.BuyUserId + "\",\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + DateTime.Now.ToString("yyyyMM") + "\"}}";
                                                 RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
+
+                                                //发放开机奖励
+                                                RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
                                             }
                                             //发放大盟主奖励
                                             if(pos.LeaderUserId > 0)
                                             {
                                                 RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
                                             }
+                                            //发放运营中心奖励
+                                            if(pos.OpId > 0)
+                                            {
+                                                RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
+                                                AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
+                                            }
                                         }
                                         // 立刷60天内刷满10000,再返40
                                         if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0 && pos.ActivationState == 1 && pos.CreditTrade >= 10000 && pos.BindingTime > DateTime.Now.AddDays(-60))

+ 10 - 0
AppStart/PublicFunction.cs

@@ -27,5 +27,15 @@ namespace MySystem
             }
             return decimal.Parse(str);
         }
+
+        public static string GetPublicParam(WebCMSEntities db, string Key)
+        {
+            CustomTagSet set = db.CustomTagSet.FirstOrDefault(m => m.Tags == Key);
+            if(set != null)
+            {
+                return set.Contents;
+            }
+            return "";
+        }
     }
 }

+ 154 - 116
AppStart/Timer/StoreApplyHelper.cs

@@ -31,7 +31,6 @@ public class StoreApplyHelper
         while (true)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
             try
             {
                 if(DateTime.Now.Day == 1 && DateTime.Now.Hour > 0 && DateTime.Now.Hour < 3)
@@ -40,121 +39,7 @@ public class StoreApplyHelper
                     if(string.IsNullOrEmpty(check))
                     {
                         function.WritePage("/StoreApply/", DateTime.Now.ToString("yyyyMM") + ".txt", DateTime.Now.ToString());
-                        Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
-                        string pre = DateTime.Now.AddMonths(-2).ToString("yyyy-MM") + "-01 00:00:00";
-                        string start = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00";
-                        string end = DateTime.Parse(start).AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
-                        //上月出货额度
-                        DataTable dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (1,2,4,6,7,8) and TransType in (10,11,2) and StoreId>0 group by StoreId");
-                        foreach(DataRow dr in dt.Rows)
-                        {
-                            int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
-                            int Count = int.Parse(function.CheckInt(dr[1].ToString()));
-                            decimal AmountMore = Count * 200;
-                            StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
-                            if(!dataDic.ContainsKey(store.UserId))
-                            {
-                                dataDic.Add(store.UserId, AmountMore);
-                            }
-                            else
-                            {
-                                dataDic[store.UserId] += AmountMore;
-                            }
-                        }
-                        dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (3,5,9) and TransType in (10,11,2) and StoreId>0 group by StoreId");
-                        foreach(DataRow dr in dt.Rows)
-                        {
-                            int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
-                            int Count = int.Parse(function.CheckInt(dr[1].ToString()));
-                            decimal AmountMore = Count * 300;
-                            StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
-                            if(!dataDic.ContainsKey(store.UserId))
-                            {
-                                dataDic.Add(store.UserId, AmountMore);
-                            }
-                            else
-                            {
-                                dataDic[store.UserId] += AmountMore;
-                            }
-                        }
-                        //上月没出货的创库
-                        string ids = "0";
-                        foreach(int UserId in dataDic.Keys)
-                        {
-                            ids += "," + UserId;
-                        }
-                        DataTable dts = OtherMySqlConn.dtable("select distinct UserId from StoreHouse where UserId not in (" + ids + ") and Status>-1");
-                        foreach(DataRow dr in dts.Rows)
-                        {
-                            int UserId = int.Parse(function.CheckInt(dr[0].ToString()));
-                            if(!dataDic.ContainsKey(UserId))
-                            {
-                                dataDic.Add(UserId, 0);
-                            }
-                        }
-                        foreach(int UserId in dataDic.Keys)
-                        {
-                            decimal Amount = dataDic[UserId];
-                            //上月出货额度与保底额度之间取较高值
-                            if(Amount < 10000 && SpecialUsers10000().Contains(UserId))
-                            {
-                                Amount = 10000;
-                            }
-                            else if(Amount < 20000 && !SpecialUsers0().Contains(UserId))
-                            {
-                                Amount = 20000;
-                            }
-                            //被担保额度
-                            decimal PromissAmount = 0;
-                            dt = OtherMySqlConn.dtable("select PromissAmount from StoreHouseAmountPromiss where ToUserId=" + UserId + " and Status=1");
-                            foreach(DataRow dr in dt.Rows)
-                            {
-                                PromissAmount += decimal.Parse(function.CheckNum(dr["PromissAmount"].ToString()));
-                            }
-                            decimal AmountMore = 0;
-                            //仓库中机具占用额度+小分仓机具占用额度
-                            DataTable dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1");
-                            if(dtmore.Rows.Count > 0)
-                            {
-                                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            }
-                            dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1");
-                            if(dtmore.Rows.Count > 0)
-                            {
-                                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            }
-                            //除开小分仓中带“授”标记机具占用额度
-                            dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2");
-                            if(dtmore.Rows.Count > 0)
-                            {
-                                AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            }
-                            dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2");
-                            if(dtmore.Rows.Count > 0)
-                            {
-                                AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            }
-                            //申请补货订单占用额度
-                            dt = OtherMySqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0");
-                            foreach(DataRow dr in dt.Rows)
-                            {
-                                AmountMore += decimal.Parse(function.CheckNum(dr["UseAmount"].ToString()));
-                            }
-                            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
-                            if (account == null)
-                            {
-                                account = db.UserAccount.Add(new UserAccount()
-                                {
-                                    Id = UserId,
-                                    UserId = UserId,
-                                }).Entity;
-                                db.SaveChanges();
-                            }
-                            account.FixedAmount = Amount;
-                            account.ValidAmount = Amount + PromissAmount + account.TempAmount - AmountMore;
-                            function.WriteLog("UserId:" + UserId + ";FixedAmount:" + account.FixedAmount + ";AmountMore:" + AmountMore + ";ValidAmount:" + account.ValidAmount, "计算分仓申请机具额度日志");
-                        }
-                        db.SaveChanges();
+                        DoSomething(db);
                     }
                 }
             }
@@ -168,6 +53,159 @@ public class StoreApplyHelper
         }
     }
 
+    public void ResetStoreReserve()
+    {
+        Thread th = new Thread(ResetStoreReserveDo);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void ResetStoreReserveDo()
+    {
+        while (true)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            try
+            {
+                string data = RedisDbconn.Instance.RPop<string>("ResetStoreReserveQueue");
+                if(!string.IsNullOrEmpty(data))
+                {
+                    int UserId = int.Parse(data);
+                    if(UserId > 0) DoSomething(db, UserId);
+                }
+            }
+            catch(Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "重置分仓额度异常");
+            }
+            db.Dispose();
+        }
+    }
+
+    public void DoSomething(WebCMSEntities db, int UId = 0)
+    {
+        string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+        Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
+        string pre = DateTime.Now.AddMonths(-2).ToString("yyyy-MM") + "-01 00:00:00";
+        string start = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00";
+        string end = DateTime.Parse(start).AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
+        string condition = "";
+        string usercondition = "";
+        if(UId > 0)
+        {
+            condition = " and StoreId in (select Id from StoreHouse where UserId=" + UId + ")";
+            usercondition = " and UserId=" + UId;
+        }
+        //上月出货额度
+        DataTable dt = CustomerSqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (1,2,4,6,7,8) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId", connstr);
+        foreach(DataRow dr in dt.Rows)
+        {
+            int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
+            int Count = int.Parse(function.CheckInt(dr[1].ToString()));
+            decimal AmountMore = Count * 200;
+            StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
+            if(!dataDic.ContainsKey(store.UserId))
+            {
+                dataDic.Add(store.UserId, AmountMore);
+            }
+            else
+            {
+                dataDic[store.UserId] += AmountMore;
+            }
+        }
+        dt = CustomerSqlConn.dtable("select StoreId,count(Id) from StoreStockChange where Id>=528358 and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (3,5,9) and TransType in (10,11,2) and StoreId>0" + condition + " group by StoreId", connstr);
+        foreach(DataRow dr in dt.Rows)
+        {
+            int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
+            int Count = int.Parse(function.CheckInt(dr[1].ToString()));
+            decimal AmountMore = Count * 300;
+            StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
+            if(!dataDic.ContainsKey(store.UserId))
+            {
+                dataDic.Add(store.UserId, AmountMore);
+            }
+            else
+            {
+                dataDic[store.UserId] += AmountMore;
+            }
+        }
+        //上月没出货的创库
+        string ids = "0";
+        foreach(int UserId in dataDic.Keys)
+        {
+            ids += "," + UserId;
+        }
+        DataTable dts = CustomerSqlConn.dtable("select distinct UserId from StoreHouse where UserId not in (" + ids + ")" + usercondition + " and Status>-1", connstr);
+        foreach(DataRow dr in dts.Rows)
+        {
+            int UserId = int.Parse(function.CheckInt(dr[0].ToString()));
+            if(!dataDic.ContainsKey(UserId))
+            {
+                dataDic.Add(UserId, 0);
+            }
+        }
+        foreach(int UserId in dataDic.Keys)
+        {
+            decimal Amount = dataDic[UserId];
+            //上月出货额度与保底额度之间取较高值,保底额度为押金的两倍                            
+            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+            if (account == null)
+            {
+                account = db.UserAccount.Add(new UserAccount()
+                {
+                    Id = UserId,
+                    UserId = UserId,
+                }).Entity;
+                db.SaveChanges();
+            }
+            decimal StoreDeposit = account.StoreDeposit;
+            if(Amount < StoreDeposit * 2)
+            {
+                Amount = StoreDeposit * 2;
+            }
+            //被担保额度
+            decimal PromissAmount = 0;
+            dt = CustomerSqlConn.dtable("select PromissAmount from StoreHouseAmountPromiss where ToUserId=" + UserId + " and Status=1", connstr);
+            foreach(DataRow dr in dt.Rows)
+            {
+                PromissAmount += decimal.Parse(function.CheckNum(dr["PromissAmount"].ToString()));
+            }
+            decimal AmountMore = 0;
+            //仓库中机具占用额度+小分仓机具占用额度
+            DataTable dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1", connstr);
+            if(dtmore.Rows.Count > 0)
+            {
+                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+            }
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1", connstr);
+            if(dtmore.Rows.Count > 0)
+            {
+                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+            }
+            //除开小分仓中带“授”标记机具占用额度
+            dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
+            if(dtmore.Rows.Count > 0)
+            {
+                AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+            }
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
+            if(dtmore.Rows.Count > 0)
+            {
+                AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+            }
+            //申请补货订单占用额度
+            dt = CustomerSqlConn.dtable("select UseAmount from StoreMachineApply where UserId=" + UserId + " and Status=0", connstr);
+            foreach(DataRow dr in dt.Rows)
+            {
+                AmountMore += decimal.Parse(function.CheckNum(dr["UseAmount"].ToString()));
+            }
+            account.FixedAmount = Amount;
+            account.ValidAmount = Amount + PromissAmount + account.TempAmount - AmountMore;
+            function.WriteLog("UserId:" + UserId + ";FixedAmount:" + account.FixedAmount + ";AmountMore:" + AmountMore + ";ValidAmount:" + account.ValidAmount, "计算分仓申请机具额度日志");
+        }
+        db.SaveChanges();
+    }
+
     public void StartEverTime()
     {
         Thread th = new Thread(StartEverTimeDo);

+ 26 - 1
Controllers/HomeController.cs

@@ -1244,7 +1244,8 @@ namespace MySystem.Controllers
             // {
             //     content += SetDepositPostService.Instance.ModifyFee(snno, 0.0006M) + "\n";
             // }
-            content = SetDepositPostService.Instance.SetFeeForSft("38888910", "0.63");
+            // content = SetDepositPostService.Instance.SetFeeForSft("38888910", "0.63");
+            // content = SetDepositPostService.Instance.SetFeeForBrand("00003202D9625450004213", bzConfigId, yhConfigId, surfeeConfigId, "");
             return content;
         }
 
@@ -1262,5 +1263,29 @@ namespace MySystem.Controllers
             return "ok";
         }
     
+
+        public string test3(string sn)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            // StoreApplyHelper.Instance.DoSomething(db, 89);
+            // AlipayPayBack2Service.Instance.DoOrderV2(db, 94559);
+            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == sn);
+            if(pos != null)
+            {
+                //发放大盟主奖励
+                if(pos.LeaderUserId > 0)
+                {
+                    RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
+                }
+                //发放运营中心奖励
+                if(pos.OpId > 0)
+                {
+                    RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
+                    AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
+                }
+            }
+            db.Dispose();
+            return "ok";
+        }
     }
 }

+ 22 - 0
Models/HelpProfitMerTradeMonthSummay.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class HelpProfitMerTradeMonthSummay
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 20 - 0
Models/Leaders.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class Leaders
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int LeaderLevel { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 1 - 0
Models/MachineApply.cs

@@ -55,5 +55,6 @@ namespace MySystem.Models
         public int BrandId { get; set; }
         public int UserId { get; set; }
         public string ApplyNo { get; set; }
+        public int OperateId { get; set; }
     }
 }

+ 1 - 0
Models/Orders.cs

@@ -64,5 +64,6 @@ namespace MySystem.Models
         public string OrderNo { get; set; }
         public int UserId { get; set; }
         public int ParentOrderId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/PosCouponRecord.cs

@@ -19,5 +19,6 @@ namespace MySystem.Models
         public int ToUserId { get; set; }
         public int FromUserId { get; set; }
         public int PosCouponId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/PosCoupons.cs

@@ -23,5 +23,6 @@ namespace MySystem.Models
         public int HelpProfitMerchantId { get; set; }
         public int HelpProfitStatus { get; set; }
         public ulong HelpProfitFlag { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 4 - 0
Models/PosMachinesTwo.cs

@@ -52,5 +52,9 @@ namespace MySystem.Models
         public DateTime? UpFeeDate { get; set; }
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
+        public int OpId { get; set; }
+        public decimal OpReserve3 { get; set; }
+        public decimal OpReserve2 { get; set; }
+        public decimal OpReserve1 { get; set; }
     }
 }

+ 1 - 0
Models/StoreBalance.cs

@@ -29,5 +29,6 @@ namespace MySystem.Models
         public int TransType { get; set; }
         public string TransRecordNo { get; set; }
         public int StoreId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/StoreChangeHistory.cs

@@ -37,5 +37,6 @@ namespace MySystem.Models
         public string ChangeRecordNo { get; set; }
         public int BrandId { get; set; }
         public int UserId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 4 - 0
Models/StoreHouse.cs

@@ -39,5 +39,9 @@ namespace MySystem.Models
         public string StoreNo { get; set; }
         public DateTime? AuthDate { get; set; }
         public ulong AuthFlag { get; set; }
+        public int ThisMonthSendCount { get; set; }
+        public string FilePath { get; set; }
+        public decimal Deposit { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/StoreStockChange.cs

@@ -44,5 +44,6 @@ namespace MySystem.Models
         public string ProductName { get; set; }
         public int BrandId { get; set; }
         public int StoreId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/UserAccount.cs

@@ -42,5 +42,6 @@ namespace MySystem.Models
         public decimal ThisMonthPreAmount { get; set; }
         public decimal ValidPreAmount { get; set; }
         public decimal SmallStoreDeposit { get; set; }
+        public decimal StoreDeposit { get; set; }
     }
 }

+ 6 - 0
Models/Users.cs

@@ -88,5 +88,11 @@ namespace MySystem.Models
         public string DeviceType { get; set; }
         public DateTime? HelpProfitAgreeDate { get; set; }
         public ulong HelpProfitAgree { get; set; }
+        public int ThisMonthSend { get; set; }
+        public int StoreStock { get; set; }
+        public DateTime? CreateStoreDate { get; set; }
+        public ulong IsSign { get; set; }
+        public DateTime? SignDate { get; set; }
+        public string SignPic { get; set; }
     }
 }

+ 129 - 0
Models/WebCMSEntities.cs

@@ -56,6 +56,7 @@ namespace MySystem.Models
         public virtual DbSet<HelpProfitExchange> HelpProfitExchange { get; set; }
         public virtual DbSet<HelpProfitExchangeDetail> HelpProfitExchangeDetail { get; set; }
         public virtual DbSet<HelpProfitMerIds> HelpProfitMerIds { get; set; }
+        public virtual DbSet<HelpProfitMerTradeMonthSummay> HelpProfitMerTradeMonthSummay { get; set; }
         public virtual DbSet<HelpProfitMerTradeSummay> HelpProfitMerTradeSummay { get; set; }
         public virtual DbSet<HelpProfitMerchantForUser> HelpProfitMerchantForUser { get; set; }
         public virtual DbSet<HelpProfitRebateDetail> HelpProfitRebateDetail { get; set; }
@@ -68,6 +69,7 @@ namespace MySystem.Models
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
+        public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
         public virtual DbSet<MachineApplyDetail> MachineApplyDetail { get; set; }
         public virtual DbSet<MachineChange> MachineChange { get; set; }
@@ -3144,6 +3146,47 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<HelpProfitMerTradeMonthSummay>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<HelpProfitMerTradeSummay>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -3996,6 +4039,40 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<Leaders>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<MachineApply>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -4066,6 +4143,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OperateId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderExpand)
                     .HasColumnType("mediumtext")
                     .HasCharSet("utf8")
@@ -7757,6 +7836,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -8178,6 +8259,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -8240,6 +8323,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.LeaderUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -8524,6 +8609,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.LeaderUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.OpReserve1).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.OpReserve2).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.OpReserve3).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosSn)
@@ -12590,6 +12683,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OpStoreNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.OpSymbol)
@@ -12684,6 +12779,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -12801,6 +12898,13 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Deposit).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.FilePath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.LaveNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.LimitTopUserId)
@@ -12820,6 +12924,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OutNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.ParentNav)
@@ -12876,6 +12982,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.StoreType).HasColumnType("int(11)");
 
+                entity.Property(e => e.ThisMonthSendCount).HasColumnType("int(11)");
+
                 entity.Property(e => e.TotalNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
@@ -13263,6 +13371,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.ProductName)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")
@@ -14998,6 +15108,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.StoreDeposit).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.TeamTotalOverProfit).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.TeamTotalProfit).HasColumnType("decimal(18,2)");
@@ -17653,6 +17765,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.CreateStoreDate).HasColumnType("datetime");
+
                 entity.Property(e => e.DeviceId)
                     .HasColumnType("varchar(128)")
                     .HasCharSet("utf8")
@@ -17705,6 +17819,10 @@ namespace MySystem.Models
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.IsSign)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
                 entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
 
                 entity.Property(e => e.LockStatus)
@@ -17833,20 +17951,31 @@ namespace MySystem.Models
 
                 entity.Property(e => e.Sex).HasColumnType("int(11)");
 
+                entity.Property(e => e.SignDate).HasColumnType("datetime");
+
                 entity.Property(e => e.SignImgUrl)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SignPic)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.StoreStock).HasColumnType("int(11)");
+
                 entity.Property(e => e.Tags)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ThisMonthSend).HasColumnType("int(11)");
+
                 entity.Property(e => e.ThisMonthTrade).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");

+ 25 - 0
OpModels/ActMerDaySummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class ActMerDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 25 - 0
OpModels/ActMerMonthSummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class ActMerMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 26 - 0
OpModels/Advertisment.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class Advertisment
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Url { get; set; }
+        public string Contents { get; set; }
+        public string PicPath { get; set; }
+        public string ColId { get; set; }
+        public string Title { get; set; }
+    }
+}

+ 27 - 0
OpModels/AmountRecord.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class AmountRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int OperateType { get; set; }
+        public decimal AfterAmount { get; set; }
+        public decimal BeforeAmount { get; set; }
+        public decimal UseAmount { get; set; }
+        public int ApplyId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 30 - 0
OpModels/Col.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class Col
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ParentId { get; set; }
+        public string Url { get; set; }
+        public string Contents { get; set; }
+        public string ColEnName { get; set; }
+        public ulong Recommend { get; set; }
+        public string ColDetail { get; set; }
+        public string ColPicPath { get; set; }
+        public string ColName { get; set; }
+        public string ColId { get; set; }
+    }
+}

+ 26 - 0
OpModels/MachineApplyOpRecord.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MachineApplyOpRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int OpType { get; set; }
+        public string TargetSn { get; set; }
+        public string SourceSn { get; set; }
+        public int ApplyId { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 11 - 0
OpModels/MenuRight.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MenuRight
+    {
+        public string MenuId { get; set; }
+        public string Name { get; set; }
+    }
+}

+ 28 - 0
OpModels/MsgBlackList.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgBlackList
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Extend { get; set; }
+        public string Remark { get; set; }
+        public string Reason { get; set; }
+        public string Ip { get; set; }
+        public string Mobile { get; set; }
+        public int TemplateId { get; set; }
+        public string ColId { get; set; }
+    }
+}

+ 34 - 0
OpModels/MsgPersonal.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgPersonal
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Remark { get; set; }
+        public string ExtendColumn { get; set; }
+        public string PushParam { get; set; }
+        public ulong ReadFlag { get; set; }
+        public int PushFlag { get; set; }
+        public string Summary { get; set; }
+        public string Url { get; set; }
+        public string Content { get; set; }
+        public string Title { get; set; }
+        public string BgPic { get; set; }
+        public int MsgType { get; set; }
+        public int UserId { get; set; }
+        public int TemplateId { get; set; }
+    }
+}

+ 37 - 0
OpModels/MsgPlacard.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgPlacard
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Url { get; set; }
+        public string Remark { get; set; }
+        public string ExtendColumn { get; set; }
+        public DateTime? PushTime { get; set; }
+        public string PushParam { get; set; }
+        public int PushFlag { get; set; }
+        public int PushType { get; set; }
+        public string BgPic { get; set; }
+        public DateTime? EffectEndDate { get; set; }
+        public DateTime? EffectStartDate { get; set; }
+        public int ShowType { get; set; }
+        public ulong IsTop { get; set; }
+        public string Content { get; set; }
+        public string Summary { get; set; }
+        public string Title { get; set; }
+        public int MsgType { get; set; }
+    }
+}

+ 25 - 0
OpModels/MsgPlacardRead.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgPlacardRead
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Remark { get; set; }
+        public ulong ReadFlag { get; set; }
+        public string UserId { get; set; }
+        public int PlacardId { get; set; }
+    }
+}

+ 31 - 0
OpModels/MsgPush.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgPush
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Mobiles { get; set; }
+        public string MessageId { get; set; }
+        public DateTime? AutoPushDate { get; set; }
+        public int TemplateId { get; set; }
+        public string Devices { get; set; }
+        public ulong IsSilent { get; set; }
+        public string Details { get; set; }
+        public string Title { get; set; }
+        public string Url { get; set; }
+        public string ClientType { get; set; }
+    }
+}

+ 38 - 0
OpModels/MsgSms.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgSms
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendStatus { get; set; }
+        public string Kind { get; set; }
+        public int Code { get; set; }
+        public int VerifyStatus { get; set; }
+        public int ErrorNum { get; set; }
+        public string VerifyCode { get; set; }
+        public string RespCode { get; set; }
+        public string RespContent { get; set; }
+        public DateTime? SendTime { get; set; }
+        public string SignName { get; set; }
+        public string Content { get; set; }
+        public int SmsType { get; set; }
+        public int SendType { get; set; }
+        public string Ip { get; set; }
+        public string Mobile { get; set; }
+        public int TemplateId { get; set; }
+        public string ColId { get; set; }
+    }
+}

+ 27 - 0
OpModels/MsgSmsSet.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgSmsSet
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Params { get; set; }
+        public string ReqUrl { get; set; }
+        public int SmsType { get; set; }
+        public string AuthPwd { get; set; }
+        public string UserName { get; set; }
+        public string Name { get; set; }
+    }
+}

+ 29 - 0
OpModels/MsgTemplate.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class MsgTemplate
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string SignName { get; set; }
+        public string Extend { get; set; }
+        public string Remark { get; set; }
+        public int MsgType { get; set; }
+        public int TemplateType { get; set; }
+        public string ColId { get; set; }
+        public string Content { get; set; }
+        public string Title { get; set; }
+    }
+}

+ 11 - 0
OpModels/OperateForCode.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class OperateForCode
+    {
+        public string OpCode { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 26 - 0
OpModels/OperateLog.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class OperateLog
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string OpMode { get; set; }
+        public string AfterOperate { get; set; }
+        public string BeforeOperate { get; set; }
+        public string OperateMan { get; set; }
+        public string TableEnName { get; set; }
+    }
+}

+ 23 - 0
OpModels/OperateRightList.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class OperateRightList
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string EnName { get; set; }
+        public string Name { get; set; }
+    }
+}

+ 24 - 0
OpModels/PageInfo.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PageInfo
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Contents { get; set; }
+        public string ColId { get; set; }
+        public string Title { get; set; }
+    }
+}

+ 25 - 0
OpModels/PosCouponDaySummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCouponDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SaleCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 24 - 0
OpModels/PosCouponForOp.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCouponForOp
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int OutNum { get; set; }
+        public int TotalNum { get; set; }
+        public int StockNum { get; set; }
+    }
+}

+ 25 - 0
OpModels/PosCouponMonthSummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCouponMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SaleCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 31 - 0
OpModels/PosCouponOrders.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCouponOrders
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ChangeKind { get; set; }
+        public int ChangeCount { get; set; }
+        public int AfterOut { get; set; }
+        public int AfterTotal { get; set; }
+        public int AfterStock { get; set; }
+        public int BeforeOut { get; set; }
+        public int BeforeTotal { get; set; }
+        public int BeforeStock { get; set; }
+        public string OrderNo { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 26 - 0
OpModels/PosCouponRecord.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCouponRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ChangeKind { get; set; }
+        public string OrderNo { get; set; }
+        public int ToUserId { get; set; }
+        public int FromUserId { get; set; }
+        public int PosCouponId { get; set; }
+    }
+}

+ 20 - 0
OpModels/PosCoupons.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCoupons
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int PosCouponId { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 21 - 0
OpModels/PosMachines.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosMachines
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int PosId { get; set; }
+        public int OpId { get; set; }
+        public int BrandId { get; set; }
+    }
+}

+ 45 - 0
OpModels/PublicAccountSet.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PublicAccountSet
+    {
+        public int Id { get; set; }
+        public string AliyunAndroidActivity { get; set; }
+        public string AliyunAndroidNotifyTitle { get; set; }
+        public string AliyunRegionId { get; set; }
+        public string SmsApiDefaultTemplate { get; set; }
+        public string SmsApiUserId { get; set; }
+        public string SmsApiSign { get; set; }
+        public string SmsApiPwd { get; set; }
+        public string ErpAppCode { get; set; }
+        public string ErpApiUrl { get; set; }
+        public string MeiQiaAppKey { get; set; }
+        public string MobAppSecret { get; set; }
+        public string MobAppKey { get; set; }
+        public string AliyunPushIosAppSecret { get; set; }
+        public string AliyunPushIosAppId { get; set; }
+        public string AliyunPushAndroidAppSecret { get; set; }
+        public string AliyunPushAndroidAppId { get; set; }
+        public string AliyunAccessKeySecret { get; set; }
+        public string AliyunAccessKeyId { get; set; }
+        public string QqIosAppKey { get; set; }
+        public string QqIosAppId { get; set; }
+        public string QqAndroidAppKey { get; set; }
+        public string QqAndroidAppId { get; set; }
+        public string WeChatMiniAppSecret { get; set; }
+        public string WeChatMiniAppId { get; set; }
+        public string ServerIp { get; set; }
+        public string WeChatOpenAppSecret { get; set; }
+        public string WeChatOpenAppId { get; set; }
+        public string WeChatPayKey { get; set; }
+        public string WeChatMchId { get; set; }
+        public string WeChatAppSecret { get; set; }
+        public string WeChatAppId { get; set; }
+        public string AlipayPublicKey { get; set; }
+        public string AlipayPrivateKey { get; set; }
+        public string AlipayPartnerId { get; set; }
+        public string AlipayAppId { get; set; }
+    }
+}

+ 19 - 0
OpModels/RightDic.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class RightDic
+    {
+        public string Id { get; set; }
+        public string Icon { get; set; }
+        public string Name { get; set; }
+        public string Url { get; set; }
+        public int RightLevel { get; set; }
+        public int Sort { get; set; }
+        public ulong MainMenu { get; set; }
+        public ulong MainStat { get; set; }
+        public ulong MainDataList { get; set; }
+        public string OtherRight { get; set; }
+    }
+}

+ 25 - 0
OpModels/SendDaySummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SendDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 25 - 0
OpModels/SendMonthSummary.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SendMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreActMerDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreActMerMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 23 - 0
OpModels/StoreForOperate.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreForOperate
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int StoreId { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 27 - 0
OpModels/StoreMachineApply.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreMachineApply
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int UserId { get; set; }
+        public string SendSn { get; set; }
+        public string ErpCode { get; set; }
+        public string SendMode { get; set; }
+        public decimal UseAmount { get; set; }
+        public int SendNum { get; set; }
+        public int ApplyNum { get; set; }
+        public string ApplyNo { get; set; }
+        public int BrandId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendDaySummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendMonthSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 35 - 0
OpModels/SysAdmin.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SysAdmin
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string HeadPhoto { get; set; }
+        public string OpCode { get; set; }
+        public int StoreCount { get; set; }
+        public string FilePath { get; set; }
+        public string MakerMobile { get; set; }
+        public string MakerName { get; set; }
+        public string MakerCode { get; set; }
+        public int UserId { get; set; }
+        public DateTime? LastLoginDate { get; set; }
+        public string Role { get; set; }
+        public string RealName { get; set; }
+        public string Password { get; set; }
+        public string AdminName { get; set; }
+        public int TotalMachineCount { get; set; }
+    }
+}

+ 24 - 0
OpModels/SysAdminRole.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SysAdminRole
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string RightInfo { get; set; }
+        public string Details { get; set; }
+        public string Name { get; set; }
+    }
+}

+ 13 - 0
OpModels/SysLog.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SysLog
+    {
+        public int Id { get; set; }
+        public string Contents { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public string CreateMan { get; set; }
+    }
+}

+ 41 - 0
OpModels/SystemSet.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class SystemSet
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string StartAdPhoto { get; set; }
+        public int UploadAutoZoomQuality { get; set; }
+        public ulong UploadOss { get; set; }
+        public string Logo { get; set; }
+        public string WebStatCode { get; set; }
+        public string Phone { get; set; }
+        public string Address { get; set; }
+        public string RightInfo { get; set; }
+        public string UploadWaterPath { get; set; }
+        public string UploadWaterPosition { get; set; }
+        public ulong UploadAutoWater { get; set; }
+        public int UploadAutoZoomHeight { get; set; }
+        public int UploadAutoZoomWidth { get; set; }
+        public ulong UploadAutoZoom { get; set; }
+        public int UploadMaxSize { get; set; }
+        public string UploadExt { get; set; }
+        public string IndexDescription { get; set; }
+        public string IndexKeyword { get; set; }
+        public string WebName { get; set; }
+        public string WebUrl { get; set; }
+    }
+}

+ 26 - 0
OpModels/UploadParams.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class UploadParams
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string TableEnName { get; set; }
+        public string ParamString { get; set; }
+        public string ColumnEnName { get; set; }
+        public string ColumnName { get; set; }
+        public string TableName { get; set; }
+    }
+}

+ 32 - 0
OpModels/UserAccount.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class UserAccount
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public decimal WithdrawingAmount { get; set; }
+        public decimal ValidAmount { get; set; }
+        public decimal TotalAmount { get; set; }
+        public decimal WithdrawAmount { get; set; }
+        public int AccountStatus { get; set; }
+        public decimal BalanceAmount { get; set; }
+        public decimal FreezeAmount { get; set; }
+        public decimal TotalAmt { get; set; }
+        public int UserId { get; set; }
+        public decimal PosCouponApplyAmount { get; set; }
+        public decimal ValidForGetAmount { get; set; }
+    }
+}

+ 33 - 0
OpModels/UserAccountRecord.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class UserAccountRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string TransRecordNo { get; set; }
+        public string Remark { get; set; }
+        public decimal AfterBalanceAmount { get; set; }
+        public decimal BeforeBalanceAmount { get; set; }
+        public decimal AfterFreezeAmount { get; set; }
+        public decimal BeforeFreezeAmount { get; set; }
+        public decimal AfterTotalAmount { get; set; }
+        public decimal BeforeTotalAmount { get; set; }
+        public decimal ChangeAmount { get; set; }
+        public int ProductType { get; set; }
+        public int ChangeType { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 42 - 0
OpModels/UserCashRecord.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class UserCashRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Remark { get; set; }
+        public string MediaSource { get; set; }
+        public string Ip { get; set; }
+        public DateTime? PaymentDate { get; set; }
+        public string ReturnMsg { get; set; }
+        public string ReturnCode { get; set; }
+        public string ResData { get; set; }
+        public string ReqData { get; set; }
+        public decimal ManageFee { get; set; }
+        public decimal TradeFee { get; set; }
+        public decimal ActualTradeAmount { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string ChanelName { get; set; }
+        public string ChannelCode { get; set; }
+        public string PayTradeNo { get; set; }
+        public int TradeType { get; set; }
+        public string SettleBankName { get; set; }
+        public string SettleBankCardNo { get; set; }
+        public string IdCardNo { get; set; }
+        public int UserId { get; set; }
+        public string CashOrderNo { get; set; }
+    }
+}

+ 2885 - 0
OpModels/WebCMSEntities.cs

@@ -0,0 +1,2885 @@
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata;
+
+namespace MySystem.OpModels
+{
+    public partial class WebCMSEntities : DbContext
+    {
+        public WebCMSEntities()
+        {
+        }
+
+        public WebCMSEntities(DbContextOptions<WebCMSEntities> options)
+            : base(options)
+        {
+        }
+
+        public virtual DbSet<ActMerDaySummary> ActMerDaySummary { get; set; }
+        public virtual DbSet<ActMerMonthSummary> ActMerMonthSummary { get; set; }
+        public virtual DbSet<Advertisment> Advertisment { get; set; }
+        public virtual DbSet<AmountRecord> AmountRecord { get; set; }
+        public virtual DbSet<Col> Col { get; set; }
+        public virtual DbSet<MachineApplyOpRecord> MachineApplyOpRecord { get; set; }
+        public virtual DbSet<MenuRight> MenuRight { get; set; }
+        public virtual DbSet<MsgBlackList> MsgBlackList { get; set; }
+        public virtual DbSet<MsgPersonal> MsgPersonal { get; set; }
+        public virtual DbSet<MsgPlacard> MsgPlacard { get; set; }
+        public virtual DbSet<MsgPlacardRead> MsgPlacardRead { get; set; }
+        public virtual DbSet<MsgPush> MsgPush { get; set; }
+        public virtual DbSet<MsgSms> MsgSms { get; set; }
+        public virtual DbSet<MsgSmsSet> MsgSmsSet { get; set; }
+        public virtual DbSet<MsgTemplate> MsgTemplate { get; set; }
+        public virtual DbSet<OperateForCode> OperateForCode { get; set; }
+        public virtual DbSet<OperateLog> OperateLog { get; set; }
+        public virtual DbSet<OperateRightList> OperateRightList { get; set; }
+        public virtual DbSet<PageInfo> PageInfo { get; set; }
+        public virtual DbSet<PosCouponDaySummary> PosCouponDaySummary { get; set; }
+        public virtual DbSet<PosCouponForOp> PosCouponForOp { get; set; }
+        public virtual DbSet<PosCouponMonthSummary> PosCouponMonthSummary { get; set; }
+        public virtual DbSet<PosCouponOrders> PosCouponOrders { get; set; }
+        public virtual DbSet<PosCouponRecord> PosCouponRecord { get; set; }
+        public virtual DbSet<PosCoupons> PosCoupons { get; set; }
+        public virtual DbSet<PosMachines> PosMachines { get; set; }
+        public virtual DbSet<PublicAccountSet> PublicAccountSet { get; set; }
+        public virtual DbSet<RightDic> RightDic { get; set; }
+        public virtual DbSet<SendDaySummary> SendDaySummary { get; set; }
+        public virtual DbSet<SendMonthSummary> SendMonthSummary { get; set; }
+        public virtual DbSet<StoreActMerDaySummary> StoreActMerDaySummary { get; set; }
+        public virtual DbSet<StoreActMerMonthSummary> StoreActMerMonthSummary { get; set; }
+        public virtual DbSet<StoreForOperate> StoreForOperate { get; set; }
+        public virtual DbSet<StoreMachineApply> StoreMachineApply { get; set; }
+        public virtual DbSet<StoreSendDaySummary> StoreSendDaySummary { get; set; }
+        public virtual DbSet<StoreSendMonthSummary> StoreSendMonthSummary { get; set; }
+        public virtual DbSet<SysAdmin> SysAdmin { get; set; }
+        public virtual DbSet<SysAdminRole> SysAdminRole { get; set; }
+        public virtual DbSet<SysLog> SysLog { get; set; }
+        public virtual DbSet<SystemSet> SystemSet { get; set; }
+        public virtual DbSet<UploadParams> UploadParams { get; set; }
+        public virtual DbSet<UserAccount> UserAccount { get; set; }
+        public virtual DbSet<UserAccountRecord> UserAccountRecord { get; set; }
+        public virtual DbSet<UserCashRecord> UserCashRecord { get; set; }
+
+        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+        {
+            if (!optionsBuilder.IsConfigured)
+            {
+                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["OpSqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
+            }
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            modelBuilder.Entity<ActMerDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<ActMerMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<Advertisment>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Contents)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PicPath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<AmountRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ApplyId).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OperateType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<Col>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColDetail)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ColEnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ColName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ColPicPath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Contents)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Recommend)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MachineApplyOpRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApplyId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.OpType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.SourceSn)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TargetSn)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MenuRight>(entity =>
+            {
+                entity.HasKey(e => e.MenuId)
+                    .HasName("PRIMARY");
+
+                entity.Property(e => e.MenuId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<MsgBlackList>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Extend)
+                    .HasColumnType("varchar(2000)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Ip)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Mobile)
+                    .HasColumnType("varchar(11)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Reason)
+                    .HasColumnType("varchar(512)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TemplateId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgPersonal>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BgPic)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Content)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ExtendColumn)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MsgType).HasColumnType("int(11)");
+
+                entity.Property(e => e.PushFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.PushParam)
+                    .HasColumnType("varchar(255)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.ReadFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(255)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.Summary)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TemplateId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgPlacard>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BgPic)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Content)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.EffectEndDate).HasColumnType("datetime");
+
+                entity.Property(e => e.EffectStartDate).HasColumnType("datetime");
+
+                entity.Property(e => e.ExtendColumn)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IsTop)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MsgType).HasColumnType("int(11)");
+
+                entity.Property(e => e.PushFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.PushParam)
+                    .HasColumnType("varchar(255)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PushTime).HasColumnType("datetime");
+
+                entity.Property(e => e.PushType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(255)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ShowType).HasColumnType("int(11)");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.Summary)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgPlacardRead>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PlacardId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.ReadFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(255)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgPush>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AutoPushDate).HasColumnType("datetime");
+
+                entity.Property(e => e.ClientType)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Details)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Devices)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IsSilent)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MessageId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Mobiles)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TemplateId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgSms>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.Code).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Content)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ErrorNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.Ip)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Kind)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Mobile)
+                    .HasColumnType("varchar(11)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RespCode)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.RespContent)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SendStatus).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendTime).HasColumnType("datetime");
+
+                entity.Property(e => e.SendType).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SignName)
+                    .HasColumnType("varchar(10)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsType).HasColumnType("int(11)");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TemplateId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.VerifyCode)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.VerifyStatus).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgSmsSet>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AuthPwd)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Params)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.ReqUrl)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsType).HasColumnType("int(11)");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<MsgTemplate>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Content)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Extend)
+                    .HasColumnType("varchar(2000)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MsgType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SignName)
+                    .HasColumnType("varchar(10)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TemplateType).HasColumnType("int(11)");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<OperateForCode>(entity =>
+            {
+                entity.HasKey(e => e.OpCode)
+                    .HasName("PRIMARY");
+
+                entity.Property(e => e.OpCode)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<OperateLog>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterOperate)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BeforeOperate)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpMode)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OperateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TableEnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<OperateRightList>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.EnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PageInfo>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Contents)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCouponDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SaleCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCouponForOp>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OutNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.StockNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCouponMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SaleCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCouponOrders>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterOut).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterStock).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterTotal).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeOut).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeStock).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeTotal).HasColumnType("int(11)");
+
+                entity.Property(e => e.ChangeCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.ChangeKind).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.OrderNo)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCouponRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ChangeKind).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.FromUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.OrderNo)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PosCouponId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.ToUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<PosCoupons>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosCouponId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<PosMachines>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<PublicAccountSet>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AlipayAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AlipayPartnerId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AlipayPrivateKey)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AlipayPublicKey)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunAccessKeyId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunAccessKeySecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunAndroidActivity)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunAndroidNotifyTitle)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunPushAndroidAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunPushAndroidAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunPushIosAppId)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunPushIosAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.AliyunRegionId)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ErpApiUrl)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ErpAppCode)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MeiQiaAppKey)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MobAppKey)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MobAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QqAndroidAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QqAndroidAppKey)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QqIosAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QqIosAppKey)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ServerIp)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsApiDefaultTemplate)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsApiPwd)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsApiSign)
+                    .HasColumnType("varchar(10)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SmsApiUserId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatMchId)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatMiniAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatMiniAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatOpenAppId)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatOpenAppSecret)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WeChatPayKey)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<RightDic>(entity =>
+            {
+                entity.Property(e => e.Id)
+                    .HasColumnName("ID")
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Icon)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MainDataList)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MainMenu)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MainStat)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OtherRight)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.RightLevel).HasColumnType("int(11)");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Url)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<SendDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<SendMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<StoreActMerDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreActMerMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreForOperate>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.StoreId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<StoreMachineApply>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApplyNo)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ApplyNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.ErpCode)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendMode)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SendNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendSn)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<StoreSendDaySummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreSendMonthSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<SysAdmin>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AdminName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.FilePath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.HeadPhoto)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.LastLoginDate).HasColumnType("datetime");
+
+                entity.Property(e => e.MakerCode)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MakerMobile)
+                    .HasColumnType("varchar(11)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MakerName)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OpCode)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Password)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RealName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Role)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.StoreCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalMachineCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<SysAdminRole>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Details)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RightInfo)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<SysLog>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.Contents)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<SystemSet>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.Address)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IndexDescription)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IndexKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Logo)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Phone)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RightInfo)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.StartAdPhoto)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UploadAutoWater)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.UploadAutoZoom)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.UploadAutoZoomHeight).HasColumnType("int(11)");
+
+                entity.Property(e => e.UploadAutoZoomQuality).HasColumnType("int(11)");
+
+                entity.Property(e => e.UploadAutoZoomWidth).HasColumnType("int(11)");
+
+                entity.Property(e => e.UploadExt)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UploadMaxSize).HasColumnType("int(11)");
+
+                entity.Property(e => e.UploadOss)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.UploadWaterPath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UploadWaterPosition)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+
+                entity.Property(e => e.WebName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WebStatCode)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.WebUrl)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
+            modelBuilder.Entity<UploadParams>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ColumnEnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ColumnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParamString)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TableEnName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TableName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<UserAccount>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AccountStatus).HasColumnType("int(11)");
+
+                entity.Property(e => e.BalanceAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.FreezeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.PosCouponApplyAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TotalAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.ValidAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ValidForGetAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+
+                entity.Property(e => e.WithdrawAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.WithdrawingAmount).HasColumnType("decimal(18,2)");
+            });
+
+            modelBuilder.Entity<UserAccountRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterBalanceAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.AfterFreezeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.AfterTotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeBalanceAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeFreezeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeTotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeType).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ProductType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TransRecordNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<UserCashRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActualTradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CashOrderNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChanelName)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChannelCode)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.IdCardNo)
+                    .HasColumnType("varchar(18)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Ip)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ManageFee).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.MediaSource)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PayTradeNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PaymentDate).HasColumnType("datetime");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(128)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReqData)
+                    .HasColumnType("varchar(2048)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ResData)
+                    .HasColumnType("varchar(2048)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReturnCode)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReturnMsg)
+                    .HasColumnType("varchar(128)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SettleBankCardNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SettleBankName)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeFee).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeType).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            OnModelCreatingPartial(modelBuilder);
+        }
+
+        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+    }
+}

+ 22 - 0
PxcModels/HelpProfitMerTradeMonthSummay.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitMerTradeMonthSummay
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 20 - 0
PxcModels/Leaders.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class Leaders
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int LeaderLevel { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 1 - 0
PxcModels/MachineApply.cs

@@ -55,5 +55,6 @@ namespace MySystem.PxcModels
         public int BrandId { get; set; }
         public int UserId { get; set; }
         public string ApplyNo { get; set; }
+        public int OperateId { get; set; }
     }
 }

+ 1 - 0
PxcModels/Orders.cs

@@ -64,5 +64,6 @@ namespace MySystem.PxcModels
         public string OrderNo { get; set; }
         public int UserId { get; set; }
         public int ParentOrderId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
PxcModels/PosCouponRecord.cs

@@ -19,5 +19,6 @@ namespace MySystem.PxcModels
         public int ToUserId { get; set; }
         public int FromUserId { get; set; }
         public int PosCouponId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
PxcModels/PosCoupons.cs

@@ -23,5 +23,6 @@ namespace MySystem.PxcModels
         public int HelpProfitMerchantId { get; set; }
         public int HelpProfitStatus { get; set; }
         public ulong HelpProfitFlag { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 4 - 0
PxcModels/PosMachinesTwo.cs

@@ -52,5 +52,9 @@ namespace MySystem.PxcModels
         public DateTime? UpFeeDate { get; set; }
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
+        public int OpId { get; set; }
+        public decimal OpReserve3 { get; set; }
+        public decimal OpReserve2 { get; set; }
+        public decimal OpReserve1 { get; set; }
     }
 }

+ 1 - 0
PxcModels/StoreBalance.cs

@@ -29,5 +29,6 @@ namespace MySystem.PxcModels
         public int TransType { get; set; }
         public string TransRecordNo { get; set; }
         public int StoreId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
PxcModels/StoreChangeHistory.cs

@@ -37,5 +37,6 @@ namespace MySystem.PxcModels
         public string ChangeRecordNo { get; set; }
         public int BrandId { get; set; }
         public int UserId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 4 - 0
PxcModels/StoreHouse.cs

@@ -39,5 +39,9 @@ namespace MySystem.PxcModels
         public string StoreNo { get; set; }
         public DateTime? AuthDate { get; set; }
         public ulong AuthFlag { get; set; }
+        public int ThisMonthSendCount { get; set; }
+        public string FilePath { get; set; }
+        public decimal Deposit { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
PxcModels/StoreStockChange.cs

@@ -44,5 +44,6 @@ namespace MySystem.PxcModels
         public string ProductName { get; set; }
         public int BrandId { get; set; }
         public int StoreId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
PxcModels/UserAccount.cs

@@ -42,5 +42,6 @@ namespace MySystem.PxcModels
         public decimal ThisMonthPreAmount { get; set; }
         public decimal ValidPreAmount { get; set; }
         public decimal SmallStoreDeposit { get; set; }
+        public decimal StoreDeposit { get; set; }
     }
 }

+ 6 - 0
PxcModels/Users.cs

@@ -88,5 +88,11 @@ namespace MySystem.PxcModels
         public string DeviceType { get; set; }
         public DateTime? HelpProfitAgreeDate { get; set; }
         public ulong HelpProfitAgree { get; set; }
+        public int ThisMonthSend { get; set; }
+        public int StoreStock { get; set; }
+        public DateTime? CreateStoreDate { get; set; }
+        public ulong IsSign { get; set; }
+        public DateTime? SignDate { get; set; }
+        public string SignPic { get; set; }
     }
 }

+ 129 - 0
PxcModels/WebCMSEntities.cs

@@ -56,6 +56,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<HelpProfitExchange> HelpProfitExchange { get; set; }
         public virtual DbSet<HelpProfitExchangeDetail> HelpProfitExchangeDetail { get; set; }
         public virtual DbSet<HelpProfitMerIds> HelpProfitMerIds { get; set; }
+        public virtual DbSet<HelpProfitMerTradeMonthSummay> HelpProfitMerTradeMonthSummay { get; set; }
         public virtual DbSet<HelpProfitMerTradeSummay> HelpProfitMerTradeSummay { get; set; }
         public virtual DbSet<HelpProfitMerchantForUser> HelpProfitMerchantForUser { get; set; }
         public virtual DbSet<HelpProfitRebateDetail> HelpProfitRebateDetail { get; set; }
@@ -68,6 +69,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
+        public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
         public virtual DbSet<MachineApplyDetail> MachineApplyDetail { get; set; }
         public virtual DbSet<MachineChange> MachineChange { get; set; }
@@ -3144,6 +3146,47 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<HelpProfitMerTradeMonthSummay>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<HelpProfitMerTradeSummay>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -3996,6 +4039,40 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<Leaders>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<MachineApply>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -4066,6 +4143,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OperateId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderExpand)
                     .HasColumnType("mediumtext")
                     .HasCharSet("utf8")
@@ -7757,6 +7836,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -8178,6 +8259,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -8240,6 +8323,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.LeaderUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -8524,6 +8609,14 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.LeaderUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.OpReserve1).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.OpReserve2).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.OpReserve3).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PosSn)
@@ -12590,6 +12683,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OpStoreNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.OpSymbol)
@@ -12684,6 +12779,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -12801,6 +12898,13 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Deposit).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.FilePath)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.LaveNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.LimitTopUserId)
@@ -12820,6 +12924,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OutNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.ParentNav)
@@ -12876,6 +12982,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.StoreType).HasColumnType("int(11)");
 
+                entity.Property(e => e.ThisMonthSendCount).HasColumnType("int(11)");
+
                 entity.Property(e => e.TotalNum).HasColumnType("int(11)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
@@ -13263,6 +13371,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.ProductName)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")
@@ -14998,6 +15108,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.StoreDeposit).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.TeamTotalOverProfit).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.TeamTotalProfit).HasColumnType("decimal(18,2)");
@@ -17653,6 +17765,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.CreateStoreDate).HasColumnType("datetime");
+
                 entity.Property(e => e.DeviceId)
                     .HasColumnType("varchar(128)")
                     .HasCharSet("utf8")
@@ -17705,6 +17819,10 @@ namespace MySystem.PxcModels
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.IsSign)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
                 entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
 
                 entity.Property(e => e.LockStatus)
@@ -17833,20 +17951,31 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.Sex).HasColumnType("int(11)");
 
+                entity.Property(e => e.SignDate).HasColumnType("datetime");
+
                 entity.Property(e => e.SignImgUrl)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SignPic)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.StoreStock).HasColumnType("int(11)");
+
                 entity.Property(e => e.Tags)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ThisMonthSend).HasColumnType("int(11)");
+
                 entity.Property(e => e.ThisMonthTrade).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");

+ 27 - 21
Startup.cs

@@ -91,8 +91,8 @@ namespace MySystem
             // services.AddHostedService<SycnSpTimer>(); //同步SP数据
 
             // services.AddHostedService<TimerStatTimer>(); //实时统计创客、激活商户数
-            services.AddHostedService<PosTradeStatTimer>(); // 统计头天的交易额、商户型创客、激活奖励、开机奖励
-            services.AddHostedService<AlipayPayBack2Timer>(); //支付宝回调处理
+            // services.AddHostedService<PosTradeStatTimer>(); // 统计头天的交易额、商户型创客、激活奖励、开机奖励
+            // services.AddHostedService<AlipayPayBack2Timer>(); //支付宝回调处理
 
             //services.AddHttpContextAccessor();
 
@@ -106,11 +106,11 @@ namespace MySystem
             MySystemLib.SystemPublicFuction.checkurl = checkurl;
             MySystemLib.SystemPublicFuction.appcheck = "success";
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
-            System.Data.DataTable tablecollection = Library.dbconn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
+            System.Data.DataTable tablecollection = Library.dbconn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer2'");
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.dbconn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.dbconn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer2' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();
@@ -185,26 +185,28 @@ namespace MySystem
             });
 
             //必须打开的
-            ActiveRewardTimer.Instance.Start(); //实时处理激活记录
-            ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
-            SycnSpBindService.Instance.Start(); //同步SP绑定数据
-            SycnSpMerchantService.Instance.Start(); //同步SP商户数据
-            SycnSpActiveService.Instance.Start(); //同步SP激活数据
-            SycnSpTradeService.Instance.Start(); //同步SP交易数据
-            SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
-            SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
-            RedPackageV2Helper.Instance.Start(); //每天生成红包
-            RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
-            RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
+            // ActiveRewardTimer.Instance.Start(); //实时处理激活记录
+            // ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
+            // SycnSpBindService.Instance.Start(); //同步SP绑定数据
+            // SycnSpMerchantService.Instance.Start(); //同步SP商户数据
+            // SycnSpActiveService.Instance.Start(); //同步SP激活数据
+            // SycnSpTradeService.Instance.Start(); //同步SP交易数据
+            // SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
+            // SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
+            // RedPackageV2Helper.Instance.Start(); //每天生成红包
+            // RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
+            // RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
             BalancePayBackService.Instance.Start(); //余额支付队列
             ReservePayBackService.Instance.Start(); //储备金支付队列
             LeaderPrizeService.Instance.Start(); //大盟主奖励发奖
-            MessageCenterService.Instance.Start(); // 消息队列
-            RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
-            StoreApplyHelper.Instance.Start(); // 每月1号重置仓库额度
-            StoreApplyHelper.Instance.StartEverTime();
-            StatService.Instance.StatUserLevel(); //升级
-            ProfitHelperV2.Instance.StatProfit(); //创客分润
+            OperatePrizeService.Instance.Start(); //运营中心奖励发奖
+            // MessageCenterService.Instance.Start(); // 消息队列
+            // RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
+            // StoreApplyHelper.Instance.Start(); // 每月1号重置仓库额度
+            // StoreApplyHelper.Instance.StartEverTime();
+            // StatService.Instance.StatUserLevel(); //升级
+            // ProfitHelperV2.Instance.StatProfit(); //创客分润
+            StatService.Instance.StartOpenReward(); //实时获取开机奖励
             //必须打开的
 
             HelpProfitPreMerchantHelper.Instance.Start(); //助利宝每天增加指定数量商机
@@ -213,6 +215,10 @@ namespace MySystem
             SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
             SetFeeFlagService.Instance.Start(); //118天提前通知创客费率调升消息
             ResetSmallStoreHelper.Instance.Start(); //每月重置小分仓额度
+            OperateService.Instance.Start(); //运营中心每天统计一次发货量、库存
+            OperateAmountService.Instance.Start(); //运营中心额度变更
+            OperateStockService.Instance.Start(); //运营中心库存实时更新
+            StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
 
             // StatService.Instance.StartPosActNum(); //实时统计激活数
             // StatService.Instance.StartNewUserNum(); //实时统计新增创客数

+ 5 - 4
appsettings.json

@@ -17,11 +17,12 @@
     "Host": "http://localhost:5047/",
     "SourceHost": "http://bs.kexiaoshuang.com/",
     "Database": "KxsMainServer",
-    "SqlConnStr": "server=47.108.231.170;port=3306;user=KxsMain;password=mzeqjriUWore0dwT;database=KxsMainServer;charset=utf8;",
-    "Pxc1SqlConnStr": "server=47.108.231.170;port=3306;user=KxsMain;password=mzeqjriUWore0dwT;database=KxsMainServer;charset=utf8;",
-    "MainSqlConnStr": "server=47.108.231.170;port=3306;user=KxsMain;password=mzeqjriUWore0dwT;database=KxsStatServer;charset=utf8;",
+    "SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;",
+    "Pxc1SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;",
+    "MainSqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsStatServer2;charset=utf8;",
     "SpSqlConnStr": "server=47.109.31.237;port=3306;user=KxsSpServer;password=jJ9qKsvwWgQA9xWG;database=KxsSpServer;charset=utf8;",
-    "RedisConnStr": "47.108.207.184:6379,password=skb@redis2022,DefaultDatabase=0,poolsize=500,preheat=50,asyncPipeline=true",
+    "OpSqlConnStr": "server=47.109.31.237;port=3306;user=KxsOpServer;password=r7jwZ8ydLoeswDR4;database=KxsOpServer;charset=utf8;",
+    "RedisConnStr": "47.109.31.237:6379,password=klm@redis,DefaultDatabase=1,poolsize=500,preheat=50,asyncPipeline=true",
     "IOSAppVersion": "1.0.0",
     "AndroidAppVersion": "1.0.0",
     "OSSKey": "iL9dWgBunZRwGbHQ",