林豪 左 2 жил өмнө
parent
commit
4940012184

+ 1 - 1
WCS.WorkEngineering/Worlds/Logs/KnownException.cs → ServiceCenter/Logs/KnownException.cs

@@ -1,4 +1,4 @@
-namespace WCS.WorkEngineering.Worlds.Logs
+namespace ServiceCenter.Logs
 {
     /// <summary>
     ///  已知异常

+ 1 - 1
WCS.WorkEngineering/Worlds/Logs/Log.cs → ServiceCenter/Logs/Log.cs

@@ -1,7 +1,7 @@
 using WCS.Core;
 using ILog = WCS.Core.ILog;
 
-namespace WCS.WorkEngineering.Worlds.Logs
+namespace ServiceCenter.Logs
 {
     /// <summary>
     ///  带KEY的日志

+ 1 - 1
WCS.WorkEngineering/Worlds/Logs/LogEnum.cs → ServiceCenter/Logs/LogEnum.cs

@@ -1,6 +1,6 @@
 using System.ComponentModel;
 
-namespace WCS.WorkEngineering.Worlds.Logs
+namespace ServiceCenter.Logs
 {
     /// <summary>
     ///  异常类型

+ 0 - 0
ServiceCenter/LogHub.cs → ServiceCenter/Logs/LogHub.cs


+ 1 - 0
ServiceCenter/WebApi/APICaller.cs

@@ -1,5 +1,6 @@
 using Newtonsoft.Json;
 using ServiceCenter.Extensions;
+using ServiceCenter.Logs;
 using System.Collections.Concurrent;
 using System.Diagnostics;
 using System.Net;

+ 1 - 0
WCS.Service/Worker.cs

@@ -1,6 +1,7 @@
 using Newtonsoft.Json;
 using PlcSiemens.Core.Extension;
 using ServiceCenter;
+using ServiceCenter.Logs;
 using ServiceCenter.Redis;
 using ServiceCenter.SqlSugars;
 using SqlSugar;

+ 1 - 1
WCS.WorkEngineering/Extensions/BCRExtension.cs

@@ -1,7 +1,7 @@
 using PlcSiemens.Core.Extension;
+using ServiceCenter.Logs;
 using WCS.Core;
 using WCS.Entity.Protocol.BCR;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.Extensions
 {

+ 2 - 2
WCS.WorkEngineering/Extensions/StationExtension.cs

@@ -1,7 +1,7 @@
-using ServiceCenter.Redis;
+using ServiceCenter.Logs;
+using ServiceCenter.Redis;
 using WCS.Core;
 using WCS.Entity.Protocol.Station;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.Extensions
 {

+ 2 - 2
WCS.WorkEngineering/Extensions/TaskExtension.cs

@@ -1,8 +1,8 @@
-using ServiceCenter.SqlSugars;
+using ServiceCenter.Logs;
+using ServiceCenter.SqlSugars;
 using WCS.Entity;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.WebApi.Models.AGV.Response;
-using WCS.WorkEngineering.Worlds.Logs;
 using TaskStatus = WCS.Entity.TaskStatus;
 
 namespace WCS.WorkEngineering.Extensions

+ 3 - 3
WCS.WorkEngineering/Extensions/WorldExtension.cs

@@ -1,6 +1,6 @@
-using WCS.Core;
-using WCS.WorkEngineering.Worlds.Logs;
-using LogInfo = WCS.WorkEngineering.Worlds.Logs.LogInfo;
+using ServiceCenter.Logs;
+using WCS.Core;
+using LogInfo = ServiceCenter.Logs.LogInfo;
 
 namespace WCS.WorkEngineering.Extensions
 {

+ 1 - 1
WCS.WorkEngineering/Systems/AgvSystems.cs

@@ -1,4 +1,5 @@
 using ServiceCenter.Extensions;
+using ServiceCenter.Logs;
 using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
@@ -8,7 +9,6 @@ using WCS.Entity.Protocol.Station;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems

+ 4 - 4
WCS.WorkEngineering/Systems/NoInteractionSystems.cs

@@ -1,4 +1,5 @@
 using PlcSiemens.Core.Extension;
+using ServiceCenter.Logs;
 using ServiceCenter.Redis;
 using ServiceCenter.SqlSugars;
 using System.ComponentModel;
@@ -8,7 +9,6 @@ using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.WebApi.Models.AGV.Response;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.Systems
 {
@@ -131,7 +131,7 @@ namespace WCS.WorkEngineering.Systems
                 }
                 catch (Exception ex)
                 {
-                    World.Log(ex.Message, Worlds.Logs.LogLevelEnum.Mid);
+                    World.Log(ex.Message, LogLevelEnum.Mid);
                 }
 
                 #endregion 处理所有的新增任务
@@ -179,7 +179,7 @@ namespace WCS.WorkEngineering.Systems
                             }
                             catch (Exception ex)
                             {
-                                World.Log(ex.Message, Worlds.Logs.LogLevelEnum.Mid);
+                                World.Log(ex.Message, LogLevelEnum.Mid);
                                 continue;
                             }
                         }
@@ -218,7 +218,7 @@ namespace WCS.WorkEngineering.Systems
                                 }
                                 catch (Exception ex)
                                 {
-                                    World.Log(ex.Message, Worlds.Logs.LogLevelEnum.Mid);
+                                    World.Log(ex.Message, LogLevelEnum.Mid);
                                     continue;
                                 }
                             }

+ 2 - 2
WCS.WorkEngineering/Systems/SrmSystems.cs

@@ -1,5 +1,6 @@
 using PlcSiemens.Core.Extension;
 using ServiceCenter.Extensions;
+using ServiceCenter.Logs;
 using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
@@ -9,9 +10,8 @@ using WCS.Entity.Protocol.Station;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
-using KnownException = WCS.WorkEngineering.Worlds.Logs.KnownException;
+using KnownException = ServiceCenter.Logs.KnownException;
 using TaskStatus = WCS.Entity.TaskStatus;
 
 namespace WCS.WorkEngineering.Systems

+ 4 - 3
WCS.WorkEngineering/Systems/一楼入库工位处理系统.cs

@@ -1,4 +1,5 @@
-using ServiceCenter.SqlSugars;
+using ServiceCenter.Logs;
+using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
 using WCS.Entity;
@@ -7,7 +8,6 @@ using WCS.Entity.Protocol.Station;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems
@@ -57,10 +57,11 @@ namespace WCS.WorkEngineering.Systems
                    if (agv.Position != obj.Entity.Code) throw new KnownException($"任务{task.ID}对应AGV任务目标地址不是当前站台", LogLevelEnum.Mid);
                }
 
-
                //获取称重
                var dev91 = Device.All.Where(v => v.Code == obj.Entity.Code).Select(v => new Device<IStation91>(v, this.World)).FirstOrDefault();
                task.Weight = dev91.Data.Weight;
+               if (task.Weight == 0) throw new KnownException($"称重异常", LogLevelEnum.Mid);
+
                WmsApi.WcsUploadInfo(task.ID, (decimal)task.Weight, task.BarCode);
 
                task.Status = Entity.TaskStatus.ConveyorExecution;

+ 2 - 2
WCS.WorkEngineering/Systems/一楼出库工位处理系统.cs

@@ -1,4 +1,5 @@
-using ServiceCenter.Redis;
+using ServiceCenter.Logs;
+using ServiceCenter.Redis;
 using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
@@ -7,7 +8,6 @@ using WCS.Service;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems

+ 2 - 2
WCS.WorkEngineering/Systems/二楼入库工位处理系统.cs

@@ -1,4 +1,5 @@
-using ServiceCenter.SqlSugars;
+using ServiceCenter.Logs;
+using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
 using WCS.Entity;
@@ -7,7 +8,6 @@ using WCS.Entity.Protocol.Station;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems

+ 2 - 2
WCS.WorkEngineering/Systems/二楼出库工位处理系统.cs

@@ -1,11 +1,11 @@
-using ServiceCenter.SqlSugars;
+using ServiceCenter.Logs;
+using ServiceCenter.SqlSugars;
 using System.ComponentModel;
 using WCS.Core;
 using WCS.Entity;
 using WCS.WorkEngineering.Extensions;
 using WCS.WorkEngineering.WebApi.Controllers;
 using WCS.WorkEngineering.Worlds;
-using WCS.WorkEngineering.Worlds.Logs;
 using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
 
 namespace WCS.WorkEngineering.Systems

+ 2 - 2
WCS.WorkEngineering/WebApi/Controllers/AgvApi.cs

@@ -1,9 +1,9 @@
-using ServiceCenter.Redis;
+using ServiceCenter.Logs;
+using ServiceCenter.Redis;
 using ServiceCenter.WebApi;
 using WCS.WorkEngineering.WebApi.Models.AGV;
 using WCS.WorkEngineering.WebApi.Models.AGV.Request;
 using WCS.WorkEngineering.WebApi.Models.AGV.Response;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.WebApi.Controllers
 {

+ 1 - 1
WCS.WorkEngineering/WebApi/Controllers/AgvController.cs

@@ -1,7 +1,7 @@
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using PlcSiemens.Core.Extension;
-using ServiceCenter;
+using ServiceCenter.Logs;
 using ServiceCenter.SqlSugars;
 using WCS.Core;
 using WCS.Entity;

+ 2 - 2
WCS.WorkEngineering/WebApi/Controllers/IwmsApi.cs

@@ -1,9 +1,9 @@
-using ServiceCenter.Redis;
+using ServiceCenter.Logs;
+using ServiceCenter.Redis;
 using ServiceCenter.WebApi;
 using WCS.WorkEngineering.WebApi.Models.AGV;
 using WCS.WorkEngineering.WebApi.Models.AGV.Request;
 using WCS.WorkEngineering.WebApi.Models.AGV.Response;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.WebApi.Controllers
 {

+ 1 - 1
WCS.WorkEngineering/WebApi/Controllers/WmsApi.cs

@@ -1,11 +1,11 @@
 using ServiceCenter;
 using ServiceCenter.Extensions;
+using ServiceCenter.Logs;
 using ServiceCenter.Redis;
 using ServiceCenter.WebApi;
 using WCS.WorkEngineering.WebApi.Models.AGV.Response;
 using WCS.WorkEngineering.WebApi.Models.WMS.Request;
 using WCS.WorkEngineering.WebApi.Models.WMS.Response;
-using WCS.WorkEngineering.Worlds.Logs;
 
 namespace WCS.WorkEngineering.WebApi.Controllers
 {

+ 4 - 5
WCS.WorkEngineering/worlds/MainWorld.cs

@@ -1,11 +1,10 @@
-using ServiceCenter;
-using ServiceCenter.Extensions;
+using ServiceCenter.Extensions;
+using ServiceCenter.Logs;
 using System.Collections.Concurrent;
 using System.ComponentModel;
 using WCS.Core;
-using WCS.WorkEngineering.Worlds.Logs;
-using KnownException = WCS.WorkEngineering.Worlds.Logs.KnownException;
-using LogInfo = WCS.WorkEngineering.Worlds.Logs.LogInfo;
+using KnownException = ServiceCenter.Logs.KnownException;
+using LogInfo = ServiceCenter.Logs.LogInfo;
 
 namespace WCS.WorkEngineering.Worlds
 {