...
|
...
|
@@ -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"`
|
|
|
} |
...
|
...
|
|