1
wankeda
2025-03-13 286ff26fa658dabe9e758d830d134172e8abd03f
WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs
@@ -15,7 +15,9 @@
{
    public partial class StockQuantityChangeRecordService : ServiceBase<Dt_StockQuantityChangeRecord, IStockQuantityChangeRecordRepository>, IStockQuantityChangeRecordService
    {
        public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType)
        public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType, int? taskNum = null)
        {
            try
        {
            List<Dt_StockQuantityChangeRecord> stockQuantityChangeRecords = new List<Dt_StockQuantityChangeRecord>();
            stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfoDetails);
@@ -25,7 +27,7 @@
            {
                x.PalleCode = stockInfo.PalletCode;
                x.BeforeQuantity = beforeQuantity;
                if (totalQuantity > beforeQuantity)
                    if (totalQuantity >= beforeQuantity)
                {
                    x.ChangeQuantity = stockInfoDetails[index].StockQuantity;
                    currentQuantity += stockInfoDetails[index].StockQuantity;
@@ -38,10 +40,18 @@
                    x.AfterQuantity = beforeQuantity - stockInfoDetails[index].StockQuantity;
                }
                x.ChangeType = changeType.ObjToInt();
                beforeQuantity += x.ChangeQuantity;
                    x.TaskNum = taskNum;
                    index++;
            });
            BaseDal.AddData(stockQuantityChangeRecords);
        }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
}