From 2a19504209e763a7c0e957e4ee265dd419486ef1 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周五, 06 9月 2024 10:21:48 +0800 Subject: [PATCH] 入库优化 --- iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs | 27 ++++++++++++++++++++++++--- 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs index 619cbf8..699af9d 100644 --- a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs +++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs @@ -492,7 +492,7 @@ } if (input.WorkPieceInfoLst.Count < 1) { - throw Oops.Oh("宸ヤ欢鍑哄簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒"); + throw Oops.Oh("宸ヤ欢鍏ュ簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒"); } List<OutBoundDetailsInput> WorkPieceInfoLst = input.WorkPieceInfoLst; @@ -504,9 +504,11 @@ List<WorkPieceInfo> db_WorkPieceInfoList = await _workPieceInfoRep.Where(w => queryOP80NewCodeList.Contains(w.OP80NewCode) && w.IsDeleted == false).ToListAsync(); + var addOutBoundLogList = new List<WorkPieceOutboundRecord>(); + foreach (var item in WorkPieceInfoLst) { - var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode); + var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode && w.IsDeleted == false); if (itemModel != null) { //itemModel.IsDeleted = true; @@ -526,7 +528,7 @@ if (workPiece != null) { workPiece.OutPerson = CurrentUserInfo.Name; - workPiece.OutRemark = "鎾ら攢宸ヤ欢鍑哄簱"; + workPiece.OutRemark = "鎾ら攢宸ヤ欢鍏ュ簱"; workPiece.OutTime = DateTime.Now; workPiece.IsOut = false; @@ -544,9 +546,28 @@ }; addOutBoundList.Add(outBoundLog); + var outBoundLogRecord = new WorkPieceOutboundRecord + { + OperationType = OutboundOperationType.鍏ュ簱.ToString(), + WorkPieceID = workPiece?.WorkPieceID, + OP80NewCode = item.OP80NewCode, + + CreatedUserId = CurrentUserInfo.UserId, + CreatedUserName = CurrentUserInfo.Name, + + + //CarNo = input.CarNo, + Remark = "宸ヤ欢鍏ュ簱", + + }; + addOutBoundLogList.Add(outBoundLogRecord); + } await _workPieceOutboundRep.InsertAsync(addOutBoundList); + + await _workPieceOutboundRecordRep.InsertAsync(addOutBoundLogList); + return "鍑哄簱鎴愬姛"; } -- Gitblit v1.9.3