From 58a8a8843f101b2a1ba25622e2ef8ade605e0c49 Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@WIN-16OJST5SSCB> Date: 星期一, 02 十二月 2024 16:28:23 +0800 Subject: [PATCH] OCV2-包装代码 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/GetStationService.cs | 20 ++++++--- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BZLOCK/JCBZYLController.cs | 4 +- /dev/null | 39 ------------------- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/IGetStationService.cs | 6 ++- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 17 +++++++- 5 files changed, 34 insertions(+), 52 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BZLOCK/JCBZYLController.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BZLOCK/JCBZYLController.cs index 4dcb06d..4848724 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BZLOCK/JCBZYLController.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BZLOCK/JCBZYLController.cs @@ -2,13 +2,13 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using WIDESEAWCS_Core; -using WIDESEAWCS_Tasks.ConveyorLineJob_GW; +using WIDESEAWCS_Tasks; namespace WIDESEAWCS_Server.Controllers.BZLOCK { [Route("api/[controller]")] [ApiController] - public class JCBZYLController : ControllerBase + public class JCBZYLController : Controller { private readonly IGetStationService _getStationService; public JCBZYLController(IGetStationService getStationService) { _getStationService = getStationService; } diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/WIDESEAWCS_Server.MvcApplicationPartsAssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/WIDESEAWCS_Server.MvcApplicationPartsAssemblyInfo.cs deleted file mode 100644 index c90ec26..0000000 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/WIDESEAWCS_Server.MvcApplicationPartsAssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆� -// 杩愯鏃剁増鏈�:4.0.30319.42000 -// -// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳戒細瀵艰嚧涓嶆纭殑琛屼负锛屽苟涓斿鏋� -// 閲嶆柊鐢熸垚浠g爜锛岃繖浜涙洿鏀瑰皢浼氫涪澶便�� -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.Reflection; - -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("MiniProfiler.AspNetCore.Mvc")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.Filters")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.Newtonsoft")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_BasicInfoRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_BasicInfoService")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_Core")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_DTO")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_IBasicInfoRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_IBasicInfoService")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_IProcessRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_ISystemRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_ISystemServices")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_ITaskInfoRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_ITaskInfoService")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_Model")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_ProcessRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_QuartzJob")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_SystemRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_SystemServices")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_TaskInfoRepository")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_TaskInfoService")] -[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEAWCS_Tasks")] - -// 鐢� MSBuild WriteCodeFragment 绫荤敓鎴愩�� - diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs index 0091885..64753c2 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs @@ -19,6 +19,7 @@ using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Repository; using WIDESEAWCS_QuartzJob.Service; namespace WIDESEAWCS_TaskInfoService @@ -32,6 +33,7 @@ private readonly IMapper _mapper; private readonly IDt_StationManagerService _stationManagerService; private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IRouterRepository _routerRepository; private Dictionary<string, OrderByType> _taskOrderBy = new() { @@ -46,7 +48,7 @@ public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList(); - public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository) : base(BaseDal) + public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, IRouterRepository routerRepository) : base(BaseDal) { _routerService = routerService; _taskExecuteDetailService = taskExecuteDetailService; @@ -55,6 +57,7 @@ _sys_ConfigService = sys_ConfigService; _stationManagerService = stationManagerService; _stationManagerRepository = stationManagerRepository; + _routerRepository = routerRepository; } /// <summary> @@ -84,6 +87,16 @@ task.TaskState = (int)TaskOutStatusEnum.OutNew; task.CurrentAddress = item.SourceAddress; task.NextAddress = routers.FirstOrDefault().ChildPosi; + } + else + { + routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress); + if (routers.Count > 0) + { + task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish; + task.CurrentAddress = item.SourceAddress; + task.NextAddress = routers.FirstOrDefault().ChildPosi; + } } } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) @@ -125,7 +138,7 @@ var hasTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode); if (hasTask != null) { - return content.Error("褰撳墠鎵樼洏瀛樺湪浠诲姟"); + return content.OK("褰撳墠鎵樼洏瀛樺湪浠诲姟"); } var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/GetStationService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/GetStationService.cs index ae7d875..f2b4ed0 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/GetStationService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/GetStationService.cs @@ -5,30 +5,36 @@ using System.Threading.Tasks; using WIDESEAWCS_BasicInfoRepository; using WIDESEAWCS_Core; +using WIDESEAWCS_Core.BaseServices; +using WIDESEAWCS_ISystemServices; +using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; using WIDESEAWCS_Tasks.ConveyorLineJob; -namespace WIDESEAWCS_Tasks.ConveyorLineJob_GW +namespace WIDESEAWCS_Tasks { - public class GetStationService: IGetStationService + public class GetStationService:ServiceBase<Dt_StationManager, IDt_StationManagerRepository>, IGetStationService { - private readonly IDt_StationManagerRepository _stationManagerRepository; - public GetStationService(IDt_StationManagerRepository stationManagerRepository) { _stationManagerRepository = stationManagerRepository; } + //private readonly IDt_StationManagerRepository _stationManagerRepository; + + public GetStationService(IDt_StationManagerRepository BaseDal, ISys_ConfigService sys_ConfigService) : base(BaseDal) + { + } public WebResponseContent GetStationHasPallet(List<string> stations) { WebResponseContent content = new WebResponseContent(); try { var x = 0; - var stationManagers = _stationManagerRepository.QueryData(x => stations.Contains(x.stationChildCode)); + var stationManagers = BaseDal.QueryData(x => stations.Contains(x.stationChildCode)); foreach (var item in stationManagers) { if (Convert.ToInt32(item.stationPLC) > 1010) { CommonConveyorLine_GW commonConveyorLine_GW = Storage.Devices.FirstOrDefault(x => x.DeviceCode == item.stationPLC) as CommonConveyorLine_GW; - var isHasPallet = Convert.ToInt32(commonConveyorLine_GW.ReadValue(ConveyorLineDBName_After.HasPallet, item.stationPLC)); - if (isHasPallet > 1) x++; + var isHasPallet = Convert.ToInt32(commonConveyorLine_GW.ReadValue(ConveyorLineDBName_After.HasPallet, item.stationChildCode)); + if (isHasPallet == 0) x++; } } content.OK(data: x); diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/IGetStationService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/IGetStationService.cs index 65f0cce..0f0dba9 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/IGetStationService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/IGetStationService.cs @@ -4,10 +4,12 @@ using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Core; +using WIDESEAWCS_Core.BaseServices; +using WIDESEAWCS_Model.Models; -namespace WIDESEAWCS_Tasks.ConveyorLineJob_GW +namespace WIDESEAWCS_Tasks { - public interface IGetStationService + public interface IGetStationService : IService<Dt_StationManager> { WebResponseContent GetStationHasPallet(List<string> stations); } -- Gitblit v1.9.3