| | |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | |
| | | // 创建历史任务实例模型 |
| | | var taskHty = CreateHistoricalTask(task); |
| | | |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InQuality) |
| | | { |
| | | await _locationRepository.UpdateDataAsync(locationInf); |
| | | await _task_HtyRepository.AddDataAsync(taskHty); |
| | | await BaseDal.DeleteDataAsync(task); |
| | | return content.OK("入库任务完成成功"); |
| | | } |
| | | // 根据是否有组盘信息创建库存实例模型 |
| | | DtStockInfo stock = boxing == null ? CreateEmptyPalletStock(task, locationInf) : CreateFullPalletStock(task, locationInf, boxing); |
| | | |
| | |
| | | AreaCode = area.AreaCode, |
| | | LocationId = loation.Id, |
| | | StockInfoDetails = boxDetail, |
| | | ProcessCode = boxing.ProcessCode, |
| | | NextProcessCode = boxing.NextProcessCode, |
| | | Remark = boxing.BoxingInfoDetails.Count().ToString(), |
| | | }; |
| | | |
| | | // 处理请求参数 |
| | |
| | | PalletCode = stock.PalletCode, |
| | | SourceAddress = input.Position, |
| | | CurrentAddress = input.Position, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskState = stock.LocationInfo.RoadwayNo.Contains("CH") ? (int)TaskInStatusEnum.InNew : (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.InQuality, |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | Creater = "System", // 修正拼写错误 |
| | |
| | | TaskId = 0, |
| | | }; |
| | | |
| | | var taskDTO = CreateTaskDTO(task); |
| | | var taskDTO = CreateTaskDTO(taskNew); |
| | | BaseDal.AddData(taskNew); |
| | | return content.OK(data: taskDTO); |
| | | // TODO质检回库 |
| | | } |
| | | |
| | | // 根据位置查询区域信息 |
| | | var area = await QueryAreaInfoByPosition(input.Position.Replace("-1", "")); |
| | | var areaCode = Regex.Replace(input.Position, @"-(\d+)", ""); |
| | | var area = await QueryAreaInfoByPosition(areaCode); |
| | | if (area == null) |
| | | { |
| | | return content.Error("该点位不在区域列表中存在"); |
| | |
| | | TaskType = task.TaskType, |
| | | }; |
| | | return content.OK(data: task); |
| | | } |
| | | } |
| | | |
| | | var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 6 && x.stationChildCode == input.Position).FirstOrDefault(); |
| | | if (stationManagers == null) |
| | |
| | | |
| | | #endregion 任务状态更改 |
| | | |
| | | #region 出库解盘 |
| | | |
| | | /// <summary> |
| | | /// 出库解盘接口 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> OutUnblockInterface(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | return content.Error("未找到任务"); |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutFinish; |
| | | var taskHty = CreateHistoricalTask(task); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion 出库解盘 |
| | | |
| | | #region 指定任务出库 |
| | | |
| | | public async Task<WebResponseContent> CreateAndSendOutboundTask(string locationCode, string palletCode) |
| | |
| | | taskType = (int)TaskOutboundTypeEnum.OutQuality; |
| | | else |
| | | taskType = (int)TaskOutboundTypeEnum.OutTray; |
| | | // 创建并添加任务到数据库 |
| | | task = CreateTask(stockInfo, "1020-1", taskType); |
| | | |
| | | if (stockInfo.AreaCode.Contains("CH")) |
| | | { |
| | | // 创建并添加任务到数据库 |
| | | task = CreateTask(stockInfo, "1020-1", taskType); |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.LocationInfo.RoadwayNo == "JZSC1") |
| | | { |
| | | task = CreateTask(stockInfo, "1359-4", taskType); |
| | | } |
| | | } |
| | | //var taskId = await BaseDal.AddDataAsync(task); |
| | | //if (taskId <= 0) |
| | | //{ |