...
|
...
|
@@ -1196,6 +1196,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
nowTime := time.Now().Unix()
|
|
|
for _, val := range taskListData {
|
|
|
tk := adapter.TaskItem{
|
|
|
Id: val.TaskId,
|
...
|
...
|
@@ -1208,6 +1209,36 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
|
|
Anomaly: val.Anomaly,
|
|
|
WarnFlag: 0,
|
|
|
LastStage: adapter.TaskStage{
|
|
|
Id: val.LastStage.Id,
|
|
|
Name: val.LastStage.Name,
|
|
|
StatusDescription: val.LastStage.StatusDescription(),
|
|
|
SortBy: val.LastStage.SortBy,
|
|
|
PlanCompletedAt: time.Unix(int64(val.LastStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
RealCompletedAt: "",
|
|
|
IsRef: false,
|
|
|
},
|
|
|
CurrentStage: adapter.TaskStage{
|
|
|
Id: val.CurrentStage.Id,
|
|
|
Name: val.CurrentStage.Name,
|
|
|
StatusDescription: val.CurrentStage.StatusDescription(),
|
|
|
SortBy: val.CurrentStage.SortBy,
|
|
|
PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
RealCompletedAt: "",
|
|
|
IsRef: false,
|
|
|
},
|
|
|
}
|
|
|
if val.LastStage.RealCompletedAt > 0 {
|
|
|
tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.CurrentStage.RealCompletedAt > 0 {
|
|
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
}
|
|
|
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
}
|
|
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
|
|
"taskId": val.TaskId,
|
...
|
...
|
@@ -1215,7 +1246,6 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务里程碑"+err.Error())
|
|
|
}
|
|
|
|
|
|
for _, val2 := range stageList {
|
|
|
stage := adapter.TaskStage{
|
|
|
Id: val2.Id,
|
...
|
...
|
@@ -1308,6 +1338,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
|
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
nowTime := time.Now().Unix()
|
|
|
for _, val := range taskListData {
|
|
|
tk := adapter.TaskItem{
|
|
|
Id: val.TaskId,
|
...
|
...
|
@@ -1320,6 +1351,36 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
|
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
|
|
Anomaly: val.Anomaly,
|
|
|
WarnFlag: 0,
|
|
|
LastStage: adapter.TaskStage{
|
|
|
Id: val.LastStage.Id,
|
|
|
Name: val.LastStage.Name,
|
|
|
StatusDescription: val.LastStage.StatusDescription(),
|
|
|
SortBy: val.LastStage.SortBy,
|
|
|
PlanCompletedAt: time.Unix(int64(val.LastStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
RealCompletedAt: "",
|
|
|
IsRef: false,
|
|
|
},
|
|
|
CurrentStage: adapter.TaskStage{
|
|
|
Id: val.CurrentStage.Id,
|
|
|
Name: val.CurrentStage.Name,
|
|
|
StatusDescription: val.CurrentStage.StatusDescription(),
|
|
|
SortBy: val.CurrentStage.SortBy,
|
|
|
PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
RealCompletedAt: "",
|
|
|
IsRef: false,
|
|
|
},
|
|
|
}
|
|
|
if val.LastStage.RealCompletedAt > 0 {
|
|
|
tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.CurrentStage.RealCompletedAt > 0 {
|
|
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
}
|
|
|
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
}
|
|
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
|
|
"taskId": val.TaskId,
|
...
|
...
|
|