dengjunjie
21 小时以前 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs
@@ -53,41 +53,110 @@
                       && task.TargetIsPickPlace && ASRSRqtPutGoods)//请求放货
                    {
                        commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, ASRSRqtPutGoods);
                        WriteDebug($"{commonStackerCrane.DeviceName}请求放货", $"WCS允许放货,任务号【{task.TaskNum}】");
                    }
                    else if ((_taskService.TaskOutboundTypes.Contains(task.TaskType)
                        || task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt())
                        && ASRSRqtGetGoods && task.SourceIsPickPlace)//请求取货
                    {
                        commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, ASRSRqtGetGoods);
                    }
                    else if (_taskService.TaskOutboundTypes.Contains(task.TaskType) && ASRSPutAGoodsDone)
                    {
                        WriteDebug($"{commonStackerCrane.DeviceName}请求取货", $"WCS允许取货,任务号【{task.TaskNum}】");
                    }
                    else
                    {
                        Dt_ShuttleCar? shuttleCar1 = _shuttleCarService.QueryCode(task.ShuttleCarCode);
                        if (shuttleCar1 != null)
                        if (task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt())
                        {
                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceName == shuttleCar1.ShuttleCarName) as ShuttleCar;
                            var shuttleCar2 = _shuttleCarService.QueryNoCode(task.ShuttleCarCode);
                            ShuttleCar shuttleCarA = Storage.Devices.FirstOrDefault(x => x.DeviceCode == shuttleCar2.ShuttleCarCode) as ShuttleCar;
                            ShuttleCar shuttleCarB = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
                            #region å–è´§
                            if (ASRSRqtGetGoods)
                            {
                                shuttleCarA.SetValue(ShuttleCarDBName.ASRSRqtGetGoods, ASRSRqtGetGoods, shuttleCarA.DeviceCode);
                                var AGVAlwASRSGetGoods = shuttleCarA.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetGoods, shuttleCarA.DeviceCode);//允许取货
                                if (AGVAlwASRSGetGoods)
                                    commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, AGVAlwASRSGetGoods);
                                WriteDebug($"{commonStackerCrane.DeviceName}请求取货", $"【{shuttleCarA.DeviceName}】{(AGVAlwASRSGetGoods ? "允许" : "不允许")}取货,任务号【{task.TaskNum}】");
                            }
                            #endregion
                            #region å–货完成
                            if (ASRSGetGoodsDone)
                            {
                                shuttleCarA.SetValue(ShuttleCarDBName.ASRSGetGoodsDone, ASRSGetGoodsDone, shuttleCarA.DeviceCode);
                                WriteDebug($"{commonStackerCrane.DeviceName}取货完成", $"【{shuttleCarA.DeviceName}】,任务号【{task.TaskNum}】");
                            }
                            #endregion
                            #region æ”¾è´§
                            if (ASRSRqtPutGoods)
                            {
                                shuttleCarB.SetValue(ShuttleCarDBName.ASRSRqtPutGoods, ASRSRqtPutGoods, shuttleCarB.DeviceCode);
                                var AGVAlwASRSPuttGoods = shuttleCarB.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSPuttGoods, shuttleCarB.DeviceCode);//允许放货
                                if (AGVAlwASRSPuttGoods)
                                    commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, AGVAlwASRSPuttGoods);
                                WriteDebug($"{commonStackerCrane.DeviceName}请求放货", $"【{shuttleCarB.DeviceName}】{(AGVAlwASRSPuttGoods ? "允许" : "不允许")}放货,任务号【{task.TaskNum}】");
                            }
                            #endregion
                            #region æ”¾è´§å®Œæˆ
                            if (ASRSPutAGoodsDone)
                            {
                                shuttleCarB.SetValue(ShuttleCarDBName.ASRSPutAGoodsDone, ASRSPutAGoodsDone, shuttleCarB.DeviceCode);
                                WriteDebug($"{commonStackerCrane.DeviceName}放货完成", $"【{shuttleCarA.DeviceName}】,任务号【{task.TaskNum}】");
                            }
                            #endregion
                        }
                        else
                        {
                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
                            if (shuttleCar != null)
                            {
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetAGV, ASRSRqtGetAGV, shuttleCar.DeviceCode);
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetGoods, ASRSRqtGetGoods, shuttleCar.DeviceCode);
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtPutGoods, ASRSRqtPutGoods, shuttleCar.DeviceCode);
                                var AGVAlwASRSGetAGV = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetAGV, shuttleCar.DeviceCode);//允许取车
                                commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetAGV, AGVAlwASRSGetAGV);
                                if (ASRSRqtGetAGV)
                                    WriteDebug($"{commonStackerCrane.DeviceName}请求取车", $"【{shuttleCar.DeviceName}】{(AGVAlwASRSGetAGV ? "允许" : "不允许")}取车,任务号【{task.TaskNum}】");
                                var AGVAlwASRSGetGoods = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetGoods, shuttleCar.DeviceCode);//允许取货
                                commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, AGVAlwASRSGetGoods);
                                if (ASRSRqtGetGoods)
                                    WriteDebug($"{commonStackerCrane.DeviceName}请求取货", $"【{shuttleCar.DeviceName}】{(AGVAlwASRSGetGoods ? "允许" : "不允许")}取货,任务号【{task.TaskNum}】");
                                var AGVAlwASRSPuttGoods = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSPuttGoods, shuttleCar.DeviceCode);//允许放货
                                commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, AGVAlwASRSPuttGoods);
                                if (ASRSRqtPutGoods)
                                    WriteDebug($"{commonStackerCrane.DeviceName}请求放货", $"【{shuttleCar.DeviceName}】{(AGVAlwASRSPuttGoods ? "允许" : "不允许")}放货,任务号【{task.TaskNum}】");
                                commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPutAGV, ASRSRqtPutAGV);
                                if (ASRSRqtPutAGV)
                                    WriteDebug($"{commonStackerCrane.DeviceName}请求放车", $"WCS允许放车,任务号【{task.TaskNum}】");
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSGetAGVDone, ASRSGetAGVDone, shuttleCar.DeviceCode);
                                if (ASRSGetAGVDone)
                                    WriteDebug($"{commonStackerCrane.DeviceName}取车完成", $"【{shuttleCar.DeviceName}】,任务号【{task.TaskNum}】");
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSGetGoodsDone, ASRSGetGoodsDone, shuttleCar.DeviceCode);
                                if (ASRSGetGoodsDone)
                                    WriteDebug($"{commonStackerCrane.DeviceName}取货完成", $"【{shuttleCar.DeviceName}】,任务号【{task.TaskNum}】");
                                shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGoodsDone, ASRSPutAGoodsDone, shuttleCar.DeviceCode);
                                //shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGVDone, ASRSPutAGVDone, shuttleCar.DeviceCode);
                                if (ASRSPutAGoodsDone)
                                    WriteDebug($"{commonStackerCrane.DeviceName}放货完成", $"【{shuttleCar.DeviceName}】,任务号【{task.TaskNum}】");
                            }
                        }
                    }