lcl 3 лет назад
Родитель
Сommit
9987d87ed6

+ 6 - 6
AppStart/ExcelHelper.cs

@@ -1304,10 +1304,10 @@ namespace MySystem
                                         decimal Amount = decimal.Parse(function.CheckNum(dr[1].ToString())); // 调整费率
                                         int Kind = int.Parse(function.CheckInt(dr[2].ToString())); // 1 调升 2 调低
                                         var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosNo) ?? new PosMachinesTwo();
-                                        if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 6)
-                                        {
+                                        // if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 6)
+                                        // {
                                             warning += PosNo + ",";
-                                        }
+                                        // }
                                     }
                                     if (!string.IsNullOrEmpty(warning))
                                     {
@@ -1322,10 +1322,10 @@ namespace MySystem
                                             decimal Amount = decimal.Parse(function.CheckNum(dr[1].ToString())); // 调整费率
                                             int Kind = int.Parse(function.CheckInt(dr[2].ToString())); // 1 调升 2 调低
                                             var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosNo) ?? new PosMachinesTwo();
-                                            if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 6)
-                                            {
+                                            // if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 6)
+                                            // {
                                                 warning += PosNo + ",";
-                                            }
+                                            // }
                                             if (Kind == 1)
                                             {
                                                 pos.UpFeeFlag = 1;

+ 0 - 273
AppStart/Helper/SycnSpTradeService.cs

@@ -1,273 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using MySystem.Models;
-using Library;
-using LitJson;
-
-namespace MySystem
-{
-    public class SycnSpTradeService
-    {
-        public readonly static SycnSpTradeService Instance = new SycnSpTradeService();
-        private SycnSpTradeService()
-        { }
-
-        public void Start(string PosSn, DateTime start, DateTime end, int StartId = 0)
-        {
-            SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
-            WebCMSEntities db = new WebCMSEntities();
-            IQueryable<SpModels.TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id > StartId && m.CreateDate >= start && m.CreateDate < end && m.TradeSnNo == PosSn);
-            foreach (SpModels.TradeRecord trade in trades.ToList())
-            {
-                bool op = true;
-                if (trade.SerEntryMode == "N")
-                {
-                    if (trade.TradeAmount == 9900 || trade.TradeAmount == 19900 || trade.TradeAmount == 29900)
-                    {
-                        op = false;
-                        MachineForMerNo posFor = db.MachineForMerNo.FirstOrDefault(m => m.MerNo == trade.MerNo) ?? new MachineForMerNo();
-                        PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
-                        if (pos != null)
-                        {
-                            if (trade.SerEntryMode == "N" && trade.ProductType == "1")
-                            {
-                                pos.SeoKeyword = trade.TradeAmount.ToString("f2");
-                                // pos.IsPurchase = 0;
-                                db.SaveChanges();
-                            }
-                        }
-                        SpModels.TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
-                        if (edit != null)
-                        {
-                            edit.Status = 2;
-                        }
-                        spdb.SaveChanges();
-                    }
-                }
-                if (trade.DiscountRateFlag == "True")
-                {
-                    op = false;
-                    SpModels.TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
-                    if (edit != null)
-                    {
-                        edit.Status = 2;
-                    }
-                    spdb.SaveChanges();
-                }
-                if(trade.ProductType == "7" && trade.TradeStatus != "00")
-                {
-                    op = false;
-                    SpModels.TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
-                    if (edit != null)
-                    {
-                        edit.Status = 2;
-                    }
-                    spdb.SaveChanges();
-                }
-                if (op)
-                {
-                    MachineForMerNo posFor = db.MachineForMerNo.FirstOrDefault(m => m.MerNo == trade.MerNo) ?? new MachineForMerNo();
-                    PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
-                    if (pos != null)
-                    {
-                        if (pos.BindMerchantId > 0)
-                        {
-                            Users user = db.Users.FirstOrDefault(m => m.Id == pos.UserId) ?? new Users();
-                            int TopUserId = 0;
-                            if (!string.IsNullOrEmpty(user.ParentNav))
-                            {
-                                TopUserId = int.Parse(user.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
-                            }
-                            bool check = db.SpOrderNos.Any(m => m.OrderNo == trade.TradeSerialNo);
-                            if (!check)
-                            {
-                                decimal TradeAmount = trade.TradeAmount;
-                                int BankCardType = -1;
-                                int QrPayFlag = 0;
-                                int VipFlag = 0;
-                                int PayType = 0;
-                                if (pos.BrandId == 1 || pos.BrandId == 3)
-                                {
-                                    TradeAmount = TradeAmount / 100;
-                                    BankCardType = int.Parse(trade.BankCardType);
-                                    if (trade.TradeType == "02") QrPayFlag = 1;
-                                    else if (trade.TradeType == "NQ") PayType = 1;
-                                    if (trade.SettleMethod == "E") VipFlag = 1;
-                                }
-                                else if (pos.BrandId == 2)
-                                {
-                                    if (trade.TradeType == "DEBIT_BY_CARD")
-                                    {
-                                        BankCardType = 0;
-                                    }
-                                    else
-                                    {
-                                        BankCardType = 1;
-                                    }
-                                    if (trade.TradeType == "CLOUD_PAY") QrPayFlag = 1;
-                                }
-                                else if (pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 8 || pos.BrandId == 9)
-                                {
-                                    TradeAmount = TradeAmount / 100;
-                                    if (trade.BankCardType == "100")
-                                    {
-                                        BankCardType = 1;
-                                    }
-                                    else if (trade.BankCardType == "200")
-                                    {
-                                        BankCardType = 0;
-                                    }
-                                    if (trade.TradeType == "200") QrPayFlag = 1;
-                                    if (trade.Field1 == "1") VipFlag = 1;
-                                }
-                                else if (pos.BrandId == 6)
-                                {
-                                    TradeAmount = TradeAmount / 100;
-                                    if (trade.BankCardType == "01" || trade.BankCardType == "11")
-                                    {
-                                        BankCardType = 0;
-                                    }
-                                    else
-                                    {
-                                        BankCardType = 1;
-                                    }
-                                }
-                                else if (pos.BrandId == 7)
-                                {
-                                    TradeAmount = TradeAmount / 100;
-                                    if (trade.BankCardType == "OA" || trade.BankCardType == "CC" || trade.BankCardType == "SCC")
-                                    {
-                                        BankCardType = 1;
-                                    }
-                                    else
-                                    {
-                                        BankCardType = 0;
-                                    }
-                                }
-                                int BrandId = int.Parse(trade.ProductType);
-                                if (BrandId == 1 && trade.MerNo.StartsWith("M900"))
-                                {
-                                    BrandId = 3;
-                                }
-                                if (BrandId == 4 && trade.DeviceType == "200")
-                                {
-                                    BrandId = 5;
-                                }
-                                decimal SourceTradeAmount = TradeAmount;
-                                if (pos.Sort == 0 && pos.BrandId == 7)
-                                {
-                                    decimal deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                                    if (deposit > 0)
-                                    {
-                                        TradeAmount -= deposit;
-                                        pos.Sort = 1;
-                                    }
-                                }
-                                if (TradeAmount > 0)
-                                {
-                                    ulong MerHelpFlag = 0;
-                                    decimal DepositAmt = decimal.Parse(function.CheckNum(pos.SeoKeyword));
-                                    if (DepositAmt > 0)
-                                    {
-                                        int Days = int.Parse(RedisDbconn.Instance.Get<string>("pobjrule:" + pos.BrandId + ":HelpPolicy:Days")); //天数
-                                        if (pos.BindingTime != null)
-                                        {
-                                            if (pos.BindingTime.Value.AddDays(Days) > DateTime.Now)
-                                            {
-                                                MerHelpFlag = 1;
-                                            }
-                                        }
-                                    }
-                                    int CapFlag = 0;
-                                    if(BankCardType == 0 && TradeAmount >= 1666.67M)
-                                    {
-                                        CapFlag = 1;
-                                    }
-                                    db.TradeRecord.Add(new TradeRecord()
-                                    {
-                                        ParentNav = user.ParentNav,
-                                        CreateDate = trade.CreateDate,
-                                        UpdateDate = trade.UpdateDate,
-                                        RecordNo = trade.TradeSerialNo, //单号
-                                        UserId = pos.UserId, //创客
-                                        MerchantId = pos.BindMerchantId, //商户
-                                        MerNo = trade.MerNo, //渠道商户编号
-                                        MerHelpFlag = MerHelpFlag, //是否属于扶持周期内商户
-                                        HelpMonthCount = 0, //扶持第几个月
-                                        MerBuddyType = user.MerchantType, //商户创客类型
-                                        SnNo = trade.TradeSnNo, //渠道SN号
-                                        TradeSerialNo = trade.ChannelSerial, //交易流水号
-                                        TradeAmount = TradeAmount, //交易金额
-                                        BankCardType = BankCardType, //银行卡类型
-                                        QrPayFlag = QrPayFlag, //云闪付标识
-                                        CapFlag = CapFlag, //借记卡是否封顶
-                                        VipFlag = VipFlag, //会员标记
-                                        PayType = PayType, //支付方式
-                                        BrandId = BrandId, //品牌
-                                        Remark = trade.Remark, //备注
-                                        TopUserId = TopUserId, //顶级创客
-                                        MerUserId = pos.UserId, //商户直属创客
-                                    });
-                                }
-                                decimal CheckMoney = 1000;
-                                int CheckDays = 30;
-                                if (pos.BrandId == 6)
-                                {
-                                    CheckMoney = 5000;
-                                }
-                                if (BankCardType == 1 || (BankCardType == 2 && pos.BrandId == 1) || (BankCardType == 2 && pos.BrandId == 3))
-                                {
-                                    pos.CreditTrade += SourceTradeAmount;
-                                }
-                                else if (BankCardType == 0)
-                                {
-                                    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;
-                                    PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
-                                    if (merchant != null)
-                                    {
-                                        merchant.ActiveStatus = 1;
-                                        merchant.MerStandardDate = DateTime.Now;
-                                        db.SaveChanges();
-                                    }
-                                    //发放大盟主奖励
-                                    if(pos.LeaderUserId > 0)
-                                    {
-                                        RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
-                                    }
-                                }
-                                db.SaveChanges();
-                            }
-                            SpModels.TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
-                            if (edit != null)
-                            {
-                                edit.Status = 2;
-                            }
-                            spdb.SaveChanges();
-                        }
-                    }
-                }
-            }
-            spdb.Dispose();
-            db.Dispose();
-        }
-    }
-}

+ 3 - 3
Areas/Admin/Controllers/MainServer/PosMachinesTwoChangeController.cs

@@ -488,14 +488,14 @@ namespace MySystem.Areas.Admin.Controllers
                     userIds += pos.BuyUserId + ",";
                 }
 
-                if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 2 || pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 6 || pos.BrandId == 7)
-                {
+                // if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 2 || pos.BrandId == 4 || pos.BrandId == 5 || pos.BrandId == 6 || pos.BrandId == 7)
+                // {
                     // PosId:机具Id
                     // Kind:1或2,1为费率0.63,2为费率0.6
                     // OpMan:操作人,app传创客编号,后台传SysUserName
                     string info = "{\"RecordId\":\"\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"" + 1 + "\",\"OpMan\": \"" + SysUserName + "\"}";
                     RedisDbconn.Instance.AddList("SetDepositPostQueue", info);
-                }
+                // }
                 // else
                 // {
                 //     upposIds.Add(pos.Id);

+ 3 - 0
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -529,6 +529,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -559,6 +560,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -645,6 +647,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status > -1 && m.Sort == 0);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 8 - 0
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -191,6 +191,10 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
                 }
+                else if (pos.BrandId == 12)
+                {
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
+                }
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
             }
@@ -478,6 +482,10 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "10").Sum(m => m.TradeAmount);
                 }
+                else if (pos.BrandId == 12)
+                {
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "12").Sum(m => m.TradeAmount);
+                }
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
             }

+ 4 - 0
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -644,6 +644,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -674,6 +675,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -705,6 +707,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 Models.MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new Models.MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new Models.PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -772,6 +775,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 4 - 0
Areas/Admin/Controllers/OperateServer/StoreMachineApplysOperateController.cs

@@ -539,6 +539,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -569,6 +570,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -600,6 +602,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -654,6 +657,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 9) FromStoreId = 4832;
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
+                if (BrandId == 12) FromStoreId = 0;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)