using System; using System.Collections.Generic; using System.Linq; using System.Text; //---------------------------------------------------------------- //Module Name: $safeprojectname$ //Purpose: //CopyRight: Muchinfo //History: //---------------------------------------------------------------- //DateTime 2017/1/12 0:17:23 //Author //Description Create //---------------------------------------------------------------- using Muchinfo.MTPClient.Adapter.Abstract; using Muchinfo.MTPClient.Data; using Muchinfo.MTPClient.Data.Model; using Muchinfo.MTPClient.Data.Model.Account; using Muchinfo.MTPClient.Infrastructure.LinkProxy; using Muchinfo.MTPClient.IService; using Muchinfo.MTPClient.NetworkCore; using Muchinfo.MTPClient.Resources; using Muchinfo.MTPClient.Service.Utilities; namespace Muchinfo.MTPClient.Service { public class DepositService : IDepositService { private SaleAdapter _saleAdapter; public DepositService() { _saleAdapter = LinkManager.Instance.TradeAdapterFactory.CreateSaleAdapter(); } public void QueryDepositPlanGoods(Action> successAction, Action errorAction) { var queryCommonParams = new List(); //queryCommonParams.Add(new QueryCommonParam(){ParamKey = "111",ParamValue = "1111"} ); QueryCommonHelper.QueryCommon(QueryStatement.QueryDepositPlan, queryCommonParams, new Action>( (deposits) => { successAction(deposits); }), (error) => { error.RequestFunc = Client_Resource.Resources_Service_QueryAccountGoodsParams; if (errorAction != null) errorAction(error); }); } /// /// 托管申请 /// /// 申请内容 /// /// public void DepositApply(DepositOrder depositOrder, Action successAction, Action errorAction) { return; //var reqeust = _saleAdapter.ToDepositReqBytes(depositOrder); //var packgage = new TCPPackage() { Content = reqeust, FunCode = FuncCode.FID_DepositReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((revPackgage) => //{ // var responeEntrity = _saleAdapter.ToLocalDepositEntity(revPackgage.Content); // if (responeEntrity.RetCode == 0) // { // //todo:生成委托单 // successAction(responeEntrity.Entity); // } // else // { // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = responeEntrity.RetCode, ReturnDesc = responeEntrity.RetMessage, RequestFunc = Client_Resource.Resources_Service_DepositOrder }); // } // } //}), new Action((errorCode, errorDesc) => //{ ////通信错误 // if (errorAction != null) // { // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_DepositOrder }); // } //})); } public void QueryDepositWareHouse(long areaId, Action> successAction, Action errorAction) { var queryCommonParams = new List(); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "areaId", ParamValue = areaId +string.Empty}); QueryCommonHelper.QueryCommon(QueryStatement.QueryDepositWareHouse, queryCommonParams, new Action>( (wareHouses) => { successAction(wareHouses); }), (error) => { error.RequestFunc = Client_Resource.AResources_Service_QueryDepositWareHouse; if (errorAction != null) errorAction(error); }); } public void QueryDepositApply(ulong accountid, DateTime begintime, DateTime endtime, Action> successAction, Action errorAction) { var queryCommonParams = new List(); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "accountId", ParamValue = accountid + string.Empty }); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "startDate", ParamValue = begintime.ToString("yyyy-MM-dd") }); queryCommonParams.Add(new QueryCommonParam() { ParamKey = "endDate", ParamValue = endtime.ToString("yyyy-MM-dd HH:mm:ss") }); QueryCommonHelper.QueryCommon(QueryStatement.QueryDepositApply, queryCommonParams, new Action>( (Applies) => { successAction(Applies); }), (error) => { error.RequestFunc = Client_Resource.AResources_Service_QueryDepositApply; if (errorAction != null) errorAction(error); }); } } }