作者 tangxvhui

补充接口

... ... @@ -743,3 +743,45 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge
}
return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
}
//根据周期和日期。获取上级评估的列表,员工的被其他人评估
func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
//获取员工的评估
cnt, assessList, err := assessReps.Find(map[string]interface{}{
"cycleId": param.CycleId,
"beginDay": param.BeginDay,
"companyId": param.CompanyId,
"targetUserId": param.TargetUserId,
"typesList": []string{string(domain.AssessSuper)},
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
var resultList []map[string]interface{}
for _, v := range assessList {
item := map[string]interface{}{
"id": v.Id,
"targetUser": v.TargetUser,
"executor": v.Executor,
}
resultList = append(resultList, item)
}
return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
}
... ...
... ... @@ -149,3 +149,21 @@ func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() {
data, err := srv.ListTargetUserInviteAssess(paramReq)
c.Response(data, err)
}
// 被评估的员工的评估列表-上级评估
func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() {
srv := service.NewStaffAssessServeice()
paramReq := &query.ListTargetAssessQuery{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
paramReq.CompanyId = 1
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.TargetUserId = int(userReq.UserId)
data, err := srv.ListTargetUserSuperAssess(paramReq)
c.Response(data, err)
}
... ...
... ... @@ -32,7 +32,7 @@ func init() {
web.NSCtrlPut("/info", (*controllers.StaffAssessController).SaveAssessInfo), //通用保存员工评估的详情
web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存)
web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我上级评估的列表
web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我上级评估的列表
web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
)
//v2 改版
... ... @@ -50,6 +50,7 @@ func init() {
web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情
web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessControllerV2).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我被上级评估的列表
)
web.AddNamespace(assessTaskNS)
... ...