dengjunjie
4 天以前 1b8daa902b075c7cedee7bbcc13b914b7a5b4ad4
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/LKBusiness/CabinOrderServicesLK.cs
@@ -45,16 +45,15 @@
                        if (orderDetail == null) throw new Exception($"未找到盘点单【{cabinOrder.Order_no}】物料编号【{detail.productCode}】物料批次【{detail.batchNo}】的明细信息");
                        decimal orderQty = detail.orderDetails?.Sum(x => decimal.TryParse(x.quantity, out var q) ? Math.Abs(q) : 0) ?? 0;
                        Dt_InventoryInfo inventoryInfo = inventoryInfos.Where(x => x.MaterielCode == detail.productCode && x.BatchNo == detail.batchNo).First();
                        var qty = inventoryInfo.SupplyQuantity - inventoryInfo.StockQuantity;
                        if (orderQty != qty)
                            throw new Exception($"盘盈入库数量不一致,上传数量【{orderQty}】,库存盘盈数量【{qty}】");
                        inventoryInfo.StockQuantity = inventoryInfo.SupplyQuantity;
                        if (orderQty != inventoryInfo.SupplyQuantity)
                            throw new Exception($"盘盈入库数量不一致,上传数量【{orderQty}】,库存盘盈数量【{inventoryInfo.SupplyQuantity}】");
                        inventoryInfo.StockQuantity += inventoryInfo.SupplyQuantity;
                        inventoryInfo.AvailableQuantity = inventoryInfo.StockQuantity;
                        inventoryInfo.SupplyQuantity = 0;
                        inventoryInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                        infosUp.Add(inventoryInfo);
                        Dt_Inventory_Batch inventory_Batch = inventory_Batches.First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo);
                        inventory_Batch.StockQuantity = inventory_Batch.SupplyQuantity;
                        inventory_Batch.StockQuantity += inventory_Batch.SupplyQuantity;
                        inventory_Batch.AvailableQuantity = inventory_Batch.StockQuantity;
                        inventory_Batch.SupplyQuantity = 0;
                        batchesUp.Add(inventory_Batch);