| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (conveyorLine != null) |
| | | { |
| | | #region ç«å°æ¹å¼ |
| | | |
| | | List<Dt_StationManger> stationManagers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == conveyorLine.DeviceCode); |
| | | |
| | | foreach (var station in stationManagers) |
| | | { |
| | | if (station.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) //æ£éç³è¯· |
| | | if (station.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) |
| | | { |
| | | //æ£éç³è¯· |
| | | bool PickRequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.R_PickRequest, station.StationCode); |
| | | if (PickRequest) |
| | | { |
| | | string PickBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, station.StationCode).Replace("\0", ""); |
| | | string PickBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, station.StationCode).Trim(); |
| | | //䏿¥WMSæç®±å°è¾¾ |
| | | if (PickBarCode.IsNotEmptyOrNull()) |
| | | { |
| | | 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(conveyorLine.DeviceCode, $"{station.PickStationCode}æ£éç³è¯·ä¸æ¥WMSé误{PickBarCode}ï¼ä¿¡æ¯{content.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(nameof(conveyorLine.DeviceCode), $"{station.StationCode}æ£éç³è¯·ä¸º{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 |
| | | { |
| | | |
| | | //å
¥åºç³è¯· |
| | | bool InRequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.R_InRequest, station.StationCode); |
| | | bool InResponse = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.W_InResponse, station.StationCode); |
| | | int InWeight = conveyorLine.GetValue<ConveyorLineDBName, int>(ConveyorLineDBName.R_InWeight, station.StationCode); |
| | | if (InRequest && !InResponse && InWeight>0) |
| | | { |
| | | string InBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_InBarCode, station.StationCode).Trim(); |
| | | //æç®±å°è¾¾ |
| | | if (InBarCode.IsNotEmptyOrNull()) |
| | | { |
| | | //ç³è¯·å
¥åºä»»å¡ |
| | | WebResponseContent content =_taskService.RequestInTask(station.StationCode,InBarCode); |
| | | if (content.Status) |
| | | { |
| | | //åå
¥å
¥åºç¡®è®¤ |
| | | conveyorLine.SetValue(ConveyorLineDBName.W_InResponse, true, station.StationCode); |
| | | WriteInfo(conveyorLine.DeviceCode, $"ç«å°{station.StationCode}æç®±{InBarCode}ç³è¯·å
¥åºæå"); |
| | | } |
| | | else |
| | | { |
| | | WriteError(conveyorLine.DeviceCode, $"ç«å°{station.StationCode}æç®±{InBarCode}ç³è¯·å
¥åºä»»å¡é误ï¼ä¿¡æ¯{content.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(conveyorLine.DeviceCode, $"ç«å°{station.StationCode}å
¥åºç³è¯·ä¸º{InRequest}æ¡ç 为空å¼"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion ç«å°æ¹å¼ |
| | | |
| | | conveyorLine.SetValue(ConveyorLineDBName.WriteHeart, true, conveyorLine.DeviceCode); |
| | | } |
| | | } |
| | | catch (Exception ex) |