diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
index 6d66acaf..918934a0 100644
--- a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
+++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj
@@ -22,6 +22,7 @@
+
diff --git a/Src/Dlhis.ScheduledTask/Dockerfile b/Src/Dlhis.ScheduledTask/Dockerfile
index 01d8ae26..8db1c218 100644
--- a/Src/Dlhis.ScheduledTask/Dockerfile
+++ b/Src/Dlhis.ScheduledTask/Dockerfile
@@ -8,6 +8,7 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj", "Src/Dlhis.ScheduledTask/"]
COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"]
+COPY ["Src/Dlhis.User.Api/Dlhis.User.Api.csproj", "Src/Dlhis.User.Api/"]
RUN dotnet restore "Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj"
COPY . .
WORKDIR "/src/Src/Dlhis.ScheduledTask"
diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs
index 903e95bd..80dae44b 100644
--- a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs
+++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs
@@ -44,13 +44,14 @@ public class AssignmentsController : ControllerBase
///
/// 更新任务状态
///
- ///
+ ///
///
[HttpPost("taskstatus")]
- public async Task UpdateDeviceTaskStatusAsync(UpdateDeviceTaskStatusRequest request)
+ public async Task UpdateDeviceTaskStatusAsync(List requests)
{
- await _assignmentService.UpdateDeviceTaskStatusAsync(request);
+ await _assignmentService.UpdateDeviceTaskStatusAsync(requests);
}
+
///
/// 获取新人脸照片
///
diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IAssignmentService.cs
index 503af278..0e241174 100644
--- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IAssignmentService.cs
+++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/IAssignmentService.cs
@@ -16,9 +16,9 @@ public interface IAssignmentService : IScopeDependency
///
/// 更新设备任务状态
///
- ///
+ ///
///
- Task UpdateDeviceTaskStatusAsync(UpdateDeviceTaskStatusRequest request);
+ Task UpdateDeviceTaskStatusAsync(List requests);
///
/// 获取新人脸照片
diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs
index 92654640..bb595476 100644
--- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs
+++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/AssignmentService.cs
@@ -188,10 +188,24 @@ public class AssignmentService : IAssignmentService
}
- public async Task UpdateDeviceTaskStatusAsync(UpdateDeviceTaskStatusRequest request)
+ public async Task UpdateDeviceTaskStatusAsync(List requests)
{
- for (int i = 0; i < 5; i++)
+ foreach (var request in requests)
{
+ //for (int i = 0; i < 5; i++)
+ //{
+
+
+ // if (effect == 0)
+ // {
+ // continue;
+ // }
+
+ // return;
+ //}
+
+ //throw new UserFriendlyException("操作失败,请重试");
+
var deviceTask = await _dbContext.Queryable().Where(x => x.Id == request.TaskId).SingleAsync();
deviceTask.ThrowIfNull("设备任务不存在");
(deviceTask.Status != DeviceTaskStatusEnumType.Process)
@@ -206,16 +220,7 @@ public class AssignmentService : IAssignmentService
.SetColumns(x => x.ModifiedTime == DateTime.Now)
.Where(x => x.Id == request.TaskId && x.Version == deviceTask.Version)
.ExecuteCommandAsync();
-
- if (effect == 0)
- {
- continue;
- }
-
- return;
}
-
- throw new UserFriendlyException("操作失败,请重试");
}