|
@@ -76,6 +76,7 @@ func (l *GetCreditUsageListLogic) GetCreditUsageList(req *types.CreditUsageListR
|
|
|
resp.Data.Total = data.PageDetails.Total
|
|
|
|
|
|
orgaMap := make(map[uint64]string)
|
|
|
+ operMap := make(map[string]string)
|
|
|
|
|
|
for _, v := range data.List {
|
|
|
organizationName := ""
|
|
@@ -85,6 +86,23 @@ func (l *GetCreditUsageListLogic) GetCreditUsageList(req *types.CreditUsageListR
|
|
|
departmentInfo, err := l.svcCtx.CoreRpc.GetDepartmentById(l.ctx, &core.IDReq{Id: v.OrganizationID})
|
|
|
if err == nil {
|
|
|
organizationName = *departmentInfo.Name
|
|
|
+ orgaMap[v.OrganizationID] = organizationName
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ operatorName := ""
|
|
|
+ if v.Operator != "" {
|
|
|
+ if uname, ok := operMap[v.Operator]; ok {
|
|
|
+ operatorName = uname
|
|
|
+ } else {
|
|
|
+ userInfo, err := l.svcCtx.CoreRpc.GetUserById(l.ctx, &core.UUIDReq{Id: v.Operator})
|
|
|
+ if err == nil {
|
|
|
+ operatorName = *userInfo.Nickname
|
|
|
+ if operatorName == "" {
|
|
|
+ operatorName = *userInfo.Username
|
|
|
+ }
|
|
|
+ operMap[v.Operator] = operatorName
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -108,6 +126,7 @@ func (l *GetCreditUsageListLogic) GetCreditUsageList(req *types.CreditUsageListR
|
|
|
Nid: &v.Nid,
|
|
|
Reason: &v.Reason,
|
|
|
Operator: &v.Operator,
|
|
|
+ OperatorName: &operatorName,
|
|
|
})
|
|
|
}
|
|
|
|