| | |
| | | /// <returns></returns> |
| | | public WebResponseContent TransmissionlineRequest(ConveyorLineDTO lineDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | WebResponseContent content = new WebResponseContent().OK(); |
| | | try |
| | | { |
| | | //if (BaseDal.QueryFirst(x => (x.SourceAddress == lineDTO.stationCode || x.CurrentAddress == lineDTO.stationCode) && x.TaskStatus == InTaskStatusEnum.AGV_InFinish.ObjToInt()) != null) |
| | |
| | | //} |
| | | var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt()); |
| | | if (task == null) throw new Exception($"æªæ¾å°æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡"); |
| | | if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡ç¶æä¸å¹é
"); |
| | | //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) 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); |
| | | |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(); |
| | | |
| | | if (lineDTO.Spec != 1 || lineDTO.Weight != 500)//æ£æµæ¡ä»¶éæ´æ¹ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ |
| | | { |
| | | task.NextAddress = "101"; |
| | | task.TaskState = (int)InTaskStatusEnum.InException; |
| | | task.Remark = $"æç[{lineDTO.Barcode}]ä¿¡æ¯ä¸åæ ¼"; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºæ¤é.ObjToInt(); |
| | | //stockInfo.StockStatus = StockStatusEmun.å
¥åºæ¤é.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | task.NextAddress = "104"; |
| | | task.CurrentAddress = lineDTO.stationCode; |
| | | task.Remark=string.Empty; |
| | | task.TaskState = (int)InTaskStatusEnum.Line_InExecuting; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | stockInfoDetail.Status = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | |
| | | #region äºå¡ |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.UpdateData(task); |
| | | Db.Updateable(stockInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | //Db.Updateable(stockInfo).ExecuteCommand(); |
| | | Db.Ado.CommitTran(); |
| | | #endregion |
| | | if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark); |
| | |
| | | TaskState = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | }; |
| | | dt_Task.Dispatchertime = DateTime.Now; |
| | | 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()); |