contract_undertaker_feedback.go
2.3 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
package domain
import "time"
// ContractUndertakerFeedback 承接人反馈信息
type ContractUndertakerFeedback struct {
// 合约承接方反馈记录ID
FeedbackId int64 `json:"feedbackId,string"`
// 合约承接方反馈内容附件
FeedbackAttachment []*Attachment `json:"feedbackAttachment"`
// 合约承接方反馈内容
FeedbackContent string `json:"feedbackContent"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创合约承接人
ContractUndertaker *User `json:"contractUndertaker"`
// 共创模式
CooperationMode *CooperationMode `json:"cooperationMode"`
// 数据所属组织机构
Org *Org `json:"org"`
// 公司
Company *Company `json:"company"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt"`
// 删除时间
DeletedAt time.Time `json:"deletedAt"`
// 反馈创建时间,同时也作为反馈时间
CreatedAt time.Time `json:"createdAt"`
}
type ContractUndertakerFeedbackRepository interface {
Save(contractUndertakerFeedback *ContractUndertakerFeedback) (*ContractUndertakerFeedback, error)
Remove(contractUndertakerFeedback *ContractUndertakerFeedback) (*ContractUndertakerFeedback, error)
FindOne(queryOptions map[string]interface{}) (*ContractUndertakerFeedback, error)
Find(queryOptions map[string]interface{}) (int64, []*ContractUndertakerFeedback, error)
}
func (contractUndertakerFeedback *ContractUndertakerFeedback) Identify() interface{} {
if contractUndertakerFeedback.FeedbackId == 0 {
return nil
}
return contractUndertakerFeedback.FeedbackId
}
func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[string]interface{}) error {
if feedbackAttachment, ok := data["feedbackAttachment"]; ok {
contractUndertakerFeedback.FeedbackAttachment = feedbackAttachment.([]*Attachment)
}
if feedbackContent, ok := data["feedbackContent"]; ok {
contractUndertakerFeedback.FeedbackContent = feedbackContent.(string)
}
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string)
}
if status, ok := data["status"]; ok {
contractUndertakerFeedback.CooperationMode.Status = status.(int32)
}
if remarks, ok := data["remarks"]; ok {
contractUndertakerFeedback.CooperationMode.Remarks = remarks.(string)
}
return nil
}