From 5e4d9f05035d1153ab191dd1cb0a4922b91983b2 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 11 十月 2023 14:36:37 +0800
Subject: [PATCH] debug

---
 model/production_progress.go |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/model/production_progress.go b/model/production_progress.go
index 898b186..3fdb02c 100644
--- a/model/production_progress.go
+++ b/model/production_progress.go
@@ -3,19 +3,18 @@
 import (
 	"apsClient/pkg/sqlitex"
 	"fmt"
-	"gorm.io/gorm"
+	"github.com/jinzhu/gorm"
 )
 
 type (
 	ProductionProgress struct {
-		gorm.Model       `json:"-"`
-		ID               int    `gorm:"primarykey"`
+		gorm.Model
 		WorkOrderID      string `gorm:"index;type:varchar(191);not null;comment:宸ュ崟ID" json:"workOrderID"`
 		OrderID          string `gorm:"index;type:varchar(191);not null;comment:璁㈠崟ID" json:"orderID"`
 		ProcedureID      string `gorm:"type:varchar(191);comment:宸ュ簭ID" json:"procedureId"`
 		DeviceID         string `gorm:"type:varchar(191);not null;comment:璁惧ID" json:"deviceId"`
 		FinishedQuantity int64  `gorm:"type:int;not null;comment:瀹屾垚鏁伴噺" json:"finishedQuantity"`
-		Position         int    `gorm:"type:int;comment:宸ヤ綔浣嶇疆" json:"position"` //姣忎釜璁惧鍙兘鏈夊涓満浣嶅悓鏃剁敓浜э紝鐢╬osition琛ㄧず浣嶇疆
+		Channel          int32  `gorm:"type:int;comment:宸ヤ綔閫氶亾" json:"channel"` //閫氶亾
 		TotalQuantity    int64  `gorm:"type:int;not null;comment:鎬婚噺" json:"totalQuantity"`
 	}
 
@@ -69,13 +68,13 @@
 	return slf
 }
 
-func (slf *ProductionProgressSearch) SetId(id int) *ProductionProgressSearch {
+func (slf *ProductionProgressSearch) SetId(id uint) *ProductionProgressSearch {
 	slf.ID = id
 	return slf
 }
 
-func (slf *ProductionProgressSearch) SetPosition(position int) *ProductionProgressSearch {
-	slf.Position = position
+func (slf *ProductionProgressSearch) SetChannel(channel int32) *ProductionProgressSearch {
+	slf.Channel = channel
 	return slf
 }
 
@@ -106,8 +105,8 @@
 		db = db.Where("device_id = ?", slf.DeviceID)
 	}
 
-	if slf.Position != 0 {
-		db = db.Where("position = ?", slf.Position)
+	if slf.Channel != 0 {
+		db = db.Where("channel = ?", slf.Channel)
 	}
 
 	return db

--
Gitblit v1.8.0