Browse Source

新增模板库查询接口

zhuyiyi 2 months ago
parent
commit
7f81d1b9ad
1 changed files with 36 additions and 0 deletions
  1. 36 0
      SiteCore/taobao/dataHelper.cs

+ 36 - 0
SiteCore/taobao/dataHelper.cs

@@ -251,6 +251,42 @@ namespace SiteCore.Handler
             ReturnSuccess(JsonConvert.SerializeObject(data));
             return;
         }
+        public void getOrderInfo()
+        {
+            string ctid = GetPostString("ctid");
+            if (string.IsNullOrEmpty(ctid))
+            {
+                returnErrorMsg("参数错误");
+                return;
+            }
+            CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ctid);
+            if (ceErpTradeCell == null)
+            {
+                returnErrorMsg("查无订单");
+                return;
+            }
+            CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
+            CeErpProduct ceErpProduct = CeErpProduct.Get(ceErpTradeCell.ProductId);
+            Dictionary<string, object> data = new Dictionary<string, object>();
+            data.Add("orderNumber", ctid);
+            data.Add("customerName", ceErpTrade.buyer_nick);
+            DateTime dateTime = (DateTime)ceErpTradeCell.pay_time;
+            data.Add("orderTime", dateTime.ToString("yyyy-MM-dd HH:mm:ss"));
+            data.Add("commodityName", ceErpProduct.PType);
+            data.Add("storeName", ceErpTrade.seller_nick);
+            data.Add("orderRemark", ceErpTradeCell.seller_memo);
+
+            string sql = string.Format("SELECT tid FROM [dbo].[view_ErpTradeCell] WITH(NOLOCK) WHERE (buyer_id = '{0}') and seller_nick = '{1}' and OrderState < 5 and IsSample = 0 ", ceErpTrade.buyer_id, ceErpTrade.seller_nick);
+            DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+            int orderCount = 1;
+            if (dataTable != null && dataTable.Rows != null && dataTable.Rows.Count > 0)
+            {
+                orderCount = dataTable.Rows.Count;
+            }
+            data.Add("orderCount", orderCount);
+            ReturnSuccess(JsonConvert.SerializeObject(data));
+            return;
+        }
 
         //http://47.114.150.226:88/Handler/dataHelper.ashx?t=get_cell_info   post请求参数(参数放body中):string tid(淘宝订单号)
         public void get_cell_info()