...
|
...
|
@@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que |
|
|
}
|
|
|
|
|
|
//根据周期获取,我的自评任务添加的邀请人
|
|
|
func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
|
|
|
func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -240,7 +240,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
|
_, myAssessTask, err := assessTaskRepo.Find(map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"executorId": param.UserId,
|
|
|
"executorId": param.TargetUserId,
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
...
|
...
|
@@ -256,7 +256,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
|
_, assessList, err := assessReps.Find(map[string]interface{}{
|
|
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
|
|
"staffAssessTaskId": assessTaskData.Id,
|
|
|
"targetUserId": param.UserId,
|
|
|
"targetUserId": param.TargetUserId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "获取个人邀请列表"+err.Error())
|
...
|
...
|
@@ -292,7 +292,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
|
}
|
|
|
|
|
|
// 根据周期和日期获取我要执行的的360评估,用户列表和评估填写的值
|
|
|
func (srv StaffAssessServeice) ListExecutorDayInviteAssess(param *query.ListExecutorAssessQuery) (
|
|
|
func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecutorAssessQuery) (
|
|
|
*adapter.ListInviteUserAssessResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -459,7 +459,7 @@ func (srv StaffAssessServeice) ListExecutorDayInviteAssess(param *query.ListExec |
|
|
}
|
|
|
|
|
|
//根据周期和日期获取我需要执行的上级评估成员列表
|
|
|
func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) {
|
|
|
func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -605,3 +605,87 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
//根据周期和日期,获取员工的自评内容
|
|
|
func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfAssessQuery) (*adapter.AssessInfoResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
// 获取员工的评估
|
|
|
_, assessList, err := assessReps.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"executorId": param.ExecutorId,
|
|
|
"cycleId": param.CycleId,
|
|
|
"beginDay": param.BeginDay,
|
|
|
"typesList": []string{string(domain.AssessSelf)},
|
|
|
"limit": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
|
|
|
}
|
|
|
if len(assessList) == 0 {
|
|
|
return &adapter.AssessInfoResp{}, nil
|
|
|
}
|
|
|
assessData := assessList[0]
|
|
|
|
|
|
assessContentList := []*domain.StaffAssessContent{}
|
|
|
if assessData.Status == domain.StaffAssessCompleted {
|
|
|
//已完成
|
|
|
assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, assessContentList, err = assessContentRepo.Find(map[string]interface{}{
|
|
|
"staffAssessId": assessData.Id,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
}
|
|
|
} else if assessData.Status == domain.StaffAssessUncompleted {
|
|
|
//未完成
|
|
|
assessContentList, err = srv.getAssessSelfInfoUncompleted(transactionContext, assessData)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取员工描述
|
|
|
staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.ExecutorId))
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
result := adapter.AssessInfoResp{
|
|
|
AssessId: assessData.Id,
|
|
|
CycleId: assessData.CycleId,
|
|
|
CycleName: assessData.CycleName,
|
|
|
LinkNodeId: assessData.LinkNodeId,
|
|
|
LinkNodeName: assessData.LinkNodeName,
|
|
|
EvaluationProjectId: assessData.EvaluationProjectId,
|
|
|
EvaluationProjectName: assessData.EvaluationProjectName,
|
|
|
BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
EndTime: assessData.EndTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
Status: string(assessData.Status),
|
|
|
TargetUserId: assessData.TargetUser.UserId,
|
|
|
TargetUserName: assessData.TargetUser.UserName,
|
|
|
CompanyId: assessData.CompanyId,
|
|
|
CompanyName: "",
|
|
|
SupperUser: "",
|
|
|
DutyTime: "",
|
|
|
AssessContent: assessContentList,
|
|
|
}
|
|
|
if staffDesc != nil {
|
|
|
result.CompanyName = staffDesc.CompanyName
|
|
|
result.SupperUser = staffDesc.SupperUserName
|
|
|
result.DutyTime = staffDesc.DutyTime
|
|
|
}
|
|
|
return &result, nil
|
|
|
} |
...
|
...
|
|