| | |
| | | public InventoryInfoService(IRepository<Dt_InventoryInfo> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | public IRepository<Dt_InventoryInfo> Repository => BaseDal; |
| | | |
| | | /// <summary> |
| | | /// wcsåä¼ ç»æè°ç¨æçæ¹æ³ |
| | |
| | | entity = new Dt_InventoryInfo |
| | | { |
| | | PalletCode = detail.orderDetails?.FirstOrDefault()?.palletCode ?? "", |
| | | WarehouseId = 001, // é»è®¤åºæ¿ç¼å·ï¼å¯æ ¹æ®ä¸å¡æ¹ |
| | | WarehouseCode = 001.ToString(), // é»è®¤åºæ¿ç¼å·ï¼å¯æ ¹æ®ä¸å¡æ¹ |
| | | LocationCode = "", // ææ å¯ç©º |
| | | StockStatus = 1, // ç«åºåºå®ä¸º 1 |
| | | MaterielCode = detail.productCode ?? detail.productName, |
| | |
| | | switch (request.orderType) |
| | | { |
| | | case "1": // å
¥åº |
| | | entity.StockQuantity += (float)orderQty; |
| | | entity.StockQuantity += orderQty; |
| | | entity.InDate = DateTime.Now; |
| | | entity.Remark = "å
¥åºååä¼ "; |
| | | break; |
| | | |
| | | case "2": // åºåº |
| | | entity.OutboundQuantity += (float)orderQty; |
| | | entity.StockQuantity -= (float)orderQty; |
| | | entity.OutboundQuantity += orderQty; |
| | | entity.StockQuantity -= orderQty; |
| | | if (entity.StockQuantity < 0) entity.StockQuantity = 0; |
| | | entity.Remark = "åºåºååä¼ "; |
| | | break; |
| | |
| | | decimal diff = Convert.ToDecimal(stock.differenceQuantity); |
| | | if (stock.IsProfit == "1") // çç |
| | | { |
| | | entity.SupplyQuantity += (float)Math.Abs(diff); |
| | | entity.SupplyQuantity += Math.Abs(diff); |
| | | } |
| | | else // çäº |
| | | { |
| | | entity.SupplyQuantity -= (float)Math.Abs(diff); |
| | | entity.SupplyQuantity -= Math.Abs(diff); |
| | | if (entity.SupplyQuantity < 0) entity.SupplyQuantity = 0; |
| | | } |
| | | entity.PalletCode = stock.palletCode; |