product_line.go
716 字节
package domain
// 生产线
type ProductLine struct {
// 生产线ID
LineId int `json:"lineId,omitempty"`
// 生产线名称
LineName string `json:"lineName,omitempty"`
// 工段列表
ProductSections []*ProductSection `json:"productSections,omitempty"`
// 已删除标识 1:正常 2:已删除
Removed int `json:"removed,omitempty"`
}
func (productLine *ProductLine) GetProductSections(removed int) []*ProductSection {
var result = make([]*ProductSection, 0)
for i := range productLine.ProductSections {
if removed > 0 && productLine.ProductSections[i].Removed != removed {
continue
}
item := productLine.ProductSections[i]
item.Removed = 0
result = append(result, item)
}
return result
}