1
dengjunjie
2025-01-10 96e6dc957aee5d20218ac8127a28db6a7e6ba6de
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -170,7 +170,7 @@
                        Dt_StationManger stationManger;
                        if (taskTypeGroup == TaskTypeGroup.InboundGroup)
                        {
                            stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress);
                            stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress);
                        }
                        else
                        {
@@ -181,7 +181,7 @@
                            return WebResponseContent.Instance.Error($"未找到站台配置信息");
                        }
                        List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi));
                        List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi || item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi));
                        router = routers.FirstOrDefault();
                        if (router == null)
                        {
@@ -194,6 +194,11 @@
                            {
                                task.NextAddress = router.NextPosi;
                                task.DeviceCode = stationManger.StationDeviceCode;
                            }
                            else if(item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
                            {
                                task.NextAddress = router.NextPosi;
                                task.DeviceCode = stationManger.StackerCraneCode;
                            }
                            else
                            {
@@ -284,8 +289,12 @@
                {
                    return WebResponseContent.Instance.Error($"未找到站台信息");
                }
                string responseStr = HttpHelper.Get($"http://127.0.0.1:9283/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
                string address = AppSettings.Get("WMSApiAddress");
                if(string.IsNullOrEmpty(address))
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                {
@@ -304,6 +313,31 @@
            return content;
        }
        public WebResponseContent RequestWMSAssignRoadway(int taskNum, List<string> roadwayNos)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string address = AppSettings.Get("WMSApiAddress");
                if (string.IsNullOrEmpty(address))
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = HttpHelper.Post($"{address}/api/Task/AssignRoadway?taskNum={taskNum}",roadwayNos.Serialize());
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                {
                    return responseContent;
                }
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// å‘WMS申请分配货位
        /// </summary>