From b331c9990a0396301e934daffe095f99d62d1c89 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 27 九月 2023 15:58:49 +0800
Subject: [PATCH] 任务获取修改,状态2只返回已开始和已结束的

---
 model/production_progress.go |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/model/production_progress.go b/model/production_progress.go
index 8305442..4a159af 100644
--- a/model/production_progress.go
+++ b/model/production_progress.go
@@ -12,9 +12,10 @@
 		ID               int    `gorm:"primarykey"`
 		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:"uniqueIndex:idx_product_procedure;type:varchar(191);comment:宸ュ簭ID" json:"procedureId"`
+		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"`
+		Channel          int32  `gorm:"type:int;comment:宸ヤ綔閫氶亾" json:"channel"` //閫氶亾
 		TotalQuantity    int64  `gorm:"type:int;not null;comment:鎬婚噺" json:"totalQuantity"`
 	}
 
@@ -73,6 +74,11 @@
 	return slf
 }
 
+func (slf *ProductionProgressSearch) SetChannel(channel int32) *ProductionProgressSearch {
+	slf.Channel = channel
+	return slf
+}
+
 func (slf *ProductionProgressSearch) build() *gorm.DB {
 	var db = slf.Orm.Model(&ProductionProgress{})
 
@@ -100,6 +106,10 @@
 		db = db.Where("device_id = ?", slf.DeviceID)
 	}
 
+	if slf.Channel != 0 {
+		db = db.Where("channel = ?", slf.Channel)
+	}
+
 	return db
 }
 

--
Gitblit v1.8.0