zhuyiyi il y a 10 mois
Parent
commit
b6d71c70e2

+ 133 - 24
SiteCore/Handler/sync.order.cs

@@ -2424,6 +2424,21 @@ namespace SiteCore.Handler
             return tid;
         }
 
+        public List<string> getTidByCtidLike(string ctid)
+        {
+            string sql = string.Format("select tid from CE_ErpTradeCell where (ctid='{0}' or tid='{0}' or orderSn='{0}')", ctid);
+            DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+            List<string> list = new List<string>();
+            if (dataTable != null && dataTable.Rows.Count > 0)
+            {
+                foreach (DataRow item in dataTable.Rows)
+                {
+                    list.Add("'" + item["tid"].ToString() + "'");
+                }
+            }
+            return list;
+        }
+
         public void get_erp_myorderlist()
         {
             DataStruct dStruct = GetPostStruct();
@@ -4186,7 +4201,17 @@ namespace SiteCore.Handler
             string tid = GetPostString("ctid");
             if (tid.Length > 0)
             {
-                if (tid.Length > 0) lw.Add(string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid));
+                string tid_sql = string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid);
+                if (tid.Length > 5)
+                {
+                    List<string> tids = getTidByCtidLike(tid);
+                    if (tids.Count > 0 && tids.Count < 10)
+                    {
+                        tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
+                    }
+                }
+
+                lw.Add(tid_sql);
             }
             string shopname = GetPostString("shopname");
             if (shopname.Length > 0) lw.Add(string.Format("seller_nick='{0}'", shopname));
@@ -4238,24 +4263,7 @@ namespace SiteCore.Handler
             dStruct.Order = "MemoOpt desc,IsSF desc, FinishPlaceTime desc, ctid desc";
             dStruct.MainWhere = string.Join(" and ", lw.ToArray());
             DataTable dt = WebCache.GetData("view_erptradecell", dStruct);
-            /*if (tid.Length > 0)
-            {
-                List<string> tids = new List<string>();
-                if (dt != null && dt.Rows.Count > 0)
-                {
-                    foreach (DataRow item in dt.Rows)
-                    {
-                        tids.Add("'" + item["tid"] + "'");
-                    }
-                }
-                if (tids.Count > 0)
-                {
-                    lw.RemoveAt(0);
-                    lw.Add(string.Format("tid in ({0})", string.Join(", ", tids)));
-                    dStruct.MainWhere = string.Join(" and ", lw.ToArray());
-                    dt = WebCache.GetData("view_erptradecell", dStruct);
-                }
-            }*/
+
             writeGridDataTableJson(dStruct.TotalCount, dt);
         }
         public void get_erp_changedeliverylist()
@@ -4265,8 +4273,17 @@ namespace SiteCore.Handler
             string tid = GetPostString("ctid");
             if (tid.Length > 0)
             {
-                lw.Add(string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid));
+                string tid_sql = string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid);
+                if (tid.Length > 5)
+                {
+                    List<string> tids = getTidByCtidLike(tid);
+                    if (tids.Count > 0 && tids.Count < 10)
+                    {
+                        tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
+                    }
+                }
 
+                lw.Add(tid_sql);
             }
             string shopname = GetPostString("shopname");
             if (shopname.Length > 0) lw.Add(string.Format("seller_nick='{0}'", shopname));
@@ -4343,7 +4360,20 @@ namespace SiteCore.Handler
             DataStruct dStruct = GetPostStruct();
             List<string> lw = new List<string>();
             string tid = GetPostString("ctid");
-            if (tid.Length > 0) lw.Add(string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid));
+            if (tid.Length > 0)
+            {
+                string tid_sql = string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid);
+                if (tid.Length > 5)
+                {
+                    List<string> tids = getTidByCtidLike(tid);
+                    if (tids.Count > 0 && tids.Count < 10)
+                    {
+                        tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
+                    }
+                }
+
+                lw.Add(tid_sql);
+            }
 
             string shopname = GetPostString("shopname");
             if (shopname.Length > 0) lw.Add(string.Format("seller_nick='{0}'", shopname));
@@ -5139,8 +5169,17 @@ namespace SiteCore.Handler
             {
                 if (tid.Length > 0)
                 {
-                    lw.Add(string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%')", tid));
+                    string tid_sql = string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid);
+                    if (tid.Length > 5)
+                    {
+                        List<string> tids = getTidByCtidLike(tid);
+                        if (tids.Count > 0 && tids.Count < 10)
+                        {
+                            tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
+                        }
+                    }
 
+                    lw.Add(tid_sql);
                 }
                 if (buyernick.Length > 0)
                     lw.Add(string.Format("buyer_nick='{0}'", buyernick));
@@ -5236,8 +5275,17 @@ namespace SiteCore.Handler
             {
                 if (tid.Length > 0)
                 {
-                    lw.Add(string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%')", tid));
+                    string tid_sql = string.Format("(ctid like '%{0}%' or OrderSn like '%{0}%') ", tid);
+                    if (tid.Length > 5)
+                    {
+                        List<string> tids = getTidByCtidLike(tid);
+                        if (tids.Count > 0 && tids.Count < 10)
+                        {
+                            tid_sql = string.Format("tid in ({0}) ", string.Join(",", tids));
+                        }
+                    }
 
+                    lw.Add(tid_sql);
                 }
                 if (buyernick.Length > 0)
                     lw.Add(string.Format("buyer_nick='{0}'", buyernick));
@@ -6896,7 +6944,7 @@ namespace SiteCore.Handler
                                 newentity.OrderSn = orderSn;
                             }
                         }
-                        
+
                         newentity.AfterSaleState = 0;
                         newentity.AfterSaleMethod = afterMethod;
                         if (!ishav)
@@ -12191,6 +12239,13 @@ namespace SiteCore.Handler
                         {
                             map["today"]++;
                         }
+                        else
+                        {
+                            if (supplierId == 119)
+                            {
+                                Debug.WriteLine(row["seller_memo"].ToString());
+                            }
+                        }
                     }
                 }
                 if (row["UnusualTime"].ToString() != null && row["UnusualTime"].ToString().Length > 0)
@@ -12794,6 +12849,60 @@ namespace SiteCore.Handler
             }
             returnErrorMsg("找不到订单");
         }
+
+        public void check_erp_sameorders()
+        {
+            if (UrlPostParmsCheck("ctid"))
+            {
+                string eid = GetPostString("ctid");
+
+                CeErpTradeCell entity = CeErpTradeCell.GetByCtid(eid);
+                if (entity != null)
+                {
+                    StringBuilder sql = new StringBuilder();
+                    sql.AppendFormat("select * from ce_erptradecell where SupplierId={0} and orderstate=6 and tid='{1}';", entity.SupplierId, entity.tid);
+                    DataTable dt = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
+                    List<string> ids = new List<string>();
+                    if (dt != null && dt.Rows.Count > 1)
+                    {
+                        foreach (DataRow dr in dt.Rows)
+                        {
+                            ids.Add("'" + dr["ctid"] + "'");
+                        }
+
+                        sql = new StringBuilder();
+                        sql.AppendFormat("select * from CE_ErpDeliverMark where ctid in ({0});", string.Join(",", ids));
+                        dt.Columns.Add(new DataColumn("dstate", typeof(int)));
+                        DataTable dt1 = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
+                        foreach (DataRow dr in dt.Rows)
+                        {
+                            dr["dstate"] = 0;
+                            foreach (DataRow row in dt1.Rows)
+                            {
+
+                                if (dr["ctid"].ToString().Equals(row["ctid"].ToString()))
+                                {
+                                    dr["dstate"] = 2;
+                                }
+
+                            }
+                            if (eid.Equals(dr["ctid"].ToString()))
+                            {
+                                dr["dstate"] = 1;
+                            }
+                        }
+
+                    }
+                    string ro_jsond = JsonConvert.SerializeObject(dt.Rows);
+                    returnSuccess(ro_jsond);
+                    return;
+                }
+                returnErrorMsg("未找到订单");
+                return;
+            }
+
+            returnErrorMsg("缺少必要的参数");
+        }
     }
 
 }

+ 6 - 1
SiteCore/taobao/commonHelper.cs

@@ -2092,11 +2092,16 @@ namespace SiteCore
                 {
                     return;
                 }
+                CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(exinfo.tid);
+                if (ceErpTradeCell == null)
+                {
+                    return;
+                }
                 JObject jsonObject12 = new JObject
                             {
                                 { "Userid",cytUserId },
                                 //{ "pwd", "lt666888" },
-                                { "LTOrderId", exinfo.tid },
+                                { "LTOrderId", ceErpTradeCell.OrderSn },
                                 { "CourierNumber", exinfo.out_sid },
                                 { "ExpressCompanyName", exinfo.company_name }
                             };

+ 1 - 0
Web/EAfterSale/WaitingVerify.aspx

@@ -27,6 +27,7 @@
         <div property="columns">
             <div type="checkcolumn" width="20"></div>
             <div field="tid" width="110" align="center" headeralign="center" renderer="orderIdRenderer">订单编号</div>
+            <div field="OrderSn" width="110" align="center" headeralign="center">识别码</div>
             <div field="pay_time" id="id_paytime" runat="server" visible="false" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">付款时间</div>
             <div field="FinishPlaceTime" width="60" align="center" dateformat="yyyy-MM-dd HH:mm" headeralign="center">下单</div>
             <div field="AfterSaleReason" width="70" align="center" headeralign="center">原因</div>

+ 1 - 1
Web/js/afterSaleReason.js

@@ -1257,7 +1257,7 @@
 }, {
     "ID": 3030102,
     "TopID": 30301,
-    "AddName": "少发(包含产品多做配件少发)"
+    "AddName": "少发"
 }, {
     "ID": 3030103,
     "TopID": 30301,

+ 1 - 1
Web/js/view.render.js

@@ -20,7 +20,7 @@
         html += "<span class=\"word_tui bc_tui\">退</span>";
     }
     if (record.IsReturn > 0) {
-        html += "<span class=\"word_tui\">回</span>";
+        html += "<span class=\"word_tui\" style=\"background-color: #0145dd; \">回</span>";
     }
     if (record.drawStatus) {
         html += "<span class=\"word_tui\">撤</span>";