zhuyiyi il y a 9 mois
Parent
commit
cb3248e4c7

+ 9 - 0
BizCom/Dao/CeErpTradeCellExtend.cs

@@ -454,6 +454,15 @@ namespace BizCom
         /// </summary>
         [Property]
         public DateTime? ReprintTime { get; set; }
+
+        private string _toType = "";
+
+        [Property]
+        public string ToType
+        {
+            get { return _toType; }
+            set { _toType = value; }
+        }
         public static CeErpTradeCellExtend getByTid(string ctid)
         {
             return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
SiteCore/Handler/sync.order.cs


+ 29 - 14
SiteCore/taobao/commonHelper.cs

@@ -27,6 +27,7 @@ using System.Linq;
 using NHibernate.Mapping;
 using System.Reflection.Emit;
 using NPOI.SS.Formula.Functions;
+using System.Security.Cryptography;
 
 namespace SiteCore
 {
@@ -1845,20 +1846,20 @@ namespace SiteCore
             }
             if (!string.IsNullOrEmpty(ctid))
             {
-                
-                CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(ctid);
-                if (ceErpTradeCellExtend != null && !string.IsNullOrEmpty(ceErpTradeCellExtend.spu_id))
-                {
-                    string result = designHelper.API_CheckOrderTo(ctid, ceErpTradeCellExtend.spu_id);
-                   /* if ("外协".Equals(result))
-                    {
-                        return new designApiResponseVo(200, "");
-                    }
-                    else if ("内部".Equals(result))
-                    {
-                        return new designApiResponseVo(-1, "内部设计!");
-                    }*/
-                }
+
+                /* CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(ctid);
+                 if (ceErpTradeCellExtend != null && !string.IsNullOrEmpty(ceErpTradeCellExtend.spu_id))
+                 {
+                     string result = designHelper.API_CheckOrderTo(ctid, ceErpTradeCellExtend.spu_id);
+                     if ("外协".Equals(result))
+                     {
+                         return new designApiResponseVo(200, "");
+                     }
+                     else if ("内部".Equals(result))
+                     {
+                         return new designApiResponseVo(-1, "内部设计!");
+                     }
+            }*/
             }
             string info_sql = string.Format("SELECT ctid,ProductId,seller_memo FROM [dbo].[CE_ErpTradeCell] WHERE tid ='{0}'", tid);
             DataTable data = DbHelper.DbConn.ExecuteDataset(info_sql).Tables[0];
@@ -1892,6 +1893,8 @@ namespace SiteCore
 
                 if (need_send && !has_design)
                 {
+                    string sql_pay = "update CE_ErpTradeCell with(rowlock) set DispatchSort=2 where tid='" + tid + "';";
+                    CeErpTradeCell.ExecuteNonQuery(sql_pay.ToString());
                     return new designApiResponseVo(200, "");
                 }
             }
@@ -2709,6 +2712,13 @@ namespace SiteCore
                         ceErpTradeCellExtend.ctid = row["ctid"].ToString();
                     }
                     ceErpTradeCellExtend.spu_id = spu_id;
+
+                    if (!string.IsNullOrEmpty(spu_id))
+                    {
+                        string result = designHelper.API_CheckOrderTo(ceErpTradeCellExtend.ctid, ceErpTradeCellExtend.spu_id);
+                        ceErpTradeCellExtend.ToType = result;
+                    }
+
                     if (ceErpTradeCellExtend.ID == 0)
                     {
                         ceErpTradeCellExtend.Create();
@@ -2719,6 +2729,11 @@ namespace SiteCore
                     }
                 }
             }
+            if (string.IsNullOrEmpty(spu_id))
+            {
+                string sql_pay = "update CE_ErpTradeCell with(rowlock) set orderstate=-1 where tid='" + father.tid + "';";
+                CeErpTradeCell.ExecuteNonQuery(sql_pay.ToString());
+            }
         }
     }
 }

+ 1 - 2
SiteCore/taobao/designHelper.cs

@@ -58,9 +58,9 @@ namespace SiteCore.Handler
             }
         }
         static string baseUrl = "http://api.lingtao8.com/";
+        static string test_baseUrl = "https://sj.lingtao8.com/";
         //static string test_baseUrl = "http://47.122.40.91:8181/";
         //static string baseUrl = "http://47.122.40.91:8099/";
-        static string test_baseUrl = baseUrl;
 
         static string pUrl = baseUrl + "api/manager/";
 
@@ -469,7 +469,6 @@ namespace SiteCore.Handler
             PostVars.Add("orderNumber", orderNumber);
             PostVars.Add("spuId", spuId);
             string result = "无";
-            return result;
             try
             {
                 byte[] ret = wc.UploadValues(post_url, "POST", PostVars);

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff