林豪 左 3 years ago
parent
commit
1a4f70864f

+ 1 - 8
Projects/永冠OPP/WCS.Service/Helpers/FinishTaskList.cs

@@ -1,10 +1,7 @@
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Diagnostics;
+using System.Collections.Generic;
 using System.Linq;
 using WCS.Service.Entity;
 using WCS.Service.Extensions;
-using WCS.Service.Log;
 
 namespace WCS.Service.Helpers
 {
@@ -48,16 +45,12 @@ namespace WCS.Service.Helpers
         {
             if (!finishes.Any()) throw new DoException("没有任务");
             var items = finishes.ToArray();
-            var timer = new Stopwatch();
-            timer.Start();
             var infos = items.Length switch
             {
                 1 => WMS.I_WCS_GetInTask(items[0].FinishCode, items[0].Station.Entity.CODE),
                 2 => WMS.I_WCS_GetInTask(items[0].FinishCode, items[0].Station.Entity.CODE, items[1].FinishCode, items[1].Station.Entity.CODE),
                 _ => throw new WarnException($"一组任务数量最大为2,当前{items.Length}"),
             };
-            timer.Stop();
-            InfoLog.INFO_TIMING($"扫码入库接口调用,耗时{timer.ElapsedMilliseconds}---------{JsonConvert.SerializeObject(infos)}");
             return infos;
         }
     }

+ 2 - 1
Projects/永冠OPP/WCS.Service/WebApi/APICaller.cs

@@ -7,6 +7,7 @@ using System.IO;
 using System.Net;
 using System.Text;
 using System.Threading.Tasks;
+using WCS.Service.Log;
 
 namespace WCS.Service
 {
@@ -101,7 +102,7 @@ namespace WCS.Service
                 var res = reader.ReadToEnd();
                 sw.Stop();
                 if (sw.ElapsedMilliseconds > 500)
-                    Console.WriteLine($"耗时:{sw.ElapsedMilliseconds},{url}");
+                    InfoLog.INFO_TIMING($"扫码入库接口调用,耗时{sw.ElapsedMilliseconds}---------{res}");
                 return res;
             }
         }