wangxinhui
2 天以前 6d3ea08855337c0cfcc60df2903d3431611c7097
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Tasks/¶þÆÚÏßÌå/ConveyorLineJob2.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
@@ -60,24 +61,55 @@
                                //上报WMS料箱到达
                                if (PickBarCode.IsNotEmptyOrNull())
                                {
                                    //WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
                                    WebResponseContent content = WebResponseContent.Instance.OK();
                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
                                    //WebResponseContent content = WebResponseContent.Instance.OK();
                                    if (content.Status)
                                    {
                                        //写入拣选确认
                                        conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)300, station.StationCode);
                                        WriteInfo(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{PickBarCode}");
                                    }
                                    else
                                    {
                                        WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}拣选申请上报WMS错误,信息{content.Message}");
                                        WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{PickBarCode},信息{content.Message}");
                                    }
                                }
                                else
                                {
                                    WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}拣选申请为{PickRequest}条码为空值");
                                    WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请为{PickRequest}条码为空值");
                                }
                            }
                            //按钮申请
                            bool DownRequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.R_DownRequest, station.StationCode);
                            if (DownRequest)
                            {
                                string PickBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, station.StationCode).Trim();
                                //上报WMS料箱到达
                                if (PickBarCode.IsNotEmptyOrNull())
                                {
                                    ContainerFlowDTO containerFlowDTO = new ContainerFlowDTO()
                                    {
                                        SlotCode = station.PickStationCode,
                                        ContainerCode = PickBarCode,
                                        Direction="100"
                                    };
                                    WebResponseContent responseContent = _taskService.ContainerFlow(containerFlowDTO, station.StationDeviceCode, station.PickStationCode);
                                    if (responseContent.Status)
                                    {
                                        conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), station.StationCode);
                                    }
                                    else
                                    {
                                        WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}按钮申请错误{PickBarCode},信息{responseContent.Message}");
                                    };
                                }
                                else
                                {
                                    WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}按钮申请为{DownRequest}条码为空值");
                                }
                            }
                        }
                        else
                        {
@@ -97,20 +129,23 @@
                                    {
                                        //写入入库确认
                                        conveyorLine.SetValue(ConveyorLineDBName.W_InResponse, true, station.StationCode);
                                        WriteInfo(conveyorLine.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库成功");
                                    }
                                    else
                                    {
                                        WriteError(nameof(conveyorLine.DeviceCode), $"站台{station.StationCode}料箱{InBarCode}申请入库任务错误,信息{content.Message}");
                                        WriteError(conveyorLine.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库任务错误,信息{content.Message}");
                                    }
                                }
                                else
                                {
                                    WriteError(nameof(conveyorLine.DeviceCode), $"站台{station.StationCode}入库申请为{InRequest}条码为空值");
                                    WriteError(conveyorLine.DeviceCode, $"站台{station.StationCode}入库申请为{InRequest}条码为空值");
                                }
                            }
                        }
                        
                    }
                    conveyorLine.SetValue(ConveyorLineDBName.WriteHeart, true, conveyorLine.DeviceCode);
                }
            }
            catch (Exception ex)