From 65b5b0ced6d04f773002908cb8c0720540f34907 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 10 四月 2025 09:20:17 +0800
Subject: [PATCH] 1

---
 代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs |   61 +++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 7 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 9a62871..edd5122 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"
@@ -1,4 +1,5 @@
 锘�#region << 鐗� 鏈� 娉� 閲� >>
+
 /*----------------------------------------------------------------
  * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoService
  * 鍒涘缓鑰咃細鑳$搴�
@@ -11,13 +12,11 @@
  * 淇敼鏃堕棿锛�
  * 鐗堟湰锛歏1.0.1
  * 淇敼璇存槑锛�
- * 
+ *
  *----------------------------------------------------------------*/
+
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
-using AutoMapper;
-using SqlSugar;
-using System.Diagnostics.CodeAnalysis;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseServices;
@@ -25,8 +24,6 @@
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
-using WIDESEAWCS_QuartzJob.Models;
-using WIDESEAWCS_QuartzJob.Service;
 
 namespace WIDESEAWCS_TaskInfoService
 {
@@ -75,5 +72,55 @@
             }
             return Task.FromResult(response);
         }
+
+        /// <summary>
+        /// 瀹屾垚浠诲姟
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public Task<WebResponseContent> FinishTask(CZTaskFinshDto dto)
+        {
+            WebResponseContent response = new WebResponseContent();
+            try
+            {
+                var czTask = BaseDal.QueryFirst(x => x.TaskTaskID == dto.TaskId);
+                if (czTask == null)
+                {
+                    response.Error("浠诲姟涓嶅瓨鍦紒");
+                    return Task.FromResult(response);
+                }
+                if (dto.Tags.Contains("姝f瀬"))
+                {
+                    czTask.TaskZJFinishNumber += 1;
+                }
+                else
+                {
+                    czTask.TaskFJFinishNumber += 1;
+                }
+                if (czTask.TaskZJFinishNumber == czTask.TaskNumber || czTask.TaskFJFinishNumber == czTask.TaskNumber)
+                {
+                    czTask.TaskStatus = TaskInStatusEnum.InFinish.ToString();
+                    czTask.TaskEndDate = DateTime.Now;
+                }
+                else
+                {
+                    czTask.TaskStatus = TaskInStatusEnum.Line_InExecuting.ToString();
+                }
+                var isTrue = BaseDal.UpdateData(czTask);
+                if (isTrue)
+                {
+                    response.OK("浠诲姟瀹屾垚鎴愬姛锛�");
+                }
+                else
+                {
+                    response.Error("浠诲姟瀹屾垚澶辫触锛�");
+                }
+            }
+            catch (Exception ex)
+            {
+                response.Error(ex.Message);
+            }
+            return Task.FromResult(response);
+        }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3