From 6efa5f6ca7536a37e3af3592bb42db63bcb8371d Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周三, 24 9月 2025 15:33:27 +0800
Subject: [PATCH] 代码备份

---
 iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs |   95 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 88 insertions(+), 7 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 6a6c9fb..f56d5f8 100644
--- a/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
+++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
@@ -239,6 +239,15 @@
                .Select(s => new WorkPieceProcessOutput
                {
                    Id = s.a.Id,
+
+                   JiaJuGongWei = s.a.JiaJuGongWei,
+
+                   DataCapturePointCname = s.a.DataCapturePointCname,
+                   UpdateDataCapturePointCname = s.a.UpdateDataCapturePointCname,
+                   QualityNoOkReason = s.a.QualityNoOkReason,
+                   CreateUserName = s.a.CreatedUserName,
+                   UpdatedUserName = s.a.UpdatedUserName,
+
                    WorkPieceID = s.a.WorkPieceID,
                    WorkingProcedureCurrent = s.a.WorkingProcedureCurrent,
                    EquipmentID = s.a.EquipmentID,
@@ -486,13 +495,13 @@
         public async Task<string> outBoundWorkPiece([FromBody] OutBoundInput input)
         {
 
-            if (input.Password == null || !input.Password.Equals("123456"))
-            {
-                throw Oops.Oh("淇敼宸ヤ欢璐ㄩ噺鐘舵�佸け璐ワ細瀵嗙爜杈撳叆閿欒锛�");
-            }
+            //if (input.Password == null || !input.Password.Equals("123456"))
+            //{
+            //    throw Oops.Oh("淇敼宸ヤ欢璐ㄩ噺鐘舵�佸け璐ワ細瀵嗙爜杈撳叆閿欒锛�");
+            //}
             if (input.WorkPieceInfoLst.Count < 1)
             {
-                throw Oops.Oh("宸ヤ欢鍑哄簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒");
+                throw Oops.Oh("宸ヤ欢鍏ュ簱澶辫触锛氭暟鎹笉鑳戒负绌猴紒");
             }
 
             List<OutBoundDetailsInput> WorkPieceInfoLst = input.WorkPieceInfoLst;
@@ -504,22 +513,31 @@
 
             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;
                     //itemModel.Remark = itemModel.Remark ?? "" + "浜屾鍙戣揣鑷姩鎾ら攢鍙戣揣";
                     //await _workPieceOutboundRep.UpdateAsync(itemModel);
+
+                    /*
                     var createitme = itemModel.CreatedTime == null ? "" : (((DateTimeOffset)itemModel.CreatedTime).UtcDateTime.ToString("yyyy-MM-dd HH:mm:ss"));
                     throw Oops.Oh($"鎴愬搧鐮亄itemModel.OP80NewCode}宸插嚭搴擄紝鍑哄簱鏃堕棿:{createitme}");
+
+                    //*/
+
+                    //涓嶅啀鎻愮ず鍑烘潵锛岃嚜鍔ㄥ拷鐣� 銆怑ditby shaocx,2024-09-04銆�
+                    continue;
                 }
                 var workPiece = db_WorkPieceInfoList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode);
                 if (workPiece != null)
                 {
                     workPiece.OutPerson = CurrentUserInfo.Name;
-                    workPiece.OutRemark = "鎾ら攢宸ヤ欢鍑哄簱";
+                    workPiece.OutRemark = "鎾ら攢宸ヤ欢鍏ュ簱";
                     workPiece.OutTime = DateTime.Now;
                     workPiece.IsOut = false;
 
@@ -537,9 +555,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 "鍑哄簱鎴愬姛";
         }
 
@@ -873,6 +910,50 @@
         }
 
 
+
+        /// <summary>
+        /// 鍑哄簱缁熻
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpPost("getOutBoundWorkPieceInfoCountList")]
+        [DisableOpLog]
+        public async Task<List<OutBoundWorkPieceInfoCountOutput>> GetOutBoundWorkPieceInfoCountList([FromBody] OutBoundWorkPieceInfoCountInput input)
+        {
+            /*
+         //娴嬭瘯
+         List<OutBoundWorkPieceInfoCountOutput> outBoundWorkPieceInfoCountOutputs = new List<OutBoundWorkPieceInfoCountOutput>();
+         outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput()
+         {
+             Count = 10,
+             WorkPieceOutboundUserName = "AAA"
+         });
+         outBoundWorkPieceInfoCountOutputs.Add(new OutBoundWorkPieceInfoCountOutput()
+         {
+             Count = 99,
+             WorkPieceOutboundUserName = "BBb"
+         });
+         return outBoundWorkPieceInfoCountOutputs;
+         //*/
+
+
+            //DateTimeOffset now = DateTimeOffset.Now; // 鑾峰彇褰撳墠鏃堕棿锛屽寘鎷椂鍖哄亸绉婚噺
+            DateTimeOffset now = input.Date; // 鑾峰彇褰撳墠鏃堕棿锛屽寘鎷椂鍖哄亸绉婚噺
+            DateTimeOffset startOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 0, 0, 0, now.Offset); // 褰撳ぉ寮�濮嬫椂闂�
+            DateTimeOffset endOfDay = new DateTimeOffset(now.Year, now.Month, now.Day, 23, 59, 59, now.Offset); // 褰撳ぉ缁撴潫鏃堕棿
+            List<WorkPieceOutbound> db_itemModelList = await _workPieceOutboundRep.Where(w => w.CreatedTime >= startOfDay
+            && w.CreatedTime <= endOfDay && w.IsDeleted == false).ToListAsync();
+            //姹囨�诲垎缁�
+            var groupList = db_itemModelList.GroupBy(g => g.WorkPieceOutboundUserName).Select(s => new OutBoundWorkPieceInfoCountOutput()
+            {
+                WorkPieceOutboundUserName = s.Key,
+                Count = s.ToList().Count
+            }).ToList();
+            return groupList;
+            //*/
+        }
+
+
         #endregion
 
     }

--
Gitblit v1.9.3