作者 tangxvhui

调整数据输出字段

package adapter
type SelectInviteUser struct {
UserId int `json:"userId,string"`
UserName string `json:"userName"` //
IsSupper bool `json:"isSupper"` // 是否,是直属上级
Types int `json:"types"` // 1:相同上级的同事 2:不相同上级的同事
UserId int `json:"userId,string"`
UserName string `json:"userName"` //
CompanyName string `json:"companyName"` //
IsSupper bool `json:"isSupper"` // 是否,是直属上级
Types int `json:"types"` // 1:相同上级的同事 2:不相同上级的同事
}
... ...
... ... @@ -1121,6 +1121,13 @@ func (srv StaffAssessServeice) SelectAssessInviteUser(param *query.SelectAssessI
userRepo := factory.CreateUserRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
//获取公司信息
companyRepo := factory.CreateCompanyRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
companyInfo, _ := companyRepo.FindOne(map[string]interface{}{
"id": param.CompanyId,
})
targetUser, err := userRepo.FindOne(map[string]interface{}{
"id": param.TargetUserId,
})
... ... @@ -1174,12 +1181,17 @@ func (srv StaffAssessServeice) SelectAssessInviteUser(param *query.SelectAssessI
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
listData := []adapter.SelectInviteUser{}
companyName := ""
if companyInfo != nil {
companyName = companyInfo.Name
}
for _, v := range userList {
item := adapter.SelectInviteUser{
UserId: int(v.Id),
UserName: v.Name,
IsSupper: false,
Types: 2, //默认是不同上级
UserId: int(v.Id),
UserName: v.Name,
CompanyName: companyName,
IsSupper: false,
Types: 2, //默认是不同上级
}
if _, ok := targetUserCharge[v.Id]; ok {
item.IsSupper = true
... ...
... ... @@ -309,7 +309,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 +417,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 +432,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:
... ...
... ... @@ -47,7 +47,7 @@ func (c *StaffAssessControllerV2) AssessTaskMeDesc() {
c.Response(data, err)
}
// 获取我要执行360评估,用户列表和评估填写的值
// 获取我要执行360评估,用户列表和评估填写的值
func (c *StaffAssessControllerV2) ListMeInviteUserAssess() {
srv := service.NewStaffAssessServeice()
paramReq := &query.ListExecutorAssessQuery{}
... ...