作者 yangfu

分红预算修改

... ... @@ -73,9 +73,9 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber + 1, //手机序号从0开始的
PageSize: applicationQuery.PageSize,
//CompanyId: int(applicationQuery.Operator.CompanyId),
PageNumber: applicationQuery.PageNumber + 1, //手机序号从0开始的
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
OrgId: applicationQuery.Operator.OrgId,
CooperationApplicationStatus: applicationQuery.Status,
})
... ...
... ... @@ -175,7 +175,25 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi
func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
var response = struct {
rankItems interface{} `json:"rankItems"`
TotalPaymentAmount interface{} `json:"totalPaymentAmount"`
}{}
cooperationContractNumbers, err := gateway.RelevantCooperationContractNumbers(allied_creation_cooperation.RelevantCooperationContractNumbers, map[string]interface{}{
"companyId": cmd.Operator.CompanyId,
"orgId": cmd.Operator.OrgId,
"userId": cmd.Operator.UserId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if len(cooperationContractNumbers) == 0 {
return response, nil
}
queryOptions := map[string]interface{}{
"userId": cmd.Operator.UserId,
"orgId": cmd.Operator.OrgId,
"offset": cmd.PageNumber * cmd.PageSize,
"limit": cmd.PageSize,
... ... @@ -192,15 +210,15 @@ func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.Cre
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
queryOptions["cooperationContractNumbers"] = cooperationContractNumbers
creditAccountStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.CreditAccountStatistics, queryOptions)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
response.rankItems = cooperationUsersStatistics
response.TotalPaymentAmount = creditAccountStatistics.Paid
return map[string]interface{}{
"rankItems": cooperationUsersStatistics,
"totalPaymentAmount": creditAccountStatistics.Paid,
}, nil
return response, nil
}
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
... ... @@ -208,7 +226,10 @@ func (srv CompanyCreditAccountService) PaymentHistoryHistogramStatistics(cmd *co
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"orgId": cmd.Operator.OrgId,
"orgId": cmd.Operator.OrgId,
"userId": cmd.Operator.UserId,
"beginTime": time.Unix(cmd.BeginTime/1000, 0),
"endTime": time.Unix(cmd.EndTime/1000, 0),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -112,6 +112,8 @@ func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *com
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"userBaseId": cmd.Operator.UserBaseId,
"beginTime": time.Unix(cmd.BeginTime/1000, 0),
"endTime": time.Unix(cmd.EndTime/1000, 0),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...