|
@@ -44,6 +44,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
@@ -44,6 +44,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
44
|
|
44
|
|
|
45
|
// 模式列表
|
45
|
// 模式列表
|
|
46
|
var modeStatistics []CooperationModeStatistics
|
46
|
var modeStatistics []CooperationModeStatistics
|
|
|
|
47
|
+ var responseModeStatistics []CooperationModeStatistics
|
|
47
|
var modeNumbers []string
|
48
|
var modeNumbers []string
|
|
48
|
err = json.UnmarshalFromString(json.MarshalToString(cooperationModeStatistics), &modeStatistics)
|
49
|
err = json.UnmarshalFromString(json.MarshalToString(cooperationModeStatistics), &modeStatistics)
|
|
49
|
if err != nil {
|
50
|
if err != nil {
|
|
@@ -54,19 +55,35 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
@@ -54,19 +55,35 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
54
|
}
|
55
|
}
|
|
55
|
|
56
|
|
|
56
|
var cooperationModes = make([]interface{}, 0)
|
57
|
var cooperationModes = make([]interface{}, 0)
|
|
57
|
- if len(modeNumbers) > 0 {
|
|
|
|
58
|
- models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
|
|
|
|
59
|
- PageSize: domain.NormalQueryRowCount,
|
|
|
|
60
|
- PageNumber: 1,
|
|
|
|
61
|
- CompanyId: cmd.Operator.CompanyId,
|
|
|
|
62
|
- //OrgId: cmd.Operator.OrgId,
|
|
|
|
63
|
- CooperationModeNumbers: modeNumbers,
|
|
|
|
64
|
- })
|
|
|
|
65
|
- if err != nil {
|
|
|
|
66
|
- return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
|
67
|
- }
|
58
|
+ models, err := gateway.CooperationModesSearch(allied_creation_cooperation.ReqCooperationModesSearch{
|
|
|
|
59
|
+ PageSize: domain.NormalQueryRowCount,
|
|
|
|
60
|
+ PageNumber: 1,
|
|
|
|
61
|
+ CompanyId: cmd.Operator.CompanyId,
|
|
|
|
62
|
+ OrgId: cmd.Operator.OrgId,
|
|
|
|
63
|
+ //CooperationModeNumbers: modeNumbers,
|
|
|
|
64
|
+ })
|
|
|
|
65
|
+ if err != nil {
|
|
|
|
66
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
|
67
|
+ }
|
|
|
|
68
|
+ mapModels := make(map[string]CooperationModeStatistics)
|
|
|
|
69
|
+ for i := range responseModeStatistics {
|
|
|
|
70
|
+ item := responseModeStatistics[i]
|
|
|
|
71
|
+ mapModels[item.CooperationModeNumber] = item
|
|
|
|
72
|
+ }
|
|
|
|
73
|
+ if len(models.List) > 0 {
|
|
68
|
for i := range models.List {
|
74
|
for i := range models.List {
|
|
69
|
item := models.List[i]
|
75
|
item := models.List[i]
|
|
|
|
76
|
+ if value, ok := mapModels[item.CooperationModeNumber]; !ok {
|
|
|
|
77
|
+ responseModeStatistics = append(responseModeStatistics, CooperationModeStatistics{
|
|
|
|
78
|
+ CooperationPeople: 0,
|
|
|
|
79
|
+ DividendsEstimate: 0,
|
|
|
|
80
|
+ OrderAmount: 0,
|
|
|
|
81
|
+ CooperationModeNumber: item.CooperationModeNumber,
|
|
|
|
82
|
+ SettlementAmount: 0,
|
|
|
|
83
|
+ })
|
|
|
|
84
|
+ } else {
|
|
|
|
85
|
+ responseModeStatistics = append(responseModeStatistics, value)
|
|
|
|
86
|
+ }
|
|
70
|
cooperationModes = append(cooperationModes, map[string]interface{}{
|
87
|
cooperationModes = append(cooperationModes, map[string]interface{}{
|
|
71
|
"cooperationModeId": item.CooperationModeId,
|
88
|
"cooperationModeId": item.CooperationModeId,
|
|
72
|
"cooperationModeName": item.CooperationModeName,
|
89
|
"cooperationModeName": item.CooperationModeName,
|
|
@@ -115,7 +132,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
@@ -115,7 +132,7 @@ func (srv CompanyStatisticsService) IndexStatistics(cmd *command.IndexStatistics |
|
115
|
return map[string]interface{}{
|
132
|
return map[string]interface{}{
|
|
116
|
"projectOverviewStatistics": projectOverviewStatistics,
|
133
|
"projectOverviewStatistics": projectOverviewStatistics,
|
|
117
|
"currentMonthDividendsStatistics": companyDividendsStatistics,
|
134
|
"currentMonthDividendsStatistics": companyDividendsStatistics,
|
|
118
|
- "cooperationModeStatistics": cooperationModeStatistics,
|
135
|
+ "cooperationModeStatistics": responseModeStatistics,
|
|
119
|
"cooperationGoodsStatistics": cooperationGoodsStatistics,
|
136
|
"cooperationGoodsStatistics": cooperationGoodsStatistics,
|
|
120
|
"cooperationModes": cooperationModes,
|
137
|
"cooperationModes": cooperationModes,
|
|
121
|
}, nil
|
138
|
}, nil
|
|
@@ -202,7 +219,7 @@ type CooperationModeStatistics struct { |
|
@@ -202,7 +219,7 @@ type CooperationModeStatistics struct { |
|
202
|
// 共创人数
|
219
|
// 共创人数
|
|
203
|
CooperationPeople float64 `json:"cooperationPeople"`
|
220
|
CooperationPeople float64 `json:"cooperationPeople"`
|
|
204
|
// 分红预算
|
221
|
// 分红预算
|
|
205
|
- DividendsEstimate string `json:"dividendsEstimate"`
|
222
|
+ DividendsEstimate float64 `json:"dividendsEstimate"`
|
|
206
|
// 订单金额
|
223
|
// 订单金额
|
|
207
|
OrderAmount float64 `json:"orderAmount"`
|
224
|
OrderAmount float64 `json:"orderAmount"`
|
|
208
|
// 共创模式编号
|
225
|
// 共创模式编号
|