|
@@ -7,6 +7,7 @@ import ( |
|
@@ -7,6 +7,7 @@ import ( |
7
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/service"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/service"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
10
|
+ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
|
10
|
)
|
11
|
)
|
11
|
|
12
|
|
12
|
type StaffAssessController struct {
|
13
|
type StaffAssessController struct {
|
|
@@ -23,9 +24,10 @@ func (c *StaffAssessController) SearchAssessTaskMe() { |
|
@@ -23,9 +24,10 @@ func (c *StaffAssessController) SearchAssessTaskMe() { |
23
|
c.Response(nil, e)
|
24
|
c.Response(nil, e)
|
24
|
return
|
25
|
return
|
25
|
}
|
26
|
}
|
26
|
- //TODO 获取当前用户信息
|
|
|
27
|
- paramReq.CompanyId = 1
|
|
|
28
|
- paramReq.UserId = 1
|
27
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
28
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
29
|
+ paramReq.UserId = int(userReq.UserId)
|
|
|
30
|
+
|
29
|
data, err := srv.SearchAssessTaskMe(paramReq)
|
31
|
data, err := srv.SearchAssessTaskMe(paramReq)
|
30
|
c.Response(data, err)
|
32
|
c.Response(data, err)
|
31
|
}
|
33
|
}
|
|
@@ -40,9 +42,9 @@ func (c *StaffAssessController) AssessTaskMeDesc() { |
|
@@ -40,9 +42,9 @@ func (c *StaffAssessController) AssessTaskMeDesc() { |
40
|
c.Response(nil, e)
|
42
|
c.Response(nil, e)
|
41
|
return
|
43
|
return
|
42
|
}
|
44
|
}
|
43
|
- //TODO 获取当前用户信息
|
|
|
44
|
- paramReq.CompanyId = 1
|
|
|
45
|
- paramReq.UserId = 1
|
45
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
46
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
47
|
+ paramReq.UserId = int(userReq.UserId)
|
46
|
data, err := srv.AssessTaskDesc(paramReq)
|
48
|
data, err := srv.AssessTaskDesc(paramReq)
|
47
|
c.Response(data, err)
|
49
|
c.Response(data, err)
|
48
|
}
|
50
|
}
|
|
@@ -57,9 +59,9 @@ func (c *StaffAssessController) AssessSelfMeList() { |
|
@@ -57,9 +59,9 @@ func (c *StaffAssessController) AssessSelfMeList() { |
57
|
c.Response(nil, e)
|
59
|
c.Response(nil, e)
|
58
|
return
|
60
|
return
|
59
|
}
|
61
|
}
|
60
|
- //TODO 获取当前用户信息
|
|
|
61
|
- paramReq.CompanyId = 1
|
|
|
62
|
- paramReq.UserId = 1
|
62
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
63
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
64
|
+ paramReq.UserId = int(userReq.UserId)
|
63
|
data, err := srv.AssessSelfList(paramReq)
|
65
|
data, err := srv.AssessSelfList(paramReq)
|
64
|
c.Response(data, err)
|
66
|
c.Response(data, err)
|
65
|
}
|
67
|
}
|
|
@@ -89,9 +91,9 @@ func (c *StaffAssessController) GetAssessSelfMeInfo() { |
|
@@ -89,9 +91,9 @@ func (c *StaffAssessController) GetAssessSelfMeInfo() { |
89
|
c.Response(nil, e)
|
91
|
c.Response(nil, e)
|
90
|
return
|
92
|
return
|
91
|
}
|
93
|
}
|
92
|
- //TODO 获取当前用户信息
|
|
|
93
|
- paramReq.CompanyId = 1
|
|
|
94
|
- paramReq.TargetUserId = 1
|
94
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
95
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
96
|
+ paramReq.TargetUserId = int(userReq.UserId)
|
95
|
data, err := srv.GetAssessSelfInfo(paramReq)
|
97
|
data, err := srv.GetAssessSelfInfo(paramReq)
|
96
|
c.Response(data, err)
|
98
|
c.Response(data, err)
|
97
|
}
|
99
|
}
|
|
@@ -106,14 +108,14 @@ func (c *StaffAssessController) GetAssessMeInviteUser() { |
|
@@ -106,14 +108,14 @@ func (c *StaffAssessController) GetAssessMeInviteUser() { |
106
|
c.Response(nil, e)
|
108
|
c.Response(nil, e)
|
107
|
return
|
109
|
return
|
108
|
}
|
110
|
}
|
109
|
- //TODO 获取当前用户信息
|
|
|
110
|
- paramReq.CompanyId = 1
|
|
|
111
|
- paramReq.UserId = 1
|
111
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
112
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
113
|
+ paramReq.UserId = int(userReq.UserId)
|
112
|
data, err := srv.GetAssessInviteUser(paramReq)
|
114
|
data, err := srv.GetAssessInviteUser(paramReq)
|
113
|
c.Response(data, err)
|
115
|
c.Response(data, err)
|
114
|
}
|
116
|
}
|
115
|
|
117
|
|
116
|
-// 保持员工邀请的人
|
118
|
+// 保持我邀请的员工
|
117
|
func (c *StaffAssessController) SaveAssessMeInviteUser() {
|
119
|
func (c *StaffAssessController) SaveAssessMeInviteUser() {
|
118
|
srv := service.NewStaffAssessServeice()
|
120
|
srv := service.NewStaffAssessServeice()
|
119
|
paramReq := &command.SaveAssessInvite{}
|
121
|
paramReq := &command.SaveAssessInvite{}
|
|
@@ -140,9 +142,11 @@ func (c *StaffAssessController) SelectAssessInviteUser() { |
|
@@ -140,9 +142,11 @@ func (c *StaffAssessController) SelectAssessInviteUser() { |
140
|
c.Response(nil, e)
|
142
|
c.Response(nil, e)
|
141
|
return
|
143
|
return
|
142
|
}
|
144
|
}
|
143
|
- //TODO 获取当前用户信息
|
|
|
144
|
- paramReq.CompanyId = 1
|
|
|
145
|
- paramReq.TargetUserId = 1
|
145
|
+ // paramReq.CompanyId = 1
|
|
|
146
|
+ // paramReq.TargetUserId = 1
|
|
|
147
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
148
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
149
|
+ paramReq.TargetUserId = int(userReq.UserId)
|
146
|
data, err := srv.SelectAssessInviteUser(paramReq)
|
150
|
data, err := srv.SelectAssessInviteUser(paramReq)
|
147
|
c.Response(data, err)
|
151
|
c.Response(data, err)
|
148
|
}
|
152
|
}
|
|
@@ -157,9 +161,12 @@ func (c *StaffAssessController) ListMeInviteUserAssess() { |
|
@@ -157,9 +161,12 @@ func (c *StaffAssessController) ListMeInviteUserAssess() { |
157
|
c.Response(nil, e)
|
161
|
c.Response(nil, e)
|
158
|
return
|
162
|
return
|
159
|
}
|
163
|
}
|
160
|
- //TODO 获取当前用户信息
|
|
|
161
|
- paramReq.CompanyId = 1
|
|
|
162
|
- paramReq.ExecutorId = 1
|
164
|
+ //获取当前用户信息
|
|
|
165
|
+ // paramReq.CompanyId = 1
|
|
|
166
|
+ // paramReq.ExecutorId = 1
|
|
|
167
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
168
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
169
|
+ paramReq.ExecutorId = int(userReq.UserId)
|
163
|
data, err := srv.ListExecutorInviteAssess(paramReq)
|
170
|
data, err := srv.ListExecutorInviteAssess(paramReq)
|
164
|
c.Response(data, err)
|
171
|
c.Response(data, err)
|
165
|
}
|
172
|
}
|
|
@@ -175,8 +182,11 @@ func (c *StaffAssessController) ListMeSupperAssess() { |
|
@@ -175,8 +182,11 @@ func (c *StaffAssessController) ListMeSupperAssess() { |
175
|
return
|
182
|
return
|
176
|
}
|
183
|
}
|
177
|
//TODO 获取当前用户信息
|
184
|
//TODO 获取当前用户信息
|
178
|
- paramReq.CompanyId = 1
|
|
|
179
|
- paramReq.ExecutorId = 1
|
185
|
+ // paramReq.CompanyId = 1
|
|
|
186
|
+ // paramReq.ExecutorId = 1
|
|
|
187
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
188
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
|
|
189
|
+ paramReq.ExecutorId = int(userReq.UserId)
|
180
|
data, err := srv.ListExecutorSupperAssess(paramReq)
|
190
|
data, err := srv.ListExecutorSupperAssess(paramReq)
|
181
|
c.Response(data, err)
|
191
|
c.Response(data, err)
|
182
|
}
|
192
|
}
|
|
@@ -191,7 +201,9 @@ func (c *StaffAssessController) GetAssessTargetUserSelfInfo() { |
|
@@ -191,7 +201,9 @@ func (c *StaffAssessController) GetAssessTargetUserSelfInfo() { |
191
|
c.Response(nil, e)
|
201
|
c.Response(nil, e)
|
192
|
return
|
202
|
return
|
193
|
}
|
203
|
}
|
194
|
- paramReq.CompanyId = 1
|
204
|
+ // paramReq.CompanyId = 1
|
|
|
205
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
206
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
195
|
data, err := srv.GetAssessSelfInfo(paramReq)
|
207
|
data, err := srv.GetAssessSelfInfo(paramReq)
|
196
|
c.Response(data, err)
|
208
|
c.Response(data, err)
|
197
|
}
|
209
|
}
|
|
@@ -206,7 +218,9 @@ func (c *StaffAssessController) GetAssessInfo() { |
|
@@ -206,7 +218,9 @@ func (c *StaffAssessController) GetAssessInfo() { |
206
|
c.Response(nil, e)
|
218
|
c.Response(nil, e)
|
207
|
return
|
219
|
return
|
208
|
}
|
220
|
}
|
209
|
- paramReq.CompanyId = 1
|
221
|
+ // paramReq.CompanyId = 1
|
|
|
222
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
223
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
210
|
data, err := srv.GetAssessInfo(paramReq)
|
224
|
data, err := srv.GetAssessInfo(paramReq)
|
211
|
c.Response(data, err)
|
225
|
c.Response(data, err)
|
212
|
}
|
226
|
}
|
|
@@ -235,7 +249,9 @@ func (c *StaffAssessController) ListTargetUserInviteAssess() { |
|
@@ -235,7 +249,9 @@ func (c *StaffAssessController) ListTargetUserInviteAssess() { |
235
|
c.Response(nil, e)
|
249
|
c.Response(nil, e)
|
236
|
return
|
250
|
return
|
237
|
}
|
251
|
}
|
238
|
- paramReq.CompanyId = 1
|
252
|
+ // paramReq.CompanyId = 1
|
|
|
253
|
+ userReq := middlewares.GetUser(c.Ctx)
|
|
|
254
|
+ paramReq.CompanyId = int(userReq.CompanyId)
|
239
|
paramReq.Types = []string{string(domain.AssessInviteSameSuper), string(domain.AssessInviteDiffSuper)}
|
255
|
paramReq.Types = []string{string(domain.AssessInviteSameSuper), string(domain.AssessInviteDiffSuper)}
|
240
|
data, err := srv.ListTargetUserAssess(paramReq)
|
256
|
data, err := srv.ListTargetUserAssess(paramReq)
|
241
|
c.Response(data, err)
|
257
|
c.Response(data, err)
|