作者 tangxvhui

调整接口 人资稽查接口

... ... @@ -30,8 +30,8 @@ type EvaluationSuperItemAdapter struct {
// 人资稽查-页面列表展示
type EvaluationItemAdapter2 struct {
EvaluationId int `json:"evaluationId"` // 周期评估id
CycleId int `json:"cycleId"` // 周期id
EvaluationId int `json:"evaluationId,string"` // 周期评估id
CycleId int `json:"cycleId,string"` // 周期id
TargetUserId int `json:"targetUserId,string"` // 目标用户ID
TargetUserName string `json:"targetUserName"` // 目标用户名称
Department string `json:"departmentVal"` // 部门(拼接文本)
... ...
... ... @@ -8,7 +8,6 @@ import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
... ... @@ -28,14 +27,14 @@ func (srv *SummaryEvaluationService) ListEvaluationShow1(param command.QueryEval
_ = transactionContext.RollbackTransaction()
}()
// 必须是HRBP权限的人才能编辑操作
hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.UserId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if hrbp != domain.RoleTypeSystem {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
}
// // 必须是HRBP权限的人才能编辑操作
// hrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.UserId)
// if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// if hrbp != domain.RoleTypeSystem {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
// }
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext})
... ...
... ... @@ -222,6 +222,7 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
DeletedAt: nil,
Version: domain.EvaluationV2,
}
for _, val := range projectParam.Recipients {
... ...
... ... @@ -212,7 +212,15 @@ func (srv *SummaryEvaluationService) GetMenu(param *command.QueryMenu) (map[stri
}
menuList := []adapter.MenuListAdapter{}
if isHrbp > 0 {
menuList = append(menuList, adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "人资稽查",
StatusName: "",
TargetUserId: param.UserId,
Types: "",
})
}
//模块-我的绩效
menu1 := adapter.MenuListAdapter{
CycleId: 0,
... ... @@ -453,7 +461,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
Status: string(evaluationData.Status),
CheckResult: string(evaluationData.CheckResult),
TotalScore: evaluationData.TotalScore,
Version: evaluationData.Version,
Version: string(evaluationData.Version),
}
//获取用户信息
companyRepo := factory.CreateCompanyRepository(map[string]interface{}{"transactionContext": transactionContext})
... ...
... ... @@ -25,12 +25,19 @@ type SummaryEvaluation struct {
EndTime time.Time `json:"endTime"` //截止时间
TotalScore string `json:"totalScore"` //最终上级评估得分.
TotalRating []RatingCodeNumber `json:"totalRating"` //汇总各个评级的数量
Version string `json:"version"` //填写评估值的规则版本 v1,v2 ,填写方式对应方法 SummaryEvaluation.FillItemValue
Version EvaluationVersion `json:"version"` //填写评估值的规则版本 v1,v2 ,填写方式对应方法 SummaryEvaluation.FillItemValue
CreatedAt time.Time `json:"createdAt"` //数据创建时间
UpdatedAt time.Time `json:"updatedAt"` //数据更新时间
DeletedAt *time.Time `json:"deletedAt"` //数据删除时间
}
type EvaluationVersion string
const (
EvaluationV1 EvaluationVersion = "v1"
EvaluationV2 EvaluationVersion = "v2"
)
// 各个评级的数量
type RatingCodeNumber struct {
Code string `json:"code"`
... ... @@ -147,9 +154,9 @@ func (evaluation *SummaryEvaluation) FillItemValue(item *EvaluationItemUsed, ite
// 非自评的情况
// 按照版本使用不同的填写规则
switch evaluation.Version {
case "v1":
case EvaluationV1:
itemValue.FillValue(item, value, "")
case "v2":
case EvaluationV2:
itemValue.FillValueV2(item, value)
default:
itemValue.FillValue(item, value, "")
... ...
... ... @@ -36,7 +36,7 @@ func (repo *SummaryEvaluationRepository) TransformToDomain(d *models.SummaryEval
Types: domain.EvaluationType(d.Types),
Status: domain.EvaluationStatus(d.Status),
CheckResult: domain.EvaluationCheckResult(d.CheckResult),
Version: d.Version,
Version: domain.EvaluationVersion(d.Version),
BeginTime: d.BeginTime,
EndTime: d.EndTime,
TotalScore: d.TotalScore,
... ... @@ -62,7 +62,7 @@ func (repo *SummaryEvaluationRepository) Save(param *domain.SummaryEvaluation) e
Types: int(param.Types),
Status: string(param.Status),
CheckResult: string(param.CheckResult),
Version: param.Version,
Version: string(param.Version),
BeginTime: param.BeginTime,
EndTime: param.EndTime,
TotalScore: param.TotalScore,
... ...
... ... @@ -496,3 +496,35 @@ func (c *SummaryEvaluationController) ListCycle() {
data, err := srv.ListCycle(companyId)
c.Response(data, err)
}
// 获取人资稽查的操作列表
func (c *SummaryEvaluationController) ListEvaluationHrCheck() {
srv := service.NewSummaryEvaluationService()
param := command.QueryEvaluationList{}
err := c.BindJSON(&param)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
param.CompanyId = int(userReq.CompanyId)
data, err := srv.ListEvaluationShow1(param)
c.Response(data, err)
}
// 获取人资稽查的列表详情
func (c *SummaryEvaluationController) InfoEvaluationHrCheck() {
srv := service.NewSummaryEvaluationService()
param := command.QueryEvaluation{}
err := c.BindJSON(&param)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
param.CompanyId = int(userReq.CompanyId)
data, err := srv.GetEvaluationShow1(param)
c.Response(data, err)
}
... ...
... ... @@ -36,6 +36,8 @@ func init() {
web.NSCtrlPost("/evaluation-finish/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationFinish),
web.NSCtrlGet("/evaluation-self/now", (*controllers.SummaryEvaluationController).ListExecutorEvaluationSelf),
web.NSCtrlPost("/staff_assess/self/remark", (*controllers.SummaryEvaluationController).SearchAssessRemark),
web.NSCtrlPost("/evaluation/hr-check/list", (*controllers.SummaryEvaluationController).ListEvaluationHrCheck),
web.NSCtrlPost("/evaluation/hr-check/info", (*controllers.SummaryEvaluationController).InfoEvaluationHrCheck),
)
web.AddNamespace(summaryNS)
summaryV2 := web.NewNamespace("/v2/summary-evaluation",
... ...