|
@@ -1,4 +1,4 @@
|
|
|
-<%@ WebHandler Language="C#" Class="testSyncZhongTai" %>
|
|
|
|
|
|
|
+<%@ WebHandler Language="C#" Class="SyncZhongTai" %>
|
|
|
|
|
|
|
|
using System;
|
|
using System;
|
|
|
using System.Web;
|
|
using System.Web;
|
|
@@ -15,7 +15,7 @@ using Curtain.Extension.ExObjectConvert;
|
|
|
/// apiid=31014
|
|
/// apiid=31014
|
|
|
/// SAP:物料bom同步接口
|
|
/// SAP:物料bom同步接口
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
-public class testSyncZhongTai : IHttpHandler, IReadOnlySessionState
|
|
|
|
|
|
|
+public class SyncZhongTai : IHttpHandler, IReadOnlySessionState
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
public void ProcessRequest(HttpContext context)
|
|
public void ProcessRequest(HttpContext context)
|
|
@@ -23,9 +23,19 @@ public class testSyncZhongTai : IHttpHandler, IReadOnlySessionState
|
|
|
context.Response.ContentType = "text/plain";
|
|
context.Response.ContentType = "text/plain";
|
|
|
DateTime syncDate = new DateTime(2023, 3, 2);
|
|
DateTime syncDate = new DateTime(2023, 3, 2);
|
|
|
|
|
|
|
|
- context.Response.Write(DateTime.Now + ":调用开始\n");
|
|
|
|
|
- string msg = SyncZhongTai.SyncFinishedProduct(syncDate, false);
|
|
|
|
|
- context.Response.Write(DateTime.Now + ":调用结束\n");
|
|
|
|
|
|
|
+ string jsonPara = JsonPost.Parameter();
|
|
|
|
|
+
|
|
|
|
|
+ if (!string.IsNullOrEmpty(jsonPara))
|
|
|
|
|
+ {
|
|
|
|
|
+ JObject json = JObject.Parse(jsonPara);
|
|
|
|
|
+ DateTime.TryParse(json["SyncDate"].ToStringEx(), out syncDate);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ string msg = string.Empty;
|
|
|
|
|
+ //context.Response.Write(DateTime.Now + ":调用开始\n");
|
|
|
|
|
+ msg = SyncZhongTai.SyncFinishedProduct(syncDate, false);
|
|
|
|
|
+ //context.Response.Write(DateTime.Now + ":调用结束\n");
|
|
|
|
|
+
|
|
|
context.Response.Write(new JsonResult() { success = true, status = JsonStatus.success, message = msg }.ToJson());
|
|
context.Response.Write(new JsonResult() { success = true, status = JsonStatus.success, message = msg }.ToJson());
|
|
|
}
|
|
}
|
|
|
|
|
|