| | |
| | | |
| | | try |
| | | { |
| | | |
| | | // 调用BaseDal.QueryFirstAsync方法,查询任务 |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | if (task != null) |
| | | { |
| | | content = await UpdateExistingTask(input, task); |
| | | return content; |
| | | } |
| | | // 创建一个TrayCellsStatusDto对象,并赋值 |
| | | TrayCellsStatusDto trayCells = new TrayCellsStatusDto() |
| | | { |
| | | TrayBarcode = input.PalletCode |
| | | Software = "WMS", |
| | | TrayBarcode = input.PalletCode, |
| | | EquipmentCode = "ECH001-B" |
| | | }; |
| | | |
| | | // 调用GetTrayCellStatusAsync方法,获取整盘电芯 |
| | |
| | | |
| | | // 添加组盘信息 |
| | | // 将content.Data转换为ResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.ToString()); |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | var boxing = await CreateBoxingInfo(result, input.PalletCode); |
| | | |
| | | // 调用GetProcessApplyAsync方法,获取工艺路线 |
| | |
| | | // 调用GetProcessResponseAsync方法,获取工艺响应 |
| | | var processResponse = await GetProcessResponseAsync(process, input.Position); |
| | | |
| | | // 调用BaseDal.QueryFirstAsync方法,查询任务 |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | // 如果task不为null,则调用UpdateExistingTask方法,更新任务;否则调用CreateNewTask方法,创建新任务 |
| | | content = task != null ? await UpdateExistingTask(input, task) : await CreateNewTask(processResponse, input); |
| | | if (content.Status) |
| | |
| | | SerialNumber = serialNoObj.SerialNo, |
| | | OrderNo = serialNoObj.PositionNo.ToString(), |
| | | Status = serialNoObj.SerialNoStatus, |
| | | MaterielCode = result.BindCode, |
| | | MaterielCode = serialNoObj.BindCode, |
| | | Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | }).ToList() |
| | | }; |
| | |
| | | // 创建一个ProcessApplyDto对象,并赋值 |
| | | return new ProcessApplyDto() |
| | | { |
| | | EquipmentCode = "ECH001-B", |
| | | Software = "WMS", |
| | | //WipOrderNo = result.BindCode, |
| | | SerialNos = content.SerialNos.Select(item => new SerialNos |
| | | { |
| | |
| | | { |
| | | case "1088": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "陈化" && x.WipOrderNo == apply.WipOrderNo && x.ProductDesc == apply.ProductNo) |
| | | .Where(x => x.EquipmentType == "陈化" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | case "1339": |
| | | case "1406": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "静置" && x.WipOrderNo == apply.WipOrderNo && x.ProductDesc == apply.ProductNo) |
| | | .Where(x => x.EquipmentType == "静置" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | default: |
| | |
| | | isUpdateStock = await _stockInfoRepository.AddDataNavAsync(stock); |
| | | } |
| | | |
| | | |
| | | |
| | | // 添加历史任务 |
| | | var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; |
| | | |
| | |
| | | // 创建WMS任务 |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = 0, |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = DateTime.Now.ToString("MMddHHmmss"), |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = input.Position, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | } |