| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEAWCS_DTO.WCSInfo; |
| | | using WIDESEA_DTO.WCSInfo; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | Db.Ado.CommitTran(); |
| | | #endregion |
| | | if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 产线ç³è¯· |
| | | /// </summary> |
| | | /// <param name="lineDTO"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ProductionlineRequest(ConveyorLineDTO lineDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode); |
| | | if (task != null && task.TaskType == TaskTypeEnum.Inbound.ObjToInt()) |
| | | return content.OK(data: task); |
| | | if (task != null) throw new Exception($"æçå·[{lineDTO.Barcode}]å·²åå¨ä»»å¡"); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode); |
| | | (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | var StockInfoDetails = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).ToList(); |
| | | #region çæå
¥åºä»»å¡ |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |
| | | CurrentAddress = lineDTO.stationCode, |
| | | NextAddress = "SC01", |
| | | SourceAddress = lineDTO.stationCode, |
| | | TargetAddress = "SC01", |
| | | CreateDate = DateTime.Now, |
| | | Creater = "System", |
| | | PalletCode = lineDTO.Barcode, |
| | | OrderNo = StockInfoDetails.Count() == 1 ? StockInfoDetails.First().OrderNo : null, |
| | | Roadway = "SC01", |
| | | TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")), |
| | | TaskState = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | }; |
| | | dt_Task.Dispatchertime = dt_Task.CreateDate; |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.AddData(dt_Task); |
| | | task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt()); |
| | | //content.Data = dt_Task; |
| | | Db.Ado.CommitTran(); |
| | | if (task != null) return content.OK(data: task); |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |