From a27f32ecbfc7390ceb9e3a8d8651c57ada88bfa0 Mon Sep 17 00:00:00 2001
From: zjh <2207896513@qq.com>
Date: 星期五, 19 十二月 2025 20:51:42 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/XB_MES_API

---
 StandardPda/MES.Service/service/Warehouse/XbRackingTaskSyxtLogManager.cs |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/StandardPda/MES.Service/service/Warehouse/XbRackingTaskSyxtLogManager.cs b/StandardPda/MES.Service/service/Warehouse/XbRackingTaskSyxtLogManager.cs
index eba52a4..10e5495 100644
--- a/StandardPda/MES.Service/service/Warehouse/XbRackingTaskSyxtLogManager.cs
+++ b/StandardPda/MES.Service/service/Warehouse/XbRackingTaskSyxtLogManager.cs
@@ -7,12 +7,46 @@
 public class XbRackingTaskSyxtLogManager : Repository<XbRackingTaskSyxtLog>
 {
     /// <summary>
+    /// 鏍搁獙浠诲姟鍗曞彿鏄惁瀛樺湪
+    /// </summary>
+    /// <param name="dto">浠诲姟瀹屾垚涓婃姤鍙傛暟</param>
+    /// <returns>浠诲姟鍗曞彿鏄惁瀛樺湪</returns>
+    public bool ValidateTaskExists(TaskCompleteReportDto dto)
+    {
+        if (dto == null || string.IsNullOrWhiteSpace(dto.TaskCode))
+        {
+            return false;
+        }
+
+        var task = Context.Queryable<XbRackingTaskSyxtLog>()
+            .Where(t => t.TaskCode == dto.TaskCode)
+            .Any();
+
+        return task;
+    }
+
+    /// <summary>
     /// 浠诲姟瀹屾垚涓婃姤
     /// </summary>
     /// <param name="dto">浠诲姟瀹屾垚涓婃姤鍙傛暟</param>
     /// <returns>缁熶竴鍝嶅簲缁撴灉</returns>
     public RackingTaskResponse TaskCompleteReport(TaskCompleteReportDto dto)
     {
+        if (dto == null)
+        {
+            return RackingTaskResponse.Fail("鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        if (string.IsNullOrWhiteSpace(dto.TaskCode))
+        {
+            return RackingTaskResponse.Fail("浠诲姟鍙蜂笉鑳戒负绌�");
+        }
+
+        if (string.IsNullOrWhiteSpace(dto.PalletCode))
+        {
+            return RackingTaskResponse.Fail("鎵樼洏缂栫爜涓嶈兘涓虹┖");
+        }
+
         try
         {
             // 姝ラ1锛氶獙璇佷换鍔″彿鏄惁瀛樺湪
@@ -93,6 +127,26 @@
     /// <returns>缁熶竴鍝嶅簲缁撴灉</returns>
     public RackingTaskResponse TaskErrorReport(TaskErrorReportDto dto)
     {
+        if (dto == null)
+        {
+            return RackingTaskResponse.Fail("鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        if (string.IsNullOrWhiteSpace(dto.TaskCode))
+        {
+            return RackingTaskResponse.Fail("浠诲姟鍙蜂笉鑳戒负绌�");
+        }
+
+        if (string.IsNullOrWhiteSpace(dto.PalletCode))
+        {
+            return RackingTaskResponse.Fail("鎵樼洏缂栫爜涓嶈兘涓虹┖");
+        }
+
+        if (string.IsNullOrWhiteSpace(dto.ErrorMessage))
+        {
+            return RackingTaskResponse.Fail("閿欒淇℃伅涓嶈兘涓虹┖");
+        }
+
         try
         {
             // 姝ラ1锛氶獙璇佷换鍔″彿鏄惁瀛樺湪
@@ -131,4 +185,4 @@
             return RackingTaskResponse.Fail($"鏇存柊浠诲姟鏃ュ織澶辫触锛歿ex.Message}");
         }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3