作者 tangxvhui

补充接口

@@ -743,3 +743,45 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge @@ -743,3 +743,45 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge
743 } 743 }
744 return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil 744 return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
745 } 745 }
  746 +
  747 +//根据周期和日期。获取上级评估的列表,员工的被其他人评估
  748 +func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
  749 +
  750 + transactionContext, err := factory.CreateTransactionContext(nil)
  751 + if err != nil {
  752 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  753 + }
  754 + if err := transactionContext.StartTransaction(); err != nil {
  755 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  756 + }
  757 + defer func() {
  758 + _ = transactionContext.RollbackTransaction()
  759 + }()
  760 + assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
  761 + "transactionContext": transactionContext,
  762 + })
  763 + //获取员工的评估
  764 + cnt, assessList, err := assessReps.Find(map[string]interface{}{
  765 + "cycleId": param.CycleId,
  766 + "beginDay": param.BeginDay,
  767 + "companyId": param.CompanyId,
  768 + "targetUserId": param.TargetUserId,
  769 + "typesList": []string{string(domain.AssessSuper)},
  770 + })
  771 + if err != nil {
  772 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
  773 + }
  774 + if err := transactionContext.CommitTransaction(); err != nil {
  775 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  776 + }
  777 + var resultList []map[string]interface{}
  778 + for _, v := range assessList {
  779 + item := map[string]interface{}{
  780 + "id": v.Id,
  781 + "targetUser": v.TargetUser,
  782 + "executor": v.Executor,
  783 + }
  784 + resultList = append(resultList, item)
  785 + }
  786 + return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
  787 +}
@@ -149,3 +149,21 @@ func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() { @@ -149,3 +149,21 @@ func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() {
149 data, err := srv.ListTargetUserInviteAssess(paramReq) 149 data, err := srv.ListTargetUserInviteAssess(paramReq)
150 c.Response(data, err) 150 c.Response(data, err)
151 } 151 }
  152 +
  153 +// 被评估的员工的评估列表-上级评估
  154 +func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() {
  155 + srv := service.NewStaffAssessServeice()
  156 + paramReq := &query.ListTargetAssessQuery{}
  157 + err := c.BindJSON(paramReq)
  158 + if err != nil {
  159 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  160 + c.Response(nil, e)
  161 + return
  162 + }
  163 + paramReq.CompanyId = 1
  164 + userReq := middlewares.GetUser(c.Ctx)
  165 + paramReq.CompanyId = int(userReq.CompanyId)
  166 + paramReq.TargetUserId = int(userReq.UserId)
  167 + data, err := srv.ListTargetUserSuperAssess(paramReq)
  168 + c.Response(data, err)
  169 +}
@@ -32,7 +32,7 @@ func init() { @@ -32,7 +32,7 @@ func init() {
32 web.NSCtrlPut("/info", (*controllers.StaffAssessController).SaveAssessInfo), //通用保存员工评估的详情 32 web.NSCtrlPut("/info", (*controllers.StaffAssessController).SaveAssessInfo), //通用保存员工评估的详情
33 web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存) 33 web.NSCtrlPut("/info-cache", (*controllers.StaffAssessController).SaveAssessCache), //通用保存员工评估的详情(缓存)
34 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表 34 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
35 - web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我上级评估的列表 35 + web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我上级评估的列表
36 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情 36 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
37 ) 37 )
38 //v2 改版 38 //v2 改版
@@ -50,6 +50,7 @@ func init() { @@ -50,6 +50,7 @@ func init() {
50 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情 50 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
51 web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情 51 web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情
52 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessControllerV2).ListTargetUserInviteAssess), //获取被评估员工360评估的列表 52 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessControllerV2).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
  53 + web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我被上级评估的列表
53 ) 54 )
54 55
55 web.AddNamespace(assessTaskNS) 56 web.AddNamespace(assessTaskNS)