SaleService.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using System.Linq;
  2. using Muchinfo.MTPClient.Adapter.Abstract;
  3. using Muchinfo.MTPClient.Data;
  4. using Muchinfo.MTPClient.Data.Model.Account;
  5. using Muchinfo.MTPClient.Data.Model.Sale;
  6. using Muchinfo.MTPClient.Infrastructure.LinkProxy;
  7. using Muchinfo.MTPClient.Infrastructure.Utilities;
  8. using Muchinfo.MTPClient.IService;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Collections.ObjectModel;
  12. using Muchinfo.MTPClient.NetworkCore;
  13. using Muchinfo.MTPClient.Service.Utilities;
  14. using Muchinfo.MTPClient.Resources;
  15. namespace Muchinfo.MTPClient.Service
  16. {
  17. public class SaleService : ISaleService
  18. {
  19. private SaleAdapter _saleAdapter;
  20. public SaleService()
  21. {
  22. _saleAdapter = LinkManager.Instance.TradeAdapterFactory.CreateSaleAdapter();
  23. }
  24. public ObservableCollection<MTPClient.Data.Model.Sale.SaleGoods> QueryAccountSaleGoodsRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodCode, int MarketId)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public List<MTPClient.Data.Model.Sale.SaleApply> QuerySaleApplyRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodsCode)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. public List<MTPClient.Data.Model.ParameterRule> QueryParameterRule(int contRightCode, uint goodsID, string loginCode)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public List<MTPClient.Data.Model.Sale.StrategicInvestor> QueryStrategicInvestor(MTPClient.Data.Model.Account.TradeAccount tradeAccount)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. /// <summary>
  41. /// 发售下单
  42. /// </summary>
  43. /// <param name="saleOrder"></param>
  44. /// <param name="successAction"></param>
  45. /// <param name="errorAction"></param>
  46. public void SaleEntrurstOrder(Data.Model.NewEntrustOrder saleOrder, Action<Data.Model.Account.OrderDetail> successAction, Action<Data.ErrorEntity> errorAction)
  47. {
  48. return;
  49. //var reqeust = _saleAdapter.ToSaleEntrustOrder(saleOrder);
  50. //var packgage = new TCPPackage() { Content = reqeust, FunCode = FuncCode.FID_IMOrderReq };
  51. //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((revPackgage) =>
  52. //{
  53. // var responeEntrity = _saleAdapter.ToSaleOrder(revPackgage.Content);
  54. // if (responeEntrity.RetCode == 0)
  55. // {
  56. // //todo:生成委托单
  57. // successAction(responeEntrity.Entity);
  58. // }
  59. // else
  60. // {
  61. // if (errorAction != null)
  62. // {
  63. // errorAction(new ErrorEntity() { ReturnCode = responeEntrity.RetCode, ReturnDesc = responeEntrity.RetMessage, RequestFunc = Client_Resource.Resources_Service_SaleEntrurstOrder });
  64. // }
  65. // }
  66. //}), new Action<int, string>((errorCode, errorDesc) =>
  67. //{ ////通信错误
  68. // if (errorAction != null)
  69. // {
  70. // //RequestFunc = "发售下单"
  71. // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_SaleEntrurstOrder });
  72. // }
  73. //}));
  74. }
  75. /// <summary>
  76. /// 查询发行商品
  77. /// </summary>
  78. /// <param name="statement"></param>
  79. /// <param name="queryCommonParams"></param>
  80. /// <param name="successAction"></param>
  81. /// <param name="errorAction"></param>
  82. public void QueryAccountSaleGoodsRpt(string statement, List<QueryCommonParam> queryCommonParams, Action<List<Data.Model.Sale.SaleGoods>> successAction, Action<Data.ErrorEntity> errorAction)
  83. {
  84. QueryCommonHelper.QueryCommon(statement, queryCommonParams, new Action<List<SaleGoods>>((orderDetails) =>
  85. {
  86. if (successAction != null)
  87. {
  88. successAction(orderDetails);
  89. }
  90. }), (error) =>
  91. {
  92. if (errorAction != null)
  93. {
  94. //RequestFunc = "查询发行商品"
  95. error.RequestFunc = Client_Resource.Resources_Service_QueryAccountSaleGoodsRpt;
  96. errorAction(error);
  97. }
  98. });
  99. }
  100. public void QueryAccountDistributeBallot(List<QueryCommonParam> queryCommonParams, Action<List<DistributeBallot>> successAction, Action<ErrorEntity> errorAction)
  101. {
  102. QueryCommonHelper.QueryCommon(QueryStatement.QueryDistributeBallot, queryCommonParams, new Action<List<DistributeBallot>>((orders) =>
  103. {
  104. if (successAction != null)
  105. {
  106. successAction(orders);
  107. }
  108. }), (error) =>
  109. {
  110. if (errorAction != null)
  111. {
  112. //RequestFunc = "查询配号中签"
  113. error.RequestFunc = Client_Resource.Resources_Service_QueryAccountDistributeBallot;
  114. errorAction(error);
  115. }
  116. });
  117. }
  118. }
  119. }