|
@@ -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();
|
|
|
|