正在显示
8 个修改的文件
包含
67 行增加
和
18 行删除
| @@ -30,8 +30,8 @@ type EvaluationSuperItemAdapter struct { | @@ -30,8 +30,8 @@ type EvaluationSuperItemAdapter struct { | ||
| 30 | 30 | ||
| 31 | // 人资稽查-页面列表展示 | 31 | // 人资稽查-页面列表展示 |
| 32 | type EvaluationItemAdapter2 struct { | 32 | type EvaluationItemAdapter2 struct { |
| 33 | - EvaluationId int `json:"evaluationId"` // 周期评估id | ||
| 34 | - CycleId int `json:"cycleId"` // 周期id | 33 | + EvaluationId int `json:"evaluationId,string"` // 周期评估id |
| 34 | + CycleId int `json:"cycleId,string"` // 周期id | ||
| 35 | TargetUserId int `json:"targetUserId,string"` // 目标用户ID | 35 | TargetUserId int `json:"targetUserId,string"` // 目标用户ID |
| 36 | TargetUserName string `json:"targetUserName"` // 目标用户名称 | 36 | TargetUserName string `json:"targetUserName"` // 目标用户名称 |
| 37 | Department string `json:"departmentVal"` // 部门(拼接文本) | 37 | Department string `json:"departmentVal"` // 部门(拼接文本) |
| @@ -8,7 +8,6 @@ import ( | @@ -8,7 +8,6 @@ import ( | ||
| 8 | "github.com/linmadan/egglib-go/core/application" | 8 | "github.com/linmadan/egglib-go/core/application" |
| 9 | "github.com/linmadan/egglib-go/utils/tool_funs" | 9 | "github.com/linmadan/egglib-go/utils/tool_funs" |
| 10 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" | 10 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" |
| 11 | - roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role" | ||
| 12 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter" | 11 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter" |
| 13 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command" | 12 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command" |
| 14 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" | 13 | "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" |
| @@ -28,14 +27,14 @@ func (srv *SummaryEvaluationService) ListEvaluationShow1(param command.QueryEval | @@ -28,14 +27,14 @@ func (srv *SummaryEvaluationService) ListEvaluationShow1(param command.QueryEval | ||
| 28 | _ = transactionContext.RollbackTransaction() | 27 | _ = transactionContext.RollbackTransaction() |
| 29 | }() | 28 | }() |
| 30 | 29 | ||
| 31 | - // 必须是HRBP权限的人才能编辑操作 | ||
| 32 | - hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.UserId) | ||
| 33 | - if err != nil { | ||
| 34 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 35 | - } | ||
| 36 | - if hrbp != domain.RoleTypeSystem { | ||
| 37 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | ||
| 38 | - } | 30 | + // // 必须是HRBP权限的人才能编辑操作 |
| 31 | + // hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.UserId) | ||
| 32 | + // if err != nil { | ||
| 33 | + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
| 34 | + // } | ||
| 35 | + // if hrbp != domain.RoleTypeSystem { | ||
| 36 | + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | ||
| 37 | + // } | ||
| 39 | 38 | ||
| 40 | evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext}) | 39 | evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext}) |
| 41 | staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext}) | 40 | staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext}) |
| @@ -222,6 +222,7 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2( | @@ -222,6 +222,7 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2( | ||
| 222 | CreatedAt: time.Now(), | 222 | CreatedAt: time.Now(), |
| 223 | UpdatedAt: time.Now(), | 223 | UpdatedAt: time.Now(), |
| 224 | DeletedAt: nil, | 224 | DeletedAt: nil, |
| 225 | + Version: domain.EvaluationV2, | ||
| 225 | } | 226 | } |
| 226 | 227 | ||
| 227 | for _, val := range projectParam.Recipients { | 228 | for _, val := range projectParam.Recipients { |
| @@ -212,7 +212,15 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri | @@ -212,7 +212,15 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri | ||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | menuList := []adapter.MenuListAdapter{} | 214 | menuList := []adapter.MenuListAdapter{} |
| 215 | - | 215 | + if isHrbp > 0 { |
| 216 | + menuList = append(menuList, adapter.MenuListAdapter{ | ||
| 217 | + CycleId: param.CycleId, | ||
| 218 | + NodeName: "人资稽查", | ||
| 219 | + StatusName: "", | ||
| 220 | + TargetUserId: param.UserId, | ||
| 221 | + Types: "", | ||
| 222 | + }) | ||
| 223 | + } | ||
| 216 | //模块-我的绩效 | 224 | //模块-我的绩效 |
| 217 | menu1 := adapter.MenuListAdapter{ | 225 | menu1 := adapter.MenuListAdapter{ |
| 218 | CycleId: 0, | 226 | CycleId: 0, |
| @@ -453,7 +461,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app | @@ -453,7 +461,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app | ||
| 453 | Status: string(evaluationData.Status), | 461 | Status: string(evaluationData.Status), |
| 454 | CheckResult: string(evaluationData.CheckResult), | 462 | CheckResult: string(evaluationData.CheckResult), |
| 455 | TotalScore: evaluationData.TotalScore, | 463 | TotalScore: evaluationData.TotalScore, |
| 456 | - Version: evaluationData.Version, | 464 | + Version: string(evaluationData.Version), |
| 457 | } | 465 | } |
| 458 | //获取用户信息 | 466 | //获取用户信息 |
| 459 | companyRepo := factory.CreateCompanyRepository(map[string]interface{}{"transactionContext": transactionContext}) | 467 | companyRepo := factory.CreateCompanyRepository(map[string]interface{}{"transactionContext": transactionContext}) |
| @@ -25,12 +25,19 @@ type SummaryEvaluation struct { | @@ -25,12 +25,19 @@ type SummaryEvaluation struct { | ||
| 25 | EndTime time.Time `json:"endTime"` //截止时间 | 25 | EndTime time.Time `json:"endTime"` //截止时间 |
| 26 | TotalScore string `json:"totalScore"` //最终上级评估得分. | 26 | TotalScore string `json:"totalScore"` //最终上级评估得分. |
| 27 | TotalRating []RatingCodeNumber `json:"totalRating"` //汇总各个评级的数量 | 27 | TotalRating []RatingCodeNumber `json:"totalRating"` //汇总各个评级的数量 |
| 28 | - Version string `json:"version"` //填写评估值的规则版本 v1,v2 ,填写方式对应方法 SummaryEvaluation.FillItemValue | 28 | + Version EvaluationVersion `json:"version"` //填写评估值的规则版本 v1,v2 ,填写方式对应方法 SummaryEvaluation.FillItemValue |
| 29 | CreatedAt time.Time `json:"createdAt"` //数据创建时间 | 29 | CreatedAt time.Time `json:"createdAt"` //数据创建时间 |
| 30 | UpdatedAt time.Time `json:"updatedAt"` //数据更新时间 | 30 | UpdatedAt time.Time `json:"updatedAt"` //数据更新时间 |
| 31 | DeletedAt *time.Time `json:"deletedAt"` //数据删除时间 | 31 | DeletedAt *time.Time `json:"deletedAt"` //数据删除时间 |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | +type EvaluationVersion string | ||
| 35 | + | ||
| 36 | +const ( | ||
| 37 | + EvaluationV1 EvaluationVersion = "v1" | ||
| 38 | + EvaluationV2 EvaluationVersion = "v2" | ||
| 39 | +) | ||
| 40 | + | ||
| 34 | // 各个评级的数量 | 41 | // 各个评级的数量 |
| 35 | type RatingCodeNumber struct { | 42 | type RatingCodeNumber struct { |
| 36 | Code string `json:"code"` | 43 | Code string `json:"code"` |
| @@ -147,9 +154,9 @@ func (evaluation *SummaryEvaluation) FillItemValue(item *EvaluationItemUsed, ite | @@ -147,9 +154,9 @@ func (evaluation *SummaryEvaluation) FillItemValue(item *EvaluationItemUsed, ite | ||
| 147 | // 非自评的情况 | 154 | // 非自评的情况 |
| 148 | // 按照版本使用不同的填写规则 | 155 | // 按照版本使用不同的填写规则 |
| 149 | switch evaluation.Version { | 156 | switch evaluation.Version { |
| 150 | - case "v1": | 157 | + case EvaluationV1: |
| 151 | itemValue.FillValue(item, value, "") | 158 | itemValue.FillValue(item, value, "") |
| 152 | - case "v2": | 159 | + case EvaluationV2: |
| 153 | itemValue.FillValueV2(item, value) | 160 | itemValue.FillValueV2(item, value) |
| 154 | default: | 161 | default: |
| 155 | itemValue.FillValue(item, value, "") | 162 | itemValue.FillValue(item, value, "") |
| @@ -36,7 +36,7 @@ func (repo *SummaryEvaluationRepository) TransformToDomain(d *models.SummaryEval | @@ -36,7 +36,7 @@ func (repo *SummaryEvaluationRepository) TransformToDomain(d *models.SummaryEval | ||
| 36 | Types: domain.EvaluationType(d.Types), | 36 | Types: domain.EvaluationType(d.Types), |
| 37 | Status: domain.EvaluationStatus(d.Status), | 37 | Status: domain.EvaluationStatus(d.Status), |
| 38 | CheckResult: domain.EvaluationCheckResult(d.CheckResult), | 38 | CheckResult: domain.EvaluationCheckResult(d.CheckResult), |
| 39 | - Version: d.Version, | 39 | + Version: domain.EvaluationVersion(d.Version), |
| 40 | BeginTime: d.BeginTime, | 40 | BeginTime: d.BeginTime, |
| 41 | EndTime: d.EndTime, | 41 | EndTime: d.EndTime, |
| 42 | TotalScore: d.TotalScore, | 42 | TotalScore: d.TotalScore, |
| @@ -62,7 +62,7 @@ func (repo *SummaryEvaluationRepository) Save(param *domain.SummaryEvaluation) e | @@ -62,7 +62,7 @@ func (repo *SummaryEvaluationRepository) Save(param *domain.SummaryEvaluation) e | ||
| 62 | Types: int(param.Types), | 62 | Types: int(param.Types), |
| 63 | Status: string(param.Status), | 63 | Status: string(param.Status), |
| 64 | CheckResult: string(param.CheckResult), | 64 | CheckResult: string(param.CheckResult), |
| 65 | - Version: param.Version, | 65 | + Version: string(param.Version), |
| 66 | BeginTime: param.BeginTime, | 66 | BeginTime: param.BeginTime, |
| 67 | EndTime: param.EndTime, | 67 | EndTime: param.EndTime, |
| 68 | TotalScore: param.TotalScore, | 68 | TotalScore: param.TotalScore, |
| @@ -496,3 +496,35 @@ func (c *SummaryEvaluationController) ListCycle() { | @@ -496,3 +496,35 @@ func (c *SummaryEvaluationController) ListCycle() { | ||
| 496 | data, err := srv.ListCycle(companyId) | 496 | data, err := srv.ListCycle(companyId) |
| 497 | c.Response(data, err) | 497 | c.Response(data, err) |
| 498 | } | 498 | } |
| 499 | + | ||
| 500 | +// 获取人资稽查的操作列表 | ||
| 501 | +func (c *SummaryEvaluationController) ListEvaluationHrCheck() { | ||
| 502 | + srv := service.NewSummaryEvaluationService() | ||
| 503 | + param := command.QueryEvaluationList{} | ||
| 504 | + err := c.BindJSON(¶m) | ||
| 505 | + if err != nil { | ||
| 506 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
| 507 | + c.Response(nil, e) | ||
| 508 | + return | ||
| 509 | + } | ||
| 510 | + userReq := middlewares.GetUser(c.Ctx) | ||
| 511 | + param.CompanyId = int(userReq.CompanyId) | ||
| 512 | + data, err := srv.ListEvaluationShow1(param) | ||
| 513 | + c.Response(data, err) | ||
| 514 | +} | ||
| 515 | + | ||
| 516 | +// 获取人资稽查的列表详情 | ||
| 517 | +func (c *SummaryEvaluationController) InfoEvaluationHrCheck() { | ||
| 518 | + srv := service.NewSummaryEvaluationService() | ||
| 519 | + param := command.QueryEvaluation{} | ||
| 520 | + err := c.BindJSON(¶m) | ||
| 521 | + if err != nil { | ||
| 522 | + e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error()) | ||
| 523 | + c.Response(nil, e) | ||
| 524 | + return | ||
| 525 | + } | ||
| 526 | + userReq := middlewares.GetUser(c.Ctx) | ||
| 527 | + param.CompanyId = int(userReq.CompanyId) | ||
| 528 | + data, err := srv.GetEvaluationShow1(param) | ||
| 529 | + c.Response(data, err) | ||
| 530 | +} |
| @@ -36,6 +36,8 @@ func init() { | @@ -36,6 +36,8 @@ func init() { | ||
| 36 | web.NSCtrlPost("/evaluation-finish/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationFinish), | 36 | web.NSCtrlPost("/evaluation-finish/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationFinish), |
| 37 | web.NSCtrlGet("/evaluation-self/now", (*controllers.SummaryEvaluationController).ListExecutorEvaluationSelf), | 37 | web.NSCtrlGet("/evaluation-self/now", (*controllers.SummaryEvaluationController).ListExecutorEvaluationSelf), |
| 38 | web.NSCtrlPost("/staff_assess/self/remark", (*controllers.SummaryEvaluationController).SearchAssessRemark), | 38 | web.NSCtrlPost("/staff_assess/self/remark", (*controllers.SummaryEvaluationController).SearchAssessRemark), |
| 39 | + web.NSCtrlPost("/evaluation/hr-check/list", (*controllers.SummaryEvaluationController).ListEvaluationHrCheck), | ||
| 40 | + web.NSCtrlPost("/evaluation/hr-check/info", (*controllers.SummaryEvaluationController).InfoEvaluationHrCheck), | ||
| 39 | ) | 41 | ) |
| 40 | web.AddNamespace(summaryNS) | 42 | web.AddNamespace(summaryNS) |
| 41 | summaryV2 := web.NewNamespace("/v2/summary-evaluation", | 43 | summaryV2 := web.NewNamespace("/v2/summary-evaluation", |
-
请 注册 或 登录 后发表评论