product_record.go
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package domain
import "time"
// 生产记录
type ProductRecord struct {
// 生产记录ID
ProductRecordId int `json:"productRecordId,omitempty"`
// 企业id
CompanyId int `json:"companyId,omitempty"`
// 组织ID
OrgId int `json:"orgId,omitempty"`
// 生产记录类型:1:领料 2:退料 4:称重 8:二级品称重
ProductRecordType int `json:"productRecordType,omitempty"`
// 生产工人
ProductWorker *User `json:"productWorker,omitempty"`
// 工作位置
WorkStation *WorkStation `json:"workStation,omitempty"`
// 创建时间
CreatedAt time.Time `json:"createdAt,omitempty"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// 删除时间
DeletedAt time.Time `json:"deletedAt,omitempty"`
// 生产记录信息
ProductRecordInfo *ProductRecordInfo `json:"productRecordInfo,omitempty"`
}
type ProductRecordRepository interface {
Save(productRecord *ProductRecord) (*ProductRecord, error)
Remove(productRecord *ProductRecord) (*ProductRecord, error)
FindOne(queryOptions map[string]interface{}) (*ProductRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*ProductRecord, error)
}
func (productRecord *ProductRecord) Identify() interface{} {
if productRecord.ProductRecordId == 0 {
return nil
}
return productRecord.ProductRecordId
}
func (productRecord *ProductRecord) Update(data map[string]interface{}) error {
return nil
}