wangxinhui
4 天以前 a0a0df2e824b6fe7e5a3c0afce78127fecf84fc9
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -8,6 +8,7 @@
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
@@ -321,6 +322,32 @@
                {
                    return content.Error($"未找到站台配置");
                }
                #region todo:临时逻辑
                if (stationManger.StationDeviceCode=="MES")
                {
                    RequestAGVArriveDTO requestAGVArriveDTO =new RequestAGVArriveDTO()
                    {
                        SD_WorkCentreAgvArriveNoticeInfo=new List<AgvArriveNotice> { new AgvArriveNotice()
                        {
                            DispatchPlanMaterialId=409,
                            WorkCentreCode="66",
                            LocationCode="3-ZD-ZJZZ",
                            CallId="4534c242-27a7-4fb6-86f5-460b09db303d"
                        } }
                    };
                    WebResponseContent webResponse= _taskService.MESAvgArriveNotice(requestAGVArriveDTO);
                    if (webResponse.Message.Contains("\"obj\": true"))
                    {
                        return content.Error($"允许取料");
                    }
                    else
                    {
                        return content.Error($"禁止放料");
                    }
                }
                #endregion
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device == null)
                {
@@ -397,7 +424,21 @@
                    }
                    else if (device.DeviceCode.Contains("TrussCarton"))//桁架
                    {
                        bool RequestPut = otherDevice.GetValue<W_TrussCartonDB, bool>(GetCartonRequest(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (!RequestPut)
                        {
                            otherDevice.SetValue(GetCartonRequest(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                            Thread.Sleep(1000);
                        }
                        bool AllowFinish = otherDevice.GetValue<R_TrussCartonDB, bool>(GetCarton(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (AllowFinish)
                        {
                        content.OK("允许放料");
                        }
                        else
                        {
                            return content.Error("禁止放料");
                        }
                    }
                }
                return content;
@@ -481,6 +522,53 @@
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¯·æ±‚ä¿¡å·
        /// </summary>
        public W_TrussCartonDB GetCartonRequest(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return W_TrussCartonDB.W_CartonRequest1;
                case "2":
                    return W_TrussCartonDB.W_CartonRequest2;
                case "3":
                    return W_TrussCartonDB.W_CartonRequest3;
                case "4":
                    return W_TrussCartonDB.W_CartonRequest4;
                case "5":
                    return W_TrussCartonDB.W_CartonRequest5;
                case "6":
                    return W_TrussCartonDB.W_CartonRequest6;
                default:
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¿›å…¥ä¿¡å·
        /// </summary>
        public R_TrussCartonDB GetCarton(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return R_TrussCartonDB.R_CartonAllow1;
                case "2":
                    return R_TrussCartonDB.R_CartonAllow2;
                case "3":
                    return R_TrussCartonDB.R_CartonAllow3;
                case "4":
                    return R_TrussCartonDB.R_CartonAllow4;
                case "5":
                    return R_TrussCartonDB.R_CartonAllow5;
                case "6":
                    return R_TrussCartonDB.R_CartonAllow6;
                default:
                    throw new Exception("未定义工位");
            }
        }
        //[HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous]
        /// <summary>