wangxinhui
22 小时以前 37051424de7c4a97132fbb06e45df594790aabf9
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Tasks/Ò»ÆÚÏßÌå/ConveyorLineJob1.cs
@@ -18,6 +18,7 @@
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -44,7 +45,8 @@
        private readonly IRouterRepository _routerRepository;
        private readonly IRouterService _routerService;
        private readonly IRouterExtension _routerExtension;
        private static string BarCode1 = "";
        private static string BarCode2 = "";
        public ConveyorLineJob1(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
        {
            _cacheService = cacheService;
@@ -90,14 +92,31 @@
                                //上报WMS料箱到达
                                if (pickBarCode.IsNotEmptyOrNull())
                                {
                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
                                    if (content.Status)
                                    if (device.DeviceCode == "CL1" && BarCode1!= pickBarCode)
                                    {
                                        WriteInfo(device.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{pickBarCode}");
                                        WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
                                        if (content.Status)
                                        {
                                            WriteInfo(device.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{pickBarCode}");
                                        }
                                        else
                                        {
                                            WriteError(device.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{pickBarCode},信息{content.Message}");
                                        }
                                        BarCode1 = pickBarCode;
                                    }
                                    else
                                    if (device.DeviceCode == "CL2" && BarCode2 != pickBarCode)
                                    {
                                        WriteError(device.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{pickBarCode},信息{content.Message}");
                                        WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
                                        if (content.Status)
                                        {
                                            WriteInfo(device.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{pickBarCode}");
                                        }
                                        else
                                        {
                                            WriteError(device.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{pickBarCode},信息{content.Message}");
                                        }
                                        BarCode2 = pickBarCode;
                                    }
                                }
                                else
@@ -115,9 +134,17 @@
                            if (InTake==256 && InBarCode.IsNotEmptyOrNull())
                            {
                                //申请入库任务
                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt());
                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.DeviceCode==device.DeviceCode);
                                if (task != null) continue;
                                Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x=>x.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt());
                                ContainerFlowDTO containerFlowDTO = new ContainerFlowDTO()
                                {
                                    SlotCode = stationManger.PickStationCode,
                                    ContainerCode= InBarCode,
                                    Direction="100"
                                };
                                WebResponseContent responseContent = _taskService.ContainerFlow(containerFlowDTO, station.StationDeviceCode, stationManger.PickStationCode);
                                if (!responseContent.Status) throw new Exception(responseContent.Message);
                                WebResponseContent content = _taskService.RequestInTask(station.StationCode, InBarCode);
                                if (content.Status)
                                {