/// <summary> /// 赎回通知交易 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btn_RedemptionTrisfer_Click(object sender, EventArgs e) { // try { this.btn_RedemptionTrisfer.Enabled = false; BrokeredMessage brokeredMessage; this.lbl_showmsg5.Text = "正在消耗,请稍等......"; this.txb_RedemptionFnums.Text = "0"; this.txb_RedemptionSnums.Text = "0"; do { brokeredMessage = this.messageReceiverRedemption.Receive(); if (brokeredMessage != null) { string batchBookCreditInfos = brokeredMessage.GetBody <string>(); //转json JObject jObject = JObject.Parse(batchBookCreditInfos); if (jObject == null) { continue; //MessageData } TirisfalUserRedemptionInfoModel tirisfalUserRedemptionInfoModel = jObject["MessageData"].ToString().FromJson <TirisfalUserRedemptionInfoModel>(); //重试5次执行数据 for (int i = 0; i < 5; i++) { Tuple <bool, string> result = await YemApiService.RedemptionSendToTrader(this.loadAppSettings.AssetApiUrl, tirisfalUserRedemptionInfoModel, "RedemptionSendToTraderLogs"); if (result.Item1) { this.UpdateTxtInfos(this.txb_RedemptionSnums); break; } else { if (i == 4) { this.UpdateTxtInfos(this.txb_RedemptionFnums); //记录下来数据 Logger.LoadData(@"RedemptionSendToTraderInfos\ErrorDeadLineInfos.txt", tirisfalUserRedemptionInfoModel.ToJson()); Logger.LoadData(@"RedemptionSendToTraderInfos\ErrorDeadLineInfos.txt", "\r\n"); } } } } } while (brokeredMessage != null); this.btn_RedemptionTrisfer.Enabled = true; MessageBox.Show("本轮次执行完毕"); } catch (Exception exception) { this.lbl_showmsg5.Text = "发生一个错误" + exception.Message; this.btn_RedemptionTrisfer.Enabled = true; Logger.LoadData(@"RedemptionSendToTraderInfos\Errors.txt", exception.Message); } }
/// <summary> /// 批量债转通知银行队列消耗 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btn_consumebatchCreditBank_Click(object sender, EventArgs e) { try { this.lbl_showMsg.Text = "正在消耗......"; this.btn_consumebatchCreditBank.Enabled = false; BrokeredMessage brokeredMessage; this.txb_batchCreditBankSNums.Text = "0"; this.txb_batchCreditBankFNums.Text = "0"; do { brokeredMessage = await this.messageReceiverBatchbookcredit.ReceiveAsync(TimeSpan.FromMinutes(1)); if (brokeredMessage != null) { string batchBookCreditInfos = brokeredMessage.GetBody <string>(); JObject jObject = JObject.Parse(batchBookCreditInfos); if (jObject == null) { continue; } //转json SendDebtForBankModel sendDebtForBankModel = jObject["MessageData"].ToString().FromJson <SendDebtForBankModel>(); //重试5次执行数据 for (int i = 0; i < 5; i++) { bool result = await YemApiService.SendDebtForBank(this.loadAppSettings.AssetApiUrl, sendDebtForBankModel, "SendDebtForBankLogs"); if (result) { this.UpdateTxtInfos(this.txb_batchCreditBankSNums); break; } else { if (i == 4) { this.UpdateTxtInfos(this.txb_batchCreditBankFNums); //记录下来数据 Logger.LoadData(@"SendDebtForBankInfos\ErrorDeadLineInfos.txt", sendDebtForBankModel.ToJson()); Logger.LoadData(@"SendDebtForBankInfos\ErrorDeadLineInfos.txt", "\r\n"); } } } } } while (brokeredMessage != null); this.btn_consumebatchCreditBank.Enabled = true; MessageBox.Show("本轮次执行完毕"); } catch (Exception exception) { this.lbl_showMsg.Text = "发生一个错误" + exception.Message; this.btn_consumebatchCreditBank.Enabled = true; Logger.LoadData(@"SendDebtForBankInfos\Errors.txt", exception.Message); } }
/// <summary> /// 批量债转回调消耗 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btn_batchCreditNotify_Click(object sender, EventArgs e) { try { this.lbl2.Text = "正在消耗......."; this.btn_batchCreditNotify.Enabled = false; BrokeredMessage brokeredMessage; this.txb_BatchCreditNotifyFnums.Text = "0"; this.txb_BatchCreditNotifySnums.Text = "0"; do { brokeredMessage = this.messageReceiverBatchCredit.Receive(); if (brokeredMessage != null) { string batchBookCreditInfos = brokeredMessage.GetBody <string>(); JObject jObject = JObject.Parse(batchBookCreditInfos); if (jObject == null) { continue; } //转json NotifyBatchCreditRequest notifyBatchCreditRequest = jObject["data"].ToString().FromJson <NotifyBatchCreditRequest>(); //重试5次执行数据 for (int i = 0; i < 5; i++) { bool result = await YemApiService.ConfirmDebt(this.loadAppSettings.YemApiUrl, notifyBatchCreditRequest, "BatchCreditNotifyLogs"); if (result) { this.UpdateTxtInfos(this.txb_BatchCreditNotifySnums); break; } else { if (i == 4) { this.UpdateTxtInfos(this.txb_BatchCreditNotifyFnums); //记录下来数据 Logger.LoadData(@"BatchCreditNotifyInfos\ErrorDeadLineInfos.txt", notifyBatchCreditRequest.ToJson()); Logger.LoadData(@"BatchCreditNotifyInfos\ErrorDeadLineInfos.txt", "\r\n"); } } } } } while (brokeredMessage != null); this.btn_batchCreditNotify.Enabled = true; MessageBox.Show("本轮次执行完毕"); } catch (Exception exception) { this.lbl2.Text = "发生一个错误" + exception.Message; this.btn_batchCreditNotify.Enabled = true; Logger.LoadData(@"BatchCreditNotifyInfos\Errors.txt", exception.Message + "----------" + exception.StackTrace); } }
/// <summary> /// 放款通知银行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btn_GrantBank_Click(object sender, EventArgs e) { try { this.lblshwMsg3.Text = "正在执行......."; this.btn_GrantBank.Enabled = false; BrokeredMessage brokeredMessage; this.txb__GrantBankSNums.Text = "0"; this.txb_GrantBankFnums.Text = "0"; do { brokeredMessage = this.messageReceiverAdvanceDebt.Receive(); if (brokeredMessage != null) { string batchBookCreditInfos = brokeredMessage.GetBody <string>(); JObject jObject = JObject.Parse(batchBookCreditInfos); if (jObject == null) { continue; } //转json AdvanceDebtRequest advanceDebtRequest = jObject["MessageData"].ToString().FromJson <AdvanceDebtRequest>(); //重试5次执行数据 for (int i = 0; i < 5; i++) { bool result = await YemApiService.SendAdvanceDebt(this.loadAppSettings.AssetApiUrl, advanceDebtRequest, "SendAdvanceDebtLogs"); if (result) { this.UpdateTxtInfos(this.txb__GrantBankSNums); break; } else { if (i == 4) { this.UpdateTxtInfos(this.txb_GrantBankFnums); //记录下来数据 Logger.LoadData(@"SendAdvanceDebtInfos\ErrorDeadLineInfos.txt", advanceDebtRequest.ToJson()); Logger.LoadData(@"SendAdvanceDebtInfos\ErrorDeadLineInfos.txt", "\r\n"); } } } } } while (brokeredMessage != null); this.btn_GrantBank.Enabled = true; MessageBox.Show("本轮次执行完毕"); } catch (Exception exception) { this.lblshwMsg3.Text = "发生一个错误" + exception.Message; this.btn_GrantBank.Enabled = true; Logger.LoadData(@"SendAdvanceDebtInfos\Errors.txt", exception.Message); } }
private async void button1_Click(object sender, EventArgs e) { List <string> assetIds = this.textBox1.Text.Trim().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); this.textBox2.Text = assetIds.Count + ""; //查询资产详细 string assetApiUrl = ConfigurationManager.AppSettings["assetApiUrl"]; foreach (var item in assetIds) { var result = await AssetApiService.Get <AssetResponse>(assetApiUrl + "/AssetPool/" + item); InsertOnSellAssetInput insertOnSellAssetInput = new InsertOnSellAssetInput { AssetCategoryCode = result.AssetCategoryCode, AssetCode = result.AssetCode, AssetId = result.AssetId, AssetName = result.AssetName, BankCardNo = result.BankCardNO, BankCode = result.BankCode, BidType = result.BidType, BillAmount = result.BillMoney, BillDueDate = result.BillDueDate, BillNo = result.BillNo, BorrPurpose = result.BorrPurpose, CalculatedAmount = result.BillMoney, CardFlag = result.CardFlag, CardName = result.CardName, CardNo = result.BankCardNO, EnterpriseLicenseNum = "320106197711100842", EnterpriseLicenseType = "50", FinancierId = result.FinancierId, FinancierName = result.FinancierName, FinancierType = result.FinancingType + "", IsEntrustedPay = result.IsEntrustedPay, Issuer = result.Issuer, PeriodDays = result.PeriodDays, PeriodType = long.Parse(result.PeriodType), Rate = 600, ProductType = result.ProductType, RepaymentType = result.RepaymentType }; bool result1 = await YemApiService.InsertOnSellAssets(ConfigurationManager.AppSettings["yemApiUrl"], new List <InsertOnSellAssetInput> { insertOnSellAssetInput }); if (result1) { this.textBox3.Text += 1; } } }
private async void button1_Click(object sender, EventArgs e) { //LocalDb //开始申购 //1.获取所有的用户 充值了的 //10000*(1000) try { Random random = new Random(); DataTable dt = SqlHelper.SqlHelper.ExecuteDataTable("select * from AccountUsers where IsVerifed=1 and IsActivity=1 and RechargeAmount>0"); int nums = random.Next(1, 6); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; string userId = dr["UserIdentifier"].ToString(); //授权 while (nums > 0) { int num = random.Next(1, 1001); //预约批量投资 long frezzeAmount = num * 10000; string orderId = Guid.NewGuid().ToGuidString(); BookFrezzeModel bookFrezzeModel = new BookFrezzeModel { FreezeAccountAmount = frezzeAmount, FreezeSumAmount = frezzeAmount, FreezeType = "01", OrderId = orderId, Remark = "", ReturnUrl = "http://www.baidu.com", RpOrderList = null, UserId = userId }; //预约冻结 bool result = await BankGatewayService.BooKFreeze(bookFrezzeModel); if (result) { //购买 BookInvestingModel bookInvestingModel = new BookInvestingModel { Cellphone = dr["CellPhone"].ToString(), CredentialNo = dr["CredentialNo"].ToString(), CredentialType = "10", OrderId = orderId, PurchaseAmount = frezzeAmount, PurchaseStartDateTime = DateTime.Now.ToChinaStandardTime(), RealName = dr["RealName"].ToString(), UserId = userId }; //调用接口 bool result1 = await YemApiService.Booking(ConfigurationManager.AppSettings["yemApiUrl"], bookInvestingModel); } nums -= 1; } nums = random.Next(1, 6); } } catch (Exception exception) { Console.WriteLine(exception); throw; } }
private async void button1_Click(object sender, EventArgs e) { List <string> bb = new List <string>(); for (int i = 0; i < 100; i++) { bb.Add(i + ""); } int nums = 20; int count = 0; List <string> cc = new List <string>(); while (bb.Count > 0) { List <string> relationOrdersSelected; if (count != 0) { int cha = bb.Count - count * nums; if (cha <= 0) { break; } relationOrdersSelected = cha >= nums?bb.GetRange(count *nums, nums) : bb.GetRange(count * nums, cha); } else { relationOrdersSelected = bb.Count >= nums?bb.GetRange(count *nums, nums) : bb; } if (relationOrdersSelected.Count <= 0) { continue; } //执行 cc.AddRange(relationOrdersSelected); count = count + 1; } List <string> assetIds = this.textBox1.Text.Trim().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); this.textBox2.Text = assetIds.Count + ""; //查询资产详细 string assetApiUrl = ConfigurationManager.AppSettings["assetApiUrl"]; foreach (var item in assetIds) { var result = await AssetApiService.Get <AssetResponse>(assetApiUrl + "AssetPool/" + item); if (result != null) { var yembizApiResult = await YemApiService.GetOnSellAssetInfoByAssetId(ConfigurationManager.AppSettings["YemApiUrl"], item); if (yembizApiResult != null) { LoanMoneyRequest loanMoneyRequest = new LoanMoneyRequest { AssetId = result.AssetId, BankCardNO = result.BankCardNO, CardName = result.CardName, IsEntrustedPay = result.IsEntrustedPay, ReceiveUserId = "C9C28A7AD0D345B29D463E73D08EA613", ShareProfitAccount = "6222609163618260515", ShareProfit = 1, UpdatedBy = "System", UserOrderSumMoney = yembizApiResult.ActualCalculatedAmount - 1 + "" }; var loadResult = await AssetApiService.Add(assetApiUrl + "YemFinanciereGrant/Loan", loanMoneyRequest); if (loadResult) { // string url = "http://10.1.25.66:806/YemEnterprisePayer/UpdateStatus?assetId='" + result.AssetId + "'&status=%E9%80%9A%E8%BF%87&assetType=10000&MendReason="; // var submitLoadResult = await AssetApiService.AddNoParam(url); var submitLoadResult = await AssetApiService.AddNoParam(assetApiUrl + "YemFinanciereGrant/SubmitLoan?assetId=" + item + "&updatedBy=1"); if (submitLoadResult) { this.textBox3.Text = Convert.ToInt32(this.textBox3.Text) + 1 + ""; } } } } } }