...
|
...
|
@@ -208,13 +208,16 @@ func (ptr *CooperationStatisticsService) CompanyCooperationUsersStatistics(query |
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
userService, _ := NewUserService()
|
|
|
|
|
|
var retMap = make([]interface{}, 0)
|
|
|
for i := range responses {
|
|
|
responses[i].CooperationTime = time.Now().Unix() * 1000
|
|
|
unPaidAmount := responses[i].DividesAmount - responses[i].ActuallyPaidAmount
|
|
|
retMap = append(retMap, map[string]interface{}{
|
|
|
|
|
|
item := map[string]interface{}{
|
|
|
"dividendsOrderAmount": responses[i].DividendsOrderAmount,
|
|
|
"dividesAmount": responses[i].DividesAmount,
|
|
|
"actuallyPaidAmount": responses[i].ActuallyPaidAmount,
|
|
|
"unPaidAmount": unPaidAmount,
|
|
|
"cooperationTime": time.Now().Unix() * 1000,
|
|
|
"participator": map[string]interface{}{
|
...
|
...
|
@@ -223,7 +226,11 @@ func (ptr *CooperationStatisticsService) CompanyCooperationUsersStatistics(query |
|
|
"userName": responses[i].UserName,
|
|
|
},
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
if user, e := userService.UserFrom(0, 0, responses[i].UserId); e == nil && user != nil {
|
|
|
item["cooperationTime"] = user.CreatedAt.Unix() * 1000
|
|
|
}
|
|
|
retMap = append(retMap, item)
|
|
|
}
|
|
|
|
|
|
return retMap, nil
|
...
|
...
|
@@ -245,8 +252,8 @@ type usersStatisticsResponse struct { |
|
|
func (ptr *CooperationStatisticsService) CooperationUserModeStatistics(queryOptions map[string]interface{}) (interface{}, error) {
|
|
|
// 参数验证
|
|
|
var request = struct {
|
|
|
UserId int64 `json:"offset" valid:"Required"`
|
|
|
//OrgId int64 `json:"orgId" valid:"Required"`
|
|
|
UserId int64 `json:"userId" valid:"Required"`
|
|
|
OrgId int64 `json:"orgId" valid:"Required"`
|
|
|
}{}
|
|
|
if err := LoadQueryObject(queryOptions, &request); err != nil {
|
|
|
return nil, err
|
...
|
...
|
@@ -270,7 +277,7 @@ func (ptr *CooperationStatisticsService) CooperationUserModeStatistics(queryOpti |
|
|
}
|
|
|
|
|
|
cooperationModeRepository, _ := repository.NewCooperationModeRepository(ptr.transactionContext)
|
|
|
_, cooperModes, err := cooperationModeRepository.Find(map[string]interface{}{"cooperationModeNumbers": modeNumbers})
|
|
|
_, cooperModes, err := cooperationModeRepository.Find(map[string]interface{}{"cooperationModeNumbers": modeNumbers, "orgId": request.OrgId})
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
@@ -284,7 +291,7 @@ func (ptr *CooperationStatisticsService) CooperationUserModeStatistics(queryOpti |
|
|
totalDividendAmount += modeStatistics.SettlementAmount
|
|
|
dividendsExpenseByTypes = append(dividendsExpenseByTypes, map[string]interface{}{
|
|
|
"dividendsTypeName": m.CooperationModeName + "分红支出",
|
|
|
"dividendsExpense": modeStatistics.SettlementAmount,
|
|
|
"dividendsExpense": modeStatistics.SettlementAmount, //实际已支付金额
|
|
|
})
|
|
|
orderAmountByTypes = append(orderAmountByTypes, map[string]interface{}{
|
|
|
"orderAmount": modeStatistics.OrderAmount,
|
...
|
...
|
|