From 367979de838ec3655d37dc618d98924c6b43b324 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期三, 24 十二月 2025 09:46:05 +0800
Subject: [PATCH] 111
---
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