From 5ffc36a1db18d3112a9b50a9cf3953d7fcf21bae Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期二, 19 八月 2025 16:37:24 +0800 Subject: [PATCH] 更新 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs" index 43a9f6d..79c9e39 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs" @@ -74,6 +74,66 @@ } } + /// <summary> + /// 鏍规嵁鎵樼洏鍙枫�佽捣濮嬪湴鍧�鍚慦MS璇锋眰浠诲姟锛堝叆搴撶増鏈�) + /// </summary> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <param name="sourceAddress">璧峰鍦板潃</param> + /// <returns></returns> + public Dt_Task? InBeforeCheck(int taskNum) + { + WebResponseContent content = new WebResponseContent(); + try + { + var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; + var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.InTransferCheck)?.ConfigValue; + if (wmsBase == null || requestTask == null) + { + throw new InvalidOperationException("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss = wmsBase + requestTask; + + var result = HttpHelper.Post(wmsIpAddrss, new { taskNum = taskNum }.ToJsonString()); + content = JsonConvert.DeserializeObject<WebResponseContent>(result); + + if (!content.Status) + { + // wms澶辫触 + throw new Exception(); + } + + + //todo 浼樺寲 濡傛湭鏌ヨ鍒颁换鍔″垯澶勭悊 + //if (content.Data != null) + //{ + var task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString()); + + Dt_Task? Relocationtask = null; + if (task.TaskNum != taskNum) + { + + BaseDal.AddData(task); + Relocationtask = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum); + } + //} + + if (Relocationtask != null) + { + return task; + } + else + { + return null; + } + + } + catch (Exception ex) + { + throw new Exception($"璇锋眰寮傚父锛歿ex.Message}"); + } + } + #region 鏍规嵁鎵樼洏鍙枫�佺珯鍙板悜WMS璇锋眰浠诲姟 /// <summary> /// 鏍规嵁鎵樼洏鍙枫�佺珯鍙板悜WMS璇锋眰浠诲姟 @@ -153,6 +213,22 @@ } } + /// <summary> + /// 杞﹁疆娴佸悜鍒嗛厤鏌ヨ鍘嗗彶璇锋眰 + /// </summary> + /// <param name="czCode"></param> + /// <param name="stationManager"></param> + /// <returns></returns> + public string RequestWheletHty(string czCode) + { + WebResponseContent content = new WebResponseContent(); + Dt_Task_Hty dt_Task_Hty = _taskHtyRepository.QueryFirst(x => x.task_CZInfo == czCode && x.CreateDate >= DateTime.Now.AddMinutes(-30)); + if (dt_Task_Hty == null) return null; + if (dt_Task_Hty.Towhereabouts == null && dt_Task_Hty.Towhereabouts == "") return null; + + return dt_Task_Hty.Towhereabouts; + } + // 妫�鏌ュ綋鍓嶆墭鐩樻槸鍚﹀瓨鍦ㄤ换鍔� private async Task<bool> HasTask(string palletCode) { @@ -213,7 +289,13 @@ if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay); + task.TaskState = (int)TaskOutStatusEnum.OutNew; + if (task.SourceAddress == "2009") + { + task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish; + } + task.CurrentAddress = taskDTO.RoadWay; task.NextAddress = stationinfo.stationChildCode; task.SourceAddress = taskDTO.SourceAddress; -- Gitblit v1.9.3