...
|
...
|
@@ -55,6 +55,8 @@ type ContractParticipant struct { |
|
|
SensitiveFlag bool `json:"sensitiveFlag"`
|
|
|
// 共创合约编号
|
|
|
primaryKey string `json:"key"`
|
|
|
// 支付凭证去重
|
|
|
duplicatePaymentDocuments map[string]struct{}
|
|
|
}
|
|
|
|
|
|
func (u *User) SimpleCopy() map[string]interface{} {
|
...
|
...
|
@@ -82,12 +84,21 @@ func NewContractParticipant(u *User, primaryKey string, attachments []*Attachmen |
|
|
Participant: u.SimpleCopy(),
|
|
|
primaryKey: primaryKey,
|
|
|
PaymentDocuments: make([]*Attachment, 0),
|
|
|
duplicatePaymentDocuments: make(map[string]struct{}),
|
|
|
}
|
|
|
if len(attachments) > 0 {
|
|
|
p.ContractContent = attachments[0].Name
|
|
|
}
|
|
|
return p
|
|
|
}
|
|
|
func (cp *ContractParticipant) AppendAttachments(attachments []*Attachment) {
|
|
|
for i := range attachments {
|
|
|
if _, ok := cp.duplicatePaymentDocuments[attachments[i].Url]; !ok {
|
|
|
cp.duplicatePaymentDocuments[attachments[i].Url] = struct{}{}
|
|
|
cp.PaymentDocuments = append(cp.PaymentDocuments, attachments[i])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (cp *ContractParticipant) Complete(userBaseId int64, sensitive bool) *ContractParticipant {
|
|
|
cp.SensitiveFlag = false
|
...
|
...
|
|