zhuyiyi 2 долоо хоног өмнө
parent
commit
50cd77d85b

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

@@ -51,6 +51,7 @@ using BizCom.Enum;
 using NPOI.POIFS.Properties;
 using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
 using static SiteCore.taoObj.Api_tmc_refund_info_Obj;
+using System.Threading.Tasks;
 
 namespace SiteCore.Handler
 {
@@ -64,7 +65,6 @@ namespace SiteCore.Handler
             string poscode = CurrentUser.UserPost.Post.Code;
 
             DataStruct dStruct = GetPostStruct();
-
             //string a = SecurityHelper.DecryptSymmetric("BnK3+504SQ8=");
             //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\新品售价(1).xls");
             //apiHelper.Api_SyncOrderByTime("598825");

+ 47 - 3
SiteCore/taobao/commonHelper.cs

@@ -31,6 +31,10 @@ using System.Security.Cryptography;
 using NHibernate.Hql.Ast;
 using System.Security.Principal;
 using Microsoft.SqlServer.Server;
+using System.Net.Http.Headers;
+using System.Net.Http;
+using System.Threading.Tasks;
+using System.Diagnostics;
 
 namespace SiteCore
 {
@@ -539,9 +543,6 @@ namespace SiteCore
                         }
 
                     }
-
-
-
                 }
                 sql = new StringBuilder();
                 sql.AppendFormat("select * from view_ErpTradeCell where orderstate=6 and unusualTag=0 and FinishPlaceTime is not null and DATEDIFF(HH,FinishPlaceTime,GETDATE())>3 and DATEDIFF(DAY,FinishPlaceTime,GETDATE())<20 and IsXianHuo=1 ;");
@@ -3705,5 +3706,48 @@ namespace SiteCore
             }
             return result;
         }
+
+        public static void sendOrderInfo(string tid, string order_status, string buyer_id, string buyer_nick, int type = 0)
+        {
+            Thread thread = new Thread(new ThreadStart(() =>
+             {
+                 string url = "https://wx.lingtao8.com/api/v1/msg/new_order";
+                 HttpClient client = new HttpClient();
+                 string param = JsonConvert.SerializeObject(new
+                 {
+                     order_type = type,
+                     order_id = tid,
+                     buyer_nick = buyer_nick,
+                     buyer_id = buyer_id,
+                     order_status = order_status,
+                 });
+                 var request = new HttpRequestMessage
+                 {
+                     Method = HttpMethod.Post,
+                     RequestUri = new Uri(url),
+
+                     Content = new StringContent(param)
+                     {
+                         Headers =
+                     {
+                        ContentType = new MediaTypeHeaderValue("application/json")
+                     }
+                     }
+                 };
+                 
+                 try
+                 {
+                     var response = client.SendAsync(request).Result;
+                     response.EnsureSuccessStatusCode();
+                 }
+                 catch (Exception e)
+                 {
+                 }
+
+             }));
+
+            thread.Start();
+
+        }
     }
 }

+ 1 - 1
SiteCore/taobao/refundTmcHelper.cs

@@ -108,11 +108,11 @@ namespace SiteCore
                 }
                 Content tObj = refundFullObj.content;
                 CeErpTrade trade = CeErpTrade.Get(tObj.refOid);
+                commonHelper.sendOrderInfo(trade.tid, "", trade.buyer_id, trade.buyer_nick, 1);
                 if (trade != null)
                 {
                     try
                     {
-
                         //apiDesign.API_GetPrintData_Refund(CeErpTradeCell.GetByTid(tObj.refOid));//退款同步设计师系统
                     }
                     catch (Exception ex)

+ 1 - 1
SiteCore/taobao/tmcHelper.cs

@@ -577,7 +577,7 @@ namespace SiteCore
                 }
                 trade.Update();
             }
-
+            commonHelper.sendOrderInfo(trade.tid, "", trade.buyer_id, trade.buyer_nick);
             //dataHelper.sendErpTradeInfo(new dataSendTradeBean(tObj));
 
             try