|
@@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
|
@@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
255
|
}
|
255
|
}
|
256
|
|
256
|
|
257
|
//获取用户数据
|
257
|
//获取用户数据
|
258
|
- userRep := factory.CreateUserRepository(map[string]interface{}{
|
258
|
+ userRepo := factory.CreateUserRepository(map[string]interface{}{
|
259
|
"transactionContext": transactionContext,
|
259
|
"transactionContext": transactionContext,
|
260
|
})
|
260
|
})
|
261
|
- userData, err := userRep.FindOne(map[string]interface{}{
|
261
|
+ userData, err := userRepo.FindOne(map[string]interface{}{
|
262
|
"id": param.UserId,
|
262
|
"id": param.UserId,
|
263
|
})
|
263
|
})
|
264
|
if err != nil {
|
264
|
if err != nil {
|
265
|
log.Logger.Error("获取用户信息," + err.Error())
|
265
|
log.Logger.Error("获取用户信息," + err.Error())
|
266
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error())
|
266
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error())
|
267
|
}
|
267
|
}
|
268
|
-
|
268
|
+ departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
|
|
|
269
|
+ "transactionContext": transactionContext,
|
|
|
270
|
+ })
|
|
|
271
|
+ var supperUserList []*domain.User
|
|
|
272
|
+ if len(userData.DepartmentId) > 0 {
|
|
|
273
|
+ _, departmentList, err := departmentRepo.Find(map[string]interface{}{
|
|
|
274
|
+ "ids": userData.DepartmentId,
|
|
|
275
|
+ })
|
|
|
276
|
+ if err != nil {
|
|
|
277
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())
|
|
|
278
|
+ }
|
|
|
279
|
+ var chargeUserIds []int64
|
|
|
280
|
+ for _, v := range departmentList {
|
|
|
281
|
+ chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)
|
|
|
282
|
+ }
|
|
|
283
|
+ if len(chargeUserIds) > 0 {
|
|
|
284
|
+ _, supperUserList, err = userRepo.Find(map[string]interface{}{
|
|
|
285
|
+ "ids": chargeUserIds,
|
|
|
286
|
+ })
|
|
|
287
|
+ if err != nil {
|
|
|
288
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())
|
|
|
289
|
+ }
|
|
|
290
|
+ }
|
|
|
291
|
+ }
|
269
|
if err := transactionContext.CommitTransaction(); err != nil {
|
292
|
if err := transactionContext.CommitTransaction(); err != nil {
|
270
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
293
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
271
|
}
|
294
|
}
|
|
@@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
|
@@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( |
289
|
SupperUserName: "",
|
312
|
SupperUserName: "",
|
290
|
DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"),
|
313
|
DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"),
|
291
|
}
|
314
|
}
|
|
|
315
|
+ for _, v := range supperUserList {
|
|
|
316
|
+ userInfo.SupperUserName = userInfo.SupperUserName + v.Name + ";"
|
|
|
317
|
+ }
|
292
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), listData)
|
318
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), listData)
|
293
|
result["userInfo"] = userInfo
|
319
|
result["userInfo"] = userInfo
|
294
|
return result, nil
|
320
|
return result, nil
|
|
@@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error { |
|
@@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error { |
313
|
return nil
|
339
|
return nil
|
314
|
}
|
340
|
}
|
315
|
|
341
|
|
316
|
-func (srv StaffAssessServeice) getStaffDesc(userId int) *domain.StaffDesc {
|
342
|
+// 获取员工自评详情
|
|
|
343
|
+func (srv StaffAssessServeice) StaffAssessSelfInfo() {
|
317
|
|
344
|
|
318
|
- return &domain.StaffDesc{}
|
|
|
319
|
} |
345
|
} |