| | |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å建åºåæ¹æ¬¡ä¿¡æ¯ |
| | | // 6ï¸â£ æ¥è¯¢åºåæ¹æ¬¡ä¿¡æ¯ |
| | | var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>() |
| | | .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo); |
| | | #region å建åºåæ¹æ¬¡ä¿¡æ¯ åªæä¸æ¯è°æ¨å
¥åºåï¼115ï¼æå¯¹æ¹æ¬¡ä¿¡æ¯è¿è¡ä¿®æ¹ |
| | | if (cabinOrder.Order_type != InOrderTypeEnum.Allocat.ObjToInt().ToString()) |
| | | { |
| | | // 6ï¸â£ æ¥è¯¢åºåæ¹æ¬¡ä¿¡æ¯ |
| | | var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>() |
| | | .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo); |
| | | |
| | | if (inventory_Batch != null) |
| | | { |
| | | inventory_Batch.StockQuantity += orderQty; |
| | | inventory_Batch.AvailableQuantity += orderQty; |
| | | BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | inventory_Batch = new Dt_Inventory_Batch |
| | | if (inventory_Batch != null) |
| | | { |
| | | MaterielCode = inventoryInfo.MaterielCode, |
| | | MaterielName = inventoryInfo.MaterielName, |
| | | MaterielSpec = inventoryInfo.MaterielSpec, |
| | | BatchNo = inventoryInfo.BatchNo, |
| | | StockQuantity = inventoryInfo.StockQuantity, |
| | | OutboundQuantity = inventoryInfo.OutboundQuantity, |
| | | AvailableQuantity = inventoryInfo.AvailableQuantity, |
| | | SupplyQuantity = inventoryInfo.SupplyQuantity, |
| | | ERPStockQuantity = 0, |
| | | Status = false, |
| | | ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"), |
| | | ValidityPeriod = inventoryInfo.ValidityPeriod, |
| | | Remark = "èªå¨å建" |
| | | }; |
| | | BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand(); |
| | | inventory_Batch.StockQuantity += orderQty; |
| | | inventory_Batch.AvailableQuantity += orderQty; |
| | | BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | inventory_Batch = new Dt_Inventory_Batch |
| | | { |
| | | MaterielCode = inventoryInfo.MaterielCode, |
| | | MaterielName = inventoryInfo.MaterielName, |
| | | MaterielSpec = inventoryInfo.MaterielSpec, |
| | | BatchNo = inventoryInfo.BatchNo, |
| | | StockQuantity = inventoryInfo.StockQuantity, |
| | | OutboundQuantity = inventoryInfo.OutboundQuantity, |
| | | AvailableQuantity = inventoryInfo.AvailableQuantity, |
| | | SupplyQuantity = inventoryInfo.SupplyQuantity, |
| | | ERPStockQuantity = 0, |
| | | Status = false, |
| | | ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"), |
| | | ValidityPeriod = inventoryInfo.ValidityPeriod, |
| | | Remark = "èªå¨å建" |
| | | }; |
| | | BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand(); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | SupplyQuantity = 0, |
| | | Remark = "å
¥åº" |
| | | }; |
| | | //è¿éè¿éçå
¥åºè°æ¨åç¶ææ¯115ï¼å°±å°è°æ¨ä»»å¡ç¶ææ¹ä¸º7 |
| | | if (cabinOrder.Order_type == InOrderTypeEnum.Allocat.ObjToInt().ToString()) supplyTask_Hty.TaskType = TaskTypeEnum.AllocatIn.ObjToInt(); |
| | | BaseDal.Db.Insertable(supplyTask_Hty).ExecuteCommand(); |
| | | #endregion |
| | | } |