| | |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | try |
| | | { |
| | | { |
| | | Dt_Tactics tactics = _tacticsService.Repository.QueryFirst(x => x.TacticeName == "åºåºçç¥"); |
| | | #region ç¹æ®åºæ¿åºåº |
| | | string WareCodeMJ = WarehouseEnum.麻精åº.ObjToInt().ToString("000"); |
| | |
| | | OrderNo = entityOrder.Out_no, |
| | | StockQuantity = InventoryInfo.AvailableQuantity, |
| | | SupplyQuantity = 0, |
| | | Modifier= InventoryInfo.ValidityPeriod,//ææææ¬¡ |
| | | Remark = "åºåº" |
| | | }; |
| | | supplyTasks.Add(supplyTask); |
| | |
| | | inventory_Batch.AvailableQuantity -= detail.order_qty; |
| | | inventory_Batch.OutboundQuantity += detail.order_qty; |
| | | List<Dt_InventoryInfo> dt_InventoryInfos = InventoryInfos.Where(x => x.MaterielCode == inventory_Batch.MaterielCode && x.BatchNo == inventory_Batch.BatchNo).ToList(); |
| | | if (dt_InventoryInfos.Count < 1) throw new Exception($"åºåºåå·ã{outorder.order_no}ãä¸ç©æç¼å·ã{detail.goods_no}ãç©ææ¹æ¬¡ã{detail.batch_num}ãçå¯ç¨åºåä¸è¶³"); |
| | | if (dt_InventoryInfos.Count < 1) throw new Exception($"æ²¡ææ¾å°åºåä¿¡æ¯ä¸çï¼åºåºåå·ã{outorder.order_no}ãçç©æç¼å·ã{detail.goods_no}ãç©ææ¹æ¬¡ã{detail.batch_num}ã"); |
| | | #endregion |
| | | #region æåºåºçç¥æ¥æ¾åºå |
| | | if (tactics.SelectTactice == TacticsEnum.ComeOutonFirstTime.ObjToInt()) |
| | |
| | | LocationCode = InventoryInfo.LocationCode, |
| | | OrderNo = entityOrder.Out_no, |
| | | StockQuantity = InventoryInfo.AvailableQuantity, |
| | | Modifier=InventoryInfo.ValidityPeriod,//ææææ¬¡ |
| | | SupplyQuantity = 0, |
| | | Remark = "åºåº" |
| | | }; |
| | |
| | | LocationCode = InventoryInfo.LocationCode, |
| | | OrderNo = entityOrder.Out_no, |
| | | StockQuantity = Order_qty, |
| | | Modifier = InventoryInfo.ValidityPeriod,//ææææ¬¡ |
| | | SupplyQuantity = 0, |
| | | Remark = "åºåº" |
| | | }; |
| | |
| | | LocationCode = item.LocationCode, |
| | | OrderNo = entityOrder.Out_no, |
| | | StockQuantity = outqty, |
| | | Modifier= item.ValidityPeriod,//æææ |
| | | SupplyQuantity = 0, |
| | | Remark = "åºåº" |
| | | }; |
| | |
| | | LocationCode = inventoryInfo.LocationCode, |
| | | OrderNo = entityOrder.Out_no, |
| | | StockQuantity = orderDetailLK.Order_qty, |
| | | Modifier = inventoryInfo.ValidityPeriod,//æææ |
| | | SupplyQuantity = 0, |
| | | Remark = "åºåº" |
| | | }; |
| | |
| | | foreach (var item in order.details) |
| | | { |
| | | //æ¾åºåæ¹æ¬¡ä¿¡æ¯ |
| | | Dt_Inventory_Batch inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.goods_no && x.BatchNo == item.batch_num).First(); |
| | | Dt_Inventory_Batch inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.goods_no && x.BatchNo == item.batch_num).FirstOrDefault(); |
| | | if (inventory_Batch==null) |
| | | { |
| | | _messageInfoService.AddMessageInfo(MessageGroupByEnum.OutOrderAlarm, "ERPæ¥æåºåºé误", $"çäºåºåºåã{order.order_no}ãç©æç¼å·ã{item.goods_no}ãç©ææ¹æ¬¡ã{item.batch_num}ãçåºåæ¹æ¬¡ä¿¡æ¯æé"); |
| | | throw new Exception($"çäºåºåºåã{order.order_no}ãç©æç¼å·ã{item.goods_no}ãç©ææ¹æ¬¡ã{item.batch_num}ãçåºåæ¹æ¬¡ä¿¡æ¯æé"); |
| | | } |
| | | var Qty = Math.Abs(inventory_Batch.SupplyQuantity); |
| | | if (Qty != item.order_qty) |
| | | { |
| | |
| | | foreach (var item in order.details) |
| | | { |
| | | //æ¾åºåæ¹æ¬¡ä¿¡æ¯ |
| | | Dt_Inventory_Batch inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.goods_no && x.BatchNo == item.batch_num).First(); |
| | | Dt_Inventory_Batch inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.goods_no && x.BatchNo == item.batch_num).FirstOrDefault(); |
| | | if (inventory_Batch==null) |
| | | { |
| | | _messageInfoService.AddMessageInfo(MessageGroupByEnum.OutOrderAlarm, "ERPæ¥æåºåºé误", $"çäºåºåºåã{order.order_no}ãç©æç¼å·ã{item.goods_no}ãç©ææ¹æ¬¡ã{item.batch_num}ãçåºåæ¹æ¬¡ä¿¡æ¯æé"); |
| | | throw new Exception($"çäºåºåºåã{order.order_no}ãç©æç¼å·ã{item.goods_no}ãç©ææ¹æ¬¡ã{item.batch_num}ãçåºåæ¹æ¬¡ä¿¡æ¯æé"); |
| | | } |
| | | var Qty = Math.Abs(inventory_Batch.SupplyQuantity); |
| | | if (Qty != item.order_qty) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var url = "http://121.37.118.63:80/GYZ2/95fck/outOrderOk"; |
| | | if (deliveryOrder.Out_type == "3") url = "http://121.37.118.63:80/GYZ2/95fck/inOrderOk"; |
| | | var url = "http://192.168.1.100:80/GYZ2/95fck/outOrderOk"; |
| | | if (deliveryOrder.Out_type == "3") url = "http://192.168.1.100:80/GYZ2/95fck/inOrderOk"; |
| | | var requestDate = new |
| | | { |
| | | order_no = deliveryOrder.Out_no |