| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using Org.BouncyCastle.Tls; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private static object lockObj = 0;// |
| | | private static List<string> strings = new List<string>(); |
| | | |
| | | public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | |
| | | string boxCodes = AppSettings.Get("BoxCodes"); |
| | | if (!string.IsNullOrEmpty(boxCodes) && strings.Count<=0) |
| | | { |
| | | foreach (string s in boxCodes.Split(",")) |
| | | { |
| | | strings.Add(s); |
| | | } |
| | | } |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | | { |
| | |
| | | //鐮佸灈鐜嚎璇锋眰浠诲姟 |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1) |
| | | { |
| | | //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | //WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | ////鍚慦MS璇锋眰浠诲姟 |
| | | //if (true) |
| | | //{ |
| | | |
| | | //} |
| | | string[] strings = conveyorLineInfoRead.R_BoxCode.Split("-"); |
| | | if (strings.Length==2) |
| | | //string[] strings = conveyorLineInfoRead.R_BoxCode.Split("-"); |
| | | //if (strings.Length==2) |
| | | //{ |
| | | #region todo:涓存椂閫昏緫 |
| | | //鍐欏叆鎵ц鏁版嵁 |
| | | if (strings.FirstOrDefault(x=>x == conveyorLineInfoRead.R_BoxCode)!=null) |
| | | { |
| | | //鍐欏叆鎵ц鏁版嵁 |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 100 + strings[1].ObjToInt(), RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, strings[1].ObjToInt(), RequestIn.StationCode); |
| | | |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 100 + 5, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, 5, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Long, 450, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 360, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 400, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode); |
| | | WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | if (content.Message.Contains("true")) |
| | | { |
| | | strings.Remove(conveyorLineInfoRead.R_BoxCode); |
| | | WriteInfo(RequestIn.StationName, content.Message); |
| | | } |
| | | else |
| | | { |
| | | WriteError(RequestIn.StationName, content.Message); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(RequestIn.StationName, $"鏁版嵁鎴彇閿欒锛歿strings}"); |
| | | WriteError(RequestIn.StationName, $"鏈壘鍒版潯鐮亄conveyorLineInfoRead.R_BoxCode}鏁版嵁"); |
| | | } |
| | | #endregion |
| | | //} |
| | | //else |
| | | //{ |
| | | // WriteError(RequestIn.StationName, $"鏁版嵁鎴彇閿欒锛歿strings}"); |
| | | //} |
| | | } |
| | | } |
| | | else |