From 040cd381f2e8475e9b4eb336b704ad878f56f4fa Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 14 九月 2023 20:42:01 +0800
Subject: [PATCH] 适应性改动

---
 api/v1/task.go |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/api/v1/task.go b/api/v1/task.go
index ca697e9..9da9503 100644
--- a/api/v1/task.go
+++ b/api/v1/task.go
@@ -65,14 +65,10 @@
 		params.PageSize = 1
 	}
 
-	taskDataList, count, code := service.NewTaskService().GetTask(params.Page, params.PageSize)
+	taskResponse, code := service.NewTaskService().GetTask(params.Page, params.PageSize)
 	if code != ecode.OK {
 		ctx.Fail(code)
 		return
-	}
-	taskResponse := &response.TaskResponse{
-		Tasks:     taskDataList,
-		TaskCount: count,
 	}
 	ctx.OkWithDetailed(taskResponse)
 }
@@ -150,7 +146,7 @@
 		ctx.Fail(code)
 		return
 	}
-	err := service.NewTaskService().UpdateProcedureStatus(nil, id, model.ProcedureStatusFinished)
+	err := service.NewTaskService().UpdateProcedureStatus(nil, id, model.ProcedureStatusFinished, procedure.Position)
 	if err != nil {
 		logx.Errorf("UpdateProcedureStatus err: %v", err.Error())
 		ctx.Fail(ecode.UnknownErr)
@@ -215,6 +211,7 @@
 		if err != nil {
 			return err
 		}
+		procedure.Position = params.Position
 		err = taskService.UpdateOrderStatus(db, order.ID, model.OrderStatusProcessing)
 		if err != nil {
 			return err
@@ -243,7 +240,7 @@
 		return
 	}
 	plcConfig.CurrentTryTimes = 0
-	err = service.PlcWrite(plcConfig, constvar.PlcStartAddressTypeTotalNumber, order.Amount.IntPart())
+	err = service.PlcWrite(plcConfig, constvar.PlcStartAddressTypeTotalNumber, params.Position, order.Amount.IntPart())
 	if err != nil {
 		ctx.FailWithMsg(ecode.NeedConfirmedErr, "绯熺硶锛屽伐鑹轰笅鍙戝け璐ャ��")
 		return

--
Gitblit v1.8.0