lcl 1 year ago
parent
commit
90350849f9
3 changed files with 322 additions and 322 deletions
  1. 319 319
      AppStart/Helper/SetDepositPostService.cs
  2. 1 1
      AppStart/Helper/SetFeeFlagService.cs
  3. 2 2
      Startup.cs

+ 319 - 319
AppStart/Helper/SetDepositPostService.cs

@@ -31,325 +31,325 @@ namespace MySystem
                 string data = RedisDbconn.Instance.RPop<string>("SetDepositPostQueue");
                 if (!string.IsNullOrEmpty(data))
                 {
-                    try
-                    {
-                        WebCMSEntities db = new WebCMSEntities();
-                        JsonData jsonObj = JsonMapper.ToObject(data);
-                        string PosIds = jsonObj["PosId"].ToString();
-                        int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString()));
-                        int RecordId = 0;
-                        if(data.Contains("\"RecordId\""))
-                        {
-                            RecordId = int.Parse(function.CheckInt(jsonObj["RecordId"].ToString()));
-                        }
-                        string OpMan = jsonObj["OpMan"].ToString();
-                        if(!string.IsNullOrEmpty(PosIds) && Kind > 0)
-                        {
-                            List<int> ids = new List<int>();
-                            string[] PosIdList = PosIds.Split(',');
-                            foreach(string sub in PosIdList)
-                            {
-                                ids.Add(int.Parse(sub));
-                            }
-                            List<KqProducts> brands = db.KqProducts.ToList();
-                            List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => ids.Contains(m.Id)).ToList();
-                            List<int> mids = poslist.Select(m => m.BindMerchantId).ToList();
-                            List<PosMerchantInfo> merchantlist = db.PosMerchantInfo.Where(m => mids.Contains(m.Id)).ToList();
-                            foreach(PosMachinesTwo pos in poslist)
-                            {
-                                PosMerchantInfo merchant = merchantlist.FirstOrDefault(m => m.Id == pos.BindMerchantId);
-                                if(merchant != null)
-                                {
-                                    decimal Fee = Kind == 1 ? 0.63M : 0.6M;
-                                    int addRate = 0;
-                                    if(pos.BrandId != 12 && pos.BrandId != 13)
-                                    {
-                                        if(Fee == 0.63M) 
-                                        {
-                                            addRate = 3;
-                                        }
-                                        else if(Fee == 0.6M)
-                                        {
-                                            Fee = 0.63M;
-                                        }
-                                    }
-                                    if(pos.BrandId == 1 || pos.BrandId == 3) //金控
-                                    {
-                                        addRate = addRate * 100;
-                                        string content = function.GetWebRequest("http://connect.kexiaoshuang.com/home/setfee?merNo=" + merchant.KqMerNo + "&sn=" + pos.PosSn + "&fee=" + Fee + "&addRate=" + addRate);
-                                        if(content.Contains("|"))
-                                        {
-                                            content = content.Split("|")[1];
-                                            JsonData obj = JsonMapper.ToObject(content);
-                                            if(obj["errorCode"].ToString() == "0000")
-                                            {
-                                                pos.SeoDescription = "设置成功";
-                                                SetRecordResult(db, RecordId, 1, "设置成功");
-                                                db.SaveChanges();
-                                            }
-                                            else
-                                            {
-                                                string msg = obj["errorCodeDesc"].ToString();
-                                                pos.SeoDescription = msg;
-                                                SetRecordResult(db, RecordId, -1, msg);
-                                                db.SaveChanges();
-                                            }
-                                        }
-                                        else
-                                        {
-                                            JsonData obj = JsonMapper.ToObject(content);
-                                            string msg = obj["message"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    else if(pos.BrandId == 2) //开店宝
-                                    {
-                                        Fee = Fee / 100;
-                                        string content = ModifyFee(pos.PosSn, Fee, addRate.ToString());
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(content.Contains("orderNo"))
-                                        {
-                                            pos.SeoDescription = "提交成功|" + obj["orderNo"].ToString() + "|" + RecordId;
-                                            // SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["msg"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    else if(pos.BrandId == 4 || pos.BrandId == 5) //乐刷
-                                    {
-                                        // 电签
-                                        // 电签标准0.63 729702301652492288
-                                        // 电签优惠0.63 729702442300088320
-                                        // 电签pos不加  696339175297294336
-
-                                        // 大POS
-                                        // PY-传统POS标准0.63 554666598481842176
-                                        // PY-传统POS优惠0.63 683857388021264384
-                                        // 大pos不加  698228081038991360
-
-                                        // 大POS
-                                        // 大POS标准0.6:713806109336940544 
-                                        // 大POS优惠0.6:713806774515802112 
-
-                                        // 电签POS
-                                        // 电签标准0.6:712391426860134400 
-                                        // 电签优惠0.6:712391668250718208 
-                                        // S0电签pos不加:696339175297294336
-                                        string bzConfigId = "", yhConfigId = "", surfeeConfigId = "";
-                                        if(pos.BrandId == 4)
-                                        {
-                                            if(Kind == 1)
-                                            {
-                                                bzConfigId = "729702301652492288";
-                                                yhConfigId = "729702442300088320";
-                                                surfeeConfigId = "696339175297294336";
-                                            }
-                                            else
-                                            {
-                                                bzConfigId = "712391426860134400";
-                                                yhConfigId = "712391668250718208";
-                                                surfeeConfigId = "696339175297294336";
-                                            }
-                                        }
-                                        else
-                                        {
-                                            if(Kind == 1)
-                                            {
-                                                bzConfigId = "554666598481842176";
-                                                yhConfigId = "683857388021264384";
-                                                surfeeConfigId = "698228081038991360";
-                                            }
-                                            else
-                                            {
-                                                bzConfigId = "713806109336940544";
-                                                yhConfigId = "713806774515802112";
-                                                surfeeConfigId = "698228081038991360";
-                                            }
-                                        }
-                                        string content = SetFeeForBrand(pos.PosSn, bzConfigId, yhConfigId, surfeeConfigId, pos.BrandId);
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(obj["code"].ToString() == "0")
-                                        {
-                                            pos.SeoDescription = "设置成功";
-                                            SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["msg"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    else if(pos.BrandId == 7) //盛付通
-                                    {
-                                        string content = SetFeeForSft(merchant.KqMerNo, Fee.ToString("f4"), addRate.ToString());
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(obj["respCode"].ToString() == "00")
-                                        {
-                                            pos.SeoDescription = "设置成功";
-                                            SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["errorMsg"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    // else if(pos.BrandId == 6) //立刷
-                                    // {
-                                    //     string content = SetLiSFee(pos.PosSn, Fee);
-                                    //     JsonData obj = JsonMapper.ToObject(content);
-                                    //     if (obj["ret_code"].ToString() == "00")
-                                    //     { 
-                                    //         if(Kind == 1)
-                                    //         {
-                                    //             pos.UpFeeFlag = 1;
-                                    //             pos.UpFeeMan = OpMan;
-                                    //             pos.UpFeeDate = DateTime.Now;
-                                    //         }
-                                    //         else if(Kind == 2)
-                                    //         {
-                                    //             pos.DownFeeFlag = 1;
-                                    //             pos.DownFeeMan = OpMan;
-                                    //             pos.DownFeeDate = DateTime.Now;
-                                    //             SetRecordResult(db, RecordId, 1);
-                                    //         }
-                                    //         db.SaveChanges();
-                                    //     }
-                                    //     else
-                                    //     {
-                                    //         string msg = obj["ret_msg"].ToString();
-                                    //         pos.SeoDescription = msg;
-                                    //         SetRecordResult(db, RecordId, -1, msg);
-                                    //         db.SaveChanges();
-                                    //     }
-                                    // }
-                                    else if(pos.BrandId == 8 || pos.BrandId == 9) //海科
-                                    {
-                                        // 【融通金宝大POS】
-                                        // 584068951081226240    大POS标准贷0.60|借0.50
-                                        // 584070145207963648    大POS优惠贷0.60|借0.5
-                                        // 574600660289888256    大POS不加
-
-                                        // 691739824478494720    大POS标准贷0.63|借0.50
-                                        // 691740128238383104    大POS优惠贷0.63|借0.50
-                                        // 574600660289888256    大POS不加
-
-                                        // 【融通金宝电签POS】
-                                        // 585167132691009536    电签POS标准贷0.60|借0.50
-                                        // 579355312831074304    电签POS优惠贷0.6|借0.5
-                                        // 570331704834170880    电签POS不加
-
-                                        // 684753829778436096    电签POS标准贷0.63|借0.50
-                                        // 684754046342934528    电签POS优惠贷0.63|借0.5
-                                        // 570331704834170880    电签POS不加
-                                        string bzConfigId = "", yhConfigId = "", surfeeConfigId = "";
-                                        if(pos.BrandId == 8)
-                                        {
-                                            if(Kind == 1)
-                                            {
-                                                bzConfigId = "684753829778436096";
-                                                yhConfigId = "684754046342934528";
-                                                surfeeConfigId = "570331704834170880";
-                                            }
-                                            else
-                                            {
-                                                bzConfigId = "585167132691009536";
-                                                yhConfigId = "579355312831074304";
-                                                surfeeConfigId = "570331704834170880";
-                                            }
-                                        }
-                                        else
-                                        {
-                                            if(Kind == 1)
-                                            {
-                                                bzConfigId = "691739824478494720";
-                                                yhConfigId = "691740128238383104";
-                                                surfeeConfigId = "574600660289888256";
-                                            }
-                                            else
-                                            {
-                                                bzConfigId = "584068951081226240";
-                                                yhConfigId = "584070145207963648";
-                                                surfeeConfigId = "574600660289888256";
-                                            }
-                                        }
-                                        string content = HKSetFeeForBrand(pos.PosSn, bzConfigId, yhConfigId, surfeeConfigId, pos.BrandId);
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(obj["code"].ToString() == "0")
-                                        {
-                                            pos.SeoDescription = "设置成功";
-                                            SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["msg"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    else if(pos.BrandId == 10 || pos.BrandId == 11) //联动
-                                    {
-                                        decimal LastFee = Fee / 100;
-                                        string content = LDFeeRate(merchant.KqMerNo, LastFee.ToString("f4"), pos.BrandId, addRate);
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(obj["code"].ToString() == "000000")
-                                        {
-                                            pos.SeoDescription = "设置成功";
-                                            SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["msg"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                    else if(pos.BrandId == 12 || pos.BrandId == 13) //盒易付
-                                    {
-                                        string content = BoxFee(merchant.KqMerNo, Fee.ToString("f2"));
-                                        JsonData obj = JsonMapper.ToObject(content);
-                                        if(obj["resultCode"].ToString() == "1")
-                                        {
-                                            pos.SeoDescription = "设置成功";
-                                            SetRecordResult(db, RecordId, 1, "设置成功");
-                                            db.SaveChanges();
-                                        }
-                                        else
-                                        {
-                                            string msg = obj["errorDesc"].ToString();
-                                            pos.SeoDescription = msg;
-                                            SetRecordResult(db, RecordId, -1, msg);
-                                            db.SaveChanges();
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                        db.Dispose();
-                        Thread.Sleep(500);
-                    }
-                    catch (Exception ex)
-                    {
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "设置费率到支付平台异常");
-                    }
+                    // try
+                    // {
+                    //     WebCMSEntities db = new WebCMSEntities();
+                    //     JsonData jsonObj = JsonMapper.ToObject(data);
+                    //     string PosIds = jsonObj["PosId"].ToString();
+                    //     int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString()));
+                    //     int RecordId = 0;
+                    //     if(data.Contains("\"RecordId\""))
+                    //     {
+                    //         RecordId = int.Parse(function.CheckInt(jsonObj["RecordId"].ToString()));
+                    //     }
+                    //     string OpMan = jsonObj["OpMan"].ToString();
+                    //     if(!string.IsNullOrEmpty(PosIds) && Kind > 0)
+                    //     {
+                    //         List<int> ids = new List<int>();
+                    //         string[] PosIdList = PosIds.Split(',');
+                    //         foreach(string sub in PosIdList)
+                    //         {
+                    //             ids.Add(int.Parse(sub));
+                    //         }
+                    //         List<KqProducts> brands = db.KqProducts.ToList();
+                    //         List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => ids.Contains(m.Id)).ToList();
+                    //         List<int> mids = poslist.Select(m => m.BindMerchantId).ToList();
+                    //         List<PosMerchantInfo> merchantlist = db.PosMerchantInfo.Where(m => mids.Contains(m.Id)).ToList();
+                    //         foreach(PosMachinesTwo pos in poslist)
+                    //         {
+                    //             PosMerchantInfo merchant = merchantlist.FirstOrDefault(m => m.Id == pos.BindMerchantId);
+                    //             if(merchant != null)
+                    //             {
+                    //                 decimal Fee = Kind == 1 ? 0.63M : 0.6M;
+                    //                 int addRate = 0;
+                    //                 if(pos.BrandId != 12 && pos.BrandId != 13)
+                    //                 {
+                    //                     if(Fee == 0.63M) 
+                    //                     {
+                    //                         addRate = 3;
+                    //                     }
+                    //                     else if(Fee == 0.6M)
+                    //                     {
+                    //                         Fee = 0.63M;
+                    //                     }
+                    //                 }
+                    //                 if(pos.BrandId == 1 || pos.BrandId == 3) //金控
+                    //                 {
+                    //                     addRate = addRate * 100;
+                    //                     string content = function.GetWebRequest("http://connect.kexiaoshuang.com/home/setfee?merNo=" + merchant.KqMerNo + "&sn=" + pos.PosSn + "&fee=" + Fee + "&addRate=" + addRate);
+                    //                     if(content.Contains("|"))
+                    //                     {
+                    //                         content = content.Split("|")[1];
+                    //                         JsonData obj = JsonMapper.ToObject(content);
+                    //                         if(obj["errorCode"].ToString() == "0000")
+                    //                         {
+                    //                             pos.SeoDescription = "设置成功";
+                    //                             SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                             db.SaveChanges();
+                    //                         }
+                    //                         else
+                    //                         {
+                    //                             string msg = obj["errorCodeDesc"].ToString();
+                    //                             pos.SeoDescription = msg;
+                    //                             SetRecordResult(db, RecordId, -1, msg);
+                    //                             db.SaveChanges();
+                    //                         }
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         JsonData obj = JsonMapper.ToObject(content);
+                    //                         string msg = obj["message"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 else if(pos.BrandId == 2) //开店宝
+                    //                 {
+                    //                     Fee = Fee / 100;
+                    //                     string content = ModifyFee(pos.PosSn, Fee, addRate.ToString());
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(content.Contains("orderNo"))
+                    //                     {
+                    //                         pos.SeoDescription = "提交成功|" + obj["orderNo"].ToString() + "|" + RecordId;
+                    //                         // SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["msg"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 else if(pos.BrandId == 4 || pos.BrandId == 5) //乐刷
+                    //                 {
+                    //                     // 电签
+                    //                     // 电签标准0.63 729702301652492288
+                    //                     // 电签优惠0.63 729702442300088320
+                    //                     // 电签pos不加  696339175297294336
+
+                    //                     // 大POS
+                    //                     // PY-传统POS标准0.63 554666598481842176
+                    //                     // PY-传统POS优惠0.63 683857388021264384
+                    //                     // 大pos不加  698228081038991360
+
+                    //                     // 大POS
+                    //                     // 大POS标准0.6:713806109336940544 
+                    //                     // 大POS优惠0.6:713806774515802112 
+
+                    //                     // 电签POS
+                    //                     // 电签标准0.6:712391426860134400 
+                    //                     // 电签优惠0.6:712391668250718208 
+                    //                     // S0电签pos不加:696339175297294336
+                    //                     string bzConfigId = "", yhConfigId = "", surfeeConfigId = "";
+                    //                     if(pos.BrandId == 4)
+                    //                     {
+                    //                         if(Kind == 1)
+                    //                         {
+                    //                             bzConfigId = "729702301652492288";
+                    //                             yhConfigId = "729702442300088320";
+                    //                             surfeeConfigId = "696339175297294336";
+                    //                         }
+                    //                         else
+                    //                         {
+                    //                             bzConfigId = "712391426860134400";
+                    //                             yhConfigId = "712391668250718208";
+                    //                             surfeeConfigId = "696339175297294336";
+                    //                         }
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         if(Kind == 1)
+                    //                         {
+                    //                             bzConfigId = "554666598481842176";
+                    //                             yhConfigId = "683857388021264384";
+                    //                             surfeeConfigId = "698228081038991360";
+                    //                         }
+                    //                         else
+                    //                         {
+                    //                             bzConfigId = "713806109336940544";
+                    //                             yhConfigId = "713806774515802112";
+                    //                             surfeeConfigId = "698228081038991360";
+                    //                         }
+                    //                     }
+                    //                     string content = SetFeeForBrand(pos.PosSn, bzConfigId, yhConfigId, surfeeConfigId, pos.BrandId);
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(obj["code"].ToString() == "0")
+                    //                     {
+                    //                         pos.SeoDescription = "设置成功";
+                    //                         SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["msg"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 else if(pos.BrandId == 7) //盛付通
+                    //                 {
+                    //                     string content = SetFeeForSft(merchant.KqMerNo, Fee.ToString("f4"), addRate.ToString());
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(obj["respCode"].ToString() == "00")
+                    //                     {
+                    //                         pos.SeoDescription = "设置成功";
+                    //                         SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["errorMsg"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 // else if(pos.BrandId == 6) //立刷
+                    //                 // {
+                    //                 //     string content = SetLiSFee(pos.PosSn, Fee);
+                    //                 //     JsonData obj = JsonMapper.ToObject(content);
+                    //                 //     if (obj["ret_code"].ToString() == "00")
+                    //                 //     { 
+                    //                 //         if(Kind == 1)
+                    //                 //         {
+                    //                 //             pos.UpFeeFlag = 1;
+                    //                 //             pos.UpFeeMan = OpMan;
+                    //                 //             pos.UpFeeDate = DateTime.Now;
+                    //                 //         }
+                    //                 //         else if(Kind == 2)
+                    //                 //         {
+                    //                 //             pos.DownFeeFlag = 1;
+                    //                 //             pos.DownFeeMan = OpMan;
+                    //                 //             pos.DownFeeDate = DateTime.Now;
+                    //                 //             SetRecordResult(db, RecordId, 1);
+                    //                 //         }
+                    //                 //         db.SaveChanges();
+                    //                 //     }
+                    //                 //     else
+                    //                 //     {
+                    //                 //         string msg = obj["ret_msg"].ToString();
+                    //                 //         pos.SeoDescription = msg;
+                    //                 //         SetRecordResult(db, RecordId, -1, msg);
+                    //                 //         db.SaveChanges();
+                    //                 //     }
+                    //                 // }
+                    //                 else if(pos.BrandId == 8 || pos.BrandId == 9) //海科
+                    //                 {
+                    //                     // 【融通金宝大POS】
+                    //                     // 584068951081226240    大POS标准贷0.60|借0.50
+                    //                     // 584070145207963648    大POS优惠贷0.60|借0.5
+                    //                     // 574600660289888256    大POS不加
+
+                    //                     // 691739824478494720    大POS标准贷0.63|借0.50
+                    //                     // 691740128238383104    大POS优惠贷0.63|借0.50
+                    //                     // 574600660289888256    大POS不加
+
+                    //                     // 【融通金宝电签POS】
+                    //                     // 585167132691009536    电签POS标准贷0.60|借0.50
+                    //                     // 579355312831074304    电签POS优惠贷0.6|借0.5
+                    //                     // 570331704834170880    电签POS不加
+
+                    //                     // 684753829778436096    电签POS标准贷0.63|借0.50
+                    //                     // 684754046342934528    电签POS优惠贷0.63|借0.5
+                    //                     // 570331704834170880    电签POS不加
+                    //                     string bzConfigId = "", yhConfigId = "", surfeeConfigId = "";
+                    //                     if(pos.BrandId == 8)
+                    //                     {
+                    //                         if(Kind == 1)
+                    //                         {
+                    //                             bzConfigId = "684753829778436096";
+                    //                             yhConfigId = "684754046342934528";
+                    //                             surfeeConfigId = "570331704834170880";
+                    //                         }
+                    //                         else
+                    //                         {
+                    //                             bzConfigId = "585167132691009536";
+                    //                             yhConfigId = "579355312831074304";
+                    //                             surfeeConfigId = "570331704834170880";
+                    //                         }
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         if(Kind == 1)
+                    //                         {
+                    //                             bzConfigId = "691739824478494720";
+                    //                             yhConfigId = "691740128238383104";
+                    //                             surfeeConfigId = "574600660289888256";
+                    //                         }
+                    //                         else
+                    //                         {
+                    //                             bzConfigId = "584068951081226240";
+                    //                             yhConfigId = "584070145207963648";
+                    //                             surfeeConfigId = "574600660289888256";
+                    //                         }
+                    //                     }
+                    //                     string content = HKSetFeeForBrand(pos.PosSn, bzConfigId, yhConfigId, surfeeConfigId, pos.BrandId);
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(obj["code"].ToString() == "0")
+                    //                     {
+                    //                         pos.SeoDescription = "设置成功";
+                    //                         SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["msg"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 else if(pos.BrandId == 10 || pos.BrandId == 11) //联动
+                    //                 {
+                    //                     decimal LastFee = Fee / 100;
+                    //                     string content = LDFeeRate(merchant.KqMerNo, LastFee.ToString("f4"), pos.BrandId, addRate);
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(obj["code"].ToString() == "000000")
+                    //                     {
+                    //                         pos.SeoDescription = "设置成功";
+                    //                         SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["msg"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //                 else if(pos.BrandId == 12 || pos.BrandId == 13) //盒易付
+                    //                 {
+                    //                     string content = BoxFee(merchant.KqMerNo, Fee.ToString("f2"));
+                    //                     JsonData obj = JsonMapper.ToObject(content);
+                    //                     if(obj["resultCode"].ToString() == "1")
+                    //                     {
+                    //                         pos.SeoDescription = "设置成功";
+                    //                         SetRecordResult(db, RecordId, 1, "设置成功");
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                     else
+                    //                     {
+                    //                         string msg = obj["errorDesc"].ToString();
+                    //                         pos.SeoDescription = msg;
+                    //                         SetRecordResult(db, RecordId, -1, msg);
+                    //                         db.SaveChanges();
+                    //                     }
+                    //                 }
+                    //             }
+                    //         }
+                    //     }
+                    //     db.Dispose();
+                    //     Thread.Sleep(500);
+                    // }
+                    // catch (Exception ex)
+                    // {
+                    //     function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "设置费率到支付平台异常");
+                    // }
                 }
                 else
                 {

+ 1 - 1
AppStart/Helper/SetFeeFlagService.cs

@@ -28,7 +28,7 @@ namespace MySystem
         {
             while (true)
             {
-                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 9)
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 19)
                 {
                     try
                     {

+ 2 - 2
Startup.cs

@@ -197,9 +197,9 @@ namespace MySystem
                 SycnMerchantTradeService.Instance.Start(); //同步商户交易额
 
                 MessageCenterService.Instance.Start(); // 消息队列
-                // SetFeeFlagService.Instance.Start(); //88天提前通知创客费率调升消息
+                SetFeeFlagService.Instance.Start(); //88天提前通知创客费率调升消息
                 LeaderTimeoutSendMessageService.Instance.Start(); //盟主过期消息提醒
-                // SetDepositService.Instance.Start(); //调整费率(通知、标记)
+                SetDepositService.Instance.Start(); //调整费率(通知、标记)
 
                 AlipayPayBack2Service.Instance.Start(); //支付宝回调处理
                 BalancePayBackService.Instance.Start(); //余额支付队列