From b6c983ac19c0c80744795e122575f4b9ac145414 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 19 四月 2026 18:53:40 +0800
Subject: [PATCH] feat: 更新机器人任务处理逻辑和接口配置
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
index 894b992..494541e 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
@@ -28,6 +28,7 @@
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.Utilities;
using WIDESEAWCS_DTO.Stock;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoRepository;
@@ -234,6 +235,49 @@
return stock;
}
+ public override WebResponseContent AddData(SaveModel saveModel)
+ {
+ try
+ {
+ if (saveModel == null || saveModel.MainData == null || saveModel.MainData.Count == 0)
+ {
+ return WebResponseContent.Instance.Error("浼犲弬閿欒,鍙傛暟涓嶈兘涓虹┖");
+ }
+
+ string validResult = typeof(Dt_RobotTask).ValidateDicInEntity(saveModel.MainData, true, TProperties);
+ if (!string.IsNullOrEmpty(validResult))
+ {
+ return WebResponseContent.Instance.Error(validResult);
+ }
+
+ object? taskNumObj = saveModel.MainData[nameof(Dt_RobotTask.RobotTaskNum)];
+ if (taskNumObj != null)
+ {
+ int taskNum = Convert.ToInt32(taskNumObj);
+ if (BaseDal.QueryFirst(x => x.RobotTaskNum == taskNum) != null)
+ {
+ return WebResponseContent.Instance.Error($"浠诲姟缂栧彿 {taskNum} 宸插瓨鍦�");
+ }
+ }
+
+ Dt_RobotTask entity = saveModel.MainData.DicToModel<Dt_RobotTask>();
+ entity.Creater = "鎵嬪姩鍒涘缓";
+ entity.CreateDate = DateTime.Now;
+
+ if (saveModel.DetailData == null || saveModel.DetailData.Count == 0)
+ {
+ BaseDal.AddData(entity);
+ return WebResponseContent.Instance.OK("鏂板鎴愬姛", entity);
+ }
+
+ return base.AddData(saveModel);
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error($"鏂板澶辫触,閿欒淇℃伅:{ex.Message}");
+ }
+ }
+
/// <summary>
/// 鏍规嵁鐩爣鍦板潃鎸夈�岀簿纭� > 鍥為��鍊笺�嶈В鏋愯鍒欏�笺��
/// </summary>
--
Gitblit v1.9.3