作者 Your Name

更新

@@ -1418,7 +1418,25 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA @@ -1418,7 +1418,25 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA
1418 log.Logger.Error("获取员工邀请的人完成情况" + err.Error()) 1418 log.Logger.Error("获取员工邀请的人完成情况" + err.Error())
1419 } 1419 }
1420 } 1420 }
1421 - 1421 + assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
  1422 + "transactionContext": transactionContext,
  1423 + })
  1424 + assessTaskData, err := assessTaskRepo.FindOne(map[string]interface{}{
  1425 + "id": param.AssessTaskId,
  1426 + })
  1427 + if err != nil {
  1428 + return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取评估任务"+err.Error())
  1429 + }
  1430 + //我评估别人,被邀请评估
  1431 + cnnt, _, err := assessRepo.Find(map[string]interface{}{
  1432 + "staffAssessTaskId": param.AssessTaskId,
  1433 + "executorId": param.ExecutorId,
  1434 + "typesList": []string{string(domain.AssessSuper)},
  1435 + "status": domain.StaffAssessUncompleted,
  1436 + })
  1437 + if err != nil {
  1438 + return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
  1439 + }
1422 if err := transactionContext.CommitTransaction(); err != nil { 1440 if err := transactionContext.CommitTransaction(); err != nil {
1423 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1441 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1424 } 1442 }
@@ -1463,7 +1481,18 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA @@ -1463,7 +1481,18 @@ func (srv StaffAssessServeice) ListExecutorSupperAssess(param *query.ListSupperA
1463 } 1481 }
1464 resultList = append(resultList, item) 1482 resultList = append(resultList, item)
1465 } 1483 }
1466 - return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil 1484 + result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList)
  1485 + result["linkNodeName"] = ""
  1486 + result["linkNodeId"] = ""
  1487 + result["lintNodeDesc"] = ""
  1488 + for _, v := range assessTaskData.StepList {
  1489 + if v.LinkNodeType == domain.LinkNodeSuperiorAssessment {
  1490 + result["linkNodeName"] = v.LinkNodeName
  1491 + result["linkNodeId"] = fmt.Sprintf("%d", v.LinkNodeId)
  1492 + result["lintNodeDesc"] = fmt.Sprintf("截止时间 %s 待评估 %d 人", v.EndTime.Local().Format("2006-01-02 15:04:05"), cnnt)
  1493 + }
  1494 + }
  1495 + return result, nil
1467 } 1496 }
1468 1497
1469 // 根据staffAssessId 获取评估的填写信息 1498 // 根据staffAssessId 获取评估的填写信息
@@ -1720,6 +1749,7 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA @@ -1720,6 +1749,7 @@ func (srv StaffAssessServeice) ListTargetUserAssess(param *query.ListTargetUserA
1720 "assessTaskId": param.AssessTaskId, 1749 "assessTaskId": param.AssessTaskId,
1721 "companyId": param.CompanyId, 1750 "companyId": param.CompanyId,
1722 "targetUserId": param.TargetUserId, 1751 "targetUserId": param.TargetUserId,
  1752 + "typesList": param.Types,
1723 }) 1753 })
1724 if err != nil { 1754 if err != nil {
1725 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error()) 1755 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
@@ -258,3 +258,21 @@ func (c *StaffAssessController) ListTargetUserInviteAssess() { @@ -258,3 +258,21 @@ func (c *StaffAssessController) ListTargetUserInviteAssess() {
258 data, err := srv.ListTargetUserAssess(paramReq) 258 data, err := srv.ListTargetUserAssess(paramReq)
259 c.Response(data, err) 259 c.Response(data, err)
260 } 260 }
  261 +
  262 +func (c *StaffAssessController) ListTargetUserMeSupperAssess() {
  263 + srv := service.NewStaffAssessServeice()
  264 + paramReq := &query.ListTargetUserAssessQuery{}
  265 + err := c.BindJSON(paramReq)
  266 + if err != nil {
  267 + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
  268 + c.Response(nil, e)
  269 + return
  270 + }
  271 + // paramReq.CompanyId = 1
  272 + userReq := middlewares.GetUser(c.Ctx)
  273 + paramReq.CompanyId = int(userReq.CompanyId)
  274 + paramReq.Types = []string{string(domain.AssessSuper)}
  275 + paramReq.TargetUserId = int(userReq.UserId)
  276 + data, err := srv.ListTargetUserAssess(paramReq)
  277 + c.Response(data, err)
  278 +}
@@ -26,7 +26,8 @@ func init() { @@ -26,7 +26,8 @@ func init() {
26 web.NSCtrlPost("/me/execute/supper/list", (*controllers.StaffAssessController).ListMeSupperAssess), //我要执行的360评估的用户列表 26 web.NSCtrlPost("/me/execute/supper/list", (*controllers.StaffAssessController).ListMeSupperAssess), //我要执行的360评估的用户列表
27 web.NSCtrlPost("/info", (*controllers.StaffAssessController).GetAssessInfo), //通用获取员工评估的详情 27 web.NSCtrlPost("/info", (*controllers.StaffAssessController).GetAssessInfo), //通用获取员工评估的详情
28 web.NSCtrlPut("/info", (*controllers.StaffAssessController).SaveAssessInfo), //通用保存员工评估的详情 28 web.NSCtrlPut("/info", (*controllers.StaffAssessController).SaveAssessInfo), //通用保存员工评估的详情
29 - web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工评估的详情 29 + web.NSCtrlPost("/target-user/invite/list", (*controllers.StaffAssessController).ListTargetUserInviteAssess), //获取被评估员工360评估的列表
  30 + web.NSCtrlPost("/me/target-user/supper/list", (*controllers.StaffAssessController).ListTargetUserMeSupperAssess), //获取我的上级评估的列表
30 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情 31 web.NSCtrlPost("/target-user/self/info", (*controllers.StaffAssessController).GetAssessTargetUserSelfInfo), //获取被评估员工的自评反馈详情
31 32
32 ) 33 )