正在显示
4 个修改的文件
包含
65 行增加
和
6 行删除
1 | +package adapter | ||
2 | + | ||
3 | +import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" | ||
4 | + | ||
5 | +//评估内容详情 | ||
6 | +type AssessInfoResp struct { | ||
7 | + CycleId int64 `json:"cycleId"` //周期id | ||
8 | + CycleName string `json:"cycleName"` //周期名称 | ||
9 | + EvaluationProjectId int `json:"evaluationProjectId"` //项目id | ||
10 | + EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 | ||
11 | + BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05 | ||
12 | + EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05 | ||
13 | + Status string `json:"status"` //完成状态 | ||
14 | + TargetUserId int `json:"targetUser"` // | ||
15 | + TargetUserName string `json:"targetUserName"` // | ||
16 | + AssessContent []AssessContent `json:"assessContent"` //评估内容 | ||
17 | +} | ||
18 | + | ||
19 | +type AssessContent struct { | ||
20 | + Category string `json:"category" comment:"类别"` | ||
21 | + Name string `json:"name" comment:"名称"` | ||
22 | + PromptTitle string `json:"promptTitle" comment:"提示项标题"` | ||
23 | + PromptText string `json:"promptText" comment:"提示项正文"` | ||
24 | + EntryItems []domain.EntryItem `json:"entryItems" comment:"填写项"` | ||
25 | + RuleId string | ||
26 | +} |
@@ -5,7 +5,7 @@ type AssessTaskDescResp struct { | @@ -5,7 +5,7 @@ type AssessTaskDescResp struct { | ||
5 | EvaluationProjectId int `json:"evaluationProjectId"` //项目id | 5 | EvaluationProjectId int `json:"evaluationProjectId"` //项目id |
6 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 | 6 | EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 |
7 | CycleName string `json:"cycleName"` //周期名称 | 7 | CycleName string `json:"cycleName"` //周期名称 |
8 | - BeginTime string `json:"beginTime"` //开始时间 2006-01-02 | 8 | + BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05 |
9 | EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05 | 9 | EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05 |
10 | StepList []AssessTaskStep `json:"stepList"` // 考评流程 | 10 | StepList []AssessTaskStep `json:"stepList"` // 考评流程 |
11 | } | 11 | } |
@@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( | @@ -255,17 +255,40 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( | ||
255 | } | 255 | } |
256 | 256 | ||
257 | //获取用户数据 | 257 | //获取用户数据 |
258 | - userRep := factory.CreateUserRepository(map[string]interface{}{ | 258 | + userRepo := factory.CreateUserRepository(map[string]interface{}{ |
259 | "transactionContext": transactionContext, | 259 | "transactionContext": transactionContext, |
260 | }) | 260 | }) |
261 | - userData, err := userRep.FindOne(map[string]interface{}{ | 261 | + userData, err := userRepo.FindOne(map[string]interface{}{ |
262 | "id": param.UserId, | 262 | "id": param.UserId, |
263 | }) | 263 | }) |
264 | if err != nil { | 264 | if err != nil { |
265 | log.Logger.Error("获取用户信息," + err.Error()) | 265 | log.Logger.Error("获取用户信息," + err.Error()) |
266 | return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error()) | 266 | return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error()) |
267 | } | 267 | } |
268 | - | 268 | + departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{ |
269 | + "transactionContext": transactionContext, | ||
270 | + }) | ||
271 | + var supperUserList []*domain.User | ||
272 | + if len(userData.DepartmentId) > 0 { | ||
273 | + _, departmentList, err := departmentRepo.Find(map[string]interface{}{ | ||
274 | + "ids": userData.DepartmentId, | ||
275 | + }) | ||
276 | + if err != nil { | ||
277 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error()) | ||
278 | + } | ||
279 | + var chargeUserIds []int64 | ||
280 | + for _, v := range departmentList { | ||
281 | + chargeUserIds = append(chargeUserIds, v.ChargeUserIds...) | ||
282 | + } | ||
283 | + if len(chargeUserIds) > 0 { | ||
284 | + _, supperUserList, err = userRepo.Find(map[string]interface{}{ | ||
285 | + "ids": chargeUserIds, | ||
286 | + }) | ||
287 | + if err != nil { | ||
288 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error()) | ||
289 | + } | ||
290 | + } | ||
291 | + } | ||
269 | if err := transactionContext.CommitTransaction(); err != nil { | 292 | if err := transactionContext.CommitTransaction(); err != nil { |
270 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 293 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
271 | } | 294 | } |
@@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( | @@ -289,6 +312,9 @@ func (srv StaffAssessServeice) AssessSelfList(param query.AssessSelfListQuery) ( | ||
289 | SupperUserName: "", | 312 | SupperUserName: "", |
290 | DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"), | 313 | DutyTime: userData.CreateAt.Local().Format("2006-01-02 15:04:05"), |
291 | } | 314 | } |
315 | + for _, v := range supperUserList { | ||
316 | + userInfo.SupperUserName = userInfo.SupperUserName + v.Name + ";" | ||
317 | + } | ||
292 | result := tool_funs.SimpleWrapGridMap(int64(cnt), listData) | 318 | result := tool_funs.SimpleWrapGridMap(int64(cnt), listData) |
293 | result["userInfo"] = userInfo | 319 | result["userInfo"] = userInfo |
294 | return result, nil | 320 | return result, nil |
@@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error { | @@ -313,7 +339,7 @@ func (srv StaffAssessServeice) CreateStaffAssessTask() error { | ||
313 | return nil | 339 | return nil |
314 | } | 340 | } |
315 | 341 | ||
316 | -func (srv StaffAssessServeice) getStaffDesc(userId int) *domain.StaffDesc { | 342 | +// 获取员工自评详情 |
343 | +func (srv StaffAssessServeice) StaffAssessSelfInfo() { | ||
317 | 344 | ||
318 | - return &domain.StaffDesc{} | ||
319 | } | 345 | } |
-
请 注册 或 登录 后发表评论