From 3dc164dc1ff1d08d29ec7ea5beabaf93a300a70b Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 09 一月 2025 09:55:07 +0800 Subject: [PATCH] 辅料仓功能添加(空箱入库,空箱出库,AGV任务完成,组盘入库,拣选入库,入平库),WMS前端界面优化 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 46 insertions(+), 8 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs" index 58b1f41..fd0185e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/Service/StockQuantityChangeRecordService.cs" @@ -16,14 +16,14 @@ { public partial class StockQuantityChangeRecordService : ServiceBase<Dt_StockQuantityChangeRecord, IStockQuantityChangeRecordRepository>, IStockQuantityChangeRecordService { - public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeTypeEnum changeType,int taskNum) + public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, float beforeQuantity, float totalQuantity, StockChangeTypeEnum changeType, int? taskNum = null) { - try - { + try + { List<Dt_StockQuantityChangeRecord> stockQuantityChangeRecords = new List<Dt_StockQuantityChangeRecord>(); stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfoDetails); int index = 0; - decimal currentQuantity = 0; + float currentQuantity = 0; stockQuantityChangeRecords.ForEach(x => { x.PalleCode = stockInfo.PalletCode; @@ -44,13 +44,51 @@ x.ChangeType = changeType.ObjToInt(); beforeQuantity += x.ChangeQuantity; x.TaskNum = taskNum; + index++; }); BaseDal.AddData(stockQuantityChangeRecords); } - catch (Exception ex) - { - throw new Exception(ex.Message); - } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + + public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null) + { + try + { + List<Dt_StockQuantityChangeRecord> stockQuantityChangeRecords = new List<Dt_StockQuantityChangeRecord>(); + + int index1 = 0; + List<Dt_StockQuantityChangeRecord> records1 = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(updateDetails); + records1.ForEach(x => + { + x.PalleCode = stockInfo.PalletCode; + x.BeforeQuantity = deleteDetails[index1].StockQuantity + deleteDetails[index1].OutboundQuantity; + x.ChangeQuantity = -deleteDetails[index1].OutboundQuantity; + x.AfterQuantity = deleteDetails[index1].StockQuantity; + index1++; + }); + stockQuantityChangeRecords.AddRange(records1); + int index2 = 0; + List<Dt_StockQuantityChangeRecord> records2 = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(deleteDetails); + records2.ForEach(x => + { + x.PalleCode = stockInfo.PalletCode; + x.BeforeQuantity = deleteDetails[index2].StockQuantity; + x.ChangeQuantity = -deleteDetails[index2].StockQuantity; + x.AfterQuantity = 0; + index2++; + }); + stockQuantityChangeRecords.AddRange(records2); + + BaseDal.AddData(stockQuantityChangeRecords); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } } } } -- Gitblit v1.9.3