cooperation_contract_change_log.go
2.6 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package domain
import "time"
const (
EDIT = iota + 1 // 编辑
PAUSE // 暂停
RECOVER // 恢复
)
// CooperationContractChangeLog 共创合约变更日志
type CooperationContractChangeLog struct {
// 共创合约变更日志
CooperationContractChangeLogId int64 `json:"cooperationContractChangeLogId,string"`
// 激励规则
IncentivesRule string `json:"incentivesRule"`
// 激励规则明细
IncentivesRuleDetail string `json:"incentivesRuleDetail"`
// 合约变更操作类型,1编辑、2暂停、3恢复
OperationType int32 `json:"operationType"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 承接人
Undertakers string `json:"undertakers"`
// 公司
Company *Company `json:"company"`
// 组织机构
Org *Org `json:"org"`
// 操作人
Operator *User `json:"operator"`
// 操作时间
OperatorTime time.Time `json:"operatorTime"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt"`
// 删除时间
DeletedAt time.Time `json:"deletedAt"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
}
type CooperationContractChangeLogRepository interface {
Save(cooperationContractChangeLog *CooperationContractChangeLog) (*CooperationContractChangeLog, error)
Remove(cooperationContractChangeLog *CooperationContractChangeLog) (*CooperationContractChangeLog, error)
FindOne(queryOptions map[string]interface{}) (*CooperationContractChangeLog, error)
Find(queryOptions map[string]interface{}) (int64, []*CooperationContractChangeLog, error)
}
func (cooperationContractChangeLog *CooperationContractChangeLog) Identify() interface{} {
if cooperationContractChangeLog.CooperationContractChangeLogId == 0 {
return nil
}
return cooperationContractChangeLog.CooperationContractChangeLogId
}
func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data map[string]interface{}) error {
if incentivesRule, ok := data["incentivesRule"]; ok {
cooperationContractChangeLog.IncentivesRule = incentivesRule.(string)
}
if incentivesRuleDetail, ok := data["incentivesRuleDetail"]; ok {
cooperationContractChangeLog.IncentivesRuleDetail = incentivesRuleDetail.(string)
}
if operationType, ok := data["operationType"]; ok {
cooperationContractChangeLog.OperationType = operationType.(int32)
}
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
cooperationContractChangeLog.CooperationContractNumber = cooperationContractNumber.(string)
}
if undertakers, ok := data["undertakers"]; ok {
cooperationContractChangeLog.Undertakers = undertakers.(string)
}
return nil
}