| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 |
- 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 未实现接口
- /// <summary>
- /// 获取所有分行信息
- /// </summary>
- /// <returns>银行分支列表</returns>
- public List<Branchs> GetBranchBanks(string bankId, string cityName, TradeAccount tradeAccount)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// 获取所有省列表地区信息
- /// </summary>
- /// <param name="tradeAccount"></param>
- /// <returns></returns>
- public List<KeyValuePair<string, string>> GetProvinces(TradeAccount tradeAccount)
- {
- //todo:这个接口之前是二级服务配置的物理文件address.txt
- throw new NotImplementedException();
- }
- /// <summary>
- /// 获取所有市地区信息
- /// </summary>
- /// <param name="province"></param>
- /// <param name="tradeAccount"></param>
- /// <returns></returns>
- public List<string> GetCitys(string province, TradeAccount tradeAccount)
- {
- //todo:这个接口之前是二级服务配置的物理文件address.txt
- throw new NotImplementedException();
- }
- public List<AmountQuery> QueryBankOutIn(DateTime startDate, DateTime endDate, TradeAccount tradeAccount)
- {
- throw new NotImplementedException();
- }
- #endregion
-
- #region 已经匹配完成
- /// <summary>
- /// 查询银行出入金
- /// </summary>
- /// <param name="startDate"></param>
- /// <param name="endDate"></param>
- /// <param name="tradeAccount"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void QueryBankOutIn(DateTime startDate, DateTime endDate, TradeAccount tradeAccount, Action<List<AmountQuery>> successAction, Action<ErrorEntity> errorAction)
- {
- return;
- //var packgage = new TCPPackage() { Content = null, FunCode = FuncCode.FID_QueryBankAmountReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryBankInOutOfMoney });
- // }
- //}));
- }
- /// <summary>
- /// 进行银行解约申请
- /// </summary>
- /// <param name="bankInfo"></param>
- /// <param name="tradeAccount"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void BankCaneclSign(SigningBank bankInfo, Action<BankSignResult> successAction, Action<ErrorEntity> errorAction)
- {
- return;
- //var Req = _bankAdapter.ToBankCancelSignReq(bankInfo);
- //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_BankCancelSignReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_BankForCancellation });
- // }
- //}));
- }
- /// <summary>
- /// 签约银行申请
- /// </summary>
- /// <param name="signingBank"></param>
- /// <param name="tradeAccount"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void BankSign(SigningBank signingBank, Action<BankSignResult> successAction, Action<ErrorEntity> 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<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_ContractBankApp });
- // }
- //}));
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="signingBank"></param>
- /// <param name="tradeAccount"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void SignUpdate(SigningBank signingBank, Action<int> successAction, Action<ErrorEntity> 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<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_ChangeOfContractInfo });
- // }
- //}));
- }
-
- /// <summary>
- /// 出入金请求
- /// </summary>
- /// <param name="request">The account.</param>
- /// <returns>BankResponse.</returns>
- public void OutInMoney(Amount amount, SigningBank bankAccountInfo, Action<BankSignResult> successAction, Action<ErrorEntity> 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<TCPPackage>((revPackgage) =>
- //{
- // // BankDepositRsp
- // // BankDepositRsp rsp = ProtobufHelper.Deserialize<BankDepositRsp>(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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestOutInMoney });
- // }
- //}));
- }
- /// <summary>
- /// 签约银行密码确认请求
- /// </summary>
- /// <param name="session">会话</param>
- /// <param name="request">请求实体</param>
- public void SignBankPwd(SignBankPDW request , Action<int> successAction, Action<ErrorEntity> errorAction)
- {
- //var Req = _bankAdapter.ToSignBankPwdReq(request);
- //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_SignBankPwdReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestContractBankPasswordConfirm });
- // }
- //}));
- }
- /// <summary>
- /// 银行平台密钥申请请求
- /// </summary>
- /// <param name="session">会话</param>
- /// <param name="request">请求实体</param>
- public void QueryEncryptKey(EncryptKeyRequest request, Action<EncryptKey> successAction, Action<ErrorEntity> errorAction)
- {
- //var Req = _bankAdapter.ToApplySecretKeyReq(request);
- //var packgage = new TCPPackage() { Content = Req, FunCode = FuncCode.FID_ApplySecretKeyReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_RequestBankPlatformPassword });
- // }
- //}));
- }
-
-
-
- /// <summary>
- /// 城市信息查询请求
- /// </summary>
- /// <param name="session">会话</param>
- /// <param name="request">请求实体</param>
- public void QueryCityInfo(string provinceCode, Action<List<City>> successAction, Action<ErrorEntity> errorAction)
- {
- var request = _bankAdapter.ToRequestQueryCity(provinceCode);
- var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_QueryCityInfoReq };
- LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- {
- ////通信错误
- if (errorAction != null)
- {
- errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryCityInfo });
- }
- }));
- }
- /// <summary>
- /// 省份信息查询请求
- /// </summary>
- /// <param name="session">会话</param>
- /// <param name="request">请求实体</param>
- public void QueryProvinceInfo(Action<List<Province>> successAction, Action<ErrorEntity> errorAction)
- {
- var request = _bankAdapter.ToRequestQueryProvince();
- var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_QueryProvinceInfoReq };
- LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- {
- ////通信错误
- if (errorAction != null)
- {
- errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_QueryProvinceInfo });
- }
- }));
- }
-
- #endregion
- /// <summary>
- /// 出入金查询
- /// </summary>
- /// <param name="statement"></param>
- /// <param name="queryCommonParams"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void QueryBankOutIn(string statement, List<QueryCommonParam> queryCommonParams, Action<List<AmountQuery>> successAction, Action<ErrorEntity> errorAction)
- {
- QueryCommonHelper.QueryCommon(statement, queryCommonParams, new Action<List<AmountQuery>>((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);
- }
- });
- }
- /// <summary>
- /// 查询账号所属会员账号信息
- /// </summary>
- /// <param name="accountId">交易员ID</param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void QueryMemberAccountInfo(ulong accountId, Action<List<AreaAccount>> successAction, Action<ErrorEntity> errorAction)
- {
- List<QueryCommonParam> queryCommonParams = new List<QueryCommonParam>();
- queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty });
- QueryCommonHelper.QueryCommon(QueryStatement.SearchClientMemberAccount, queryCommonParams, new Action<List<AreaAccount>>((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<List<SigningBank>> successAction, Action<ErrorEntity> errorAction)
- {
- List<QueryCommonParam> queryCommonParams = new List<QueryCommonParam>();
- queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty });
- QueryCommonHelper.QueryCommon(QueryStatement.QueryBankCustomerSign, queryCommonParams, new Action<List<SigningBank>>((signInfos) =>
- {
- if (successAction != null)
- {
- successAction(signInfos);
- }
- }), (error) =>
- {
- if (errorAction != null)
- {
- error.RequestFunc ="签约信息查询";
- errorAction(error);
- }
- });
- }
- public void QueryCusBankParamConfig(ulong accountId, Action<List<CusBankInfo>> successAction, Action<ErrorEntity> errorAction)
- {
- List<QueryCommonParam> queryCommonParams = new List<QueryCommonParam>();
- queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountId + string.Empty });
- QueryCommonHelper.QueryCommon(QueryStatement.QueryCusBankParamconfig, queryCommonParams, new Action<List<CusBankInfo>>((bankinfos) =>
- {
- if (successAction != null)
- {
- successAction(bankinfos);
- }
- }), (error) =>
- {
- if (errorAction != null)
- {
- error.RequestFunc = "托管信息查询";
- errorAction(error);
- }
- });
- }
- public void QueryCommonBankInfo(List<QueryCommonParam> queryCommonParams, Action<List<Banks>> successAction, Action<ErrorEntity> errorAction)
- {
-
- QueryCommonHelper.QueryCommon(QueryStatement.QueryBankInfo, queryCommonParams, new Action<List<Banks>>((bankinfos) =>
- {
- if (successAction != null)
- {
- successAction(bankinfos);
- }
- }), (error) =>
- {
- if (errorAction != null)
- {
- error.RequestFunc = "托管信息查询";
- errorAction(error);
- }
- });
- }
- public void QueryBankCustomerSign(string accountCode, Action<ObservableCollection<SigningBank>> successAction, Action<ErrorEntity> errorAction)
- {
- throw new NotImplementedException();
- }
- public void QueryCusBankInfo(Action<List<SigningBank>> successAction, Action<ErrorEntity> errorAction)
- {
- throw new NotImplementedException();
- }
- public void QueryBankInfo(Action<List<Banks>> successAction, Action<ErrorEntity> errorAction)
- {
- throw new NotImplementedException();
- }
- public void QueryBankParamConfig(string cusBankID, Action<List<SigningBank>> successAction, Action<ErrorEntity> errorAction)
- {
- throw new NotImplementedException();
- }
- public void BankGetIdentifyCode(IdentifyCodeReq bankInfo, Action<bool> successAction, Action<ErrorEntity> errorAction)
- {
- var request = _bankAdapter.ToIdentifyCodeReq(bankInfo);
- var packgage = new TCPPackage() { Content = request, FunCode = FuncBankCode.FID_BANK_BankGetIdentifyCodeReq };
- LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- {
- ////通信错误
- if (errorAction != null)
- {
- errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_BankGetIdentifyCode });
- }
- }));
- }
- public void GetBankBalace(SigningBank bankInfo, Action<List<BankBalanceModel>> successAction, Action<ErrorEntity> errorAction)
- {
- //var request = _bankAdapter.ToBankSubBalanceReq(bankInfo);
- //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_QueryBankAccountInfoReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_QueryBankBalance });
- // }
- //}));
- }
- public void BankUnBindBankCard(SigningBank bankInfo, Action<BankUnBindResult> successAction, Action<ErrorEntity> errorAction)
- {
- //var request = _bankAdapter.ToBankUnBindCardReq(bankInfo);
- //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_BankUnbindCardReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Function_BankUnBindBankCard });
- // }
- //}));
- }
- public void BankBindingBankCard(SigningBank bankInfo, Action<BankSignResult> successAction, Action<ErrorEntity> errorAction)
- {
- //var request = _bankAdapter.ToBankRebindCardReq(bankInfo);
- //var packgage = new TCPPackage() { Content = request, FunCode = FuncCode.FID_BankRebindCardReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((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<int, string>((errorCode, errorDesc) =>
- //{
- // ////通信错误
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Function_BankReBindBankCard });
- // }
- //}));
- }
- }
- }
|