作者 yangfu

共创详情支付凭证列表

... ... @@ -49,6 +49,8 @@ type ContractParticipant struct {
ContractContent string `json:"contractContent"`
// 支付凭证
PaymentDocument string `json:"paymentDocument"`
// 支付凭证
PaymentDocuments []*Attachment `json:"paymentDocuments"`
// 敏感标识
SensitiveFlag bool `json:"sensitiveFlag"`
// 共创合约编号
... ... @@ -76,9 +78,10 @@ func (ut *Salesman) ToUser() *User {
func NewContractParticipant(u *User, primaryKey string, attachments []*Attachment) *ContractParticipant {
p := &ContractParticipant{
User: u,
Participant: u.SimpleCopy(),
primaryKey: primaryKey,
User: u,
Participant: u.SimpleCopy(),
primaryKey: primaryKey,
PaymentDocuments: make([]*Attachment, 0),
}
if len(attachments) > 0 {
p.ContractContent = attachments[0].Name
... ...
... ... @@ -271,15 +271,6 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
key := keyfun(u.CooperationContractNumber, u.Undertaker.UserBaseId)
userSorted = append(userSorted, key)
mapUser[keyfun(u.CooperationContractNumber, u.Undertaker.UserBaseId)] = domain.NewContractParticipant(u.Undertaker.ToUser(), key, u.Undertaker.ContractAttachment)
//if u.Undertaker.Referrer != nil {
// key = keyfun(u.CooperationContractNumber, u.Undertaker.Referrer.UserBaseId)
// userSorted = append(userSorted, key)
// mapUser[keyfun(u.CooperationContractNumber, u.Undertaker.Referrer.UserBaseId)] = domain.NewContractParticipant(u.Undertaker.Referrer.ToUser(), key, u.Undertaker.ContractAttachment)
//}
//if u.Undertaker.Salesman != nil {
// userSorted = append(userSorted, keyfun(u.CooperationContractNumber, u.Undertaker.Salesman.UserBaseId))
// mapUser[keyfun(u.CooperationContractNumber, u.Undertaker.Salesman.UserBaseId)] = domain.NewContractParticipant(u.Undertaker.Salesman.ToUser(), key, u.Undertaker.ContractAttachment)
//}
}
// 2.合约的订单金额
... ... @@ -325,10 +316,11 @@ func (ptr *CooperationStatisticsService) PersonCooperationProjectSharedInfo(quer
detail := creditAccounts[i].AccountDetail[j]
key := keyfun(detail.CooperationContractNumber, creditAccounts[i].Participator.UserBaseId)
mapCreditAccount[key] = creditAccounts[i]
if v, ok := mapUser[key]; ok && len(v.PaymentDocument) == 0 {
if len(mapCreditAccount[key].PaymentDocumentAttachments) > 0 {
if v, ok := mapUser[key]; ok {
if len(v.PaymentDocument) == 0 && len(mapCreditAccount[key].PaymentDocumentAttachments) > 0 {
v.PaymentDocument = "查看"
}
v.PaymentDocuments = append(v.PaymentDocuments, creditAccounts[i].PaymentDocumentAttachments...)
}
}
}
... ...