已添加7个文件
已重命名1个文件
已修改27个文件
| | |
| | | public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"{deviceChildCode}éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "DeviceCommand" && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "ReadDeviceCommand" && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using HslCommunication; |
| | | using System.ComponentModel; |
| | | using System.Reflection; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | |
| | | namespace WIDESEAWCS_QuartzJob |
| | | { |
| | | /// <summary> |
| | | /// ä¸è¬å åæºå®ç°ç±»ï¼å®ç°å åæºæ¥å£å± |
| | | /// </summary> |
| | | [Description("å åæº")] |
| | | public class STK : IStackerCrane |
| | | { |
| | | #region Private Member |
| | | |
| | | /// <summary> |
| | | /// å®æä¿¡å·çå¾
æ¶é´ |
| | | /// </summary> |
| | | private const int WaitTimeout = 20 * 6000; |
| | | |
| | | /// <summary> |
| | | /// å®æä¿¡å·è¯»åé¢ç |
| | | /// </summary> |
| | | private const int ReadTimeout = 100; |
| | | |
| | | /// <summary> |
| | | /// å åæºé讯对象 |
| | | /// </summary> |
| | | private BaseCommunicator _communicator; |
| | | /// <summary> |
| | | /// å åæºåè®®ä¿¡æ¯ |
| | | /// </summary> |
| | | private readonly List<DeviceProDTO> _deviceProDTOs; |
| | | /// <summary> |
| | | /// å åæºåè®®æç»ä¿¡æ¯ |
| | | /// </summary> |
| | | private readonly List<DeviceProtocolDetailDTO> _deviceProtocolDetailDTOs; |
| | | /// <summary> |
| | | /// 设å¤ç¼å· |
| | | /// </summary> |
| | | public readonly string _deviceCode; |
| | | /// <summary> |
| | | /// 设å¤åç§° |
| | | /// </summary> |
| | | public readonly string _deviceName; |
| | | /// <summary> |
| | | /// ä¸ä¸æ¬¡ä»»å¡å· |
| | | /// </summary> |
| | | private int _lastTaskNum; |
| | | |
| | | private bool _isChecked = false; |
| | | |
| | | private bool _heartStatr = true; |
| | | |
| | | private bool _isConnected = true; |
| | | #endregion Private Member |
| | | |
| | | #region Public Member |
| | | /// <summary> |
| | | /// å åæºé讯对象 |
| | | /// </summary> |
| | | public BaseCommunicator Communicator => _communicator; |
| | | |
| | | /// <summary> |
| | | /// å åæºåè®®ä¿¡æ¯ |
| | | /// </summary> |
| | | public List<DeviceProDTO> DeviceProDTOs => _deviceProDTOs; |
| | | |
| | | /// <summary> |
| | | /// å åæºåè®®æç»ä¿¡æ¯ |
| | | /// </summary> |
| | | public List<DeviceProtocolDetailDTO> DeviceProtocolDetailDTOs => _deviceProtocolDetailDTOs; |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸æ¬¡æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int LastTaskNum => _lastTaskNum; |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç¼å· |
| | | /// </summary> |
| | | public string DeviceCode => _deviceCode; |
| | | |
| | | /// <summary> |
| | | /// 设å¤åç§° |
| | | /// </summary> |
| | | public string DeviceName => _deviceName; |
| | | |
| | | /// <summary> |
| | | /// é讯æ¯å¦å·²è¿æ¥ |
| | | /// </summary> |
| | | public bool IsConnected => Communicator.IsConnected && _isConnected; |
| | | |
| | | /// <summary> |
| | | /// å åæºä»»å¡å®æäºä»¶ |
| | | /// </summary> |
| | | public event EventHandler<StackerCraneTaskCompletedEventArgs> StackerCraneTaskCompletedEventHandler; |
| | | |
| | | /// <summary> |
| | | /// å åæºä»»å¡å½ä»¤å¯¹è±¡ |
| | | /// </summary> |
| | | public object StackerCraneTaskCommand { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºå®æäºä»¶æ¯å¦å·²è®¢é
|
| | | /// </summary> |
| | | public bool IsEventSubscribed => StackerCraneTaskCompletedEventHandler != null; |
| | | |
| | | /// <summary> |
| | | /// å åæºä¸MOMè¿æ¥ç¶æ |
| | | /// </summary> |
| | | public bool StackerOnline { get; set; } = false; |
| | | |
| | | public int? LastTaskType { get; set; } = null; |
| | | |
| | | public int CurrentTaskNum => throw new NotImplementedException(); |
| | | |
| | | public bool IsFault => throw new NotImplementedException(); |
| | | |
| | | public DeviceStatus Status => throw new NotImplementedException(); |
| | | #endregion |
| | | |
| | | #region Constructor Function |
| | | /// <summary> |
| | | /// æé 彿° |
| | | /// </summary> |
| | | /// <param name="communicator">å åæºé讯对象</param> |
| | | /// <param name="deviceProDTOs">å åæºå议信æ¯</param> |
| | | /// <param name="deviceProtocolDetailDTOs">å åæºåè®®æç»ä¿¡æ¯</param> |
| | | /// <param name="deviceCode">设å¤ç¼å·</param> |
| | | /// <param name="deviceName">设å¤åç§°</param> |
| | | public STK(BaseCommunicator communicator, List<DeviceProDTO> deviceProDTOs, List<DeviceProtocolDetailDTO> deviceProtocolDetailDTOs, string deviceCode, string deviceName) |
| | | { |
| | | _communicator = communicator; |
| | | _deviceProDTOs = deviceProDTOs; |
| | | _deviceProtocolDetailDTOs = deviceProtocolDetailDTOs; |
| | | _deviceCode = deviceCode; |
| | | _deviceName = deviceName; |
| | | } |
| | | #endregion |
| | | |
| | | #region Private Method |
| | | private void AnalysisData() |
| | | { |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region Public Method |
| | | /// <summary> |
| | | /// åéä»»å¡å½ä»¤ |
| | | /// </summary> |
| | | /// <param name="command">ä»»å¡å½ä»¤</param> |
| | | /// <returns></returns> |
| | | public bool SendCommand<T>(T command, string childCode) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == childCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (devicePro == null) |
| | | { |
| | | return false; |
| | | } |
| | | if (Communicator.WriteCustomer(devicePro.DeviceProAddress, command)) |
| | | { |
| | | StackerCraneTaskCommand = command; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读åPLCæ°æ®ï¼è¿åèªå®ä¹å¯¹è±¡ |
| | | /// </summary> |
| | | /// <typeparam name="T">æ³å</typeparam> |
| | | /// <param name="deviceChildCode">å设å¤ç¼å·</param> |
| | | /// <returns>è¿åèªå®ä¹å¯¹è±¡ææåºå¼å¸¸</returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "ReadDeviceCommand" && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | throw new Exception("æªæ¾å°å议信æ¯"); |
| | | } |
| | | else |
| | | { |
| | | return Communicator.ReadCustomer<T>(devicePro.DeviceProAddress); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读åPLCæ°æ®ï¼è¿åèªå®ä¹å¯¹è±¡ |
| | | /// </summary> |
| | | /// <typeparam name="T">æ³å</typeparam> |
| | | /// <param name="deviceChildCode">å设å¤ç¼å·</param> |
| | | /// <param name="typeName">åæ°ç±»å</param> |
| | | /// <returns>è¿åèªå®ä¹å¯¹è±¡ææåºå¼å¸¸</returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public T ReadCustomer<T>(string deviceChildCode, string typeName) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == typeName && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | throw new Exception("æªæ¾å°å议信æ¯"); |
| | | } |
| | | else |
| | | { |
| | | return Communicator.ReadCustomer<T>(devicePro.DeviceProAddress); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åæ°åç§°ã设å¤åç¼å·åå
¥å¯¹åºçæ°æ®ã |
| | | /// </summary> |
| | | /// <typeparam name="TEnum">åæ°åç§°æä¸¾ç±»åã</typeparam> |
| | | /// <typeparam name="TValue">è¦åå
¥çæ°æ®ç±»åã</typeparam> |
| | | /// <param name="enum">åæ°åç§°ã</param> |
| | | /// <param name="value">è¦åå
¥çæ°æ®ã</param> |
| | | /// <param name="deviceChildCode">设å¤åç¼å·å</param> |
| | | /// <returns>è¿ååå
¥æåæå¤±è´¥</returns> |
| | | public bool SetValue<TEnum, TValue>(TEnum @enum, TValue value, string deviceChildCode) |
| | | where TEnum : Enum |
| | | where TValue : notnull |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == @enum.ToString() && x.DeviceChildCode == deviceChildCode); |
| | | return devicePro == null ? throw new Exception($"åå
¥æ°æ®é误,æªå¨å议信æ¯é颿¾å°åæ°{value.ToString()}") : Communicator.WriteObj(devicePro.DeviceProAddress, devicePro.DeviceDataType, value); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åæ°åç§°ã设å¤åç¼å·åå
¥å¯¹åºçæ°æ®ã |
| | | /// </summary> |
| | | /// <typeparam name="TEnum">åæ°åç§°æä¸¾ç±»åã</typeparam> |
| | | /// <typeparam name="TValue">è¦åå
¥çæ°æ®ç±»åã</typeparam> |
| | | /// <param name="enum">åæ°åç§°ã</param> |
| | | /// <param name="value">è¦åå
¥çæ°æ®ã</param> |
| | | /// <param name="deviceChildCode">设å¤åç¼å·å</param> |
| | | /// <returns>è¿ååå
¥æåæå¤±è´¥</returns> |
| | | public bool SetValue<TEnum, TValue>(TEnum @enum, TValue value, string deviceChildCode, string typeName) |
| | | where TEnum : Enum |
| | | where TValue : notnull |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamType == typeName && x.DeviceProParamName == @enum.ToString() && x.DeviceChildCode == deviceChildCode); |
| | | return devicePro == null ? throw new Exception($"åå
¥æ°æ®é误,æªå¨å议信æ¯é颿¾å°åæ°{value.ToString()}") : Communicator.WriteObj(devicePro.DeviceProAddress, devicePro.DeviceDataType, value); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åæ°å称读åå åæºå¯¹åºçæ°æ®ã |
| | | /// </summary> |
| | | /// <typeparam name="TEnum">åæ°åç§°æä¸¾ç±»åã</typeparam> |
| | | /// <typeparam name="TRsult">读åç»æçè¿åå¼ç±»åã</typeparam> |
| | | /// <param name="value">åæ°åç§°ã</param> |
| | | /// <returns>è¿å读åå°çæ°æ®ã</returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public TRsult GetValue<TEnum, TRsult>(TEnum value, string childCode) where TEnum : Enum |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == value.ToString() && x.DeviceChildCode == childCode); |
| | | return devicePro == null ? throw new Exception() : (TRsult)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸è®¾å¤çå¿è·³ |
| | | /// </summary> |
| | | public void Heartbeat() |
| | | { |
| | | |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | _heartStatr = false; |
| | | _communicator.Dispose(); |
| | | GC.SuppressFinalize(this); |
| | | } |
| | | |
| | | public bool SendCommand<T>(T command) where T : IDataTransfer, new() |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | event EventHandler<StackerCraneTaskCompletedEventArgs> StackerCraneTaskCompletedEventHandler; |
| | | |
| | | /// <summary> |
| | | /// 读åPLCåè®®å°åçæ°æ® |
| | | /// </summary> |
| | | /// <typeparam name="TEnum">å议信æ¯çæä¸¾å¯¹è±¡ä¿¡æ¯ã</typeparam> |
| | | /// <typeparam name="TRsult">è¯»åæ°æ®çç±»å对象信æ¯ã</typeparam> |
| | | /// <param name="value">æä¸¾å¼</param> |
| | | /// <returns>读åå°çæ°æ®</returns> |
| | | TRsult GetValue<TEnum, TRsult>(TEnum value) where TEnum : Enum; |
| | | ///// <summary> |
| | | ///// 读åPLCåè®®å°åçæ°æ® |
| | | ///// </summary> |
| | | ///// <typeparam name="TEnum">å议信æ¯çæä¸¾å¯¹è±¡ä¿¡æ¯ã</typeparam> |
| | | ///// <typeparam name="TRsult">è¯»åæ°æ®çç±»å对象信æ¯ã</typeparam> |
| | | ///// <param name="value">æä¸¾å¼</param> |
| | | ///// <returns>读åå°çæ°æ®</returns> |
| | | //TRsult GetValue<TEnum, TRsult>(TEnum value) where TEnum : Enum; |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åæ°åç§°åå
¥å åæºå¯¹åºçæ°æ®ã |
| | | /// </summary> |
| | | /// <typeparam name="TEnum">åæ°åç§°æä¸¾ç±»åã</typeparam> |
| | | /// <typeparam name="TValue">è¦åå
¥çæ°æ®ç±»åã</typeparam> |
| | | /// <param name="enum">åæ°åç§°ã</param> |
| | | /// <param name="value">è¦åå
¥çæ°æ®ã</param> |
| | | /// <returns>è¿ååå
¥æåæå¤±è´¥</returns> |
| | | /// <exception cref="Exception"></exception> |
| | | bool SetValue<TEnum, TValue>(TEnum @enum, TValue value) where TEnum : Enum where TValue : notnull; |
| | | ///// <summary> |
| | | ///// æ ¹æ®åæ°åç§°åå
¥å åæºå¯¹åºçæ°æ®ã |
| | | ///// </summary> |
| | | ///// <typeparam name="TEnum">åæ°åç§°æä¸¾ç±»åã</typeparam> |
| | | ///// <typeparam name="TValue">è¦åå
¥çæ°æ®ç±»åã</typeparam> |
| | | ///// <param name="enum">åæ°åç§°ã</param> |
| | | ///// <param name="value">è¦åå
¥çæ°æ®ã</param> |
| | | ///// <returns>è¿ååå
¥æåæå¤±è´¥</returns> |
| | | ///// <exception cref="Exception"></exception> |
| | | //bool SetValue<TEnum, TValue>(TEnum @enum, TValue value) where TEnum : Enum where TValue : notnull; |
| | | } |
| | | } |
| | |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæ¥è¯¢è¾éçº¿æªæ§è¡çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryConveyorLineTask(int palletCode, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡ç¼å·</param> |
| | |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | |
| | | foreach (var station in stationManagers) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode); |
| | | var request = conveyorLine.GetValue<ConveyorLineDBName, byte>(ConveyorLineDBName.EntApply, station.stationChildCode); |
| | | |
| | | DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == command.RequestTask.ToString()); |
| | | |
| | | //x.DeviceProParamName == nameof(ConveyorLineTaskCommand.ConveyorLineSingal) |
| | | DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == request.ToString()); |
| | | |
| | | if (deviceProtocolDetails != null) |
| | | { |
| | | MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType); |
| | | if (method != null) |
| | | { |
| | | method.Invoke(this, new object[] { conveyorLine, command, station }); |
| | | method.Invoke(this, new object[] { conveyorLine, conveyorLine, station }); |
| | | } |
| | | } |
| | | |
| | | //ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode); |
| | | //command.PVI.Replace("/0", "").Replace("\"\\u0010\\u000f", ""); |
| | | //command.CarColor.Replace("/0", ""); |
| | | //command.CarType.Replace("/0", ""); |
| | | //command.CarCate.Replace("/0", ""); |
| | | //command.CatSkyWindow.Replace("/0", ""); |
| | | |
| | | //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == command.Request.ToString()); |
| | | |
| | | ////x.DeviceProParamName == nameof(ConveyorLineTaskCommand.ConveyorLineSingal) |
| | | //if (deviceProtocolDetails != null) |
| | | //{ |
| | | // MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType); |
| | | // if (method != null) |
| | | // { |
| | | // method.Invoke(this, new object[] { conveyorLine, command, station }); |
| | | // } |
| | | //} |
| | | #region è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | |
| | | //var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¾é线请æ±åé
è·¯å¾ |
| | | /// è¾é线请æ±å
¥åº |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public void RequestInboundFlow(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | public void RequestReceviceCar(CommonConveyorLine conveyorLine, CommonConveyorLine conveyorLine2, Dt_StationManager stationInfo) |
| | | { |
| | | var log = $"ã{conveyorLine.DeviceName}ã,æçå·ï¼ã{stationInfo.stationChildCode}ã,ç«å°ï¼ã{stationInfo.remark}ãè¯·æ±æµå"; |
| | | var log = $"ã{conveyorLine.DeviceName}ã,æçå·ï¼ã{stationInfo.stationChildCode}ã,ç«å°ï¼ã{stationInfo.remark}ã请æ±ä»»å¡"; |
| | | ConsoleHelper.WriteSuccessLine(log); |
| | | |
| | | //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" }); |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | //if() |
| | | |
| | | var taskNew = _taskService.QueryConveyorLineTask(command.Barcode, stationInfo.stationChildCode); |
| | | var palletcode = conveyorLine2.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.SkidNo, stationInfo.stationChildCode); |
| | | var taskNew = _taskService.QueryConveyorLineTask(palletcode, stationInfo.stationChildCode); |
| | | if (taskNew == null) |
| | | { |
| | | if (_taskService.RequestTask(command.Barcode, stationInfo).Result.Status) |
| | | if (_taskService.RequestTask(palletcode, stationInfo).Result.Status) |
| | | { |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(command.Barcode, stationInfo.stationChildCode); |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(palletcode, stationInfo.stationChildCode); |
| | | if (task != null) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | |
| | | else |
| | | { |
| | | //妿任å¡è¯·æ±å¤±è´¥ |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Barcode, taskNew.PalletCode, stationInfo.stationChildCode); |
| | | |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(taskNew); |
| | | } |
| | | } |
| | | |
| | |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | //if() |
| | | |
| | | var taskNew = _taskService.QueryConveyorLineTask(command.Barcode, stationInfo.stationChildCode); |
| | | var taskNew = _taskService.QueryConveyorLineTask(command.PalletCode.ToString().PadLeft(4, '0'), stationInfo.stationChildCode); |
| | | if (taskNew == null) |
| | | { |
| | | if (_taskService.RequestTask(command.Barcode, stationInfo).Result.Status) |
| | | if (_taskService.RequestTask(command.PalletCode.ToString().PadLeft(4, '0'), stationInfo).Result.Status) |
| | | { |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(command.Barcode, stationInfo.stationChildCode); |
| | | Dt_Task task = _taskService.QueryConveyorLineTask(command.PalletCode.ToString().PadLeft(4, '0'), stationInfo.stationChildCode); |
| | | if (task != null) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | |
| | | else |
| | | { |
| | | //妿任å¡è¯·æ±å¤±è´¥ |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Barcode, taskNew.PalletCode, stationInfo.stationChildCode); |
| | | |
| | | if ((taskNew.TargetAddress == "2042" || taskNew.TargetAddress == "2032") && taskNew.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.TargetAddress, stationInfo.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | } |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(taskNew); |
| | | } |
| | | } |
| | | |
| | |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | { |
| | | //string clinfo = conveyorLine.ReadValue(ConveyorLineDBName.Barcode, stationInfo.stationChildCode).ToString(); |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.Barcode, stationInfo.stationChildCode); |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.PalletCode.ToString().PadLeft(4, '0'), stationInfo.stationChildCode); |
| | | if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish) |
| | | { |
| | | //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | |
| | | ConsoleHelper.WriteErrorLine($"{stationInfo.stationChildCode}ç«å°è¯·æ±ååºä¿¡æ¯:{content.ToJsonString()}"); |
| | | if (content.Status) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceName, stationInfo.stationChildCode); |
| | | if (task != null) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Barcode, task.PalletCode, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.SkidNo, task.PalletCode, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | //conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | |
| | | if (task.TargetAddress == "2009" && task.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) |
| | | { |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | { |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.Barcode, stationInfo.stationChildCode); |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceName, stationInfo.stationChildCode); |
| | | if (task != null) |
| | | { |
| | | if (task.TargetAddress == "2032" || task.TargetAddress == "2042") |
| | | { |
| | | bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | else |
| | | { |
| | | WebResponseContent content = _taskService.RequestWheelsFlow(task.PalletCode).Result; |
| | | if (content.Status) |
| | | { |
| | | string taraddress = content.Data.ToString(); // "2032";SourceAddress |
| | | |
| | | bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Barcode}ï¼åWMSç³è¯·å»å失败ï¼åå ï¼{content.Message},åå
¥ç³è¯ä¿¡æ
éï¼2"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | string taraddresspos = _taskService.RequestWheletHty(command.Barcode); |
| | | if (taraddresspos != null) |
| | | var canTask = _taskRepository.QueryData(x => true).OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).FirstOrDefault(); |
| | | if (null != canTask && task.PalletCode == canTask.PalletCode) |
| | | { |
| | | |
| | | bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddresspos, stationInfo.stationChildCode); |
| | | bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | //WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task); |
| | | |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Barcode}ï¼æªæ¾å°ä»»å¡ï¼ç³è¯·ä¸ä¸å°å为ï¼{stationInfo.stationChildCode},åå
¥ç³è¯ä¿¡æ
éï¼2"); |
| | | //command.PalletCode = (Int32)20; |
| | | //command.PVI = "ABCD0123456789"; |
| | | //command.CarCate = "SUV"; |
| | | //command.CarColor = "AB01"; |
| | | |
| | | conveyorLine.SetValue(ConveyorLineDBName.SkidNo, 20, stationInfo.stationChildCode); |
| | | |
| | | conveyorLine.SetValue(ConveyorLineDBName.PVI, "ABCD", stationInfo.stationChildCode); |
| | | |
| | | //conveyorLine.SendCommand<ConveyorLineTaskCommand>(command, stationInfo.stationChildCode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¾é线请æ±å
¥åº |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | //public void RequestInbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) |
| | | //{ |
| | | // var stationInfo = _stationManagerService.GetStationInfoByChildCode(childDeviceCode); |
| | | // if (stationInfo != null) |
| | | // { |
| | | // //_taskService.r |
| | | // } |
| | | // var taskNew = _taskService.QueryCraneConveyorLineTask(command.ConveyorLineTaskNum.ObjToInt(), childDeviceCode); |
| | | // if (taskNew == null) |
| | | // { |
| | | // string barcode = command.ConveyorLineBarcode.TrimEnd(); |
| | | // if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Result.Status) |
| | | // { |
| | | // Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | // //taskCommand.InteractiveSignal = command.InteractiveSignal; |
| | | // taskCommand.ResponState = 1; |
| | | // taskCommand.ConveyorLineTaskNum = task.TaskNum; |
| | | // taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(task.NextAddress); |
| | | // conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | |
| | | // //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | |
| | | // _taskService.UpdateTaskStatusToNext(task); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | |
| | | #region ReadDevice |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// æ/èªå¨ |
| | | /// </summary> |
| | | TaskNum, |
| | | Auto, |
| | | |
| | | /// <summary> |
| | | /// ç®æ å°å |
| | | /// è¿è¡ |
| | | /// </summary> |
| | | TargetAddress, |
| | | Running, |
| | | |
| | | /// <summary> |
| | | /// è¯·æ± |
| | | /// å
¥åºè¯·æ± |
| | | /// </summary> |
| | | RequestTask, |
| | | EntApply, |
| | | |
| | | /// <summary> |
| | | /// 请æ±ååº |
| | | /// åºåºè¯·æ± |
| | | /// </summary> |
| | | ResponState, |
| | | OutApply, |
| | | |
| | | /// <summary> |
| | | /// è¯·æ±æ¾æ |
| | | /// å
è®¸æ¾æ |
| | | /// </summary> |
| | | RequestPut, |
| | | AllowPut, |
| | | |
| | | /// <summary> |
| | | /// æ¾æå®æ |
| | | /// æ»åºå ä½ |
| | | /// </summary> |
| | | PutFinish, |
| | | Occupy, |
| | | |
| | | /// <summary> |
| | | /// ç®æ å°å |
| | | /// æ¯å¦æ¥è¦ |
| | | /// </summary> |
| | | Barcode, |
| | | IsAlarm, |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨ |
| | | /// å¤ç¨1 |
| | | /// </summary> |
| | | Spare, |
| | | Spare1, |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨2 |
| | | /// </summary> |
| | | Spare2, |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨3 |
| | | /// </summary> |
| | | Spare3, |
| | | |
| | | /// <summary> |
| | | /// æ»æ©å· |
| | | /// </summary> |
| | | SkidNo, |
| | | |
| | | /// <summary> |
| | | /// PVI |
| | | /// </summary> |
| | | PVI, |
| | | |
| | | /// <summary> |
| | | /// PVIåå
¥ |
| | | /// </summary> |
| | | PVI_W, |
| | | |
| | | /// <summary> |
| | | /// æ»æ©å· |
| | | /// </summary> |
| | | Spare4, |
| | | |
| | | /// <summary> |
| | | /// =1 ç©ºæ¬ =2æ¬ç» =3车身 =4çµæ± 壳 =5ç©ºææ¶ |
| | | /// </summary> |
| | | Spare5, |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨6 |
| | | /// </summary> |
| | | Spare6, |
| | | #endregion |
| | | |
| | | #region WriteDevice |
| | |
| | | // public short ConveyorLineAlarm { get; set; } |
| | | |
| | | |
| | | //} |
| | | //} |
| | | |
| | | public class ConveyorLineTaskCommand : DeviceCommand |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public short TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ å°å |
| | | /// è¯·æ± |
| | | /// </summary> |
| | | public short TargetAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä»»å¡ |
| | | /// </summary> |
| | | public short RequestTask { get; set; } |
| | | public byte Request { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±ååº |
| | |
| | | public short ResponState { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯·æ±æ¾æ |
| | | /// æ»æ©å· |
| | | /// </summary> |
| | | public short RequestPut { get; set; } |
| | | public int PalletCode { get; set; } //=> |
| | | |
| | | /// <summary> |
| | | /// æ¾æå®æ |
| | | /// PVIç |
| | | /// </summary> |
| | | public short PutFinish { get; set; } |
| | | [DataLength(13)] |
| | | public string PVI { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¡ç |
| | | /// å¤ç¨1 |
| | | /// </summary> |
| | | [DataLength(10)] |
| | | public string Barcode { get; set; } |
| | | [DataLength(3)] |
| | | public string Spare1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨ |
| | | /// 车系 |
| | | /// </summary> |
| | | public short Spare { get; set; } |
| | | [DataLength(4)] |
| | | public string CarType { get; set; } |
| | | |
| | | //public short SourceAddress { get; set; } |
| | | //public short TargetAddress { get; set; } |
| | | /// <summary> |
| | | /// 车å |
| | | /// </summary> |
| | | [DataLength(4)] |
| | | public string CarCate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹åçä½ç½® |
| | | /// </summary> |
| | | [DataLength(4)] |
| | | public string CarPosition { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤©çª |
| | | /// </summary> |
| | | [DataLength(4)] |
| | | public string CatSkyWindow { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车身é¢è² |
| | | /// </summary> |
| | | [DataLength(2)] |
| | | public string CarColor { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ç¨2 |
| | | /// </summary> |
| | | public short Spare2 { get; set; } |
| | | |
| | | } |
| | | |
| | | public class ConveyorLineTaskCommand_CZ : DeviceCommand |
| | | { |
| | | /// <summary> |
| | | /// 车轴æ¡ç |
| | | /// </summary> |
| | | [DataLength(40)] |
| | | public string Number { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å· |
| | | /// </summary> |
| | | public short ConveyorLineSingal { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±åé¦ |
| | | /// </summary> |
| | | public short ResponState { get; set; } |
| | | } |
| | | |
| | | //public class ConveyorLineTaskCommandWrite : DeviceCommand |
| | | //{ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Mapster; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Text; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.HttpContextUser; |
| | | using WIDESEAWCS_IProcessRepository; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using WIDESEAWCS_ITaskInfo_HtyRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class SCJob : JobBase, IJob |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IProcessRepository _processRepository; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly INoticeService _noticeService; |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | private readonly ITask_HtyRepository _htyRepository; |
| | | private readonly ISys_ConfigService _sys_ConfigService; |
| | | private static List<string>? userTokenIds; |
| | | private static List<int>? userIds; |
| | | |
| | | public SCJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository htyRepository, ISys_ConfigService sys_ConfigService) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _processRepository = processRepository; |
| | | _cacheService = cacheService; |
| | | _noticeService = noticeService; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _htyRepository = htyRepository; |
| | | _sys_ConfigService = sys_ConfigService; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | try |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null && value is STK commonStackerCrane) |
| | | { |
| | | List<string> childCodes = commonStackerCrane.DeviceProDTOs.GroupBy(d => d.DeviceChildCode).Select(g => g.Key).ToList(); |
| | | Parallel.For(0, childCodes.Count, (i, state) => |
| | | { |
| | | |
| | | ConsoleHelper.WriteColorLine($"ã{childCodes[i]}ãæ¶é´ã{DateTime.Now}ããã{Thread.CurrentThread.ManagedThreadId}ã", ConsoleColor.Magenta); |
| | | |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, byte>(StackerCraneDBName.TaskState, childCodes[i]) == 2) |
| | | { |
| | | int taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.CurrentTaskNum, childCodes[i]); |
| | | byte workStatus = commonStackerCrane.GetValue<StackerCraneDBName, byte>(StackerCraneDBName.TaskState, childCodes[i]); |
| | | |
| | | ConsoleHelper.WriteColorLine($"ã{childCodes[i]}ãå åæºä½ä¸ç¶æï¼ã{workStatus}ãæ¶é´ã{DateTime.Now}", ConsoleColor.Magenta); |
| | | |
| | | string str = $"ã{childCodes[i]}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{taskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(childCodes[i], str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); |
| | | |
| | | if (task == null) |
| | | { |
| | | commonStackerCrane.SetValue(StackerCraneDBName.CMD, 2, childCodes[i]); |
| | | } |
| | | else |
| | | { |
| | | var content = _taskService.StackCraneTaskCompleted(taskNum); |
| | | |
| | | var isWorkType = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 2, childCodes[i]); |
| | | str = $"ã{childCodes[i]}ãWMS|WCSä»»å¡å®æï¼ã{content.Status}ã,å åæºå®æä¿¡å·åå
¥ï¼ã{isWorkType}ã,ä»»å¡å·ï¼ã{taskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(childCodes[i], str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | } |
| | | } |
| | | |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Online, childCodes[i]) //å¨çº¿ |
| | | && commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Free, childCodes[i]) //ç©ºé² |
| | | && !commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Alarm, childCodes[i]) //æ æ¥è¦ |
| | | && !commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Goods, childCodes[i]) //è½½è´§å°æ è´§ |
| | | && commonStackerCrane.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Flag, childCodes[i]) //è´§åå¯ç¨ |
| | | ) |
| | | { |
| | | Dt_Task? task = GetTask(commonStackerCrane, childCodes[i]); |
| | | if (task != null) |
| | | { |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | var taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.CurrentTaskNum, childCodes[i]); |
| | | //var taskBarCode = commonStackerCrane.GetValue<StackerCraneDBName, string>(StackerCraneDBName.Barcode); |
| | | ConsoleHelper.WriteColorLine($"ã{childCodes[i]}ãå åæºä»»å¡å·ï¼ã{taskNum}ãä»»å¡ä»»å¡å·ï¼ã{task.TaskNum}ã", ConsoleColor.DarkBlue); |
| | | if (taskNum == 0) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ã{childCodes[i]}ãä»»å¡å·ä¸ºã{0}ã,ä»»å¡å·ä¸ä¸è´å¯ä»¥ä¸åä»»å¡", ConsoleColor.DarkBlue); |
| | | |
| | | Thread.Sleep(500); |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand, childCodes[i]); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»»å¡ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane">å åæºå¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(STK commonStackerCrane, string childCode) |
| | | { |
| | | Dt_Task task; |
| | | |
| | | task = _taskService.QueryExcutingTask(childCode); |
| | | if (task != null) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"å åæºå卿§è¡ä¸çä»»å¡,è¯·æ£æ¥"); |
| | | return null; |
| | | } |
| | | |
| | | task = _taskService.QueryRelocationTask(childCode); |
| | | if (task != null) |
| | | { |
| | | return task; |
| | | } |
| | | |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneTask(childCode); |
| | | } |
| | | else |
| | | { |
| | | var lastTaskTypeGroup = commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup(); |
| | | if (lastTaskTypeGroup == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(childCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(childCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(childCode); |
| | | } |
| | | } |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | //var relocation = _taskService.OutBeforeCheck(task.TaskNum); |
| | | |
| | | //if (relocation != null) |
| | | //{ |
| | | // return relocation; |
| | | //} |
| | | |
| | | // æ£æ¥å½ååºåºä»»å¡ç«å°æ¯å¦å
许æ¾è´§ |
| | | var occupiedStation = OutTaskStationIsOccupied(task); |
| | | if (occupiedStation == null) |
| | | { |
| | | // 妿å½ååºåºä»»å¡ç«å°ä¸å
许æ¾è´§ï¼æé¤å½åä»»å¡ï¼æ¥æ¾å
¶ä»åºåºä»»å¡ |
| | | |
| | | var log = $"ä»»å¡å·ï¼ã{task.TaskNum}ãåºåºå°åï¼ã{task.NextAddress}ãä¸å
许æ¾è´§"; |
| | | ConsoleHelper.WriteErrorLine(log); |
| | | |
| | | _noticeService.Logs(userTokenIds, new { commonStackerCrane.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" }); |
| | | WriteInfo(commonStackerCrane.DeviceName, log); |
| | | |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | else |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | else if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | var relocation = _taskService.InBeforeCheck(task.TaskNum); |
| | | |
| | | if (relocation != null) |
| | | { |
| | | return relocation; |
| | | } |
| | | } |
| | | return task; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å¤æåºåºç«å°æ¯å¦è¢«å ç¨ |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns>妿æªè¢«å ç¨ï¼è¿åä¼ å
¥çä»»å¡ä¿¡æ¯ï¼å¦åï¼è¿ånull</returns> |
| | | private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) |
| | | { |
| | | Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault(); |
| | | |
| | | //Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault(); |
| | | if (router != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode); |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | if (conveyorLine.IsOccupied(router.ChildPosi))//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°åºåºç«å°ã{router.ChildPosiDeviceCode}ã对åºçéè®¯å¯¹è±¡ï¼æ æ³å¤æåºåºç«å°æ¯å¦è¢«å ç¨"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³æ ¡éªç«å°"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.TrayCode = ""; |
| | | stackerCraneTaskCommand.TaskNo = task.TaskNum; |
| | | stackerCraneTaskCommand.TaskType = 1; |
| | | stackerCraneTaskCommand.Goods_Type = 0; |
| | | stackerCraneTaskCommand.CMD = 1; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); |
| | | if (routers.Count > 0) |
| | | { |
| | | stackerCraneTaskCommand.S_Row = Convert.ToInt16(routers.FirstOrDefault().SrmRow); |
| | | stackerCraneTaskCommand.S_Bay = Convert.ToInt16(routers.FirstOrDefault().SrmColumn); |
| | | stackerCraneTaskCommand.S_level = Convert.ToInt16(routers.FirstOrDefault().SrmLayer); |
| | | |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.E_Row = Convert.ToInt16(targetCodes[0]) /*% 2 != 0 ? (short)1 : (short)2*/; |
| | | stackerCraneTaskCommand.E_Bay = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.E_level = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³è·å对åºçå åæºåè´§ç«å°ä¿¡æ¯"); |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); |
| | | if (routers.Count > 0) |
| | | { |
| | | stackerCraneTaskCommand.E_Row = Convert.ToInt16(routers.FirstOrDefault().SrmRow); |
| | | stackerCraneTaskCommand.E_Bay = Convert.ToInt16(routers.FirstOrDefault().SrmColumn); |
| | | stackerCraneTaskCommand.E_level = Convert.ToInt16(routers.FirstOrDefault().SrmLayer); |
| | | |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.S_Row = Convert.ToInt16(sourceCodes[0]) /*% 2 != 0 ? (short)1 : (short)2*/; |
| | | stackerCraneTaskCommand.S_Bay = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.S_level = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³è·å对åºçå åæºæ¾è´§ç«å°ä¿¡æ¯"); |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.E_Row = Convert.ToInt16(targetCodes[0]) /*% 2 != 0 ? (short)1 : (short)2*/; |
| | | stackerCraneTaskCommand.E_Bay = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.E_level = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.S_Row = Convert.ToInt16(sourceCodes[0])/* % 2 != 0 ? (short)1 : (short)2*/; |
| | | stackerCraneTaskCommand.S_Bay = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.S_level = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | // this.buttons.unshift({ //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | | // name: 'æé®', //æé®åç§° |
| | | // icon: 'el-icon-document', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | // type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | // onClick: function () { |
| | | // this.$Message.success('ç¹å»äºæé®'); |
| | | // } |
| | | // }); |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150; |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | // meta: { |
| | | // keepAlive: true |
| | | // } |
| | | } |
| | | }, |
| | | { |
| | | path: '/Dt_BDCConfiguration', |
| | | name: 'Dt_BDCConfiguration', |
| | | component: () => import('@/views/widesea_wms/basicinfo/Dt_BDCConfiguration.vue'), |
| | | meta: { |
| | | keepAlive: false |
| | | } |
| | | }, |
| | | ] |
| | | export default tables |
| | |
| | | const table = ref({ |
| | | key: 'id', |
| | | footer: "Foots", |
| | | cnName: 'æ¶è£
å·¥å', |
| | | cnName: 'æ»è£
å·¥å', |
| | | name: 'Orderinfo/Dt_AssemblyOrderInfo', |
| | | url: "/Dt_AssemblyOrderInfo/", |
| | | sortName: "Id" |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wms/basicinfo/Dt_AreaInfo.jsæ¤å¤ç¼å |
| | | --> |
| | | <template> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/widesea_wms/basicinfo/Dt_BDCConfiguration.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'Id', |
| | | footer: "Foots", |
| | | cnName: 'é
置信æ¯', |
| | | name: 'basicinfo/Dt_BDCConfiguration', |
| | | url: "/Dt_BDCConfiguration/", |
| | | sortName: "Id" |
| | | }); |
| | | const editFormFields = ref({ |
| | | "Name": "", |
| | | "IsActive": "", |
| | | "MaxWhiteBodyCache": "", |
| | | "MaxPaintedBodyCache": "", |
| | | "MaxEmptySledCache": "" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { "title": "é
ç½®åç§°", "field": "Name", type: "text" }, |
| | | { "title": "æ¯å¦å¯ç¨", "field": "IsActive", type: "int" }, |
| | | |
| | | ], |
| | | [ |
| | | { "title": "æå¤§ç½è½¦èº«ç¼å", "field": "MaxWhiteBodyCache", type: "text" }, |
| | | { "title": "æå¤§å½©è½¦èº«ç¼å", "field": "MaxPaintedBodyCache", type: "text" }, |
| | | { "title": "æå¤§ç©ºæ»æ©ç¼å", "field": "MaxEmptySledCache", type: "text" }, |
| | | ] |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | "Name": "", |
| | | "IsActive": "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { "title": "é
ç½®åç§°", "field": "Name", type: "text" }, |
| | | { "title": "æ¯å¦å¯ç¨", "field": "IsActive", type: "int" } |
| | | ], |
| | | ]); |
| | | const columns = ref([{ field: 'Id', title: 'ID', type: 'int', sort: true, hidden: true, width: 110, readonly: true, require: true, align: 'left' }, |
| | | { field: 'name', title: 'é
ç½®åç§°', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'isActive', title: 'ç¶æ', type: 'int', width: 110, align: 'left', bind: { key: "status", data: [] } }, |
| | | { field: 'maxWhiteBodyCache', title: 'æå¤§ç½è½¦èº«ç¼å', type: 'int', width: 120, align: 'left' }, |
| | | { field: 'maxWhiteBodyCache', title: 'æå¤§å½©è½¦èº«ç¼å', type: 'int', width: 120, align: 'left' }, |
| | | { field: 'maxWhiteBodyCache', title: 'æå¤§ç©ºæ»æ©ç¼å', type: 'int', width: 120, align: 'left' }, |
| | | { field: 'creater', title: 'å建人', type: 'string', width: 75, align: 'left' }, |
| | | { field: 'createDate', title: 'å建æ¶é´', type: 'datetime', sort: true, width: 120, align: 'left', sort: true }, |
| | | { field: 'modifier', title: 'ä¿®æ¹äºº', type: 'string', sort: true, width: 75, align: 'left' }, |
| | | { field: 'modifyDate', title: 'ä¿®æ¹æ¶é´', type: 'datetime', sort: true, width: 120, align: 'left', sort: true }, |
| | | |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "" |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common |
| | | { |
| | | /// <summary> |
| | | /// AVI/BDCåMES请æ±è½¦è¾ç¹å¾ä¿¡æ¯ |
| | | /// rfidPrint : pviå·+ç½è½¦èº«ç©æå·å4ä½ |
| | | /// vin : vinå· |
| | | /// AB00 : 车å |
| | | /// SE00 : 车身é¢è² |
| | | /// AD00 : å¤©çª |
| | | /// </summary> |
| | | public class GetCarCharacteristicInfo |
| | | { |
| | | /// <summary> |
| | | /// å¯ä¸æ è¯ |
| | | /// </summary> |
| | | public string unionKey { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç¼ç |
| | | /// </summary> |
| | | public string code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// pviå·+ç½è½¦èº«ç©æå·å4ä½ |
| | | /// </summary> |
| | | public string rfid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// VINå· |
| | | /// </summary> |
| | | public bool success { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 忥æ¶é´ |
| | | /// </summary> |
| | | public DateTime? messageTime { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_Common.MES.Request |
| | | { |
| | | /// <summary> |
| | | /// BDC请æ±çè£
ç¹å¾ä¸å |
| | | /// 车身è¿å
¥BDCæ¶ï¼BDC读å车身ä¸çä¸ç»´æ¡ç åMES请æ±çè£
ç¹å¾ä¿¡æ¯ |
| | | /// 请æ±åæ° |
| | | /// </summary> |
| | | public class IssuedCharacterInfo |
| | | { |
| | | /// <summary> |
| | | /// å·¥åç¼å· |
| | | /// </summary> |
| | | public string plantCode { get; set; } = "1022"; |
| | | public string plantCode { get; set; } = "1052"; |
| | | |
| | | /// <summary> |
| | | /// pviå·+ç½è½¦èº«ç©æå·å4ä½ (æ«æè½¦èº«ç½è½¦èº«ç©æç ) |
| | |
| | | |
| | | namespace WIDESEA_Common |
| | | { |
| | | |
| | | public class pushWorkOrderInfo |
| | | { |
| | | public List<pushWorkOrderInfoDet> list { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¶è£
å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | public class pushWorkOrderInfo |
| | | public class pushWorkOrderInfoDet |
| | | { |
| | | /// <summary> |
| | | /// å·¥å |
| | |
| | | /// <summary> |
| | | /// 车身è¿ç¹ |
| | | /// </summary> |
| | | public const string PassPoint = "PassPoint"; |
| | | public const string AVIPASS = "AVIPASS"; |
| | | |
| | | /// <summary> |
| | | /// WCSæ¥æ¶ä»»å¡ |
| | |
| | | /// 车身ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | public const string IssuedCharacter = "IssuedCharacter"; |
| | | |
| | | /// <summary> |
| | | /// BDCåMES请æ±è½¦è¾ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | public const string getCharacteristic = "getCharacteristic"; |
| | | } |
| | | } |
| | |
| | | [ImporterHeader(Name = "ä¿®æ¹äºº")] |
| | | [ExporterHeader(DisplayName = "ä¿®æ¹äºº")] |
| | | [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "ä¿®æ¹äºº")] |
| | | public string Modifier { get; set; } |
| | | public string Modifier { get; set; } = "System"; |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹æ¥æ |
| | |
| | | [ImporterHeader(Name = "ä¿®æ¹æ¥æ")] |
| | | [ExporterHeader(DisplayName = "ä¿®æ¹æ¥æ")] |
| | | [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "ä¿®æ¹æ¥æ")] |
| | | public DateTime? ModifyDate { get; set; } //= DateTime.Now; |
| | | public DateTime? ModifyDate { get; set; } = DateTime.Now; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®çæ¬ |
| | |
| | | { |
| | | // ä½¿ç¨ myScopedService æ§è¡ä»»å¡ |
| | | |
| | | await DBSeed.SeedAsync(_dbContext, _webRootPath); |
| | | //await DBSeed.SeedAsync(_dbContext, _webRootPath); |
| | | |
| | | //å¤ç§æ· 忥 |
| | | //await DBSeed.TenantSeedAsync(_dbContext); |
| | |
| | | { |
| | | public interface IMESService : IDependency |
| | | { |
| | | /// <summary> |
| | | /// æ¶è£
å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent pushWorkOrderInfo(object json); |
| | | |
| | | /// <summary> |
| | | /// é¢ç»å®å·¥å |
| | | /// </summary> |
| | | WebResponseContent prebind(object json); |
| | | |
| | | WebResponseContent PassPoint(string stationCode); |
| | | /// <summary> |
| | | /// 车身è¿ç¹è¯·æ± |
| | | /// </summary> |
| | | WebResponseContent PassPoint(string stationCode, string rfid); |
| | | |
| | | /// <summary> |
| | | /// æ»è£
å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | WebResponseContent pushOrderInfo(object json); |
| | | |
| | | /// <summary> |
| | | /// BDC请æ±çè£
ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="rfidPrint">RFID</param> |
| | | /// <param name="vin">VINå·</param> |
| | | /// <param name="stationNo">ç«å°è¯·æ±ç¹ä½</param> |
| | | /// <returns></returns> |
| | | WebResponseContent issuedCharacter(string rfidPrint, string vin, string stationNo); |
| | | |
| | | /// <summary> |
| | | /// 车身ç»å®å·¥å(çè£
ç´éæ¶è£
) |
| | | /// </summary> |
| | | WebResponseContent bindWorkOrder(string stationNo, string rfid); |
| | | |
| | | /// <summary> |
| | | /// BDC请æ±è½¦è¾ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="rfidPrint">RFID</param> |
| | | /// <param name="stationNo">ç«å°è¯·æ±ç¹ä½</param> |
| | | /// <returns></returns> |
| | | WebResponseContent getCharacteristic(string rfidPrint, string stationNo); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// BDCç¼åé
ç½®ï¼åå¨åç±»ç©æçæå¤§ç¼åæ°ééå¶ |
| | | /// BDCç¼åé
ç½® |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_BDCConfiguration), "BDCç¼åé
ç½®")] |
| | | public class Dt_BDCConfiguration |
| | | [SugarTable(nameof(Dt_BDCConfiguration_detail), "BDCé
ç½®")] |
| | | public class Dt_BDCConfiguration_detail : BaseEntity |
| | | { |
| | | [Key] |
| | | [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "Name")] |
| | | public int Con_Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é
ç½®åç§° |
| | | /// </summary> |
| | | [Required] |
| | | [MaxLength(100)] |
| | | public string Name { get; set; } = "Default Configuration"; |
| | | [SugarColumn(ColumnName = "Name")] |
| | | public string Name { get; set; } = "é»è®¤é
ç½®"; |
| | | |
| | | /// <summary> |
| | | /// ç½è½¦èº«æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxWhiteBodyCache")] |
| | | [Range(0, int.MaxValue)] |
| | | |
| | | public int MaxWhiteBodyCache { get; set; } = 100; |
| | | |
| | | /// <summary> |
| | | /// 彩车身æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxPaintedBodyCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxPaintedBodyCache { get; set; } = 100; |
| | | |
| | | /// <summary> |
| | | /// çµæ± 壳æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxBatteryCaseCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxBatteryCaseCache { get; set; } = 50; |
| | | |
| | | /// <summary> |
| | | /// ç©ºæ»æ©æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxEmptySledCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxEmptySledCache { get; set; } = 30; |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¶é´ |
| | | /// </summary> |
| | | public DateTime LastUpdatedTime { get; set; } = DateTime.Now; |
| | | |
| | | /// <summary> |
| | | /// æ´æ°äºº |
| | | /// </summary> |
| | | [MaxLength(50)] |
| | | public string UpdatedBy { get; set; } = "System"; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IsActive")] |
| | | public int IsActive { get; set; } = 1; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// BDCç¼åé
ç½®ï¼åå¨åç±»ç©æçæå¤§ç¼åæ°ééå¶ |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_BDCConfiguration), "BDCé
置详æ
")] |
| | | public class Dt_BDCConfiguration: BaseEntity |
| | | { |
| | | [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é
ç½®åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Name")] |
| | | public string Name { get; set; } = "é»è®¤é
ç½®"; |
| | | |
| | | /// <summary> |
| | | /// ç½è½¦èº«æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxWhiteBodyCache")] |
| | | [Range(0, int.MaxValue)] |
| | | |
| | | public int MaxWhiteBodyCache { get; set; } = 100; |
| | | |
| | | /// <summary> |
| | | /// 彩车身æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxPaintedBodyCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxPaintedBodyCache { get; set; } = 100; |
| | | |
| | | /// <summary> |
| | | /// çµæ± 壳æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxBatteryCaseCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxBatteryCaseCache { get; set; } = 50; |
| | | |
| | | /// <summary> |
| | | /// ç©ºæ»æ©æå¤§ç¼åæ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MaxEmptySledCache")] |
| | | [Range(0, int.MaxValue)] |
| | | public int MaxEmptySledCache { get; set; } = 30; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IsActive")] |
| | | public int IsActive { get; set; } = 1; |
| | | } |
| | | } |
| | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IDt_CarBodyRepository _carBodyRepository; |
| | | private readonly IDt_AssemblyOrderInfoRepository _assemblyOrderInfoRepository; |
| | | private readonly IDt_PaintingOrderInfoRepository _paintingOrderInfoRepository; |
| | | |
| | | public MESService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository, IDt_AreaInfoRepository dt_AreaInfoRepository, IDt_PalletInfoRepository palletInfoRepository, IDt_PalletStockInfoRepository palletStockInfoRepository, IDt_OutOrderRepository OutOrderRepository, IUnitOfWorkManage unitOfWorkManage, IDt_CarBodyRepository carBodyRepository, IDt_AssemblyOrderInfoRepository assemblyOrderInfoRepository) |
| | | public MESService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository, IDt_AreaInfoRepository dt_AreaInfoRepository, IDt_PalletInfoRepository palletInfoRepository, IDt_PalletStockInfoRepository palletStockInfoRepository, IDt_OutOrderRepository OutOrderRepository, IUnitOfWorkManage unitOfWorkManage, IDt_CarBodyRepository carBodyRepository, IDt_AssemblyOrderInfoRepository assemblyOrderInfoRepository, IDt_PaintingOrderInfoRepository paintingOrderInfoRepository) |
| | | { |
| | | _locationRepository = locationRepository; |
| | | _taskRepository = taskRepository; |
| | |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _carBodyRepository = carBodyRepository; |
| | | _assemblyOrderInfoRepository = assemblyOrderInfoRepository; |
| | | _paintingOrderInfoRepository = paintingOrderInfoRepository; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | /// <summary> |
| | | /// 车身è¿ç¹è¯·æ± |
| | | /// </summary> |
| | | public partial class MESService |
| | | { |
| | | public WebResponseContent PassPoint(string stationCode) |
| | | public WebResponseContent PassPoint(string stationCode, string rfid) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_MESIPAddress); |
| | | var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.MESIPAddress)?.ConfigValue; |
| | | var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.PassPoint)?.ConfigValue; |
| | | var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.AVIPASS)?.ConfigValue; |
| | | if (wmsBase == null || ipAddress == null) |
| | | { |
| | | throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | |
| | | union_key = Guid.NewGuid().ToString(), |
| | | line_code = stationInfo.stationChildCode, |
| | | message_time = DateTime.Now, |
| | | plant_code = "", |
| | | pvi = "", |
| | | plant_code = "1052", |
| | | pvi = rfid, |
| | | station_code = stationInfo.stationChildCode, |
| | | vin = "", |
| | | pass_time = DateTime.Now |
| | |
| | | throw new Exception($"车身è¿ç¹å¼å¸¸ï¼{responseContent.Message}"); |
| | | } |
| | | |
| | | LogFactory.GetLog("车身è¿ç¹").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("车身è¿ç¹").Info(true, $"å·¥ä½å·:{stationCode},RFID:{rfid}"); |
| | | |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// </summary> |
| | | public partial class MESService |
| | | { |
| | | public WebResponseContent bindWorkOrder(string stationCode) |
| | | public WebResponseContent bindWorkOrder(string stationNo, string rfid) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + ipAddress; |
| | | |
| | | var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == stationCode); |
| | | var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == stationNo); |
| | | |
| | | BindWorkOrder passPoint = new BindWorkOrder() |
| | | { |
| | |
| | | stationCode = stationInfo.stationChildCode, |
| | | messageTime = DateTime.Now.ToString(), |
| | | plantCode = "1022", |
| | | pvi = "", |
| | | pvi = rfid, |
| | | workOrderNo = "", |
| | | workOrderType = "", |
| | | workshopCode = "" |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IdentityModel.Tokens.Jwt; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Common.MES; |
| | | using WIDESEA_Common.MES.Request; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | /// <summary> |
| | | /// BDCåMES请æ±è½¦è¾ç¹å¾ä¿¡æ¯ |
| | | /// æ¥å£æè¿°: BDCå¨PBS01åä¸ä¸ªå·¥ä½éè¿ï¼PVI+ç½è½¦èº«å4ä½ï¼åMES请æ±VIN+车è¾ç¹å¾ä¿¡æ¯åå
¥tag |
| | | /// </summary> |
| | | public partial class MESService |
| | | { |
| | | /// <summary> |
| | | /// BDC请æ±è½¦è¾ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="rfidPrint">RFID</param> |
| | | /// <param name="stationNo">ç«å°è¯·æ±ç¹ä½</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent getCharacteristic(string rfidPrint, string stationNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | CarCharacteristicInfo characterInfo = new CarCharacteristicInfo() |
| | | { |
| | | plantCode = "1052", |
| | | rfidPrint = rfidPrint, |
| | | vin = vin, |
| | | messageTime = DateTime.Now.ToString(), |
| | | unionKey = Guid.NewGuid().ToString(), |
| | | }; |
| | | |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_MESIPAddress); |
| | | var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.MESIPAddress)?.ConfigValue; |
| | | var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.getCharacteristic)?.ConfigValue; |
| | | if (wmsBase == null || ipAddress == null) |
| | | { |
| | | throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | | } |
| | | var wmsIpAddress = wmsBase + ipAddress; |
| | | |
| | | var MESrespon = HttpHelper.Post(wmsIpAddress, characterInfo.ToJson()); |
| | | |
| | | GetCarCharacteristicInfo characterRespon = JsonConvert.DeserializeObject<GetCarCharacteristicInfo>(MESrespon); |
| | | if (!characterRespon.success) |
| | | { |
| | | throw new Exception($"{characterRespon}"); |
| | | } |
| | | |
| | | LogFactory.GetLog("BDC请æ±è½¦è¾ç¹å¾ä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("BDC请æ±è½¦è¾ç¹å¾ä¿¡æ¯").Info(true, $"å·¥ä½å·:{stationNo},RFID:{rfidPrint}"); |
| | | |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error($"BDC请æ±è½¦è¾ç¹å¾ä¿¡æ¯ï¼:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public partial class MESService |
| | | { |
| | | /// <summary> |
| | | /// BDC请æ±çè£
ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="rfidPrint">RFID</param> |
| | | /// <param name="vin">VINå·</param> |
| | | /// <param name="stationNo">ç«å°è¯·æ±ç¹ä½</param> |
| | | /// <returns></returns> |
| | | |
| | | public WebResponseContent issuedCharacter(string rfidPrint, string vin, string stationNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | { |
| | | IssuedCharacterInfo characterInfo = new IssuedCharacterInfo() |
| | | { |
| | | plantCode = "1022", |
| | | plantCode = "1052", |
| | | rfidPrint = rfidPrint, |
| | | vin = vin, |
| | | messageTime = DateTime.Now |
| | |
| | | }; |
| | | |
| | | _carBodyRepository.AddData(CarBody); |
| | | |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"å·¥ä½å·:{stationNo},RFID:{rfidPrint}"); |
| | | |
| | | |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"请æ±çè£
ç¹å¾ä¿¡æ¯å¼å¸¸ï¼:{ex.Message}"); |
| | | return content.Error($"请æ±çè£
ç¹å¾ä¿¡æ¯å¼å¸¸ï¼:{ex.Message}"); |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | /// <summary> |
| | | /// é¢ç»å® |
| | | /// </summary> |
| | | |
| | | public partial class MESService |
| | | { |
| | | public WebResponseContent prebind(object json) |
| | |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | /// <summary> |
| | | /// æ»è£
å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | |
| | | public partial class MESService |
| | | { |
| | | public WebResponseContent pushOrderInfo(object json) |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | responseContent.OK(); |
| | | |
| | | LogFactory.GetLog("æ»è£
å·¥åä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("æ»è£
å·¥åä¿¡æ¯").Info(true, json.ToJsonString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEA_StorageOutOrderRepository; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | public partial class MESService |
| | | { |
| | | /// <summary> |
| | | /// æ¶è£
å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | |
| | | public WebResponseContent pushWorkOrderInfo(object json) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | |
| | | var result = JsonConvert.DeserializeObject<pushWorkOrderInfo>(json.ToString()); |
| | | |
| | | var palletStockInfos = _palletStockInfoRepository.QueryData(x => x.OrderID == result.workOrderNo); |
| | | var paintingOrderInfos = new List<Dt_PaintingOrderInfo>(); |
| | | foreach (var item in result.list) |
| | | { |
| | | Dt_PaintingOrderInfo paintingOrderInfo = new Dt_PaintingOrderInfo() |
| | | { |
| | | biwMaterial = item.biwMaterial, |
| | | carBodyCharacteristic = item.carBodyCharacteristic, |
| | | config1 = item.config1, |
| | | config3 = item.config3, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "System", |
| | | pbMaterial = item.pbMaterial, |
| | | plantCode = item.plantCode, |
| | | pvi = item.pvi, |
| | | sequenceNo = item.sequenceNo, |
| | | skylightCharacteristic = item.skylightCharacteristic, |
| | | twoToneCharacteristic = item.twoToneCharacteristic, |
| | | vehicleCharacteristic = item.vehicleCharacteristic, |
| | | workOrderNo = item.workOrderNo, |
| | | workOrderSendStatus = item.workOrderSendStatus, |
| | | splitStrategy = item.splitStrategy, |
| | | workOrderType = item.workOrderType, |
| | | workshopCode = item.workshopCode, |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | paintingOrderInfos.Add(paintingOrderInfo); |
| | | } |
| | | _paintingOrderInfoRepository.AddData(paintingOrderInfos); |
| | | |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, result.ToJsonString()); |
| | |
| | | MaxPaintedBodyCache = maxPaintedBody, |
| | | MaxBatteryCaseCache = maxBatteryCase, |
| | | MaxEmptySledCache = maxEmptySled, |
| | | LastUpdatedTime = DateTime.Now, |
| | | UpdatedBy = App.User.UserName, |
| | | CreateDate = DateTime.Now, |
| | | Creater = App.User.UserName, |
| | | IsActive = 1 |
| | | }; |
| | | |
| | |
| | | using System.Security.Cryptography.X509Certificates; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | |
| | |
| | | private readonly ILocationInfoRepository _locationRepository; |
| | | private readonly IDt_RoadWayInfoRepository _roadWayInfoRepository; |
| | | private readonly IDt_RoadWayRepository _roadWayRepository; |
| | | |
| | | private readonly IMESService _mesService; |
| | | |
| | | |
| | | // æ´æ°æé 彿° |
| | | public BDCManager(IDt_BDCConfigurationService BDCConfigurationService, ILocationInfoRepository locationInfoRepository, IDt_RoadWayInfoRepository roadWayInfoRepository ) |
| | | public BDCManager(IDt_BDCConfigurationService BDCConfigurationService, ILocationInfoRepository locationInfoRepository, IDt_RoadWayInfoRepository roadWayInfoRepository, IMESService mesService) |
| | | { |
| | | _BDCConfigurationService = BDCConfigurationService; |
| | | _locationRepository = locationInfoRepository; |
| | | _roadWayInfoRepository = roadWayInfoRepository; |
| | | _mesService = mesService; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | var carBody = _carBodyRepository.QueryFirst(x => x.PalletCode == input.PalletCode); |
| | | |
| | | BDCManager bDCManager = new BDCManager(_bdcConfigurationService, _locationRepository, _roadWayInfoRepository); |
| | | //BDCManager bDCManager = new BDCManager(_bdcConfigurationService, _locationRepository, _roadWayInfoRepository); |
| | | |
| | | await bDCManager.AddToBDC(carBody); |
| | | //await bDCManager.AddToBDC(carBody); |
| | | |
| | | // è·ååºä½ |
| | | var location = RequestLocation(stationInfo.Roadway); |
| | |
| | | #endregion 请æ±ä»»å¡å
¥åº |
| | | |
| | | #region åºä½åé
|
| | | |
| | | #region è·åè´§ä½ |
| | | object objLOCK = new object(); |
| | | /// <summary> |
| | | /// åååºä½åé
|
| | | /// åºä½åé
|
| | | /// </summary> |
| | | /// <param name="requestTask"></param> |
| | | /// <param name="locationInfos"></param> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers; |
| | | |
| | | [Route("api/[controller]")] |
| | | [Route("api/BDC")] |
| | | [ApiController] |
| | | public class MESController : Controller |
| | | { |
| | |
| | | /// <param name="stationCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PassPoint"), AllowAnonymous] |
| | | public WebResponseContent PassPoint(string stationCode) |
| | | public WebResponseContent PassPoint(string stationCode,string rfid) |
| | | { |
| | | return _MESService.PassPoint(stationCode); |
| | | return _MESService.PassPoint(stationCode, rfid); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return _MESService.issuedCharacter(carCode, vin, station); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 车身è¿ç¹ |
| | | /// </summary> |
| | | /// <param name="stationCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PassPoint"), AllowAnonymous] |
| | | public WebResponseContent PassPoint(string stationCode, string rfid) |
| | | { |
| | | return _MESService.(stationCode, rfid); |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.CreateAndSendOutboundTask(saveModel); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æä¿®æ¹ |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ°æ®</param> |
| | | /// <returns></returns> |
| | | //[HttpPost, AllowAnonymous, Route("UpdateTaskStatus")] |
| | | ////[TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })] // 5ç§èæµ |
| | | //public async Task<WebResponseContent> UpdateTaskStatus([FromBody] UpdateStatusDto input) |
| | | //{ |
| | | // return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState); |
| | | //} |
| | | } |