diff --git a/pkg/application/staff_assess/service/service.go b/pkg/application/staff_assess/service/service.go index 1faebaf..3b20cf8 100644 --- a/pkg/application/staff_assess/service/service.go +++ b/pkg/application/staff_assess/service/service.go @@ -922,14 +922,13 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a ruleRepo := factory.CreateEvaluationRuleRepository(map[string]interface{}{ "transactionContext": transactionContext, }) - ruleMap := map[string]*domain.EvaluationRule{} + ruleMap := map[int64]*domain.EvaluationRule{} for _, v := range linkNode.NodeContents { if _, ok := ruleMap[v.RuleId]; ok { continue } - rid, _ := strconv.Atoi(v.RuleId) ruleData, err := ruleRepo.FindOne(map[string]interface{}{ - "id": rid, + "id": v.RuleId, }) if err == nil { ruleMap[v.RuleId] = ruleData diff --git a/pkg/port/beego/controllers/staff_assess_controller.go b/pkg/port/beego/controllers/staff_assess_controller.go index 96f5214..a4ab438 100644 --- a/pkg/port/beego/controllers/staff_assess_controller.go +++ b/pkg/port/beego/controllers/staff_assess_controller.go @@ -114,4 +114,19 @@ func (c *StaffAssessController) GetAssessInviteUser() { c.Response(data, err) } -//保持员工邀请的人 +// 保持员工邀请的人 +func (c *StaffAssessController) SaveAssessInviteUser() { + srv := service.NewStaffAssessServeice() + paramReq := &command.SaveAssessInvite{} + err := c.BindJSON(paramReq) + if err != nil { + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) + c.Response(nil, e) + return + } + //TODO 获取当前用户信息 + // paramReq.CompanyId = 1 + // paramReq.UserId = 1 + data, err := srv.SaveAssessInviteUser(paramReq) + c.Response(data, err) +} diff --git a/pkg/port/beego/routers/staff_assess_router.go b/pkg/port/beego/routers/staff_assess_router.go index ad0d5fc..bda9b96 100644 --- a/pkg/port/beego/routers/staff_assess_router.go +++ b/pkg/port/beego/routers/staff_assess_router.go @@ -15,9 +15,10 @@ func init() { // /v1/staff-assess/self/me/list assessNS := web.NewNamespace("/v1/staff-assess", // web.NSBefore(filters.AllowCors(), middlewares.CheckToken()), - web.NSCtrlPost("/self/me/list", (*controllers.StaffAssessController).AssessSelfMeList), //获取我的自评反馈列表 - web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessController).GetAssessSelfInfo), //获取我的自评反馈详情 - web.NSCtrlPost("/me/invite-user", (*controllers.StaffAssessController).GetAssessInviteUser), + web.NSCtrlPost("/self/me/list", (*controllers.StaffAssessController).AssessSelfMeList), //获取我的自评反馈列表 + web.NSCtrlPost("/self/me/info", (*controllers.StaffAssessController).GetAssessSelfInfo), //获取我的自评反馈详情 + web.NSCtrlPost("/me/invite-user", (*controllers.StaffAssessController).GetAssessInviteUser), //获取邀请的员工 + web.NSCtrlPost("/me/save-invite-user", (*controllers.StaffAssessController).SaveAssessInviteUser), //保存邀请的员工 ) web.AddNamespace(assessTaskNS) web.AddNamespace(assessNS)