using Muchinfo.MTPClient.Adapter.Abstract; using Muchinfo.MTPClient.CustomException; using Muchinfo.MTPClient.Data; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Model.Account; using Muchinfo.MTPClient.Data.Model.Bank; using Muchinfo.MTPClient.Infrastructure.Helpers; using Muchinfo.MTPClient.Infrastructure.LinkProxy; using Muchinfo.MTPClient.Infrastructure.Utilities; using Muchinfo.MTPClient.IService; using Muchinfo.MTPClient.NetworkCore; using Muchinfo.MTPClient.NetworkCore.Package; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Windows; using Muchinfo.MTPClient.Data.Model.Sale; using Muchinfo.MTPClient.Service.Utilities; using Muchinfo.PC.Common.Helpers; using tas; using Muchinfo.MTPClient.Resources; using Bank; namespace Muchinfo.MTPClient.Service { public class BankService : IBankService { #region 构造函数 private readonly BankAdapter _bankAdapter; public BankService() { _bankAdapter = LinkManager.Instance.TradeAdapterFactory.CreateBankAdapter(); } #endregion #region 未实现接口 /// /// 获取所有分行信息 /// /// 银行分支列表 public List GetBranchBanks(string bankId, string cityName, TradeAccount tradeAccount) { throw new NotImplementedException(); } /// /// 获取所有省列表地区信息 /// /// /// public List> GetProvinces(TradeAccount tradeAccount) { //todo:这个接口之前是二级服务配置的物理文件address.txt throw new NotImplementedException(); } /// /// 获取所有市地区信息 /// /// /// /// public List GetCitys(string province, TradeAccount tradeAccount) { //todo:这个接口之前是二级服务配置的物理文件address.txt throw new NotImplementedException(); } public List QueryBankOutIn(DateTime startDate, DateTime endDate, TradeAccount tradeAccount) { throw new NotImplementedException(); } #endregion #region 已经匹配完成 /// /// 查询银行出入金 /// /// /// /// /// /// public void QueryBankOutIn(DateTime startDate, DateTime endDate, TradeAccount tradeAccount, Action> successAction, Action errorAction) { return; //var packgage = new TCPPackage() { Content = null, FunCode = FuncCode.FID_QueryBankAmountReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromBankSignRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // // successAction(null); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "查询银行出入金" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_QueryBankInOutOfMoney // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryBankInOutOfMoney }); // } //})); } /// /// 进行银行解约申请 /// /// /// /// /// public void BankCaneclSign(SigningBank bankInfo, Action successAction, Action errorAction) { return; //var Req = _bankAdapter.ToBankCancelSignReq(bankInfo); //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_BankCancelSignReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromBankSignRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // try // { // var rsp = _bankAdapter.FromBankSignRspToBankSignResult(responeEntity); // successAction(rsp); // } // catch (Exception ex) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = ExceptionManager.NetWorkErrorDataError, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // LogHelper.WriteError(typeof (BankService), ex.ToString()); // } // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = string.Format("进行银行解约申请,用户ID({0})" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_BankForCancellation // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_BankForCancellation }); // } //})); } /// /// 签约银行申请 /// /// /// /// /// public void BankSign(SigningBank signingBank, Action successAction, Action errorAction) { return; //var obj= new tas.BankSignReq() //{ // ExtOperatorID = (long)signingBank.ExtOperatorID, // AccountCode = signingBank.AccountCode, // BankAccountNo = signingBank.BankAccount, // BankAccountName = signingBank.AccountName, // CertType = (int)signingBank.CredentialType, // CertID = string.IsNullOrWhiteSpace(signingBank.CredentialNumber) ? "0000" : signingBank.CredentialNumber, // CusBankID = signingBank.CusBankID+string.Empty, // CustomerName = signingBank.CustomerName, // ExBankNo = signingBank.BankId, // ExBankName = signingBank.Name, // OpenBankNo = signingBank.BranchId, // OpenBankName = signingBank.BranchBankName, // PaymentNo = signingBank.PaymentNumber, // ProtocolNo = signingBank.ProtocolNumber, // AccountType = (int)signingBank.AccountType, // Currency = string.IsNullOrWhiteSpace(signingBank.Currency) ? "RMB" : signingBank.Currency, // BankAccountPWD =string.IsNullOrEmpty(signingBank.BankPassword)?string.Empty: signingBank.BankPassword, // //BankAccountPWD = signingBank.BankPassword, // //SerialNumber = request.SerialNumber // // BankAccountPWD = request.BankAccountPWD, // IdentifyCode = signingBank.IdentifyCode, // AgentCertID = signingBank.AgentCID, // AgentCertType = (int)signingBank.AgentCredentialType, // AgentName = signingBank.AgentName, // BankAccountType = (int)signingBank.BankAccountType, // BankCity = signingBank.CityCode, // BankProvince = signingBank.ProvinceCode, // MobilePhone = signingBank.MobilePhone, // BankCardType = signingBank.BankCardType == 0 ? 1 : (int)signingBank.BankCardType, //}; //var Req = _bankAdapter.ToBankSignReq(obj); //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_BankSignReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromBankSignRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // try // { // var rsp = _bankAdapter.FromBankSignRspToBankSignResult(responeEntity); // successAction(rsp); // } // catch (Exception ex) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = ExceptionManager.NetWorkErrorDataError, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // LogHelper.WriteError(typeof (BankService), ex.ToString()); // } // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = string.Format("签约银行申请,用户ID({0})" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_ContractBankApp // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_ContractBankApp }); // } //})); } /// /// /// /// /// /// /// public void SignUpdate(SigningBank signingBank, Action successAction, Action errorAction) { //var sur = new tas.SignUpdateReq() //{ // ExtOperatorID = signingBank.ExtOperatorID, // CustomerSignId = signingBank.CustomerSignId, // AccountCode = signingBank.AccountCode, // AccountType = (int)signingBank.AccountType, // CusBankID = signingBank.CusBankID+string.Empty, // Currency = string.IsNullOrWhiteSpace(signingBank.Currency) ? "RMB" : signingBank.Currency, // OpenBankNo = signingBank.BankId, // OpenBankName = signingBank.Name, // BankAccountNo = signingBank.BankAccount, // BankAccountName = signingBank.AccountName, // BankId = signingBank.BankId, // MobilePhone = signingBank.MobilePhone, // IdentifyCode = signingBank.IdentifyCode, // //SerialNumber = request.SerialNumber //}; //var Req = _bankAdapter.ToSignUpdateReq(sur); //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_SignUpdateReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromSignUpdateRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // successAction(responeEntity.RetCode); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = string.Format("签约信息变更,用户ID({0}) // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_ChangeOfContractInfo // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_ChangeOfContractInfo }); // } //})); } /// /// 出入金请求 /// /// The account. /// BankResponse. public void OutInMoney(Amount amount, SigningBank bankAccountInfo, Action successAction, Action errorAction) { return; //byte[] Req = null; //uint FCode = 0; //#region switch amount.FundsApplyType //switch (amount.FundsApplyType) //{ // case Data.Enums.FundsApplyType.Withdraw: //出金 655597 // FCode = FuncCode.FID_BankWithDrawReq; // var bwdr = new Bank.BankWithDrawReq() // { // // ExtOperatorID = request.OperationFlowId, // ExtOperatorID = (long)amount.AccountId, // AccountCode = amount.AccountCode, // Amount = -(double)amount.Money, // BankAccountNo = bankAccountInfo.BankAccount, // Currency = string.IsNullOrEmpty(bankAccountInfo.Currency) ? "RMB" : bankAccountInfo.Currency, // //OutInMoneyType = (int)request.OutInMoneyType, // AccountType = (int)amount.AccountType,// amount.AccountType, // CusBankID = bankAccountInfo.CusBankID == 0 ? "0" : bankAccountInfo.CusBankID+string.Empty, // CustomerSignId = bankAccountInfo.CustomerSignId, // IdentifyCode = bankAccountInfo.IdentifyCode, // //SerialNumber = request.SerialNumber, // OldTaPWD = string.IsNullOrEmpty(amount.Password) ? string.Empty : EncryptHelper.MD5(amount.Password), // Desc = amount.Remark // }; // Req = _bankAdapter.ToBankWithDrawReq(bwdr); // break; // case Data.Enums.FundsApplyType.Deposit://入金 655599 // FCode = FuncCode.FID_BankDepositReq; // var bdr = new Bank.BankDepositReq() // { // // ExtOperatorID = request.OperationFlowId, // ExtOperatorID = (long)amount.AccountId, // AccountCode = amount.AccountCode, // Amount = (double)amount.Money, // BankAccountNo = bankAccountInfo.BankAccount, // Currency = string.IsNullOrEmpty(bankAccountInfo.Currency) ? "RMB" : bankAccountInfo.Currency, // //OutInMoneyType = (int)request.OutInMoneyType, // AccountType = (int)amount.AccountType,// amount.AccountType, // CusBankID = bankAccountInfo.CusBankID == 0 ? "0" : bankAccountInfo.CusBankID+string.Empty, // CustomerSignId = bankAccountInfo.CustomerSignId, // IdentifyCode=bankAccountInfo.IdentifyCode, // //SerialNumber = request.SerialNumber, // OldTaPWD = string.IsNullOrEmpty(amount.Password) ? string.Empty : EncryptHelper.MD5(amount.Password), // Desc = amount.Remark // }; // Req = _bankAdapter.ToBankDepositReq(bdr); // break; // default: // break; //} //#endregion //var packgage = new TCPPackage() { Content = Req, FunCode = FCode }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // // BankDepositRsp // // BankDepositRsp rsp = ProtobufHelper.Deserialize(buffer); // var responeEntity = _bankAdapter.FromBankDepositRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // try // { // // 待转模型 SignBankPwdInRsp=》 BankSignResult // var rep = _bankAdapter.FromSignBankPwdInRspToBankSignResult(responeEntity); // successAction(rep); // } // catch (Exception ex) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = ExceptionManager.NetWorkErrorDataError, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // LogHelper.WriteError(typeof(BankService), ex.ToString()); // } // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney }); // } //})); } /// /// 签约银行密码确认请求 /// /// 会话 /// 请求实体 public void SignBankPwd(SignBankPDW request , Action successAction, Action errorAction) { //var Req = _bankAdapter.ToSignBankPwdReq(request); //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_SignBankPwdReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromSignBankPwdInRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // successAction(responeEntity.RetCode); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "签约银行密码确认请求" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestContractBankPasswordConfirm // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestContractBankPasswordConfirm }); // } //})); } /// /// 银行平台密钥申请请求 /// /// 会话 /// 请求实体 public void QueryEncryptKey(EncryptKeyRequest request, Action successAction, Action errorAction) { //var Req = _bankAdapter.ToApplySecretKeyReq(request); //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_ApplySecretKeyReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromApplySecretKeyResponse(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // var rsp = new EncryptKey() // { // KMCode = responeEntity.KMCode, // KPCode = responeEntity.KPCode, // SecretKey = responeEntity.SecretKey, // }; // successAction(rsp); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "银行平台密钥申请请求" // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetDesc, // RequestFunc = Client_Resource.Resources_Service_RequestBankPlatformPassword // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestBankPlatformPassword }); // } //})); } /// /// 城市信息查询请求 /// /// 会话 /// 请求实体 public void QueryCityInfo(string provinceCode, Action> successAction, Action errorAction) { var request = _bankAdapter.ToRequestQueryCity(provinceCode); var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_QueryCityInfoReq }; LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => { var responeEntity = _bankAdapter.ToLocalCityInfo(revPackgage.Content); if (responeEntity.RetCode == 0) { successAction(responeEntity.Entity); } else { if (errorAction != null) { errorAction(new ErrorEntity() { //RequestFunc = "城市信息查询请求" ReturnCode = responeEntity.RetCode, ReturnDesc = responeEntity.RetMessage, RequestFunc = Client_Resource.Resources_Service_QueryCityInfo }); } } }), new Action((errorCode, errorDesc) => { ////通信错误 if (errorAction != null) { errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryCityInfo }); } })); } /// /// 省份信息查询请求 /// /// 会话 /// 请求实体 public void QueryProvinceInfo(Action> successAction, Action errorAction) { var request = _bankAdapter.ToRequestQueryProvince(); var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_QueryProvinceInfoReq }; LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => { var responeEntity = _bankAdapter.ToLocalProvinceInfo(revPackgage.Content); if (responeEntity.RetCode == 0) { successAction(responeEntity.Entity); } else { if (errorAction != null) { errorAction(new ErrorEntity() { //RequestFunc = "省份信息查询请求" Resources_Service_QueryProvinceInfo ReturnCode = responeEntity.RetCode, ReturnDesc = responeEntity.RetMessage, RequestFunc = Client_Resource.Resources_Service_QueryProvinceInfo }); } } }), new Action((errorCode, errorDesc) => { ////通信错误 if (errorAction != null) { errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryProvinceInfo }); } })); } #endregion /// /// 出入金查询 /// /// /// /// /// public void QueryBankOutIn(string statement, List queryCommonParams, Action> successAction, Action errorAction) { QueryCommonHelper.QueryCommon(statement, queryCommonParams, new Action>((amountQuery) => { if (successAction != null) { successAction(amountQuery); } }),(error) => { if (errorAction != null) { //RequestFunc = "出入金明细查询({0})" Resources_Service_QueryBankOutIn error.RequestFunc = string.Format(Client_Resource.Resources_Service_QueryBankOutIn, statement); errorAction(error); } }); } /// /// 查询账号所属会员账号信息 /// /// 交易员ID /// /// public void QueryMemberAccountInfo(ulong accountId, Action> successAction, Action errorAction) { List queryCommonParams = new List(); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty }); QueryCommonHelper.QueryCommon(QueryStatement.SearchClientMemberAccount, queryCommonParams, new Action>((amountQuery) => { if (successAction != null) { successAction(amountQuery); } }), (error) => { if (errorAction != null) { error.RequestFunc = string.Format(Client_Resource.Resources_Service_areaAccount, QueryStatement.SearchClientMemberAccount); errorAction(error); } }); } public void QueryBankCustomerSignInfo(ulong accountId, Action> successAction, Action errorAction) { List queryCommonParams = new List(); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty }); QueryCommonHelper.QueryCommon(QueryStatement.QueryBankCustomerSign, queryCommonParams, new Action>((signInfos) => { if (successAction != null) { successAction(signInfos); } }), (error) => { if (errorAction != null) { error.RequestFunc ="签约信息查询"; errorAction(error); } }); } public void QueryCusBankParamConfig(ulong accountId, Action> successAction, Action errorAction) { List queryCommonParams = new List(); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty }); QueryCommonHelper.QueryCommon(QueryStatement.QueryCusBankParamconfig, queryCommonParams, new Action>((bankinfos) => { if (successAction != null) { successAction(bankinfos); } }), (error) => { if (errorAction != null) { error.RequestFunc = "托管信息查询"; errorAction(error); } }); } public void QueryCommonBankInfo(List queryCommonParams, Action> successAction, Action errorAction) { QueryCommonHelper.QueryCommon(QueryStatement.QueryBankInfo, queryCommonParams, new Action>((bankinfos) => { if (successAction != null) { successAction(bankinfos); } }), (error) => { if (errorAction != null) { error.RequestFunc = "托管信息查询"; errorAction(error); } }); } public void QueryBankCustomerSign(string accountCode, Action> successAction, Action errorAction) { throw new NotImplementedException(); } public void QueryCusBankInfo(Action> successAction, Action errorAction) { throw new NotImplementedException(); } public void QueryBankInfo(Action> successAction, Action errorAction) { throw new NotImplementedException(); } public void QueryBankParamConfig(string cusBankID, Action> successAction, Action errorAction) { throw new NotImplementedException(); } public void BankGetIdentifyCode(IdentifyCodeReq bankInfo, Action successAction, Action errorAction) { var request = _bankAdapter.ToIdentifyCodeReq(bankInfo); var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_BankGetIdentifyCodeReq }; LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => { var responeEntity = _bankAdapter.FromIdentifyCodeReq(revPackgage.Content); if (responeEntity.RetCode == 0) { successAction(true); } else { if (errorAction != null) { errorAction(new ErrorEntity() { //RequestFunc = "获取手机验证码" ReturnCode = responeEntity.RetCode, ReturnDesc = responeEntity.RetDesc, RequestFunc = Client_Resource.Resources_Service_BankGetIdentifyCode }); } } }), new Action((errorCode, errorDesc) => { ////通信错误 if (errorAction != null) { errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_BankGetIdentifyCode }); } })); } public void GetBankBalace(SigningBank bankInfo, Action> successAction, Action errorAction) { //var request = _bankAdapter.ToBankSubBalanceReq(bankInfo); //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_QueryBankAccountInfoReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntity = _bankAdapter.FromoBankSubBalanceRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // successAction(responeEntity.Entity); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetMessage, // RequestFunc = Client_Resource.Resources_QueryBankBalance // }); // } // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_QueryBankBalance }); // } //})); } public void BankUnBindBankCard(SigningBank bankInfo, Action successAction, Action errorAction) { //var request = _bankAdapter.ToBankUnBindCardReq(bankInfo); //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_BankUnbindCardReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // try // { // var responeEntity = _bankAdapter.ToBankUnBindCardRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // successAction(responeEntity.Entity); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetMessage, // RequestFunc = Client_Resource.Function_BankUnBindBankCard // }); // } // } // } // catch (Exception ex) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = ExceptionManager.NetWorkErrorDataError, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // LogHelper.WriteError(typeof (BankService), ex.ToString()); // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Function_BankUnBindBankCard }); // } //})); } public void BankBindingBankCard(SigningBank bankInfo, Action successAction, Action errorAction) { //var request = _bankAdapter.ToBankRebindCardReq(bankInfo); //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_BankRebindCardReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // try // { // var responeEntity = _bankAdapter.ToBankReBindCardRsp(revPackgage.Content); // if (responeEntity.RetCode == 0) // { // successAction(responeEntity.Entity); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() // { // ReturnCode = responeEntity.RetCode, // ReturnDesc = responeEntity.RetMessage, // RequestFunc = Client_Resource.Function_BankReBindBankCard // }); // } // } // } // catch (Exception ex) // { // errorAction(new ErrorEntity() // { // //RequestFunc = "出入金请求" // ReturnCode = ExceptionManager.NetWorkErrorDataError, // RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney // }); // LogHelper.WriteError(typeof(BankService), ex.ToString()); // } //}), new Action((errorCode, errorDesc) => //{ // ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Function_BankReBindBankCard }); // } //})); } } }