Jelajahi Sumber

临时批量设置费率

lcl 1 tahun lalu
induk
melakukan
2076196a59
3 mengubah file dengan 225 tambahan dan 58 penghapusan
  1. 51 0
      AppStart/Helper/SetDepositPostService.cs
  2. 116 0
      AppStart/Timer/TestHelper.cs
  3. 58 58
      Startup.cs

+ 51 - 0
AppStart/Helper/SetDepositPostService.cs

@@ -442,6 +442,57 @@ namespace MySystem
         string reqUrl = "https://push.mfe88.com/push-service/api/MODIFYPERPOSFEE";
 
 
+
+
+        public string SetFee(string merNo, string sn, decimal addRate, int fee)
+        {
+            // 2021092711IpAreT 降费特惠…刷卡交易手续费
+            // 2020032508Nu0QCG 刷卡交易手续费
+            // 2020032508Nx8oyW 借记卡封顶手续费
+            // 2020032508O4EWB6 刷卡结算手续费
+            List<SetDepositList> rateDOs = new List<SetDepositList>();
+            rateDOs.Add(new SetDepositList()
+            {
+                productSubType = "2020032508Nu0QCG",
+                updateValue = addRate,
+                updateType = 0
+            });
+            // rateDOs.Add(new SetDepositList()
+            // {
+            //     productSubType = "2020032508Nx8oyW",
+            //     updateValue = fee,
+            //     updateType = 0
+            // });
+            rateDOs.Add(new SetDepositList()
+            {
+                productSubType = "2020032508O4EWB6",
+                updateValue = fee,
+                updateType = 0
+            });
+            Dictionary<string, string> headers = new Dictionary<string, string>();
+            headers.Add("X-Client-ID", "4487378308096");
+            headers.Add("X-Security", "RSA");
+            function.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
+            Dictionary<string, object> obj = new Dictionary<string, object>();
+            obj.Add("merNo", merNo);
+            obj.Add("sn", sn);
+            obj.Add("batchUpdateType", 2);
+            obj.Add("rateDOs", rateDOs);
+            string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
+            function.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
+            function.WriteLog(content, "设置金控机具费率");
+            content = Encrypt(content);
+            string signstr = Sign(content);
+            headers.Add("X-Sign", signstr);
+            string headerString = Newtonsoft.Json.JsonConvert.SerializeObject(headers);
+            function.WriteLog(headerString, "设置金控机具费率");
+            string req = "{\"param\":\"" + content + "\"}";
+            function.WriteLog(req, "设置金控机具费率");
+            string result = function.PostWebRequest(reqUrl, req, headers, "application/json");
+            function.WriteLog(result, "设置金控机具费率");
+            return result;
+        }
+
         public string SetJkFee(string merNo, string sn, decimal fee = 0.6M)
         {
             List<SetDepositList> rateDOs = new List<SetDepositList>();

+ 116 - 0
AppStart/Timer/TestHelper.cs

@@ -81,6 +81,33 @@ public class TestHelper
         //     string result = SetDepositPostService.Instance.LDFeeRate(dr["KqMerNo"].ToString(), "0.0063", int.Parse(dr["BrandId"].ToString()), 0);
         //     function.WriteLog(result + "\n\n", "临时设置联动费率日志");
         // }
+
+        // function.WriteLog("000006026200825805", "临时设置费率日志");
+        // string result = SetDepositPostService.Instance.SetFeeForSft("40585414", "0.6300", "0");
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+
+        // function.WriteLog("0000320226626450030145", "临时设置费率日志");
+        // result = SetDepositPostService.Instance.LDFeeRate("110000004265069", "0.0063", 1, 3);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+        // function.WriteLog("0000320226624650409066", "临时设置费率日志");
+        // result = SetDepositPostService.Instance.LDFeeRate("110000004842951", "0.0063", 1, 3);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+
+        // function.WriteLog("0000320226636450184893", "临时设置费率日志");
+        // result = SetDepositPostService.Instance.LDFeeRate("110000004744970", "0.0063", 3, 0);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+        // function.WriteLog("0000320226636450180288", "临时设置费率日志");
+        // result = SetDepositPostService.Instance.LDFeeRate("110000004760326", "0.0063", 3, 0);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+        
+        // function.WriteLog("00003102702303069483466", "临时设置费率日志");
+        // string result = SetDepositPostService.Instance.SetFee("M7000615224RVXMbk7", "00003102702303069483466", 0.63M, 300);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+        // function.WriteLog("00000302JBNL01471793", "临时设置费率日志");
+        // result = SetDepositPostService.Instance.SetFee("M900065131JVMYUBl5", "00000302JBNL01471793", 0.63M, 0);
+        // function.WriteLog(result + "\n\n", "临时设置费率日志");
+
+        // return;
         bool op = true;
         while(op)
         {
@@ -109,4 +136,93 @@ public class TestHelper
         }
     }
 
+
+
+    public void StartJk()
+    {
+        Thread th = new Thread(setJkFee);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void setJkFee()
+    {
+        bool op = true;
+        while(op)
+        {
+            int page = int.Parse(function.CheckInt(function.ReadInstance("/TmpSetJkFee/page.txt")));
+            if(page < 1) page = 1;
+            int skip = (page - 1) * 100;
+            DataTable dt = CustomerSqlConn.dtable("select KqMerNo,KqSnNo from PosMerchantInfo where Id in (select BindMerchantId from PosMachinesTwo where BrandId in (1,3) and (DownFeeFlag=1 or UpFeeFlag=0) and BindingState=1 and BindingTime<'" + DateTime.Now.AddDays(-90).ToString("yyyy-MM-dd HH:mm:ss") + "') limit " + skip + ",100", "server=rm-2vcs4j67tla603c9d5o.mysql.cn-chengdu.rds.aliyuncs.com;port=3306;user=KxsProfitServer;password=FrW8ZfxlcaVdm1r0;database=KxsProfitServer;charset=utf8;");
+            if(dt.Rows.Count > 0)
+            {
+                foreach(DataRow dr in dt.Rows)
+                {
+                    function.WriteLog(dr["KqMerNo"].ToString(), "临时设置金控费率日志");
+                    function.WriteLog(dr["KqSnNo"].ToString(), "临时设置金控费率日志");
+                    string merNo = dr["KqMerNo"].ToString();
+                    string sn = dr["KqSnNo"].ToString();
+                    string result = SetDepositPostService.Instance.SetFee(merNo, sn, 0.63M, 0);
+                    function.WriteLog(result + "\n\n", "临时设置金控费率日志");
+                }
+                page += 1;
+                function.WritePage("/TmpSetJkFee/", "page.txt", page.ToString());
+            }
+            else
+            {
+                op = false;
+                function.WriteLog("执行结束\n\n", "临时设置金控费率日志");
+            }
+            dt.Dispose();
+            dt.Clear();
+        }
+    }
+
+
+    public void StartSft()
+    {
+        Thread th = new Thread(setSftFee);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void setSftFee()
+    {
+        bool op = true;
+        while(op)
+        {
+            int page = int.Parse(function.CheckInt(function.ReadInstance("/TmpSetSftFee/page.txt")));
+            if(page < 1) page = 1;
+            int skip = (page - 1) * 100;
+            DataTable dt = CustomerSqlConn.dtable("select mer.KqMerNo,DownFeeFlag,UpFeeFlag from (select BindMerchantId,DownFeeFlag,UpFeeFlag from PosMachinesTwo where BrandId=7 and BindingState=1 and BindingTime<'" + DateTime.Now.AddDays(-90).ToString("yyyy-MM-dd HH:mm:ss") + "') tb left join PosMerchantInfo mer on tb.BindMerchantId=mer.Id limit " + skip + ",100", "server=rm-2vcs4j67tla603c9d5o.mysql.cn-chengdu.rds.aliyuncs.com;port=3306;user=KxsProfitServer;password=FrW8ZfxlcaVdm1r0;database=KxsProfitServer;charset=utf8;");
+            if(dt.Rows.Count > 0)
+            {
+                foreach(DataRow dr in dt.Rows)
+                {
+                    function.WriteLog(dr["KqMerNo"].ToString(), "临时设置盛付通费率日志");
+                    string merNo = dr["KqMerNo"].ToString();
+                    string DownFeeFlag = dr["DownFeeFlag"].ToString();
+                    string UpFeeFlag = dr["UpFeeFlag"].ToString();
+                    string addRate = "0";
+                    string Fee = "0.6300";
+                    if(UpFeeFlag == "1" && DownFeeFlag == "0")
+                    {
+                        addRate = "3";
+                    }
+                    string result = SetDepositPostService.Instance.SetFeeForSft(merNo, Fee, addRate);
+                    function.WriteLog(result + "\n\n", "临时设置盛付通费率日志");
+                }
+                page += 1;
+                function.WritePage("/TmpSetSftFee/", "page.txt", page.ToString());
+            }
+            else
+            {
+                op = false;
+                function.WriteLog("执行结束\n\n", "临时设置盛付通费率日志");
+            }
+            dt.Dispose();
+            dt.Clear();
+        }
+    }
+
 }

+ 58 - 58
Startup.cs

@@ -166,70 +166,70 @@ namespace MySystem
             }
             if(Library.ConfigurationManager.EnvironmentFlag == 2)
             {
-                SycnSpBindService.Instance.Start(); //同步SP绑定数据
-                SycnSpBindService.Instance.StartSim(); //同步SP广电卡绑定数据
-                SycnSpMerchantService.Instance.Start(); //同步SP商户数据
-                SycnSpActiveService.Instance.Start(); //同步SP激活数据
-                SycnSpTradeService.Instance.Start(); //同步SP交易数据
-                SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
-                SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
-                SycnSpMerchantRecordService.Instance.Start(); //同步SP商户记录数据
+                // SycnSpBindService.Instance.Start(); //同步SP绑定数据
+                // SycnSpBindService.Instance.StartSim(); //同步SP广电卡绑定数据
+                // SycnSpMerchantService.Instance.Start(); //同步SP商户数据
+                // SycnSpActiveService.Instance.Start(); //同步SP激活数据
+                // SycnSpTradeService.Instance.Start(); //同步SP交易数据
+                // SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
+                // SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
+                // SycnSpMerchantRecordService.Instance.Start(); //同步SP商户记录数据
 
-                StatService.Instance.StartActiveReward(); //实时处理激活奖励
-                StatService.Instance.StartActiveReward1(); //实时处理0押激活奖励
-                StatService.Instance.StartActiveReward2(); //实时处理盒易付0押激活奖励
-                StatService.Instance.StartSimActive(); //实时广电卡激活奖励
-                StatService.Instance.StartOpenReward(); //实时获取开机奖励
-                StatService.Instance.ListenFluxRecord(); //实时获取流量费分佣
-                LeaderPrizeService.Instance.Start(); //大盟主奖励发奖
-                OperatePrizeService.Instance.Start(); //运营中心奖励发奖
-                StatService.Instance.StatUserLevel(); //升级
-                ProfitHelperV2.Instance.StatProfit(); //创客分润
-                RedPackageV2Helper.Instance.Start(); //每天生成红包
-                RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
-                RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
-                ActRewardService.Instance.Start(); //发放激活奖励
-                HelpProfitPreMerchantHelper.Instance.Start(); //助利宝每天增加指定数量商机
-                AddActService.Instance.Start(); //划拨后检查机具激活状态,并自动补录
-                PrePosRingService.Instance.Start(); //预发未申请提醒
-                PrePosWithholdService.Instance.Start(); //预发机过期未申请提交到预扣款
-                PrePosWithholdService.Instance.StartPre(); //预发机申请成功,处理预扣款
-                SycnMerchantTradeService.Instance.Start(); //同步商户交易额
+                // StatService.Instance.StartActiveReward(); //实时处理激活奖励
+                // StatService.Instance.StartActiveReward1(); //实时处理0押激活奖励
+                // StatService.Instance.StartActiveReward2(); //实时处理盒易付0押激活奖励
+                // StatService.Instance.StartSimActive(); //实时广电卡激活奖励
+                // StatService.Instance.StartOpenReward(); //实时获取开机奖励
+                // StatService.Instance.ListenFluxRecord(); //实时获取流量费分佣
+                // LeaderPrizeService.Instance.Start(); //大盟主奖励发奖
+                // OperatePrizeService.Instance.Start(); //运营中心奖励发奖
+                // StatService.Instance.StatUserLevel(); //升级
+                // ProfitHelperV2.Instance.StatProfit(); //创客分润
+                // RedPackageV2Helper.Instance.Start(); //每天生成红包
+                // RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
+                // RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
+                // ActRewardService.Instance.Start(); //发放激活奖励
+                // HelpProfitPreMerchantHelper.Instance.Start(); //助利宝每天增加指定数量商机
+                // AddActService.Instance.Start(); //划拨后检查机具激活状态,并自动补录
+                // PrePosRingService.Instance.Start(); //预发未申请提醒
+                // PrePosWithholdService.Instance.Start(); //预发机过期未申请提交到预扣款
+                // PrePosWithholdService.Instance.StartPre(); //预发机申请成功,处理预扣款
+                // SycnMerchantTradeService.Instance.Start(); //同步商户交易额
 
-                MessageCenterService.Instance.Start(); // 消息队列
-                SetFeeFlagService.Instance.Start(); //88天提前通知创客费率调升消息
-                LeaderTimeoutSendMessageService.Instance.Start(); //盟主过期消息提醒
-                SetDepositService.Instance.Start(); //调整费率(通知、标记)
+                // MessageCenterService.Instance.Start(); // 消息队列
+                // SetFeeFlagService.Instance.Start(); //88天提前通知创客费率调升消息
+                // LeaderTimeoutSendMessageService.Instance.Start(); //盟主过期消息提醒
+                // SetDepositService.Instance.Start(); //调整费率(通知、标记)
 
-                AlipayPayBack2Service.Instance.Start(); //支付宝回调处理
-                BalancePayBackService.Instance.Start(); //余额支付队列
-                ReservePayBackService.Instance.Start(); //储备金支付队列
-                OrderRefundService.Instance.Start(); //商城订单退款
+                // AlipayPayBack2Service.Instance.Start(); //支付宝回调处理
+                // BalancePayBackService.Instance.Start(); //余额支付队列
+                // ReservePayBackService.Instance.Start(); //储备金支付队列
+                // OrderRefundService.Instance.Start(); //商城订单退款
 
-                StatService.Instance.Start(); //每日重置交易额
-                StoreApplyHelper.Instance.Start(); // 每月1号重置仓库额度
-                DepositReturnStatService.Instance.Start(); //每月1号统计达标商户(退押需要的)
-                DepositReturnStatService.Instance.StartEverTime(); //统计单个商户达标数据(退押需要的)
-                AutoOpOrderService.Instance.StartOrderCancel(); //自动取消超时订单(15分钟)
-                OperateStockService.Instance.Start(); //运营中心库存实时更新
-                ResetSmallStoreHelper.Instance.Start(); //每月重置小分仓额度
-                ResetSmallStoreHelper.Instance.Listen(); //监听每月1号重置小分仓额度
-                OperateService.Instance.Start(); //运营中心每天统计一次发货量、库存
-                TimeOutPosChargeService.Instance.StartDoChargeAmount(); //实时监听待扣款记录,并扣费
-                InstallmentDeductionService.Instance.Start(); //分期扣款(每月20号执行)
+                // StatService.Instance.Start(); //每日重置交易额
+                // StoreApplyHelper.Instance.Start(); // 每月1号重置仓库额度
+                // DepositReturnStatService.Instance.Start(); //每月1号统计达标商户(退押需要的)
+                // DepositReturnStatService.Instance.StartEverTime(); //统计单个商户达标数据(退押需要的)
+                // AutoOpOrderService.Instance.StartOrderCancel(); //自动取消超时订单(15分钟)
+                // OperateStockService.Instance.Start(); //运营中心库存实时更新
+                // ResetSmallStoreHelper.Instance.Start(); //每月重置小分仓额度
+                // ResetSmallStoreHelper.Instance.Listen(); //监听每月1号重置小分仓额度
+                // OperateService.Instance.Start(); //运营中心每天统计一次发货量、库存
+                // TimeOutPosChargeService.Instance.StartDoChargeAmount(); //实时监听待扣款记录,并扣费
+                // InstallmentDeductionService.Instance.Start(); //分期扣款(每月20号执行)
 
-                ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
-                RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
-                StoreApplyHelper.Instance.StartEverTime(); //分仓临时额度变更
-                PreStoreApplyHelper.Instance.StartEverTime(); //小分仓临时额度变更
-                SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
-                SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
-                OperateAmountService.Instance.Start(); //运营中心额度变更
-                LeaderApplyCouponsHelper.Instance.Start(); //盟主储蓄金申请机具券打标记
-                DepositReturnService.Instance.Start(); //退押金到支付宝余额
-                StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
+                // ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
+                // RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
+                // StoreApplyHelper.Instance.StartEverTime(); //分仓临时额度变更
+                // PreStoreApplyHelper.Instance.StartEverTime(); //小分仓临时额度变更
+                // SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
+                // SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
+                // OperateAmountService.Instance.Start(); //运营中心额度变更
+                // LeaderApplyCouponsHelper.Instance.Start(); //盟主储蓄金申请机具券打标记
+                // DepositReturnService.Instance.Start(); //退押金到支付宝余额
+                // StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
 
-                // TestHelper.Instance.Start();
+                TestHelper.Instance.Start();
             }