作者 Your Name
... ... @@ -6,7 +6,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 企业端分红服务 【80%】
// 企业端分红服务
type CompanyDividendsService struct {
}
... ...
... ... @@ -6,7 +6,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 企业端分红服务 【50%】
// 企业端分红服务
type PersonDividendsService struct {
}
... ...
... ... @@ -9,7 +9,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CooperationProjectService 共创项目服务 【100%】
// CooperationProjectService 共创项目服务
type CooperationProjectService struct {
}
... ...
... ... @@ -8,7 +8,7 @@ import (
"time"
)
// CompanyCreditAccountService 企业端账期结算 【50%】
// CompanyCreditAccountService 企业端账期结算
type CompanyCreditAccountService struct {
}
... ... @@ -138,23 +138,23 @@ func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.Cre
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv CompanyCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"xAxis": map[string]interface{}{
"data": []string{"7-5", "7-15", "7-25"},
},
"yAxis": struct{}{},
"source": map[string]interface{}{
"value": []float64{60, 80, 90},
},
}, nil
//return map[string]interface{}{
// "xAxis": map[string]interface{}{
// "data": []string{"7-5", "7-15", "7-25"},
// },
// "yAxis": struct{}{},
// "source": map[string]interface{}{
// "value": []float64{60, 80, 90},
// },
//}, nil
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"orgId": cmd.Operator.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return paymentHistoryHistogramStatistics, nil
}
... ...
... ... @@ -4,9 +4,10 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"time"
)
// PersonCreditAccountService 企业端账期结算 【0%】
// PersonCreditAccountService 企业端账期结算
type PersonCreditAccountService struct {
}
... ... @@ -33,41 +34,56 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
// PaymentHistoryStatistics 支付历史统计
func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
queryOptions := map[string]interface{}{
"orgId": cmd.Operator.OrgId,
"userBaseId": cmd.Operator.UserBaseId,
"offset": cmd.PageNumber * cmd.PageSize,
"limit": cmd.PageSize,
"sortByActuallyPaidAmount": 2,
}
if cmd.BeginTime > 0 {
queryOptions["beginTime"] = time.Unix(cmd.BeginTime/1000, 0)
}
if cmd.EndTime > 0 {
queryOptions["endTime"] = time.Unix(cmd.EndTime/1000, 0)
}
cooperationUsersStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PersonCompanyPaymentHistoryStatistics, queryOptions)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
creditAccountStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.CreditAccountStatistics, queryOptions)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"rankItems": []struct{}{},
"totalPaymentAmount": 6000,
"rankItems": cooperationUsersStatistics,
"totalPaymentAmount": creditAccountStatistics.Paid,
}, nil
}
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"xAxis": map[string]interface{}{
"data": []string{"7-5", "7-15", "7-25"},
},
"yAxis": struct{}{},
"source": map[string]interface{}{
"value": []float64{60, 80, 90},
},
}, nil
//return map[string]interface{}{
// "xAxis": map[string]interface{}{
// "data": []string{"7-5", "7-15", "7-25"},
// },
// "yAxis": struct{}{},
// "source": map[string]interface{}{
// "value": []float64{60, 80, 90},
// },
//}, nil
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"userBaseId": cmd.Operator.UserBaseId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return paymentHistoryHistogramStatistics, nil
}
... ...
... ... @@ -33,9 +33,13 @@ const (
CooperationCompanyStatistics = "CooperationCompanyStatistics"
// 个人 - 用户合约统计
PersonCooperationContractStatistics = "PersonCooperationContractStatistics"
// 个人 - 企业支付统计
PersonCompanyPaymentHistoryStatistics = "PersonCompanyPaymentHistoryStatistics"
// 账期结算单统计
CreditAccountStatistics = "CreditAccountStatistics"
// 公司/个人 - 支付历史统计直方图
PaymentHistoryHistogramStatistics = "PaymentHistoryHistogramStatistics"
)
// CooperationStatistics 共创统计
... ...