添加 ProductionLine 属性并优化任务处理逻辑
在多个文件中添加了 `ProductionLine` 属性,以支持任务的创建和更新。更新了相关方法的参数和返回值,确保在处理任务时正确使用该属性。同时,简化了代码,移除了冗余的赋值,并新增了托盘状态检查逻辑。所有更改旨在提高代码的可读性、维护性和系统的整体性能。
添加 ProductionLine 属性并更新相关逻辑
在多个文件中添加了 ProductionLine 属性,并对现有属性进行了格式化和注释。更新了任务创建和更新逻辑,以支持新属性的处理。修改了 WMSTaskDTO 的创建方式,确保 ProductionLine 被正确赋值。新增了查询空盘库存信息的方法,并在相关方法中更新了参数传递,确保逻辑一致性和正确性。这些更改旨在提高代码的可读性、维护性和系统性能。
| | |
| | | /// ä¼å
级 |
| | | /// </summary> |
| | | public int Grade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨: æç产线 |
| | | ///</summary> |
| | | public string? ProductionLine { get; set; } |
| | | } |
| | | } |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç产线 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æç产线")] |
| | | [ExporterHeader(DisplayName = "æç产线")] |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "æç产线")] |
| | | public string ProductionLine { get; set; } |
| | | } |
| | | } |
| | |
| | | } |
| | | var wmsIpAddrss = wmsBase + requestTask; |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = "", EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode }.ToJsonString()); |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = "", EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode, ProductionLine = stationManager.productLine }.ToJsonString()); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Status) |
| | | { |
| | |
| | | using System; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | /// ä¼å
级 |
| | | /// </summary> |
| | | public int Grade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨: æç产线 |
| | | ///</summary> |
| | | public string? ProductionLine { get; set; } |
| | | } |
| | | } |
| | |
| | | public string? ErrorMessage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨: æç产线 |
| | | /// é»è®¤å¼: |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "ProductionLine", Length = 20, IsNullable = true)] |
| | | public string? ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 任塿§è¡æç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "任塿§è¡æç»")] |
| | |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç产产线")] |
| | | [ExporterHeader(DisplayName = "ç产产线")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç产产线")] |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | IsFull = false, |
| | | AreaCode = area.AreaCode ?? "", |
| | | LocationId = loation.Id, |
| | | ProductionLine = task.ProductionLine, |
| | | StockInfoDetails = new List<DtStockInfoDetail>() |
| | | { |
| | | new DtStockInfoDetail() |
| | |
| | | { |
| | | NGStation = efg.Select(x => x.stationNGChildCode).ToList(); |
| | | } |
| | | content = await CreateNewTask(input, NGStation, 2); |
| | | content = await CreateNewTask(input, result.ProductionLine, NGStation, 2); |
| | | return content.Error("åå¨å¼å¸¸çµè¯"); |
| | | } |
| | | |
| | |
| | | { |
| | | // TODO éè³å
è£
|
| | | List<string> strings = stationManagers.Where(x => x.stationType == 0).Select(x => x.Roadway).ToList(); |
| | | content = await CreateNewTask(input, strings, 3); |
| | | content = await CreateNewTask(input, result.ProductionLine, strings, 3); |
| | | return content; |
| | | } |
| | | else |
| | |
| | | var config = _configService.GetByConfigKey("SYS_InStacker", "CW3InStacker"); |
| | | var strings = config.ConfigValue.Split(',').ToList(); |
| | | // TODO å
¥åº |
| | | content = await CreateNewTask(input, strings); |
| | | content = await CreateNewTask(input, result.ProductionLine, strings); |
| | | if (content.Status) |
| | | await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | | } |
| | |
| | | List<string> strings = stationManagers.Roadway.Split(',').ToList(); |
| | | Console.WriteLine(strings.ToJsonString() + "b-----------------------"); |
| | | //// è°ç¨CreateNewTaskæ¹æ³ï¼å建æ°ä»»å¡ |
| | | content = await CreateNewTask(input, strings); |
| | | content = await CreateNewTask(input, result.ProductionLine, strings); |
| | | if (content.Status) |
| | | { |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | |
| | | Creater = "System", // ä¿®æ£æ¼åé误 |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | ProductionLine = stock.ProductionLine, |
| | | }; |
| | | |
| | | var taskDTO = CreateTaskDTO(taskNew); |
| | |
| | | if (task != null && task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | //WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | //{ |
| | | // TaskNum = task.TaskNum.Value, |
| | | // Grade = 1, |
| | | // PalletCode = task.PalletCode, |
| | | // RoadWay = task.Roadway, |
| | | // SourceAddress = task.SourceAddress, |
| | | // TargetAddress = task.Roadway, |
| | | // TaskState = task.TaskState.Value, |
| | | // Id = 0, |
| | | // TaskType = task.TaskType, |
| | | //}; |
| | | return content.OK(data: task); |
| | | } |
| | | |
| | | // æ ¹æ®ä½ç½®æ¥è¯¢åºåä¿¡æ¯ |
| | | var areaCode = Regex.Replace(input.Position, @"-(\d+)", ""); |
| | | var area = await QueryAreaInfoByPosition(areaCode); |
| | | if (area == null) |
| | | { |
| | | return content.Error("该ç¹ä½ä¸å¨åºåå表ä¸åå¨"); |
| | | } |
| | | |
| | | // è·åæ´ççµè¯å±æ§ç¶æ |
| | | TrayCellsStatusDto trayCells = CreateTrayCellsStatusDto(area, input.PalletCode); |
| | | content = await GetTrayCellStatusAsync(trayCells); |
| | | if (!content.Status) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"è·åçµè¯ç¶æå¤±è´¥:{content.Message}"); |
| | | return content; |
| | | } |
| | | |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | if (result.ProductionLine.IsNullOrEmpty()) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"å½åæçæ 产线,èç³»MOMæ·»å 产线"); |
| | | return content.Error("å½åæçæ 产线,èç³»MOMæ·»å 产线"); |
| | | } |
| | | |
| | | |
| | | var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 6 && x.stationChildCode == input.Position).FirstOrDefault(); |
| | | if (stationManagers == null) |
| | |
| | | throw new Exception("æªæ¾å°ç©ºæçå
¥åºç«å°åå
¥åºç«å°é
ç½®"); |
| | | } |
| | | List<string> strings = stationManagers.Roadway.Split(',').ToList(); |
| | | //Console.WriteLine(strings.ToJsonString() + "b-----------------------"); |
| | | |
| | | return await CreateNewTask(input, strings, 1); |
| | | return await CreateNewTask(input, result.ProductionLine, strings, 1); |
| | | } |
| | | catch (Exception) |
| | | { |
| | |
| | | { |
| | | return content.Error("åºåä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | |
| | | //ConsoleHelper.WriteColorLine(JsonConvert.SerializeObject(stockInfo), ConsoleColor.DarkMagenta); |
| | | |
| | | |
| | | // æ°å¢éå¤ä»»å¡æ ¡éª |
| | | var hasTask = BaseDal.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | | .Includes(x => x.StockInfoDetails) // é¢å è½½StockInfoDetails |
| | | .Where(x => x.ProductionLine == station.productLine) |
| | | .Where(x => x.AreaCode == areaCode && x.IsFull == false) |
| | | .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "空æç")) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // è¿æ»¤æ¡ä»¶ |
| | |
| | | Creater = "System", // ä¿®æ£æ¼åé误 |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | ProductionLine = stockInfo.ProductionLine, |
| | | }; |
| | | } |
| | | |
| | |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | ProductionLine = task.ProductionLine, |
| | | }; |
| | | } |
| | | |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | |
| | | // å建WMSä»»å¡ |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.InTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = CreateWMSTaskDTO(task); |
| | |
| | | TaskState = taskOld.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = taskOld.TaskType, |
| | | ProductionLine = taskOld.ProductionLine |
| | | }; |
| | | } |
| | | else if (source is Dt_Task task) |
| | |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | ProductionLine = task.ProductionLine |
| | | }; |
| | | } |
| | | else |
| | |
| | | } |
| | | } |
| | | |
| | | if (stock.IsFull) |
| | | { |
| | | var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); |
| | | if (stocks != null && stocks.Count > 0) |
| | | { |
| | |
| | | item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); |
| | | } |
| | | var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocks); |
| | | } |
| | | } |
| | | |
| | | // æ·»å åå²ä»»å¡ |
| | |
| | | |
| | | #region ä»»å¡è¯·æ±æ¹æ³ |
| | | |
| | | |
| | | private static readonly SemaphoreSlim _semaphoreUpdate = new SemaphoreSlim(1, 1); |
| | | // æ´æ°ä»»å¡è´§ä½ |
| | | |
| | | private async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input, Dt_Task task) |
| | | { |
| | | await _semaphoreUpdate.WaitAsync(); |
| | | try |
| | | { |
| | | if (task == null) |
| | | { |
| | |
| | | return new WebResponseContent().Error($"æ´æ°ä»»å¡æ¶åçé误: {ex.Message}"); |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | finally { _semaphoreUpdate.Release(); } |
| | | } |
| | | |
| | | private void MapTaskProperties(Dt_Task task, RequestTaskDto input, string toAddress, int taskState) |
| | | { |
| | |
| | | /// <param name="process">å··é</param> |
| | | /// <param name="flag">æ è¯ï¼0-å
¥åºï¼1-空æçå
¥åºï¼2-NGå
¥åºï¼3-åºåºï¼</param> |
| | | /// <returns></returns> |
| | | private async Task<WebResponseContent> CreateNewTask(RequestTaskDto input, List<string> process = null, int flag = 0) |
| | | private async Task<WebResponseContent> CreateNewTask(RequestTaskDto input, string productionLine, List<string> process = null, int flag = 0) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | |
| | | TaskState = flag == 3 ? (int)TaskOutStatusEnum.OutNew : (int)TaskInStatusEnum.InNew, |
| | | TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : flag == 1 ? (int)TaskInboundTypeEnum.InTray : flag == 2 ? (int)TaskInboundTypeEnum.InNG : (int)TaskOutboundTypeEnum.Outbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = productionLine |
| | | }; |
| | | |
| | | // å°è¯æ·»å æ°ä»»å¡ |
| | |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | ProductionLine = task.ProductionLine |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | } |
| | |
| | | using WIDESEA_StorageTaskRepository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | |
| | | namespace WIDESEA_StorageTaskServices; |
| | | |
| | |
| | | //if (task.TaskState == (int)TaskInStatusEnum.InNew) |
| | | { |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.TargetAddress, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | //WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | //{ |
| | | // TaskNum = task.TaskNum.Value, |
| | | // Grade = 1, |
| | | // PalletCode = task.PalletCode, |
| | | // RoadWay = task.Roadway, |
| | | // SourceAddress = task.SourceAddress, |
| | | // TargetAddress = task.TargetAddress, |
| | | // TaskState = task.TaskState.Value, |
| | | // Id = 0, |
| | | // TaskType = task.TaskType, |
| | | // ProductionLine = task.ProductionLine, |
| | | //}; |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | return content.OK(data: taskDTO); |
| | | } |
| | | } |
| | |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | ProductionLine = task.ProductionLine |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | } |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | return taskNG; |
| | | } |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | return taskNG; |
| | | } |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | return task; |
| | | } |
| | |
| | | |
| | | if (locationInfo == null) throw new Exception("åºä½å·²æ»¡"); |
| | | |
| | | if (stationManager.stationType == 1) |
| | | { |
| | | #region |
| | | // å建ä¸ä¸ªTrayCellsStatusDto对象ï¼å¹¶èµå¼ |
| | | TrayCellsStatusDto trayCells = new TrayCellsStatusDto() |
| | | { |
| | |
| | | // å¦æç¶æä¸ºfalseï¼åè¿åcontent |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | |
| | | // æ·»å ç»çä¿¡æ¯ |
| | | // å°content.Data转æ¢ä¸ºResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | |
| | | if (stationManager.stationType == 6 && result.ProductionLine.IsNullOrEmpty()) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"å½åæçæ 产线,èç³»MOMæ·»å 产线"); |
| | | throw new Exception("å½åæçæ 产线,èç³»MOMæ·»å 产线"); |
| | | } |
| | | |
| | | if (stationManager.stationType == 1) |
| | | { |
| | | #region |
| | | |
| | | if (result.SerialNos.Count <= 0) |
| | | { |
| | | ConsoleHelper.WriteErrorLine(result.MOMMessage); |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine |
| | | }; |
| | | return taskNG; |
| | | } |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = stationManager.stationType == 1 ? (int)TaskInboundTypeEnum.Inbound : (int)TaskInboundTypeEnum.InTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine, |
| | | }; |
| | | int lastStatus = locationInfo.LocationStatus; |
| | | ConsoleHelper.WriteSuccessLine($"ä¿®æ¹åï¼" + lastStatus.ToString()); |
| | |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | TaskType = (int)TaskOutboundTypeEnum.OutTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = stockinfo.ProductionLine, |
| | | }; |
| | | |
| | | return task; |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.InTray, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine, |
| | | }; |
| | | return Epmtytask; |
| | | } |
| | |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = result.ProductionLine, |
| | | }; |
| | | |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | |
| | | |
| | | var location = locations.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | |
| | | var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1","10086"); |
| | | var stockInfo = await QueryStockInfoForEmptyTrayFRAsync("CWSC1", "10086", taskDTO.ProductionLine); |
| | | |
| | | if (stockInfo != null) |
| | | { |
| | |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ç©ºçåºåä¿¡æ¯ |
| | | /// </summary> |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayFRAsync(string areaCode, string position, string productLine) |
| | | { |
| | | var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode); |
| | | |
| | | ConsoleHelper.WriteColorLine(position + "..." + areaCode, ConsoleColor.Magenta); |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == position && x.stationType == 17); |
| | | |
| | | ConsoleHelper.WriteColorLine(station.Roadway, ConsoleColor.Magenta); |
| | | var stackers = station.Roadway.Split(',').ToList(); |
| | | |
| | | |
| | | var devices = SqlSugarHelper.DbWCS.Queryable<Dt_DeviceInfo>() |
| | | .Where(x => x.DeviceStatus == "1") |
| | | .Where(x => stackers.Contains(x.DeviceCode)) |
| | | .ToList(); |
| | | |
| | | var deviceCode = devices.Select(x => x.DeviceCode).ToList(); |
| | | |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | | .Includes(x => x.StockInfoDetails) // é¢å è½½StockInfoDetails |
| | | .Where(x => x.ProductionLine == productLine) |
| | | .Where(x => x.AreaCode == areaCode && x.IsFull == false) |
| | | .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "空æç")) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // è¿æ»¤æ¡ä»¶ |
| | | .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo)) |
| | | .OrderBy(x => x.CreateDate) // æåº |
| | | .FirstAsync(); // 转æ¢ä¸ºå表 |
| | | |
| | | //var firstOrDefault = result[0]; // æ¥æ¾ç¬¬ä¸ä¸ªå¹é
çå
ç´ |
| | | //return firstOrDefault; |
| | | return result; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | public async Task<WebResponseContent> RequestOutTaskToBZAsync(RequestTaskDto json) |
| | |
| | | Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position && x.stationType == 12 && x.stationArea == "Call"); |
| | | |
| | | var stockInfo = _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Where(x => x.ProductionLine == station.productLine) |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | | .Where(x => x.AreaCode == "CWSC3" && x.IsFull == true) // è¿æ»¤æ¡ä»¶ |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock) // è¿æ»¤æ¡ä»¶ |
| | |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | TaskType = (int)TaskOutboundTypeEnum.Outbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | Creater = "Systeam", |
| | | ProductionLine = stockInfo.ProductionLine, |
| | | }; |
| | | |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | |
| | | var config = _configService.GetByConfigKey("SYS_InStacker", "CW3InStacker"); |
| | | var strings = config.ConfigValue.Split(',').ToList(); |
| | | // å
¥åºéè³å¸¸æ¸©3 |
| | | var resultContent = await CreateNewTask(input, strings); |
| | | var resultContent = await CreateNewTask(input, input.ProductionLine, strings); |
| | | if (resultContent.Status) |
| | | { |
| | | await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | |
| | | { |
| | | // éè³å
è£
|
| | | List<string> strings = stationManagers.Where(x => x.stationType == 0).Select(x => x.Roadway).ToList(); |
| | | return await CreateNewTask(input, strings, 3); |
| | | return await CreateNewTask(input, input.ProductionLine, strings, 3); |
| | | } |
| | | else |
| | | { |
| | | var config = _configService.GetByConfigKey("SYS_InStacker", "CW3InStacker"); |
| | | var strings = config.ConfigValue.Split(',').ToList(); |
| | | // å
¥åºéè³å¸¸æ¸©3 |
| | | var resultContent = await CreateNewTask(input, strings); |
| | | var resultContent = await CreateNewTask(input, input.ProductionLine, strings); |
| | | if (resultContent.Status) |
| | | { |
| | | await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | |
| | | } |
| | | List<string> strings = stationManagers.Roadway.Split(',').ToList(); |
| | | |
| | | var resultContent = await CreateNewTask(input, strings); |
| | | var resultContent = await CreateNewTask(input, result.ProductionLine, strings); |
| | | if (resultContent.Status) |
| | | { |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | |
| | | // NGStation = stationManagers.stationNGChildCode.Split(',').ToList(); |
| | | //} |
| | | List<string> NGStation = stationManagers.stationNGChildCode.Split(',').ToList(); |
| | | content = await CreateNewTask(input, NGStation, 2); |
| | | content = await CreateNewTask(input, input.ProductionLine, NGStation, 2); |
| | | return content.Error("åå¨å¼å¸¸çµè¯"); |
| | | } |
| | | |
| | |
| | | TargetAddress = task.Roadway, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType |
| | | TaskType = task.TaskType, |
| | | ProductionLine = task.ProductionLine, |
| | | }; |
| | | return new WebResponseContent().OK(data: taskDTO); |
| | | } |