| | |
| | | using Magicodes.IE.Core; |
| | | using MailKit.Search; |
| | | using System; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | |
| | | if (stockInfo != null) throw new Exception($"æçã{productionlineDTO.Barcode}ãå·²åå¨åºåä¿¡æ¯"); |
| | | stockInfo = new Dt_StockInfo(); |
| | | stockInfo.Details = new List<Dt_StockInfoDetail>(); |
| | | var OrderNo = productionlineDTO.batchNo.Split('T')[0]; |
| | | Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(OrderNo); |
| | | if (inboundOrder == null) throw new Exception($"æªæ¾å°å
¥åºåã{OrderNo}ã"); |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == productionlineDTO.batchNo); |
| | | if (inboundOrderDetail == null) throw new Exception($"æªæ¾å°æ¹å·ã{productionlineDTO.batchNo}ãçå
¥åºè¯¦æ
"); |
| | | if (inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity < 1) throw new Exception($"æ¹å·ã{productionlineDTO.batchNo}ãç»çæ°éè¶
åº"); |
| | | #region MyRegion |
| | | Dt_InboundOrderDetail inboundOrderDetail = _inboundService.InboundOrderDetailService.Repository.QueryFirst(x => x.BatchNo == productionlineDTO.batchNo); |
| | | if (inboundOrderDetail == null) |
| | | throw new Exception($"æªæ¾å°æ¹å·ã{productionlineDTO.batchNo}ãçå
¥åºè¯¦æ
"); |
| | | if (inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity < 1) |
| | | throw new Exception($"æ¹å·ã{productionlineDTO.batchNo}ãç»çæ°éè¶
åº"); |
| | | Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.Id == inboundOrderDetail.OrderId); |
| | | if (inboundOrder == null) throw new Exception($"æªæ¾å°æ¹å·ã{productionlineDTO.batchNo}ãçå
¥åºå¤´è¡¨"); |
| | | inboundOrder.Details = new List<Dt_InboundOrderDetail>() { inboundOrderDetail }; |
| | | #endregion |
| | | #region MyRegion |
| | | //var OrderNo = productionlineDTO.batchNo.Split('T')[0]; |
| | | //Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(OrderNo); |
| | | //if (inboundOrder == null) throw new Exception($"æªæ¾å°å
¥åºåã{OrderNo}ã"); |
| | | //Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == productionlineDTO.batchNo); |
| | | //if (inboundOrderDetail == null) throw new Exception($"æªæ¾å°æ¹å·ã{productionlineDTO.batchNo}ãçå
¥åºè¯¦æ
"); |
| | | //if (inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity < 1) throw new Exception($"æ¹å·ã{productionlineDTO.batchNo}ãç»çæ°éè¶
åº"); |
| | | #endregion |
| | | |
| | | Dt_Task dt_Task = new Dt_Task() |
| | | { |
| | |
| | | Creater = "System", |
| | | PalletCode = productionlineDTO.Barcode, |
| | | Roadway = "SC01", |
| | | OrderNo = OrderNo, |
| | | OrderNo = inboundOrder.OrderNo, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskState = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |