...
|
...
|
@@ -44,6 +44,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
|
|
|
|
// 模式列表
|
|
|
var modeStatistics []CooperationModeStatistics
|
|
|
var responseModeStatistics []CooperationModeStatistics
|
|
|
var modeNumbers []string
|
|
|
err = json.UnmarshalFromString(json.MarshalToString(cooperationModeStatistics), &modeStatistics)
|
|
|
if err != nil {
|
...
|
...
|
@@ -54,19 +55,35 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
|
}
|
|
|
|
|
|
var cooperationModes = make([]interface{}, 0)
|
|
|
if len(modeNumbers) > 0 {
|
|
|
models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
|
|
|
PageSize: domain.NormalQueryRowCount,
|
|
|
PageNumber: 1,
|
|
|
CompanyId: cmd.Operator.CompanyId,
|
|
|
//OrgId: cmd.Operator.OrgId,
|
|
|
CooperationModeNumbers: modeNumbers,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
|
|
|
PageSize: domain.NormalQueryRowCount,
|
|
|
PageNumber: 1,
|
|
|
CompanyId: cmd.Operator.CompanyId,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
//CooperationModeNumbers: modeNumbers,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
mapModels := make(map[string]CooperationModeStatistics)
|
|
|
for i := range responseModeStatistics {
|
|
|
item := responseModeStatistics[i]
|
|
|
mapModels[item.CooperationModeNumber] = item
|
|
|
}
|
|
|
if len(models.List) > 0 {
|
|
|
for i := range models.List {
|
|
|
item := models.List[i]
|
|
|
if value, ok := mapModels[item.CooperationModeNumber]; !ok {
|
|
|
responseModeStatistics = append(responseModeStatistics, CooperationModeStatistics{
|
|
|
CooperationPeople: 0,
|
|
|
DividendsEstimate: 0,
|
|
|
OrderAmount: 0,
|
|
|
CooperationModeNumber: item.CooperationModeNumber,
|
|
|
SettlementAmount: 0,
|
|
|
})
|
|
|
} else {
|
|
|
responseModeStatistics = append(responseModeStatistics, value)
|
|
|
}
|
|
|
cooperationModes = append(cooperationModes, map[string]interface{}{
|
|
|
"cooperationModeId": item.CooperationModeId,
|
|
|
"cooperationModeName": item.CooperationModeName,
|
...
|
...
|
@@ -90,6 +107,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
|
PageSize: 1,
|
|
|
CompanyId: cmd.Operator.CompanyId,
|
|
|
OrgId: cmd.Operator.OrgId,
|
|
|
Status: 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
@@ -115,7 +133,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
|
return map[string]interface{}{
|
|
|
"projectOverviewStatistics": projectOverviewStatistics,
|
|
|
"currentMonthDividendsStatistics": companyDividendsStatistics,
|
|
|
"cooperationModeStatistics": cooperationModeStatistics,
|
|
|
"cooperationModeStatistics": responseModeStatistics,
|
|
|
"cooperationGoodsStatistics": cooperationGoodsStatistics,
|
|
|
"cooperationModes": cooperationModes,
|
|
|
}, nil
|
...
|
...
|
@@ -202,7 +220,7 @@ type CooperationModeStatistics struct { |
|
|
// 共创人数
|
|
|
CooperationPeople float64 `json:"cooperationPeople"`
|
|
|
// 分红预算
|
|
|
DividendsEstimate string `json:"dividendsEstimate"`
|
|
|
DividendsEstimate float64 `json:"dividendsEstimate"`
|
|
|
// 订单金额
|
|
|
OrderAmount float64 `json:"orderAmount"`
|
|
|
// 共创模式编号
|
...
|
...
|
|