|
@@ -55,6 +55,8 @@ type ContractParticipant struct { |
|
@@ -55,6 +55,8 @@ type ContractParticipant struct { |
55
|
SensitiveFlag bool `json:"sensitiveFlag"`
|
55
|
SensitiveFlag bool `json:"sensitiveFlag"`
|
56
|
// 共创合约编号
|
56
|
// 共创合约编号
|
57
|
primaryKey string `json:"key"`
|
57
|
primaryKey string `json:"key"`
|
|
|
58
|
+ // 支付凭证去重
|
|
|
59
|
+ duplicatePaymentDocuments map[string]struct{}
|
58
|
}
|
60
|
}
|
59
|
|
61
|
|
60
|
func (u *User) SimpleCopy() map[string]interface{} {
|
62
|
func (u *User) SimpleCopy() map[string]interface{} {
|
|
@@ -82,12 +84,21 @@ func NewContractParticipant(u *User, primaryKey string, attachments []*Attachmen |
|
@@ -82,12 +84,21 @@ func NewContractParticipant(u *User, primaryKey string, attachments []*Attachmen |
82
|
Participant: u.SimpleCopy(),
|
84
|
Participant: u.SimpleCopy(),
|
83
|
primaryKey: primaryKey,
|
85
|
primaryKey: primaryKey,
|
84
|
PaymentDocuments: make([]*Attachment, 0),
|
86
|
PaymentDocuments: make([]*Attachment, 0),
|
|
|
87
|
+ duplicatePaymentDocuments: make(map[string]struct{}),
|
85
|
}
|
88
|
}
|
86
|
if len(attachments) > 0 {
|
89
|
if len(attachments) > 0 {
|
87
|
p.ContractContent = attachments[0].Name
|
90
|
p.ContractContent = attachments[0].Name
|
88
|
}
|
91
|
}
|
89
|
return p
|
92
|
return p
|
90
|
}
|
93
|
}
|
|
|
94
|
+func (cp *ContractParticipant) AppendAttachments(attachments []*Attachment) {
|
|
|
95
|
+ for i := range attachments {
|
|
|
96
|
+ if _, ok := cp.duplicatePaymentDocuments[attachments[i].Url]; !ok {
|
|
|
97
|
+ cp.duplicatePaymentDocuments[attachments[i].Url] = struct{}{}
|
|
|
98
|
+ cp.PaymentDocuments = append(cp.PaymentDocuments, attachments[i])
|
|
|
99
|
+ }
|
|
|
100
|
+ }
|
|
|
101
|
+}
|
91
|
|
102
|
|
92
|
func (cp *ContractParticipant) Complete(userBaseId int64, sensitive bool) *ContractParticipant {
|
103
|
func (cp *ContractParticipant) Complete(userBaseId int64, sensitive bool) *ContractParticipant {
|
93
|
cp.SensitiveFlag = false
|
104
|
cp.SensitiveFlag = false
|