예제 #1
0
 public static void CheckOrder(DataTable tbSource, string sellerNick)
 {
     if (tbSource != null && tbSource.Rows.Count > 0)
     {
         TBTrade objTrade = new TBTrade();
         for (int i = 0; i < tbSource.Rows.Count; i++)
         {
             string orderNo = tbSource.Rows[i]["OrderNo"].ToString();
             string id      = tbSource.Rows[i]["id"].ToString();
             string company = tbSource.Rows[i]["commpany"].ToString();
             string code    = BatchShippingDAL.GetLogistCodeByName(company);
             if (!string.IsNullOrEmpty(code))
             {
                 Trade trade = objTrade.GetBuyerInfoByTid(Convert.ToInt64(orderNo));
                 if (trade != null)
                 {
                     if (trade.Status.Equals("WAIT_SELLER_SEND_GOODS"))//等待卖家发货,即:买家已付款
                     {
                         BatchShippingDAL.UpdateOrderStatus(orderNo, sellerNick, id, "可发货", "");
                     }
                     else
                     {
                         BatchShippingDAL.UpdateOrderStatus(orderNo, sellerNick, id, "无效", "该订单号无效");
                     }
                 }
                 else
                 {
                     BatchShippingDAL.UpdateOrderStatus(orderNo, sellerNick, id, "无效", "该订单号无效");
                 }
             }
             else
             {
                 BatchShippingDAL.UpdateOrderStatus(orderNo, sellerNick, id, "无效", "物流公司名称不正确");
             }
         }
     }
 }
예제 #2
0
        /// <summary>
        /// 查询卖家最近半年获得的中差评
        /// 修改人:LU
        /// 日期:20160909
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public List <TradeRateChild> GetSellerRate(String startDate, String endDate, string sellerNick)
        {
            RatingTop rateObj  = new RatingTop();
            TBTrade   objTrade = new TBTrade();
            RatingDAL objDal   = new RatingDAL();

            List <TradeRate> lstTradeRate = new List <TradeRate>();
            //检查商家设置:是否开通半年内差评和退款的买家加入黑名单
            DataRow drCfg = objDal.CheckIsOpenAddBlakList(sellerNick);

            if (drCfg != null)
            {
                //调用接口搜索评价信息:只能获取距今180天内的评价记录(只支持查询卖家给出或得到的评价)
                lstTradeRate = rateObj.GetTradeRate(CurrentPage, PageSize, startDate, endDate, ref total);
            }

            if (lstTradeRate != null && lstTradeRate.Count > 0)
            {
                TradeRateChild objRate = null;
                foreach (TradeRate rate in lstTradeRate)
                {
                    if (TotalPoolRates == null)
                    {
                        TotalPoolRates = new List <TradeRateChild>();
                    }
                    if (!rate.Result.Equals("good"))//将好评过滤掉
                    {
                        if (rate.Result.Equals("neutral"))
                        {
                            rate.Result = "中评";
                        }
                        if (rate.Result.Equals("bad"))
                        {
                            rate.Result = "差评";
                        }
                        objRate           = new TradeRateChild();
                        objRate.Nick      = rate.Nick;
                        objRate.Content   = rate.Content;
                        objRate.ItemTitle = rate.ItemTitle;
                        objRate.Result    = rate.Result;
                        Trade objContact = objTrade.GetBuyerInfoByTid(rate.Tid);
                        objRate.Cellphone = objContact == null ? "" : objContact.ReceiverMobile;
                        objRate.RealName  = objContact == null ? "" : objContact.ReceiverName;
                        objRate.Created   = rate.Created;
                        TotalPoolRates.Add(objRate);
                    }

                    #region 判断黑名单加入条件

                    if (drCfg != null)
                    {
                        if (Convert.ToInt32(drCfg["atuoAddBlackListBadRate"]) > 0)
                        { //开通将半年内差评用户加入黑名单
                            if (!rate.Result.Equals("good"))
                            {
                                //中差评 加入黑名单
                                BlakList objList = new BlakList();
                                objList.SellerNick = sellerNick;
                                objList.BlakName   = rate.Nick;
                                if (!objDal.ChekBlaklist(objList))
                                {
                                    objDal.AddBlaklist(objList);
                                }
                            }
                        }
                        if (Convert.ToInt32(drCfg["atuoAddBlackListTuiKuan"]) > 0)
                        {  //开通将半年内退款用户加入黑名单
                           // 获取单笔交易的部分信息:查询该笔订单是否有退货
                            string buyerNick = objTrade.GetBuyerTradeByTid(rate.Tid);
                            if (!string.IsNullOrEmpty(buyerNick))
                            {
                                //中差评 加入黑名单
                                BlakList objList = new BlakList();
                                objList.SellerNick = sellerNick;
                                objList.BlakName   = buyerNick;
                                if (!objDal.ChekBlaklist(objList))
                                {
                                    objDal.AddBlaklist(objList);
                                }
                            }
                        }
                    }

                    #endregion
                }
            }
            PageNo = PageNo + PageSize;
            if (PageNo < total)
            {
                CurrentPage = CurrentPage + 1;
                GetSellerRate(startDate, endDate, sellerNick);
            }
            PageNo      = 0;
            CurrentPage = 1;
            PageSize    = 100;
            return(TotalPoolRates);
        }