Example #1
0
 /// <summary>
 /// 获取挂牌列表
 /// </summary>
 public void GetCommodity()
 {
     #region 拉取挂牌列表
     var commodity = HttpService.GetList();
     if (commodity != null && commodity.Success && commodity.Result != null)
     {
         AllListedList CommodityData = commodity.Result;
         CommodityDataDy.Clear();
         foreach (var v in CommodityData.sellList)
         {
             if (v != null && v.id != null && !HttpService.JudgmentBlack(v.PublisherId))
             {
                 if (!CommodityDataDy.ContainsKey(v.id))
                 {
                     CommodityDataDy.Add(v.id, v);
                 }
             }
         }
         foreach (var v in CommodityData.buyList)
         {
             if (v != null && v.id != null && !HttpService.JudgmentBlack(v.PublisherId))
             {
                 if (!CommodityDataDy.ContainsKey(v.id))
                 {
                     CommodityDataDy.Add(v.id, v);
                 }
             }
         }
         UpdataAllCommodityEvent?.Invoke();
     }
     #endregion
 }
Example #2
0
        private void MQTTService_UpdataEvent(string obj)
        {
            if (obj != null)
            {
                if (obj == "getBaseInfo")
                {
                    //刷新
                    GetContract();
                    return;
                }

                //挂牌信息
                var b1 = Helper.Deserialize <OneListedResponse>(obj);

                if (b1.Success && b1.Result != null && CommodityDataDy != null)
                {
                    int       type = 2;
                    OneListed cd   = b1.Result;
                    if (cd != null && !HttpService.JudgmentBlack(cd.PublisherId))
                    {
                        if (cd.id != null)
                        {
                            if (CommodityDataDy.ContainsKey(cd.id))
                            {
                                //更新
                                CommodityDataDy[cd.id].Update(cd);
                                type = 2;//更新
                            }
                            else
                            {
                                type = cd.transType;
                                CommodityDataDy.Add(cd.id, cd);
                            }
                            UpdataCommodityInfoEvent?.Invoke(cd, type);
                        }
                    }
                    return;
                }

                //if (b1.Result.TransStatusName == "摘牌")
                //{
                //    //摘牌
                //    var b2 = Helper.Deserialize<DelistBrandOrderResponseArguments>(obj);
                //    if (b2.data != null)
                //    {
                //        UpdataDelistingEvent?.Invoke(b2.data);
                //        return;
                //    }
                //}
                ////核销
                //var b3 = Helper.Deserialize<DelistBrandVerifyResponseArguments>(obj);
                //if (b3.Success && b3.data != null)
                //{
                //    NoticeWriteOffEvent?.Invoke(b3.data);
                //}
                ////撤牌
                //var b4 = Helper.Deserialize<ActionOrderResponseArguments>(obj);
                //if (b4.Success && b4.result != null)
                //{
                //    NoticeWithdrawTheCard?.Invoke(b4.result);
                //}
                UpdataEvent?.Invoke(obj);
            }
        }