Pārlūkot izejas kodu

审核部分完善

yuanrf 2 dienas atpakaļ
vecāks
revīzija
d8ec60b57b
1 mainītis faili ar 12 papildinājumiem un 6 dzēšanām
  1. 12 6
      OASystem/OASystem.Api/Controllers/TaskController.cs

+ 12 - 6
OASystem/OASystem.Api/Controllers/TaskController.cs

@@ -739,6 +739,9 @@ namespace OASystem.API.Controllers
 
                 _sqlsugar.BeginTran();
 
+                var existsApproved = _sqlsugar.Queryable<Task_WorkTaskReceipt>()
+               .First(x => x.WorkOrderId == receipt.WorkOrderId && x.WorkTaskId == receipt.WorkTaskId && x.IsDel == 0 && x.IsApproved == 1);
+
                 var affected = _sqlsugar.Updateable<Task_WorkTaskReceipt>()
                     .SetColumns(x => new Task_WorkTaskReceipt
                     {
@@ -748,13 +751,16 @@ namespace OASystem.API.Controllers
                     .Where(x => x.Id == dto.ReceiptId)
                     .ExecuteCommand();
 
-                _sqlsugar.Updateable<Task_WorkOrder>()
-                .SetColumns(x => new Task_WorkOrder
+                if (existsApproved == null)
                 {
-                    ProgressId = x.ProgressId + 1
-                })
-                .Where(x => x.Id == receipt.WorkOrderId)
-                .ExecuteCommand();
+                    _sqlsugar.Updateable<Task_WorkOrder>()
+                                    .SetColumns(x => new Task_WorkOrder
+                                    {
+                                        ProgressId = x.ProgressId + 1
+                                    })
+                                    .Where(x => x.Id == receipt.WorkOrderId)
+                                    .ExecuteCommand();
+                }
 
                 _sqlsugar.CommitTran();