Selaa lähdekoodia

新增查询订单详情

zhuyiyi 2 viikkoa sitten
vanhempi
sitoutus
c3f5d54257
2 muutettua tiedostoa jossa 21 lisäystä ja 3 poistoa
  1. 3 1
      SiteCore/Handler/sync.order.cs
  2. 18 2
      SiteCore/taobao/dataHelper.cs

+ 3 - 1
SiteCore/Handler/sync.order.cs

@@ -66,7 +66,7 @@ namespace SiteCore.Handler
             DataStruct dStruct = GetPostStruct();
 
             //string a = SecurityHelper.DecryptSymmetric("BnK3+504SQ8=");
-            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\香薰卡售价.xlsx");
+            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\新品售价(1).xls");
             //apiHelper.Api_SyncOrderByTime("598825");
             //apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
             //apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
@@ -278,6 +278,8 @@ namespace SiteCore.Handler
             string price2 = GetPostString("price2");
             if (price2.Length > 0) lw.Add(string.Format("payment <= '{0}'", price2));
             string isoldcustomer = GetPostString("isoldcus");
+            string buyer_id = GetPostString("buyer_id");
+            if (buyer_id.Length > 0) lw.Add(string.Format("buyer_id = '{0}'", buyer_id));
             string spudata = GetPostString("spudata");
             if ("0".Equals(spudata))
             {

+ 18 - 2
SiteCore/taobao/dataHelper.cs

@@ -311,14 +311,14 @@ namespace SiteCore.Handler
                 returnErrorMsg("缺少必要参数");
                 return;
             }
-
-            string sql = string.Format("SELECT tid,ctid,payment,ProductName,OrderState,Material,Craft,ProductSize,ProductCount,posCode,seller_nick,buyer_nick,buyer_id,FinishDesignTime FROM [dbo].[view_ErpTradeCell] WHERE {0}", where);
+            string sql = string.Format("SELECT tid,ctid,payment,ProductName,OrderState,Material,Craft,ProductSize,ShopId,ProductCount,posCode,seller_nick,buyer_nick,buyer_id,FinishDesignTime FROM [dbo].[view_ErpTradeCell] WHERE {0}", where);
 
             DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
 
             List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
             if (dataTable != null && dataTable.Rows.Count > 0)
             {
+                string shopCode = "";
                 Dictionary<string, object> data = new Dictionary<string, object>();
                 foreach (DataRow row in dataTable.Rows)
                 {
@@ -356,6 +356,22 @@ namespace SiteCore.Handler
                     data.Add("ProductCount", row["ProductCount"]);
                     data.Add("ProductName", row["ProductName"]);
                     data.Add("FinishDesignTime", row["FinishDesignTime"]);
+                    if (string.IsNullOrEmpty(row["posCode"].ToString()) && !string.IsNullOrEmpty(shopCode))
+                    {
+                        data["shopCode"] = shopCode;
+                    }
+
+                    if (!string.IsNullOrEmpty(row["ShopId"].ToString()) && string.IsNullOrEmpty(shopCode) && string.IsNullOrEmpty(row["posCode"].ToString()))
+                    {
+                        string shopsql = string.Format("SELECT posCode FROM [dbo].[view_ErpTradeCell] WHERE ShopId = {0} and posCode <> ''  ORDER BY ID desc;", row["ShopId"]);
+
+                        DataTable shopData = DbHelper.DbConn.ExecuteDataset(shopsql).Tables[0];
+                        if (shopData != null && shopData.Rows.Count > 0)
+                        {
+                            data["shopCode"] = shopData.Rows[0]["posCode"];
+                        }
+                    }
+                    shopCode = data["shopCode"].ToString();
                     list.Add(data);
                 }
             }