| | |
| | | } |
| | | else |
| | | { |
| | | //return true; |
| | | object? obj = null; |
| | | for (int i = 0; i < 5; i++) |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | T readValue = Read<T>(address); |
| | | stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, readValue, value)); |
| | |
| | | stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAndReadCheckSuccess, address, value, readValue)); |
| | | return true; |
| | | } |
| | | else if (i < 4) |
| | | else if (i < 2) |
| | | { |
| | | Write(address, value); |
| | | } |
| | |
| | | if (operateResult.IsSuccess) |
| | | { |
| | | object? obj = null; |
| | | for (int i = 0; i < 5; i++) |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | T readValue = ReadCustomer<T>(address); |
| | | stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, address, JsonConvert.SerializeObject(readValue))); |
| | |
| | | if (j == propertyInfos.Length - 1) |
| | | return true; |
| | | } |
| | | |
| | | plc.WriteCustomer(address, value); |
| | | } |
| | | stringBuilder.AppendLine(string.Format(CommunicationExceptionMessage.WriteAndReadCheckFaild, address, JsonConvert.SerializeObject(value), JsonConvert.SerializeObject(obj))); |
| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | var task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error($"未找到该任务信息,任务号:【{taskNum}】"); |
| | | |
| | | //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | //{ |
| | | // //todo |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | //{ |
| | | // //todo 同步到WMS |
| | | |
| | | // BaseDal.DeleteData(task); |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | //{ |
| | | // //todo 调用WMS移库完成 |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // throw new Exception($"任务类型错误,未找到该任务类型,任务号:【{taskNum}】,任务类型:【{task.TaskType}】"); |
| | | //} |
| | | |
| | | #region WMS同步任务完成 |
| | | |
| | | var keys = new Dictionary<string, object>() |
| | |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"任务完成异常,任务号:【{taskNum}】"); |
| | | QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.Message}】{Environment.NewLine}{Environment.NewLine}"); |
| | | } |
| | | QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}"); |
| | | return content; |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_DTO.WMS; |
| | | using WIDESEAWCS_ISystemServices; |
| | |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"任务完成异常,任务号:【{taskNum}】"); |
| | | QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.Message}】{Environment.NewLine}{Environment.NewLine}"); |
| | | } |
| | | QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}"); |
| | | return content; |
| | | } |
| | | |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + requestTrayOutTask; |
| | | |
| | | var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString()); |
| | | var deviceCode = device.Select(x => x.DeviceCode).ToList(); |
| | | //var device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && x.DeviceRemark == platform.Id.ToString()); |
| | | //var deviceCode = device.Select(x => x.DeviceCode).ToList(); |
| | | List<string> strings = platform.Location.Split(',').ToList(); |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.ToJsonString()); |
| | |
| | | { |
| | | string[] chineseNumbers = new string[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" }; |
| | | var locationList = new List<DtLocationInfo>(); |
| | | for (int line = 3; line <= x; line++) |
| | | for (int line = 1; line <= x; line++) |
| | | { |
| | | for (int column = 1; column <= y; column++) |
| | | { |
| | |
| | | LocationType = locType, |
| | | Remark = "", |
| | | Depth = locType > 1 ? (((line - 1) % 4) + 1) == 2 || (((line - 1) % 4) + 1) == 3 ? 1 : 2 : 1, |
| | | RoadwayNo = locType > 1 ? $"GWSC{((line - 1) / 4) + 1}" : $"GWSC{((line - 1) / 2) + 1}", |
| | | RoadwayNo = locType > 1 ? $"JZSC{((line - 1) / 4) + 1}" : $"JZSC{((line - 1) / 2) + 1}", |
| | | LocationStatus = LocationEnum.Free.ObjToInt(), |
| | | AreaId = areaId, |
| | | Creater = "System", |