Browse Source

新增接口调用时间记录

Administrator 3 years ago
parent
commit
b67d70a374
1 changed files with 8 additions and 2 deletions
  1. 8 2
      Projects/永冠OPP/WCS.Service/Helpers/FinishTaskList.cs

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

@@ -1,7 +1,9 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Linq;
 using WCS.Service.Entity;
 using WCS.Service.Extensions;
+using WCS.Service.Log;
 
 namespace WCS.Service.Helpers
 {
@@ -45,12 +47,16 @@ namespace WCS.Service.Helpers
         {
             if (!finishes.Any()) throw new DoException("没有任务");
             var items = finishes.ToArray();
-            return items.Length switch
+            var now = DateTime.Now;
+            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}"),
             };
+            var time = DateTime.Now;
+            InfoLog.INFO_TIMING($"扫码入库接口调用,耗时{(time - now).TotalMilliseconds},{now}-----{time}");
+            return infos;
         }
     }
 }