正在显示
4 个修改的文件
包含
14 行增加
和
11 行删除
| @@ -7,7 +7,7 @@ type TaskInfoAdapter struct { | @@ -7,7 +7,7 @@ type TaskInfoAdapter struct { | ||
| 7 | LeaderId int64 `json:"leaderId,string"` // | 7 | LeaderId int64 `json:"leaderId,string"` // |
| 8 | Leader UserData `json:"leader"` // 任务负责人 | 8 | Leader UserData `json:"leader"` // 任务负责人 |
| 9 | Status int `json:"status"` // 任务的状态 | 9 | Status int `json:"status"` // 任务的状态 |
| 10 | - StatusDescript string `json:"statusDescript"` // | 10 | + StatusDescription string `json:"statusDescription"` // |
| 11 | Level int `json:"level"` // 优先级,值越小优先级越高 | 11 | Level int `json:"level"` // 优先级,值越小优先级越高 |
| 12 | LevalName string `json:"levalName"` // 优先级名称 | 12 | LevalName string `json:"levalName"` // 优先级名称 |
| 13 | RelatedUserId []string `json:"relatedUserId"` // 相关的员工id | 13 | RelatedUserId []string `json:"relatedUserId"` // 相关的员工id |
| @@ -24,7 +24,7 @@ type UserData struct { | @@ -24,7 +24,7 @@ type UserData struct { | ||
| 24 | type TaskStage struct { | 24 | type TaskStage struct { |
| 25 | Id int `json:"id,string"` | 25 | Id int `json:"id,string"` |
| 26 | Name string `json:"name"` //里程碑名称 | 26 | Name string `json:"name"` //里程碑名称 |
| 27 | - StatusDescript string `json:"statusDescript"` //里程碑的完成情况 | 27 | + StatusDescription string `json:"statusDescription"` //里程碑的完成情况 |
| 28 | Status int `json:"status"` //里程碑状态 | 28 | Status int `json:"status"` //里程碑状态 |
| 29 | SortBy int `json:"sortBy"` | 29 | SortBy int `json:"sortBy"` |
| 30 | PlanCompletedAt string `json:"planCompletedAt"` //计划完成时间, 例:2006-01-02 | 30 | PlanCompletedAt string `json:"planCompletedAt"` //计划完成时间, 例:2006-01-02 |
| @@ -339,7 +339,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task | @@ -339,7 +339,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task | ||
| 339 | Name: taskData.Leader.Name, | 339 | Name: taskData.Leader.Name, |
| 340 | }, | 340 | }, |
| 341 | Status: int(taskData.Status), | 341 | Status: int(taskData.Status), |
| 342 | - StatusDescript: taskData.StatusDescript(), | 342 | + StatusDescription: taskData.StatusDescription(), |
| 343 | Level: taskData.Level, | 343 | Level: taskData.Level, |
| 344 | LevalName: taskData.LevelName, | 344 | LevalName: taskData.LevelName, |
| 345 | RelatedUserId: []string{}, | 345 | RelatedUserId: []string{}, |
| @@ -371,7 +371,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task | @@ -371,7 +371,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task | ||
| 371 | PlanCompletedAt: t1, | 371 | PlanCompletedAt: t1, |
| 372 | RealCompletedAt: t2, | 372 | RealCompletedAt: t2, |
| 373 | SortBy: val.SortBy, | 373 | SortBy: val.SortBy, |
| 374 | - StatusDescript: val.StatusDescript(), | 374 | + StatusDescription: val.StatusDescription(), |
| 375 | Status: int(val.Status), | 375 | Status: int(val.Status), |
| 376 | }) | 376 | }) |
| 377 | } | 377 | } |
| @@ -533,7 +533,7 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte | @@ -533,7 +533,7 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte | ||
| 533 | stage := adapter.TaskStage{ | 533 | stage := adapter.TaskStage{ |
| 534 | Id: val.Id, | 534 | Id: val.Id, |
| 535 | Name: val.Name, | 535 | Name: val.Name, |
| 536 | - StatusDescript: val.StatusDescript(), | 536 | + StatusDescription: val.StatusDescription(), |
| 537 | Status: int(val.Status), | 537 | Status: int(val.Status), |
| 538 | SortBy: val.SortBy, | 538 | SortBy: val.SortBy, |
| 539 | } | 539 | } |
| @@ -638,6 +638,7 @@ func (t TaskService) ListTask2(param command.SearchTaskCommand) (map[string]inte | @@ -638,6 +638,7 @@ func (t TaskService) ListTask2(param command.SearchTaskCommand) (map[string]inte | ||
| 638 | return nil, nil | 638 | return nil, nil |
| 639 | } | 639 | } |
| 640 | 640 | ||
| 641 | +// 以hrbp角色权限获取任务列表 | ||
| 641 | func (t TaskService) ListTask2ForHrbp(param command.SearchTaskCommand) (map[string]interface{}, error) { | 642 | func (t TaskService) ListTask2ForHrbp(param command.SearchTaskCommand) (map[string]interface{}, error) { |
| 642 | return nil, nil | 643 | return nil, nil |
| 643 | } | 644 | } |
| @@ -36,6 +36,7 @@ type TaskLeader struct { | @@ -36,6 +36,7 @@ type TaskLeader struct { | ||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | // 设置任务的优先级 | 38 | // 设置任务的优先级 |
| 39 | +// 值越小优先级越高,不是预定义的任务优先级,排在最后 | ||
| 39 | func (t *Task) ApplyLevelName(name string) { | 40 | func (t *Task) ApplyLevelName(name string) { |
| 40 | t.LevelName = name | 41 | t.LevelName = name |
| 41 | switch name { | 42 | switch name { |
| @@ -51,7 +52,7 @@ func (t *Task) ApplyLevelName(name string) { | @@ -51,7 +52,7 @@ func (t *Task) ApplyLevelName(name string) { | ||
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | // StatusDescript | 54 | // StatusDescript |
| 54 | -func (t *Task) StatusDescript() string { | 55 | +func (t *Task) StatusDescription() string { |
| 55 | switch t.Status { | 56 | switch t.Status { |
| 56 | case TaskWait: | 57 | case TaskWait: |
| 57 | return "待启动" | 58 | return "待启动" |
| @@ -6,8 +6,8 @@ type TaskStageState int | @@ -6,8 +6,8 @@ type TaskStageState int | ||
| 6 | 6 | ||
| 7 | const ( | 7 | const ( |
| 8 | TaskStageUncompleted TaskStageState = 1 //里程碑未完成 | 8 | TaskStageUncompleted TaskStageState = 1 //里程碑未完成 |
| 9 | - TaskStageCompletedOverdue TaskStageState = 2 //里程碑逾期完成 | ||
| 10 | - TaskStageCompleted TaskStageState = 3 //里程碑完成 | 9 | + // TaskStageCompletedOverdue TaskStageState = 2 //里程碑逾期完成 |
| 10 | + TaskStageCompleted TaskStageState = 2 //里程碑完成 | ||
| 11 | 11 | ||
| 12 | ) | 12 | ) |
| 13 | 13 | ||
| @@ -32,7 +32,7 @@ type TaskStageRepository interface { | @@ -32,7 +32,7 @@ type TaskStageRepository interface { | ||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | // 描述里程碑完成情况 | 34 | // 描述里程碑完成情况 |
| 35 | -func (t TaskStage) StatusDescript() string { | 35 | +func (t TaskStage) StatusDescription() string { |
| 36 | nowDay := time.Now().Format("2006-01-02") | 36 | nowDay := time.Now().Format("2006-01-02") |
| 37 | nowTime, _ := time.ParseInLocation("2006-01-02", nowDay, time.Local) | 37 | nowTime, _ := time.ParseInLocation("2006-01-02", nowDay, time.Local) |
| 38 | 38 | ||
| @@ -45,10 +45,11 @@ func (t TaskStage) StatusDescript() string { | @@ -45,10 +45,11 @@ func (t TaskStage) StatusDescript() string { | ||
| 45 | str = "未完成" | 45 | str = "未完成" |
| 46 | } | 46 | } |
| 47 | case TaskStageCompleted: | 47 | case TaskStageCompleted: |
| 48 | + if t.PlanCompletedAt >= t.RealCompletedAt { | ||
| 48 | str = "已完成" | 49 | str = "已完成" |
| 49 | - case TaskStageCompletedOverdue: | 50 | + } else { |
| 50 | str = "逾期完成" | 51 | str = "逾期完成" |
| 51 | } | 52 | } |
| 52 | - | 53 | + } |
| 53 | return str | 54 | return str |
| 54 | } | 55 | } |
-
请 注册 或 登录 后发表评论