yanjinhui
2 天以前 5d756f53f07880dc8b7ba0bc9f060b9e94d4b25e
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs
@@ -161,8 +161,8 @@
                #region è´§ä½
                var location = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
                if (location == null) return WebResponseContent.Instance.Error($"请维护货位编号【{LocationCode}】的货位信息");
                if (location.EnableStatus == EnableStatusEnum.Disable.ObjToInt())
                    return WebResponseContent.Instance.Error($"货位编号【{LocationCode}】已禁用,请恢复正常再使用");
                //if (location.EnableStatus == EnableStatusEnum.Disable.ObjToInt())
                //    return WebResponseContent.Instance.Error($"货位编号【{LocationCode}】已禁用,请恢复正常再使用");
                if (location.WarehouseCode != cabinOrderDetail.Reservoirarea)
                    return WebResponseContent.Instance.Error($"货位编号【{LocationCode}】所属库房与当前入库单所属库房不匹配");
                if (location.LocationStatus == LocationStatusEnum.Free.ObjToInt())
@@ -376,7 +376,7 @@
                    };
                    #endregion
                    List<Dt_MaterielInfo> materielInfos = _materielInfoService.Repository.QueryData(x => order.details.Select(x => x.goods_no).Contains(x.MaterielCode));
                    List<Dt_MaterielInfo> materielInfos = _materielInfoService.Repository.QueryData(x => order.details.Select(x => x.goods_no).Contains(x.MaterielCode)).ToList();
                    List<Dt_MaterielInfo> materielInfosUp = new List<Dt_MaterielInfo>();
                    foreach (var item in order.details)
                    {
@@ -607,8 +607,8 @@
                    List<Dt_CabinOrder> cabinOrdersAdd = new List<Dt_CabinOrder>();
                    string WareCodeLK = WarehouseEnum.立库.ObjToInt().ToString("000");
                    string WareCodeDJ = WarehouseEnum.大件库.ObjToInt().ToString("000");
                    List<Dt_Inventory_Batch> inventory_Batchs = _inventory_BatchServices.Repository.QueryData(x => codes.Contains(x.MaterielCode));
                    List<Dt_InventoryInfo> _InventoryInfos = _inventoryInfoService.Repository.QueryData(x => codes.Contains(x.MaterielCode));
                    List<Dt_Inventory_Batch> inventory_Batchs = _inventory_BatchServices.Repository.QueryData(x => codes.Contains(x.MaterielCode)).ToList();
                    List<Dt_InventoryInfo> _InventoryInfos = _inventoryInfoService.Repository.QueryData(x => codes.Contains(x.MaterielCode)).ToList();
                    foreach (var item in order.details)
                    {
                        //找库存批次信息
@@ -619,10 +619,15 @@
                        List<Dt_InventoryInfo> inventoryInfos = _InventoryInfos.Where(x => x.MaterielCode == inventory_Batch.MaterielCode && x.BatchNo == inventory_Batch.BatchNo).ToList();
                        //获取立库盘点差异数
                        var inventoryLK = inventoryInfos.Where(x => x.WarehouseCode == WareCodeLK).First();
                        var LkQty = Math.Abs(inventoryLK.SupplyQuantity);
                        //var LkQty = Math.Abs(inventoryLK.SupplyQuantity);
                        var LkQty = inventoryLK.SupplyQuantity;
                        //获取大件库盘点差异数
                        var inventoryDJ = inventoryInfos.Where(x => x.WarehouseCode == WareCodeDJ).ToList();
                        var DJQty = Math.Abs(inventoryDJ.Sum(x => x.SupplyQuantity));
                        //var DJQty = Math.Abs(inventoryDJ.Sum(x => x.SupplyQuantity));
                        var DJQty = inventoryDJ.Sum(x => x.SupplyQuantity);
                        if (LkQty + DJQty != Qty) throw new Exception($"【{order.order_no}】物料编号【{item.goods_no}】物料批次【{item.batch_num}】的物料信息与物料批次信息盘盈数量不符");
                        if (LkQty == 0)//立库无差异
                        {
@@ -780,7 +785,7 @@
                                Details = order.details.Select(d => new Dt_CabinOrderDetail
                                {
                                    Goods_no = d.goods_no,
                                    Order_qty = LkQty,
                                    Order_qty =Math.Abs( LkQty),
                                    Batch_num = d.batch_num,
                                    Exp_date = d.exp_date,
                                    Reservoirarea = WareCodeLK,
@@ -829,7 +834,8 @@
                List<Dt_CabinOrderDetail> cabinOrderDetails = new List<Dt_CabinOrderDetail>();
                foreach (var item in cabinOrders)
                {
                    if (item.Details != null) cabinOrderDetails.AddRange(cabinOrderDetails);
                    if (item.Details != null) cabinOrderDetails.AddRange(item.Details);
                    item.Modifier = App.User.UserName;
                    item.ModifyDate = DateTime.Now;
                    item.Details = null;