作者 Your Name
... ... @@ -138,18 +138,9 @@ func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.Cre
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv CompanyCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, 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
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
paymentHistoryHistogramStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"orgId": cmd.Operator.OrgId,
})
if err != nil {
... ...
... ... @@ -67,18 +67,9 @@ func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.Cred
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, 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
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
paymentHistoryHistogramStatistics, err := gateway.CreditAccountStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
paymentHistoryHistogramStatistics, err := gateway.CooperationStatistics(allied_creation_cooperation.PaymentHistoryHistogramStatistics, map[string]interface{}{
"userBaseId": cmd.Operator.UserBaseId,
})
if err != nil {
... ...
... ... @@ -43,26 +43,38 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics
}
// 模式列表
models, err := gateway.CooperationModeList(allied_creation_cooperation.ReqCooperationModeList{
PageSize: 20,
PageNumber: 1,
CompanyId: cmd.Operator.CompanyId,
OrgId: cmd.Operator.OrgId,
UserId: cmd.Operator.UserId,
UserBaseId: cmd.Operator.UserBaseId,
})
var modeStatistics []CooperationModeStatistics
var modeNumbers []string
err = json.UnmarshalFromString(json.MarshalToString(cooperationModeStatistics), &modeStatistics)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var cooperationModes []interface{}
for i := range models.List {
item := models.List[i]
cooperationModes = append(cooperationModes, map[string]interface{}{
"cooperationModeId": item.CooperationModeId,
"cooperationModeName": item.CooperationModeName,
"cooperationModeNumber": item.CooperationModeNumber,
for i := range modeStatistics {
modeNumbers = append(modeNumbers, modeStatistics[i].CooperationModeNumber)
}
var cooperationModes = make([]interface{}, 0)
if len(modeNumbers) > 0 {
models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
PageSize: 20,
PageNumber: 1,
//CompanyId: cmd.Operator.CompanyId,
//OrgId: cmd.Operator.OrgId,
CooperationModeNumbers: modeNumbers,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
for i := range models.List {
item := models.List[i]
cooperationModes = append(cooperationModes, map[string]interface{}{
"cooperationModeId": item.CooperationModeId,
"cooperationModeName": item.CooperationModeName,
"cooperationModeNumber": item.CooperationModeNumber,
})
}
}
// 项目概览统计
contracts, err := gateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
PageNumber: 1,
... ... @@ -184,3 +196,16 @@ func (srv CompanyStatisticsService) CooperationPersonStatistics(cmd *command.Coo
"cooperationPersonStatistics": response,
}, nil
}
type CooperationModeStatistics struct {
// 共创人数
CooperationPeople float64 `json:"cooperationPeople"`
// 分红预算
DividendsEstimate string `json:"dividendsEstimate"`
// 订单金额
OrderAmount float64 `json:"orderAmount"`
// 共创模式编号
CooperationModeNumber string `json:"cooperationModeNumber"`
// 结算金额
SettlementAmount float64 `json:"settlementAmount"`
}
... ...
... ... @@ -46,6 +46,8 @@ type (
OrgId int64 `json:"orgId"`
UserId int64 `json:"userId"`
UserBaseId int64 `json:"userBaseId"`
//模式编码列表
CooperationModeNumbers []string `cname:"模式编码列表" json:"cooperationModeNumbers,omitempty"`
}
DataCooperationModeList struct {
... ... @@ -163,6 +165,8 @@ type (
OrgId int64 `json:"orgId"`
UserId int64 `json:"userId"`
UserBaseId int64 `json:"userBaseId"`
//模式编码列表
CooperationModeNumbers []string `cname:"模式编码列表" json:"cooperationModeNumbers,omitempty"`
}
DataCooperationModesSearch struct {
... ...