作者 yangfu

互动消息 机会补充

@@ -29,6 +29,9 @@ func (this DepartmentsResponse) GetRootDepartment() []*Department { @@ -29,6 +29,9 @@ func (this DepartmentsResponse) GetRootDepartment() []*Department {
29 if len(this.Departments) == 0 { 29 if len(this.Departments) == 0 {
30 return []*Department{} 30 return []*Department{}
31 } 31 }
  32 + if this.Departments[0].PId != 0 {
  33 + return []*Department{}
  34 + }
32 return this.Departments[0].Departments 35 return this.Departments[0].Departments
33 } 36 }
34 37
@@ -721,10 +721,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, @@ -721,10 +721,9 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance,
721 defer func() { 721 defer func() {
722 if p := recover(); p != nil { 722 if p := recover(); p != nil {
723 log.Error(p) 723 log.Error(p)
724 - } else {  
725 - log.Debug("")  
726 } 724 }
727 }() 725 }()
  726 + //TODO:测试
728 if header.UserId == chance.UserId { 727 if header.UserId == chance.UserId {
729 return 728 return
730 } 729 }
@@ -51,6 +51,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent @@ -51,6 +51,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent
51 interactionCount += item.MsgTotal 51 interactionCount += item.MsgTotal
52 continue 52 continue
53 } 53 }
  54 + if item.MsgType == protocol.MsgTypeChanceRevise {
  55 + interactionCount += item.MsgTotal
  56 + continue
  57 + }
54 if item.MsgType == protocol.MsgTypeBulletin { 58 if item.MsgType == protocol.MsgTypeBulletin {
55 var tmpTotal int 59 var tmpTotal int
56 models.GetBulletinUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &tmpTotal) 60 models.GetBulletinUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &tmpTotal)
@@ -591,6 +595,7 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance @@ -591,6 +595,7 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance
591 var ( 595 var (
592 myChances []protocol.ChanceReviseItemOrm 596 myChances []protocol.ChanceReviseItemOrm
593 total int 597 total int
  598 + provider *protocol.BaseUserInfo
594 ) 599 )
595 600
596 if total, err = models.GetChanceReviseMsg(header.UserId, request.LastId, request.PageSize, protocol.MsgTypeChanceRevise, &myChances); err != nil { 601 if total, err = models.GetChanceReviseMsg(header.UserId, request.LastId, request.PageSize, protocol.MsgTypeChanceRevise, &myChances); err != nil {
@@ -608,7 +613,11 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance @@ -608,7 +613,11 @@ func MsgChanceRevise(header *protocol.RequestHeader, request *protocol.MsgChance
608 commItem := protocol.MsgCommonListItem{} 613 commItem := protocol.MsgCommonListItem{}
609 commItem.Chance, commItem.ChanceStatus = agg.SetChanceItem(header, chance.CommChanceItemOrm) 614 commItem.Chance, commItem.ChanceStatus = agg.SetChanceItem(header, chance.CommChanceItemOrm)
610 agg.SetMsgItem(header, chance.MsgItemOrm, &commItem) 615 agg.SetMsgItem(header, chance.MsgItemOrm, &commItem)
611 - 616 + if provider, err = agg.GetUserBaseInfo(chance.SenderUserId, header.CompanyId); err != nil {
  617 + log.Error(err)
  618 + return
  619 + }
  620 + commItem.Chance.Provider = provider
612 commItem.ChanceId = chance.ChanceId 621 commItem.ChanceId = chance.ChanceId
613 commItem.ReviewStatus = chance.ReviewStatus 622 commItem.ReviewStatus = chance.ReviewStatus
614 rsp.List = append(rsp.List, commItem) 623 rsp.List = append(rsp.List, commItem)