作者 tangxvhui

添加接口

@@ -100,8 +100,8 @@ func (c *StaffAssessControllerV2) GetAssessMeInviteUser() { @@ -100,8 +100,8 @@ func (c *StaffAssessControllerV2) GetAssessMeInviteUser() {
100 c.Response(data, err) 100 c.Response(data, err)
101 } 101 }
102 102
103 -// 获取员工自评详情  
104 -func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() { 103 +// 获取当前登录员工自评详情
  104 +func (c *StaffAssessControllerV2) GetAssessSelfMeInfo() {
105 srv := service.NewStaffAssessServeice() 105 srv := service.NewStaffAssessServeice()
106 paramReq := &query.GetExecutorSelfAssessQuery{} 106 paramReq := &query.GetExecutorSelfAssessQuery{}
107 err := c.BindJSON(paramReq) 107 err := c.BindJSON(paramReq)
@@ -112,29 +112,30 @@ func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() { @@ -112,29 +112,30 @@ func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() {
112 } 112 }
113 userReq := middlewares.GetUser(c.Ctx) 113 userReq := middlewares.GetUser(c.Ctx)
114 paramReq.CompanyId = int(userReq.CompanyId) 114 paramReq.CompanyId = int(userReq.CompanyId)
  115 + paramReq.TargetUserId = int(userReq.UserId)
115 data, err := srv.GetAssessSelfInfoV2(paramReq) 116 data, err := srv.GetAssessSelfInfoV2(paramReq)
116 c.Response(data, err) 117 c.Response(data, err)
117 } 118 }
118 119
119 -// 获取当前登录员工自评详情  
120 -func (c *StaffAssessControllerV2) GetAssessSelfMeInfo() { 120 +// 被评估的员工的评估列表-360评估
  121 +func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() {
121 srv := service.NewStaffAssessServeice() 122 srv := service.NewStaffAssessServeice()
122 - paramReq := &query.GetExecutorSelfAssessQuery{} 123 + paramReq := &query.ListTargetAssessQuery{}
123 err := c.BindJSON(paramReq) 124 err := c.BindJSON(paramReq)
124 if err != nil { 125 if err != nil {
125 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) 126 e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
126 c.Response(nil, e) 127 c.Response(nil, e)
127 return 128 return
128 } 129 }
  130 +
129 userReq := middlewares.GetUser(c.Ctx) 131 userReq := middlewares.GetUser(c.Ctx)
130 paramReq.CompanyId = int(userReq.CompanyId) 132 paramReq.CompanyId = int(userReq.CompanyId)
131 - paramReq.TargetUserId = int(userReq.UserId)  
132 - data, err := srv.GetAssessSelfInfoV2(paramReq) 133 + data, err := srv.ListTargetUserInviteAssess(paramReq)
133 c.Response(data, err) 134 c.Response(data, err)
134 } 135 }
135 136
136 -// 被评估的员工的评估列表-360评估  
137 -func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() { 137 +// 被评估的员工的评估列表-当前登录用户-上级评估
  138 +func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() {
138 srv := service.NewStaffAssessServeice() 139 srv := service.NewStaffAssessServeice()
139 paramReq := &query.ListTargetAssessQuery{} 140 paramReq := &query.ListTargetAssessQuery{}
140 err := c.BindJSON(paramReq) 141 err := c.BindJSON(paramReq)
@@ -143,15 +144,16 @@ func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() { @@ -143,15 +144,16 @@ func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() {
143 c.Response(nil, e) 144 c.Response(nil, e)
144 return 145 return
145 } 146 }
146 - 147 + paramReq.CompanyId = 1
147 userReq := middlewares.GetUser(c.Ctx) 148 userReq := middlewares.GetUser(c.Ctx)
148 paramReq.CompanyId = int(userReq.CompanyId) 149 paramReq.CompanyId = int(userReq.CompanyId)
149 - data, err := srv.ListTargetUserInviteAssess(paramReq) 150 + paramReq.TargetUserId = int(userReq.UserId)
  151 + data, err := srv.ListTargetUserSuperAssess(paramReq)
150 c.Response(data, err) 152 c.Response(data, err)
151 } 153 }
152 154
153 // 被评估的员工的评估列表-上级评估 155 // 被评估的员工的评估列表-上级评估
154 -func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() { 156 +func (c *StaffAssessControllerV2) ListTargetUserSupperAssess() {
155 srv := service.NewStaffAssessServeice() 157 srv := service.NewStaffAssessServeice()
156 paramReq := &query.ListTargetAssessQuery{} 158 paramReq := &query.ListTargetAssessQuery{}
157 err := c.BindJSON(paramReq) 159 err := c.BindJSON(paramReq)
@@ -163,7 +165,22 @@ func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() { @@ -163,7 +165,22 @@ func (c *StaffAssessControllerV2) ListTargetUserMeSupperAssess() {
163 paramReq.CompanyId = 1 165 paramReq.CompanyId = 1
164 userReq := middlewares.GetUser(c.Ctx) 166 userReq := middlewares.GetUser(c.Ctx)
165 paramReq.CompanyId = int(userReq.CompanyId) 167 paramReq.CompanyId = int(userReq.CompanyId)
166 - paramReq.TargetUserId = int(userReq.UserId)  
167 data, err := srv.ListTargetUserSuperAssess(paramReq) 168 data, err := srv.ListTargetUserSuperAssess(paramReq)
168 c.Response(data, err) 169 c.Response(data, err)
169 } 170 }
  171 +
  172 +// 获取员工自评详情
  173 +func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() {
  174 + srv := service.NewStaffAssessServeice()
  175 + paramReq := &query.GetExecutorSelfAssessQuery{}
  176 + err := c.BindJSON(paramReq)
  177 + if err != nil {
  178 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  179 + c.Response(nil, e)
  180 + return
  181 + }
  182 + userReq := middlewares.GetUser(c.Ctx)
  183 + paramReq.CompanyId = int(userReq.CompanyId)
  184 + data, err := srv.GetAssessSelfInfoV2(paramReq)
  185 + c.Response(data, err)
  186 +}
@@ -49,6 +49,7 @@ func init() { @@ -49,6 +49,7 @@ func init() {
49 web.NSCtrlPost("/me/invite-user", (*controllers.StaffAssessControllerV2).GetAssessMeInviteUser), //获取邀请的员工 49 web.NSCtrlPost("/me/invite-user", (*controllers.StaffAssessControllerV2).GetAssessMeInviteUser), //获取邀请的员工
50 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情 50 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessControllerV2).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
51 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessControllerV2).ListTargetUserInviteAssess), //获取被评估员工360评估的列表 51 web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessControllerV2).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
  52 + web.NSCtrlPost("/target-user/supper/list", (*controllers.StaffAssessControllerV2).ListTargetUserSupperAssess), //获取被评估员工被上级评估的列表
52 web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情 53 web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情
53 web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessControllerV2).ListTargetUserMeSupperAssess), //获取我被上级评估的列表 54 web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessControllerV2).ListTargetUserMeSupperAssess), //获取我被上级评估的列表
54 ) 55 )