From 291f66df5621f0644ce9d15548eb6590045691f0 Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期一, 14 四月 2025 09:26:43 +0800 Subject: [PATCH] 添加PDA下发输送线回流任务 --- 代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs" index edd5122..342bfba 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs" @@ -17,6 +17,7 @@ #endregion << 鐗� 鏈� 娉� 閲� >> +using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; @@ -29,8 +30,10 @@ { public class TaskCZService : ServiceBase<DtCZTask, ITaskCZRepository>, ITaskCZService { - public TaskCZService(ITaskCZRepository BaseDal) : base(BaseDal) + private readonly ITaskRepository _taskRepository; + public TaskCZService(ITaskCZRepository BaseDal, ITaskRepository taskRepository) : base(BaseDal) { + _taskRepository = taskRepository; } public Task<WebResponseContent> AddTaskCZAsync(CZTaskDto dto) @@ -122,5 +125,38 @@ } return Task.FromResult(response); } + /// <summary> + /// 杈撻�佺嚎鍥炴祦 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public Task<WebResponseContent> EmptyTask(SaveModel saveModel) + { + WebResponseContent webResponseContent = new WebResponseContent(); + try + { + string Saddress = saveModel.MainData["sourceAddress"].ToString(); + string Taddress = saveModel.MainData["targetAddress"].ToString(); + + Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == Saddress && x.TaskState == (int)TaskInStatusEnum.InPending && x.TargetAddress == "WaitBind"); + if (task == null) + { + webResponseContent.Error("浠诲姟涓嶅瓨鍦紒"); + return Task.FromResult(webResponseContent); + } + task.TargetAddress = Taddress; + task.TaskState = (int)TaskInStatusEnum.InNew; + var isTrue = _taskRepository.UpdateData(task); + if (isTrue) + { + webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�"); + } + } + catch (Exception ex) + { + webResponseContent.Error(ex.Message); + } + return Task.FromResult(webResponseContent); + } } } \ No newline at end of file -- Gitblit v1.9.3