Merge remote-tracking branch 'origin/test' into test
# Conflicts: # pkg/port/beego/routers/staff_assess_router.go
正在显示
19 个修改的文件
包含
145 行增加
和
37 行删除
go_build_main_go
已删除
100755 → 0
不能预览此文件类型
1 | package adapter | 1 | package adapter |
2 | 2 | ||
3 | type AssessCycleDayResp struct { | 3 | type AssessCycleDayResp struct { |
4 | - CycleId int `json:"cycleId"` | 4 | + CycleId string `json:"cycleId"` |
5 | CycleName string `json:"cycleName"` | 5 | CycleName string `json:"cycleName"` |
6 | BeginDay string `json:"beginDay"` | 6 | BeginDay string `json:"beginDay"` |
7 | } | 7 | } |
@@ -8,7 +8,7 @@ type AssessTaskDescQuery struct { | @@ -8,7 +8,7 @@ type AssessTaskDescQuery struct { | ||
8 | 8 | ||
9 | //获取我的项目周期进度描述 | 9 | //获取我的项目周期进度描述 |
10 | type AssessTaskDescV2Query struct { | 10 | type AssessTaskDescV2Query struct { |
11 | - CycleId int `json:"cycleId"` | 11 | + CycleId int `json:"cycleId,string"` |
12 | BeginDay string `json:"beginDay"` | 12 | BeginDay string `json:"beginDay"` |
13 | UserId int `json:"userId"` //当前登录人的id | 13 | UserId int `json:"userId"` //当前登录人的id |
14 | CompanyId int `json:"companyId"` //当前登录的公司 | 14 | CompanyId int `json:"companyId"` //当前登录的公司 |
@@ -4,7 +4,7 @@ package query | @@ -4,7 +4,7 @@ package query | ||
4 | type GetExecutorSelfAssessQuery struct { | 4 | type GetExecutorSelfAssessQuery struct { |
5 | CompanyId int `json:"companyId"` // | 5 | CompanyId int `json:"companyId"` // |
6 | TargetUserId int `json:"targetUserId,string"` //评估的执行人,必填 | 6 | TargetUserId int `json:"targetUserId,string"` //评估的执行人,必填 |
7 | - CycleId int `json:"cycleId"` //评估周期id 必填 | 7 | + CycleId int `json:"cycleId,string"` //评估周期id 必填 |
8 | BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02 | 8 | BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02 |
9 | AcquireCache int `json:"acquireCache"` // 0不获取缓存数据,1获取缓存数据 | 9 | AcquireCache int `json:"acquireCache"` // 0不获取缓存数据,1获取缓存数据 |
10 | } | 10 | } |
1 | package query | 1 | package query |
2 | 2 | ||
3 | -// 根据周期和日期获取我要执行的的360评估,用户列表和评估填写的值 | 3 | +// 根据周期和日期获取我要执行的的评估,用户列表和评估填写的值 |
4 | type ListExecutorAssessQuery struct { | 4 | type ListExecutorAssessQuery struct { |
5 | PageNumber int `json:"pageNumber"` | 5 | PageNumber int `json:"pageNumber"` |
6 | PageSize int `json:"pageSize"` | 6 | PageSize int `json:"pageSize"` |
7 | UserName string `json:"userName"` //查询条件 员工的名称 | 7 | UserName string `json:"userName"` //查询条件 员工的名称 |
8 | CompanyId int `json:"companyId"` // | 8 | CompanyId int `json:"companyId"` // |
9 | ExecutorId int `json:"executorId,string"` //评估的执行人,必填 | 9 | ExecutorId int `json:"executorId,string"` //评估的执行人,必填 |
10 | - CycleId int `json:"cycleId"` //评估周期id 必填 | 10 | + CycleId int `json:"cycleId,string"` //评估周期id 必填 |
11 | BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02 | 11 | BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02 |
12 | } | 12 | } |
@@ -4,6 +4,6 @@ package query | @@ -4,6 +4,6 @@ package query | ||
4 | type ListInviteUserQuery struct { | 4 | type ListInviteUserQuery struct { |
5 | CompanyId int `json:"companyId"` //对公司 | 5 | CompanyId int `json:"companyId"` //对公司 |
6 | TargetUserId int `json:"targetUserId,string"` //被评估的员工id | 6 | TargetUserId int `json:"targetUserId,string"` //被评估的员工id |
7 | - CycleId int `json:"CycleId"` //评估任务的周期id | 7 | + CycleId int `json:"CycleId,string"` //评估任务的周期id |
8 | BeginDay string `json:"beginDay"` //日期 | 8 | BeginDay string `json:"beginDay"` //日期 |
9 | } | 9 | } |
1 | +package query | ||
2 | + | ||
3 | +//获取员工被其他人评估的列表 | ||
4 | +type ListTargetAssessQuery struct { | ||
5 | + PageNumber int `json:"pageNumber"` | ||
6 | + PageSize int `json:"pageSize"` | ||
7 | + CompanyId int `json:"companyId"` // | ||
8 | + TargetUserId int `json:"targetUserId,string"` //评估的执行人,必填 | ||
9 | + CycleId int `json:"cycleId,string"` //评估周期id 必填 | ||
10 | + BeginDay string `json:"beginDay"` //评估任务的开始日期 2006-01-02 | ||
11 | +} |
@@ -279,30 +279,7 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) | @@ -279,30 +279,7 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) | ||
279 | log.Logger.Error("获取用户信息," + err.Error()) | 279 | log.Logger.Error("获取用户信息," + err.Error()) |
280 | return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error()) | 280 | return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error()) |
281 | } | 281 | } |
282 | - // departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{ | ||
283 | - // "transactionContext": transactionContext, | ||
284 | - // }) | ||
285 | - // var supperUserList []*domain.User | ||
286 | - // if len(userData.DepartmentId) > 0 { | ||
287 | - // _, departmentList, err := departmentRepo.Find(map[string]interface{}{ | ||
288 | - // "ids": userData.DepartmentId, | ||
289 | - // }) | ||
290 | - // if err != nil { | ||
291 | - // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error()) | ||
292 | - // } | ||
293 | - // var chargeUserIds []int64 | ||
294 | - // for _, v := range departmentList { | ||
295 | - // chargeUserIds = append(chargeUserIds, v.ChargeUserIds...) | ||
296 | - // } | ||
297 | - // if len(chargeUserIds) > 0 { | ||
298 | - // _, supperUserList, err = userRepo.Find(map[string]interface{}{ | ||
299 | - // "ids": chargeUserIds, | ||
300 | - // }) | ||
301 | - // if err != nil { | ||
302 | - // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error()) | ||
303 | - // } | ||
304 | - // } | ||
305 | - // } | 282 | + |
306 | supperUserList, _ := srv.getStaffSuper(transactionContext, *userData) | 283 | supperUserList, _ := srv.getStaffSuper(transactionContext, *userData) |
307 | if err := transactionContext.CommitTransaction(); err != nil { | 284 | if err := transactionContext.CommitTransaction(); err != nil { |
308 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 285 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
@@ -30,7 +30,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ | @@ -30,7 +30,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ | ||
30 | staffAssessTaskRepo := dao.NewStaffAssessDao(map[string]interface{}{ | 30 | staffAssessTaskRepo := dao.NewStaffAssessDao(map[string]interface{}{ |
31 | "transactionContext": transactionContext, | 31 | "transactionContext": transactionContext, |
32 | }) | 32 | }) |
33 | - var limit int = 200 | 33 | + var limit int = 360 |
34 | var offset int = 0 | 34 | var offset int = 0 |
35 | if param.PageSize > 0 { | 35 | if param.PageSize > 0 { |
36 | limit = param.PageSize | 36 | limit = param.PageSize |
@@ -459,7 +459,7 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu | @@ -459,7 +459,7 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu | ||
459 | return &result, nil | 459 | return &result, nil |
460 | } | 460 | } |
461 | 461 | ||
462 | -//根据周期和日期获取我需要执行的上级评估成员列表 | 462 | +// 根据周期和日期获取我需要执行的上级评估成员列表 |
463 | func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) { | 463 | func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) { |
464 | transactionContext, err := factory.CreateTransactionContext(nil) | 464 | transactionContext, err := factory.CreateTransactionContext(nil) |
465 | if err != nil { | 465 | if err != nil { |
@@ -609,7 +609,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu | @@ -609,7 +609,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu | ||
609 | return result, nil | 609 | return result, nil |
610 | } | 610 | } |
611 | 611 | ||
612 | -//根据周期和日期,获取员工的自评内容 | 612 | +// 根据周期和日期,获取员工的自评内容 |
613 | func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfAssessQuery) (*adapter.AssessInfoResp, error) { | 613 | func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfAssessQuery) (*adapter.AssessInfoResp, error) { |
614 | transactionContext, err := factory.CreateTransactionContext(nil) | 614 | transactionContext, err := factory.CreateTransactionContext(nil) |
615 | if err != nil { | 615 | if err != nil { |
@@ -697,3 +697,45 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA | @@ -697,3 +697,45 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA | ||
697 | } | 697 | } |
698 | return &result, nil | 698 | return &result, nil |
699 | } | 699 | } |
700 | + | ||
701 | +//根据周期和日期。获取360评估的列表,员工的被其他人评估 | ||
702 | +func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) { | ||
703 | + | ||
704 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
705 | + if err != nil { | ||
706 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
707 | + } | ||
708 | + if err := transactionContext.StartTransaction(); err != nil { | ||
709 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
710 | + } | ||
711 | + defer func() { | ||
712 | + _ = transactionContext.RollbackTransaction() | ||
713 | + }() | ||
714 | + assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{ | ||
715 | + "transactionContext": transactionContext, | ||
716 | + }) | ||
717 | + //获取员工的评估 | ||
718 | + cnt, assessList, err := assessReps.Find(map[string]interface{}{ | ||
719 | + "cycleId": param.CycleId, | ||
720 | + "beginDay": param.BeginDay, | ||
721 | + "companyId": param.CompanyId, | ||
722 | + "targetUserId": param.TargetUserId, | ||
723 | + "typesList": []string{string(domain.AssessInviteSameSuper), string(domain.AssessInviteDiffSuper)}, | ||
724 | + }) | ||
725 | + if err != nil { | ||
726 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error()) | ||
727 | + } | ||
728 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
729 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
730 | + } | ||
731 | + var resultList []map[string]interface{} | ||
732 | + for _, v := range assessList { | ||
733 | + item := map[string]interface{}{ | ||
734 | + "id": v.Id, | ||
735 | + "targetUser": v.TargetUser, | ||
736 | + "executor": v.Executor, | ||
737 | + } | ||
738 | + resultList = append(resultList, item) | ||
739 | + } | ||
740 | + return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil | ||
741 | +} |
@@ -12,6 +12,7 @@ type PerformanceApplicationForm struct { | @@ -12,6 +12,7 @@ type PerformanceApplicationForm struct { | ||
12 | Standard string //标准 | 12 | Standard string //标准 |
13 | Task string //任务、指标 | 13 | Task string //任务、指标 |
14 | Definition string //定义 | 14 | Definition string //定义 |
15 | + Required string // 是否必填 是 否 | ||
15 | } | 16 | } |
16 | 17 | ||
17 | type PerformanceDimension struct { | 18 | type PerformanceDimension struct { |
@@ -24,6 +25,7 @@ type PerformanceModule struct { | @@ -24,6 +25,7 @@ type PerformanceModule struct { | ||
24 | Weight string `json:"weight"` //权重 | 25 | Weight string `json:"weight"` //权重 |
25 | Standard string `json:"standard"` //标准(结构化的成果描述) | 26 | Standard string `json:"standard"` //标准(结构化的成果描述) |
26 | Target []*PerformanceTarget `json:"performanceTarget"` //任务\指标 | 27 | Target []*PerformanceTarget `json:"performanceTarget"` //任务\指标 |
28 | + Required int `json:"required"` // 是否必填 | ||
27 | } | 29 | } |
28 | 30 | ||
29 | type PerformanceTarget struct { | 31 | type PerformanceTarget struct { |
@@ -34,6 +36,7 @@ type PerformanceTarget struct { | @@ -34,6 +36,7 @@ type PerformanceTarget struct { | ||
34 | func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) { | 36 | func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) { |
35 | formRows := make([]*PerformanceApplicationForm, 0) | 37 | formRows := make([]*PerformanceApplicationForm, 0) |
36 | var dimensionName, moduleName, taskName, weightName, standardName string | 38 | var dimensionName, moduleName, taskName, weightName, standardName string |
39 | + required := "是" | ||
37 | for key, item := range rows { | 40 | for key, item := range rows { |
38 | if key < 3 { | 41 | if key < 3 { |
39 | continue | 42 | continue |
@@ -80,6 +83,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) | @@ -80,6 +83,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) | ||
80 | } | 83 | } |
81 | } | 84 | } |
82 | form.Standard = standardName | 85 | form.Standard = standardName |
86 | + //是否必填 | ||
87 | + if len(item) > 9 && item[9] != "" { | ||
88 | + required = strings.TrimSpace(item[9]) | ||
89 | + } | ||
90 | + form.Required = required | ||
83 | formRows = append(formRows, form) | 91 | formRows = append(formRows, form) |
84 | } | 92 | } |
85 | dimensions := make([]*PerformanceDimension, 0) | 93 | dimensions := make([]*PerformanceDimension, 0) |
@@ -144,11 +152,16 @@ func loadPerformanceModule(forms []*PerformanceApplicationForm) ([]*PerformanceM | @@ -144,11 +152,16 @@ func loadPerformanceModule(forms []*PerformanceApplicationForm) ([]*PerformanceM | ||
144 | if err != nil { | 152 | if err != nil { |
145 | return modules, err | 153 | return modules, err |
146 | } | 154 | } |
155 | + required, err := getRequired(item) | ||
156 | + if err != nil { | ||
157 | + return modules, err | ||
158 | + } | ||
147 | module := &PerformanceModule{ | 159 | module := &PerformanceModule{ |
148 | ModuleName: moduleName, | 160 | ModuleName: moduleName, |
149 | Weight: weightName, | 161 | Weight: weightName, |
150 | Standard: standardName, | 162 | Standard: standardName, |
151 | Target: tasks, | 163 | Target: tasks, |
164 | + Required: required, | ||
152 | } | 165 | } |
153 | modules = append(modules, module) | 166 | modules = append(modules, module) |
154 | } | 167 | } |
@@ -201,6 +214,27 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { | @@ -201,6 +214,27 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { | ||
201 | return name, nil | 214 | return name, nil |
202 | } | 215 | } |
203 | 216 | ||
217 | +// 获取是否必填 | ||
218 | +func getRequired(items []*PerformanceApplicationForm) (int, error) { | ||
219 | + if len(items) <= 0 { | ||
220 | + return NodeRequiredYes, nil | ||
221 | + } | ||
222 | + var name string | ||
223 | + for _, item := range items { | ||
224 | + if name == "" { | ||
225 | + name = item.Required | ||
226 | + } | ||
227 | + if name != item.Required { | ||
228 | + return NodeRequiredYes, errors.New(item.ModuleName + " 对应的是否必填不一致") | ||
229 | + } | ||
230 | + } | ||
231 | + if name == "否" { | ||
232 | + return NodeRequiredNo, nil | ||
233 | + } else { | ||
234 | + return NodeRequiredYes, nil | ||
235 | + } | ||
236 | +} | ||
237 | + | ||
204 | // 获取任务 | 238 | // 获取任务 |
205 | func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { | 239 | func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) { |
206 | tasks := make([]*PerformanceTarget, 0) | 240 | tasks := make([]*PerformanceTarget, 0) |
@@ -297,16 +297,19 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | @@ -297,16 +297,19 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | ||
297 | t_department as ( | 297 | t_department as ( |
298 | select department.id::text as depart_id from department where charge_user_ids @>'[%d]' | 298 | select department.id::text as depart_id from department where charge_user_ids @>'[%d]' |
299 | ), | 299 | ), |
300 | + -- 部门主管 | ||
300 | t_user_1 as ( | 301 | t_user_1 as ( |
301 | select t_user_department.user_id::text from t_user_department | 302 | select t_user_department.user_id::text from t_user_department |
302 | join t_department on t_user_department.depart_id = t_department.depart_id | 303 | join t_department on t_user_department.depart_id = t_department.depart_id |
303 | ), | 304 | ), |
305 | + -- 如果是hrbp | ||
304 | t_project_1 as( | 306 | t_project_1 as( |
305 | select evaluation_project.id as project_id | 307 | select evaluation_project.id as project_id |
306 | from evaluation_project | 308 | from evaluation_project |
307 | where evaluation_project.cycle_id =%d | 309 | where evaluation_project.cycle_id =%d |
308 | and evaluation_project.hr_bp = %d | 310 | and evaluation_project.hr_bp = %d |
309 | ), | 311 | ), |
312 | + -- 如果的项目管理员 | ||
310 | t_project_2 as( | 313 | t_project_2 as( |
311 | select evaluation_project.id as project_id | 314 | select evaluation_project.id as project_id |
312 | from evaluation_project | 315 | from evaluation_project |
@@ -314,11 +317,13 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | @@ -314,11 +317,13 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | ||
314 | and evaluation_project.pmp =1 | 317 | and evaluation_project.pmp =1 |
315 | and evaluation_project.pmp_ids @>'["%d"]' | 318 | and evaluation_project.pmp_ids @>'["%d"]' |
316 | ), | 319 | ), |
320 | + -- 合并数据 | ||
317 | t_project_3 as ( | 321 | t_project_3 as ( |
318 | select t_project_2.project_id from t_project_2 | 322 | select t_project_2.project_id from t_project_2 |
319 | union | 323 | union |
320 | select t_project_1.project_id from t_project_1 | 324 | select t_project_1.project_id from t_project_1 |
321 | ), | 325 | ), |
326 | + -- 初步过滤数据 | ||
322 | t_staff_assess_0 as ( | 327 | t_staff_assess_0 as ( |
323 | select staff_assess.id as assess_id, | 328 | select staff_assess.id as assess_id, |
324 | staff_assess.target_user->>'userId' as target_user_id, | 329 | staff_assess.target_user->>'userId' as target_user_id, |
@@ -330,6 +335,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | @@ -330,6 +335,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | ||
330 | and to_char(staff_assess.begin_time,'YYYY-MM-DD')='%s' | 335 | and to_char(staff_assess.begin_time,'YYYY-MM-DD')='%s' |
331 | and staff_assess."types" ='self' | 336 | and staff_assess."types" ='self' |
332 | ), | 337 | ), |
338 | + -- 根据查看权限过滤合并数据 | ||
333 | t_staff_assess_1 as ( | 339 | t_staff_assess_1 as ( |
334 | (select t_staff_assess_0.assess_id, | 340 | (select t_staff_assess_0.assess_id, |
335 | t_staff_assess_0.target_user_id, | 341 | t_staff_assess_0.target_user_id, |
@@ -411,7 +417,7 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa | @@ -411,7 +417,7 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa | ||
411 | 417 | ||
412 | type AssessCycleDayMe struct { | 418 | type AssessCycleDayMe struct { |
413 | BeginDay string `json:"beginDay"` | 419 | BeginDay string `json:"beginDay"` |
414 | - CycleId int `json:"cycleId"` | 420 | + CycleId string `json:"cycleId"` |
415 | CycleName string `json:"cycleName"` | 421 | CycleName string `json:"cycleName"` |
416 | } | 422 | } |
417 | 423 |
@@ -121,7 +121,7 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf | @@ -121,7 +121,7 @@ func (controller *ImportController) parseTemplateNodeContent(data []*domain.Perf | ||
121 | } | 121 | } |
122 | 122 | ||
123 | // 必填项 | 123 | // 必填项 |
124 | - nc.Required = domain.NodeRequiredYes | 124 | + nc.Required = module.Required |
125 | nodeContents = append(nodeContents, nc) | 125 | nodeContents = append(nodeContents, nc) |
126 | } | 126 | } |
127 | } | 127 | } |
@@ -110,9 +110,42 @@ func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() { | @@ -110,9 +110,42 @@ func (c *StaffAssessControllerV2) GetAssessTargetUserSelfInfo() { | ||
110 | c.Response(nil, e) | 110 | c.Response(nil, e) |
111 | return | 111 | return |
112 | } | 112 | } |
113 | - // paramReq.CompanyId = 1 | ||
114 | userReq := middlewares.GetUser(c.Ctx) | 113 | userReq := middlewares.GetUser(c.Ctx) |
115 | paramReq.CompanyId = int(userReq.CompanyId) | 114 | paramReq.CompanyId = int(userReq.CompanyId) |
116 | data, err := srv.GetAssessSelfInfoV2(paramReq) | 115 | data, err := srv.GetAssessSelfInfoV2(paramReq) |
117 | c.Response(data, err) | 116 | c.Response(data, err) |
118 | } | 117 | } |
118 | + | ||
119 | +// 获取当前登录员工自评详情 | ||
120 | +func (c *StaffAssessControllerV2) GetAssessSelfMeInfo() { | ||
121 | + srv := service.NewStaffAssessServeice() | ||
122 | + paramReq := &query.GetExecutorSelfAssessQuery{} | ||
123 | + err := c.BindJSON(paramReq) | ||
124 | + if err != nil { | ||
125 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
126 | + c.Response(nil, e) | ||
127 | + return | ||
128 | + } | ||
129 | + userReq := middlewares.GetUser(c.Ctx) | ||
130 | + paramReq.CompanyId = int(userReq.CompanyId) | ||
131 | + paramReq.TargetUserId = int(userReq.UserId) | ||
132 | + data, err := srv.GetAssessSelfInfoV2(paramReq) | ||
133 | + c.Response(data, err) | ||
134 | +} | ||
135 | + | ||
136 | +// 被评估的员工的评估列表-360评估 | ||
137 | +func (c *StaffAssessControllerV2) ListTargetUserInviteAssess() { | ||
138 | + srv := service.NewStaffAssessServeice() | ||
139 | + paramReq := &query.ListTargetAssessQuery{} | ||
140 | + err := c.BindJSON(paramReq) | ||
141 | + if err != nil { | ||
142 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
143 | + c.Response(nil, e) | ||
144 | + return | ||
145 | + } | ||
146 | + | ||
147 | + userReq := middlewares.GetUser(c.Ctx) | ||
148 | + paramReq.CompanyId = int(userReq.CompanyId) | ||
149 | + data, err := srv.ListTargetUserInviteAssess(paramReq) | ||
150 | + c.Response(data, err) | ||
151 | +} |
@@ -18,7 +18,7 @@ func init() { | @@ -18,7 +18,7 @@ func init() { | ||
18 | web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表 | 18 | web.NSCtrlPost("/cycle/day/content", (*controllers.StaffAssessController).ListAssessContentCycleDay), //根据周期里的考核日期,获取员工填写评估内容列表 |
19 | web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表 | 19 | web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表 |
20 | ) | 20 | ) |
21 | - // /v1/staff-assess/self/me/list | 21 | + |
22 | assessNS := web.NewNamespace("/v1/staff-assess", | 22 | assessNS := web.NewNamespace("/v1/staff-assess", |
23 | web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()), | 23 | web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()), |
24 | web.NSCtrlPost("/self/me/list", (*controllers.StaffAssessController).AssessSelfMeList), //获取我的自评反馈列表 | 24 | web.NSCtrlPost("/self/me/list", (*controllers.StaffAssessController).AssessSelfMeList), //获取我的自评反馈列表 |
@@ -48,6 +48,7 @@ func init() { | @@ -48,6 +48,7 @@ func init() { | ||
48 | web.NSCtrlPost("/me/execute/supper/list", (*controllers.StaffAssessControllerV2).ListMeSupperAssess), //我要执行的360评估的用户列表 | 48 | web.NSCtrlPost("/me/execute/supper/list", (*controllers.StaffAssessControllerV2).ListMeSupperAssess), //我要执行的360评估的用户列表 |
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("/self/me/info", (*controllers.StaffAssessControllerV2).GetAssessSelfMeInfo), //获取当前周期里我的自评反馈详情 | ||
51 | ) | 52 | ) |
52 | 53 | ||
53 | web.AddNamespace(assessTaskNS) | 54 | web.AddNamespace(assessTaskNS) |
templates/.~tpl_template_question.xlsx
0 → 100644
不能预览此文件类型
-
请 注册 或 登录 后发表评论