zhuyiyi 9 luni în urmă
părinte
comite
9089312e28

+ 4 - 1
BizCom/Dao/CeErpTradeOrder.cs

@@ -312,7 +312,10 @@ namespace BizCom
         {
             return FindFirst(Expression.Eq("oid", oid));
         }
-
+        public static CeErpTradeOrder GetBySpuId(string oid)
+        {
+            return FindFirst(Expression.Eq("spu_id", oid));
+        }
 
         public static void Del(object id)
         {

+ 2 - 0
BizCom/Dao/CeErpTradeSpu.cs

@@ -121,6 +121,7 @@ namespace BizCom
         /// 是否同步
         /// </summary>
         private bool _isSync = false;
+        [Property]
         public bool isSync
         {
             get { return _isSync; }
@@ -130,6 +131,7 @@ namespace BizCom
         /// 返回信息
         /// </summary>
         private string _message = "";
+        [Property]
 
         public string message
         {

+ 1 - 1
SiteCore/Handler/noti.cs

@@ -642,7 +642,7 @@ namespace SiteCore.Handler
 
                                 }
                                 //判断能不能推送
-                                designApiResponseVo result = commonHelper.checkOrderListDesignInfo(entity.tid);
+                                designApiResponseVo result = commonHelper.checkOrderListDesignInfo(entity.tid, entity.ctid);
                                 if (result != null && result.code == 200)
                                 {
                                     designApiResponseVo response = designHelper.API_GetPrintData_CreateOrder(entity, "SysAdmin");

Fișier diff suprimat deoarece este prea mare
+ 1 - 0
SiteCore/Handler/sync.order.cs


+ 19 - 1
SiteCore/taobao/commonHelper.cs

@@ -1836,12 +1836,30 @@ namespace SiteCore
                 }
             }
         }
-        public static designApiResponseVo checkOrderListDesignInfo(string tid)
+        public static designApiResponseVo checkOrderListDesignInfo(string tid, string ctid = "")
         {
+
             if (string.IsNullOrEmpty(tid))
             {
                 return new designApiResponseVo(-1, "无订单信息");
             }
+            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, "内部设计!");
+                    }*/
+                }
+            }
             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];
             string check_info = "无订单信息";

+ 32 - 16
SiteCore/taobao/dataHelper.cs

@@ -412,8 +412,7 @@ namespace SiteCore.Handler
         }
         public static long GetTimeStamp()
         {
-            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
-            return Convert.ToInt64(ts.TotalSeconds);
+            return DateTimeOffset.Now.ToUnixTimeSeconds();
         }
 
         public static string getToken()
@@ -428,7 +427,7 @@ namespace SiteCore.Handler
                     string token_end = RedisHelper.StringGet("token_end").ToString();
                     long token_endtime = Convert.ToInt64(token_end);
                     long currentTime = GetTimeStamp();
-                    if (currentTime >= token_endtime)
+                    if (currentTime <= token_endtime)
                     {
                         return token;
                     }
@@ -483,7 +482,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -520,7 +519,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataSpuInfoResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataSpuInfoResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -557,7 +556,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -594,7 +593,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -756,7 +755,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -841,7 +840,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -973,7 +972,7 @@ namespace SiteCore.Handler
                 });
                 string data = httpContent(post_url, param);
                 dataShopResponseVo dataResponseVos = JsonConvert.DeserializeObject<dataShopResponseVo>(data);
-                if ("0".Equals(dataResponseVos.errcode))
+                if (dataResponseVos != null && "0".Equals(dataResponseVos.errcode))
                 {
                     if (dataResponseVos.data.bizObjectPage.content.Count > 0)
                     {
@@ -1009,9 +1008,17 @@ namespace SiteCore.Handler
 
             var task = Task.Run(() =>
             {
-                var response = client.SendAsync(request).Result;
-                response.EnsureSuccessStatusCode();
-                return response.Content.ReadAsStringAsync().Result;
+                try
+                {
+                    var response = client.SendAsync(request).Result;
+                    response.EnsureSuccessStatusCode();
+                    return response.Content.ReadAsStringAsync().Result;
+                }
+                catch (Exception ex)
+                {
+                    return "";
+                }
+
             });
 
             return task.Result;
@@ -1039,9 +1046,18 @@ namespace SiteCore.Handler
 
             var task = Task.Run(() =>
             {
-                var response = client.SendAsync(request).Result;
-                response.EnsureSuccessStatusCode();
-                return response.Content.ReadAsStringAsync().Result;
+                try
+                {
+                    var response = client.SendAsync(request).Result;
+                    response.EnsureSuccessStatusCode();
+                    return response.Content.ReadAsStringAsync().Result;
+                }
+                catch (Exception e)
+                {
+                    return "";
+                }
+
+
             });
 
             return task.Result;

+ 36 - 2
SiteCore/taobao/designHelper.cs

@@ -57,8 +57,12 @@ namespace SiteCore.Handler
                 }
             }
         }
-        static string pUrl = "http://api.lingtao8.com/api/manager/";
-        // static string pUrl = "http://47.122.40.91:8099/api/manager/";
+        static string baseUrl = "http://api.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/";
 
         static HttpHelper tb_http = new HttpHelper();
 
@@ -455,6 +459,36 @@ namespace SiteCore.Handler
             }
         }
 
+        public static string API_CheckOrderTo(string orderNumber, string spuId)
+        {
+            string post_url = test_baseUrl + "api/originalOrder/discernOrder";
+
+            WebClient wc = new WebClient();
+            wc.Encoding = Encoding.GetEncoding("utf-8");
+            NameValueCollection PostVars = new NameValueCollection();
+            PostVars.Add("orderNumber", orderNumber);
+            PostVars.Add("spuId", spuId);
+            string result = "无";
+            return result;
+            try
+            {
+                byte[] ret = wc.UploadValues(post_url, "POST", PostVars);
+                string remoteInfo = Encoding.GetEncoding("utf-8").GetString(ret);
+                designApiResponseVo designApiResponseVo = JsonConvert.DeserializeObject<designApiResponseVo>(remoteInfo);
+                if (designApiResponseVo.code == 200)
+                {
+                    result = designApiResponseVo.msg;
+                }
+            }
+            catch (Exception ex)
+            {
+                XLog.SaveLog(0, "API_refundOrder:" + ex.Message);
+            }
+            return result;
+
+
+        }
+
         public static string API_GetPrintData_Refund(CeErpTradeCell ceErpTradeCell)
         {
 

+ 2 - 2
ecomServer/MainForm.cs

@@ -807,7 +807,7 @@ namespace ErpServer
                                         //手绘   logo  画册 海报  宣传单
                                         if ((IsOldCustomer == "1" && (ProductId == 28 || ProductId == 57 || ProductId == 40 || ProductId == 4 || ProductId == 13)))
                                         {
-                                            result = commonHelper.checkOrderListDesignInfo(dr["tid"].ToString());
+                                            result = commonHelper.checkOrderListDesignInfo(dr["tid"].ToString(), dr["ctid"].ToString());
                                             if (result != null && result.code == 200)
                                             {
                                                 continue;
@@ -828,7 +828,7 @@ namespace ErpServer
                                     {
                                         if (userId != 82)
                                         {
-                                            result = commonHelper.checkOrderListDesignInfo(dr["tid"].ToString());
+                                            result = commonHelper.checkOrderListDesignInfo(dr["tid"].ToString(), dr["ctid"].ToString());
                                             if (result != null && result.code == 200)
                                             {
                                                 continue;

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff