| | |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_ISquareCabinServices; |
| | | using WIDESEA_Model.Models; |
| | |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | string WareCode = WarehouseEnum.大件åº.ObjToInt().ToString("000"); |
| | | if (materielInfo.Business_qty >= materielInfo.MinQty) return response; |
| | | Dt_Tactics tactics = _tacticsService.Repository.QueryFirst(x => x.TacticeName == "åºåºçç¥"); |
| | | List<Dt_SupplyTask> supplyTasks = new List<Dt_SupplyTask>(); |
| | | List<Dt_InventoryInfo> dt_InventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.MaterielCode == materielInfo.MaterielCode && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.StockQuantity > x.OutboundQuantity && x.LocationCode != "ç«åº").OrderBy(x => x.InDate).ToList(); |
| | | List<Dt_InventoryInfo> dt_InventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.MaterielCode == materielInfo.MaterielCode && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.StockQuantity > x.OutboundQuantity && x.WarehouseCode == WareCode); |
| | | if (tactics.SelectTactice == TacticsEnum.ComeOutonFirstTime.ObjToInt()) |
| | | dt_InventoryInfos = dt_InventoryInfos.OrderBy(x => x.ValidityPeriod).ToList(); |
| | | else |
| | | dt_InventoryInfos = dt_InventoryInfos.OrderBy(x => x.InDate).ToList(); |
| | | decimal Qty = 0; |
| | | foreach (var item in dt_InventoryInfos) |
| | | { |
| | |
| | | } |
| | | item.AvailableQuantity = item.StockQuantity - item.OutboundQuantity; |
| | | } |
| | | #region 大件åºè¡¥ç«åºåç«åºä¸å¡åºåæ°è¿æ¯å°äºç«åºæå°åºåæ°ï¼æ·»å æç¤ºä¿¡æ¯ |
| | | |
| | | #endregion |
| | | #region æ·»å è°æ¨åºåºå |
| | | Dt_DeliveryOrder deliveryOrder = new Dt_DeliveryOrder() |
| | | { |
| | |
| | | Reservoirarea = cabinOrder.Warehouse_no, |
| | | Goods_no = item.Goods_no, |
| | | Order_qty = item.Order_qty, |
| | | Order_Inqty = item.Order_qty, |
| | | Batch_num = item.Batch_num, |
| | | OrderDetailStatus = "æ°å»º", |
| | | Status = 0 |
| | |
| | | #endregion |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _basicService.MaterielInfoService.Repository.UpdateData(materielInfo); |
| | | _inventoryInfoService.Repository.UpdateData(dt_InventoryInfos); |
| | | _supplyTaskService.AddData(supplyTasks); |
| | | BaseDal.Db.InsertNav(deliveryOrder).Include(x => x.Details).ExecuteCommand(); |