| | |
| | | { |
| | | public partial class StockQuantityChangeRecordService : ServiceBase<Dt_StockQuantityChangeRecord, IStockQuantityChangeRecordRepository>, IStockQuantityChangeRecordService |
| | | { |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, float beforeQuantity, float totalQuantity, StockChangeTypeEnum changeType, int? taskNum = null) |
| | | /// <summary> |
| | | /// å·æåå¨åºåè®°å½ |
| | | /// </summary> |
| | | /// <param name="stockInfo">åºå</param> |
| | | /// <param name="beforeQuantity">åå¨ååºå</param> |
| | | /// <param name="changeQuantity">åå¨åºå</param> |
| | | /// <param name="changeType">åå¨ç±»å</param> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="orderNo">åæ®ç¼å·</param> |
| | | /// <exception cref="Exception"></exception> |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, decimal beforeQuantity, decimal changeQuantity, StockChangeTypeEnum changeType, int? taskNum = 0,string orderNo="") |
| | | { |
| | | try |
| | | { |
| | | Dt_StockQuantityChangeRecord stockQuantityChangeRecord = new Dt_StockQuantityChangeRecord() |
| | | { |
| | | StockId = stockInfo.Id, |
| | | PalleCode = stockInfo.PalletCode, |
| | | MaterielCode=stockInfo.MaterielCode, |
| | | MaterielName=stockInfo.MaterielName, |
| | | BatchNo = "", |
| | | SerilNumber=$"{stockInfo.Id}", |
| | | OrderNo = orderNo, |
| | | TaskNum= taskNum, |
| | | ChangeType=changeType.ObjToInt(), |
| | | ChangeQuantity=changeQuantity, |
| | | BeforeQuantity=beforeQuantity, |
| | | AfterQuantity=beforeQuantity+changeQuantity, |
| | | Creater="System" |
| | | }; |
| | | BaseDal.AddData(stockQuantityChangeRecord); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, StockChangeTypeEnum changeType, int? taskNum = null) |
| | | /// <summary> |
| | | /// æåè¾
æåºåè®°å½ |
| | | /// </summary> |
| | | /// <param name="proStockInfo">åºå</param> |
| | | /// <param name="beforeQuantity">åå¨ååºå</param> |
| | | /// <param name="changeQuantity">åå¨åºå</param> |
| | | /// <param name="changeType">åå¨ç±»å</param> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="orderNo"></param> |
| | | /// <exception cref="Exception"></exception> |
| | | public void AddStockChangeRecord(Dt_ProStockInfo proStockInfo, decimal beforeQuantity, decimal changeQuantity, StockChangeTypeEnum changeType, int? taskNum = null, string orderNo = "") |
| | | { |
| | | try |
| | | { |
| | | |
| | | Dt_StockQuantityChangeRecord stockQuantityChangeRecord = new Dt_StockQuantityChangeRecord() |
| | | { |
| | | StockId = proStockInfo.Id, |
| | | PalleCode = proStockInfo.PalletCode, |
| | | MaterielCode = proStockInfo.proStockInfoDetails?.FirstOrDefault()?.ProductCode ?? "", |
| | | MaterielName = proStockInfo.proStockInfoDetails?.FirstOrDefault()?.ProductName ?? "", |
| | | BatchNo = "", |
| | | SerilNumber = $"{proStockInfo.Id}", |
| | | OrderNo = orderNo, |
| | | TaskNum = taskNum, |
| | | ChangeType = changeType.ObjToInt(), |
| | | ChangeQuantity = changeQuantity, |
| | | BeforeQuantity = beforeQuantity, |
| | | AfterQuantity = beforeQuantity + changeQuantity, |
| | | Creater = "System" |
| | | }; |
| | | BaseDal.AddData(stockQuantityChangeRecord); |
| | | } |
| | | catch (Exception ex) |
| | | { |