...
|
...
|
@@ -14,7 +14,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
|
|
)
|
|
|
|
|
|
//获取我的项目周期列表
|
|
|
// 获取我的项目周期列表
|
|
|
func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQuery) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -63,7 +63,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ |
|
|
return tool_funs.SimpleWrapGridMap(int64(cnt), listData), nil
|
|
|
}
|
|
|
|
|
|
//获取我的项目周期进度描述
|
|
|
// 获取我的项目周期进度描述
|
|
|
func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Query) (*adapter.AssessCycleDescResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que |
|
|
return &result, nil
|
|
|
}
|
|
|
|
|
|
//根据周期获取,我的自评任务添加的邀请人
|
|
|
// 根据周期获取,我的自评任务添加的邀请人
|
|
|
func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
...
|
...
|
@@ -234,7 +234,12 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUse |
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
companyReps := factory.CreateCompanyRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
companyInfo, _ := companyReps.FindOne(map[string]interface{}{
|
|
|
"id": param.CompanyId,
|
|
|
})
|
|
|
assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
...
|
...
|
@@ -281,11 +286,17 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUse |
|
|
result.EndTime = v.EndTime.Local().Format("2006-01-02 15:04:05")
|
|
|
break
|
|
|
}
|
|
|
companyName := ""
|
|
|
if companyInfo != nil {
|
|
|
companyName = companyInfo.Name
|
|
|
}
|
|
|
for _, v := range assessList {
|
|
|
if v.Types == domain.AssessInviteDiffSuper {
|
|
|
v.Executor.CompanyName = companyName
|
|
|
result.InviteDiffSuper = append(result.InviteDiffSuper, v.Executor)
|
|
|
}
|
|
|
if v.Types == domain.AssessInviteSameSuper {
|
|
|
v.Executor.CompanyName = companyName
|
|
|
result.InviteSameSuper = append(result.InviteSameSuper, v.Executor)
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -309,7 +320,12 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu |
|
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
companyRepo := factory.CreateCompanyRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
companyInfo, _ := companyRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.CompanyId,
|
|
|
})
|
|
|
//获取 executorId 对应的360评估任务 用户
|
|
|
condition := map[string]interface{}{
|
|
|
"beginDay": param.BeginDay,
|
...
|
...
|
@@ -412,6 +428,10 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu |
|
|
}
|
|
|
tableHeader = append(tableHeader, changeableHeader...)
|
|
|
listData := []map[string]interface{}{}
|
|
|
companyName := ""
|
|
|
if companyInfo != nil {
|
|
|
companyName = companyInfo.Name
|
|
|
}
|
|
|
for _, v := range assessList {
|
|
|
m := map[string]interface{}{
|
|
|
"staffAssessTaskId": v.StaffAssessTaskId,
|
...
|
...
|
@@ -423,6 +443,7 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu |
|
|
"types": string(v.Types),
|
|
|
"endTime": v.EndTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"assessId": strconv.Itoa(v.Id),
|
|
|
"companyName": companyName,
|
|
|
}
|
|
|
switch v.Status {
|
|
|
case domain.StaffAssessCompleted:
|
...
|
...
|
@@ -478,6 +499,14 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu |
|
|
assessRepo := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
//公司存储
|
|
|
companyRepo := factory.CreateCompanyRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
companyInfo, _ := companyRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.CompanyId,
|
|
|
})
|
|
|
|
|
|
limit := 20
|
|
|
if param.PageSize > 0 {
|
...
|
...
|
@@ -502,6 +531,7 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
//获取目标用户
|
|
|
userIds := []int{}
|
|
|
for _, v := range assessList {
|
...
|
...
|
@@ -556,10 +586,20 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
|
}
|
|
|
var allAssessId []int
|
|
|
for _, v := range assessList {
|
|
|
allAssessId = append(allAssessId, v.Id)
|
|
|
}
|
|
|
|
|
|
assessValueMap := d.SearchContentValueByAssessId(allAssessId)
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
companyName := ""
|
|
|
if companyInfo != nil {
|
|
|
companyName = companyInfo.Name
|
|
|
}
|
|
|
resultList := []adapter.ListSupperAssessResp{}
|
|
|
for _, v := range assessList {
|
|
|
item := adapter.ListSupperAssessResp{
|
...
|
...
|
@@ -575,7 +615,12 @@ func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecu |
|
|
InviteTotal: 5,
|
|
|
Department: "",
|
|
|
Position: "",
|
|
|
CompanyName: companyName,
|
|
|
DutyTime: "",
|
|
|
ContentValue: []string{},
|
|
|
}
|
|
|
if values, ok := assessValueMap[v.Id]; ok {
|
|
|
item.ContentValue = values
|
|
|
}
|
|
|
//填入部门
|
|
|
for _, vv := range v.TargetDepartment {
|
...
|
...
|
@@ -690,19 +735,21 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
TargetUserName: assessData.TargetUser.UserName,
|
|
|
CompanyId: assessData.CompanyId,
|
|
|
CompanyName: "",
|
|
|
CompanyLogo: "",
|
|
|
SupperUser: "",
|
|
|
DutyTime: "",
|
|
|
AssessContent: assessContentList,
|
|
|
}
|
|
|
if staffDesc != nil {
|
|
|
result.CompanyName = staffDesc.CompanyName
|
|
|
result.CompanyLogo = staffDesc.CompanyLogo
|
|
|
result.SupperUser = staffDesc.SupperUserName
|
|
|
result.DutyTime = staffDesc.DutyTime
|
|
|
}
|
|
|
return &result, nil
|
|
|
}
|
|
|
|
|
|
//根据周期和日期。获取360评估的列表,员工的被其他人评估
|
|
|
// 根据周期和日期。获取360评估的列表,员工的被其他人评估
|
|
|
func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
...
|
...
|
@@ -744,7 +791,7 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge |
|
|
return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
|
|
|
}
|
|
|
|
|
|
//根据周期和日期。获取上级评估的列表,员工的被其他人评估
|
|
|
// 根据周期和日期。获取上级评估的列表,员工的被其他人评估
|
|
|
func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
...
|
...
|
@@ -774,7 +821,7 @@ func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTarget |
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
var resultList []map[string]interface{}
|
|
|
resultList := []map[string]interface{}{}
|
|
|
for _, v := range assessList {
|
|
|
item := map[string]interface{}{
|
|
|
"id": v.Id,
|
...
|
...
|
|