|
@@ -1196,6 +1196,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1196,6 +1196,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1196
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
1196
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
1197
|
"transactionContext": transactionContext,
|
1197
|
"transactionContext": transactionContext,
|
1198
|
})
|
1198
|
})
|
|
|
1199
|
+ nowTime := time.Now().Unix()
|
1199
|
for _, val := range taskListData {
|
1200
|
for _, val := range taskListData {
|
1200
|
tk := adapter.TaskItem{
|
1201
|
tk := adapter.TaskItem{
|
1201
|
Id: val.TaskId,
|
1202
|
Id: val.TaskId,
|
|
@@ -1208,6 +1209,36 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1208,6 +1209,36 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1208
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
1209
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
1209
|
Anomaly: val.Anomaly,
|
1210
|
Anomaly: val.Anomaly,
|
1210
|
WarnFlag: 0,
|
1211
|
WarnFlag: 0,
|
|
|
1212
|
+ LastStage: adapter.TaskStage{
|
|
|
1213
|
+ Id: val.LastStage.Id,
|
|
|
1214
|
+ Name: val.LastStage.Name,
|
|
|
1215
|
+ StatusDescription: val.LastStage.StatusDescription(),
|
|
|
1216
|
+ SortBy: val.LastStage.SortBy,
|
|
|
1217
|
+ PlanCompletedAt: time.Unix(int64(val.LastStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
1218
|
+ RealCompletedAt: "",
|
|
|
1219
|
+ IsRef: false,
|
|
|
1220
|
+ },
|
|
|
1221
|
+ CurrentStage: adapter.TaskStage{
|
|
|
1222
|
+ Id: val.CurrentStage.Id,
|
|
|
1223
|
+ Name: val.CurrentStage.Name,
|
|
|
1224
|
+ StatusDescription: val.CurrentStage.StatusDescription(),
|
|
|
1225
|
+ SortBy: val.CurrentStage.SortBy,
|
|
|
1226
|
+ PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
1227
|
+ RealCompletedAt: "",
|
|
|
1228
|
+ IsRef: false,
|
|
|
1229
|
+ },
|
|
|
1230
|
+ }
|
|
|
1231
|
+ if val.LastStage.RealCompletedAt > 0 {
|
|
|
1232
|
+ tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
1233
|
+ }
|
|
|
1234
|
+ if val.CurrentStage.RealCompletedAt > 0 {
|
|
|
1235
|
+ tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
1236
|
+ }
|
|
|
1237
|
+ if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
1238
|
+ tk.WarnFlag = int(domain.TaskWarn)
|
|
|
1239
|
+ }
|
|
|
1240
|
+ if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
|
|
1241
|
+ tk.WarnFlag = int(domain.TaskWarn)
|
1211
|
}
|
1242
|
}
|
1212
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1243
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1213
|
"taskId": val.TaskId,
|
1244
|
"taskId": val.TaskId,
|
|
@@ -1215,7 +1246,6 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1215,7 +1246,6 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1215
|
if err != nil {
|
1246
|
if err != nil {
|
1216
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务里程碑"+err.Error())
|
1247
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务里程碑"+err.Error())
|
1217
|
}
|
1248
|
}
|
1218
|
-
|
|
|
1219
|
for _, val2 := range stageList {
|
1249
|
for _, val2 := range stageList {
|
1220
|
stage := adapter.TaskStage{
|
1250
|
stage := adapter.TaskStage{
|
1221
|
Id: val2.Id,
|
1251
|
Id: val2.Id,
|
|
@@ -1308,6 +1338,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
|
@@ -1308,6 +1338,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
1308
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
1338
|
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
1309
|
"transactionContext": transactionContext,
|
1339
|
"transactionContext": transactionContext,
|
1310
|
})
|
1340
|
})
|
|
|
1341
|
+ nowTime := time.Now().Unix()
|
1311
|
for _, val := range taskListData {
|
1342
|
for _, val := range taskListData {
|
1312
|
tk := adapter.TaskItem{
|
1343
|
tk := adapter.TaskItem{
|
1313
|
Id: val.TaskId,
|
1344
|
Id: val.TaskId,
|
|
@@ -1320,6 +1351,36 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
|
@@ -1320,6 +1351,36 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s |
1320
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
1351
|
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
|
1321
|
Anomaly: val.Anomaly,
|
1352
|
Anomaly: val.Anomaly,
|
1322
|
WarnFlag: 0,
|
1353
|
WarnFlag: 0,
|
|
|
1354
|
+ LastStage: adapter.TaskStage{
|
|
|
1355
|
+ Id: val.LastStage.Id,
|
|
|
1356
|
+ Name: val.LastStage.Name,
|
|
|
1357
|
+ StatusDescription: val.LastStage.StatusDescription(),
|
|
|
1358
|
+ SortBy: val.LastStage.SortBy,
|
|
|
1359
|
+ PlanCompletedAt: time.Unix(int64(val.LastStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
1360
|
+ RealCompletedAt: "",
|
|
|
1361
|
+ IsRef: false,
|
|
|
1362
|
+ },
|
|
|
1363
|
+ CurrentStage: adapter.TaskStage{
|
|
|
1364
|
+ Id: val.CurrentStage.Id,
|
|
|
1365
|
+ Name: val.CurrentStage.Name,
|
|
|
1366
|
+ StatusDescription: val.CurrentStage.StatusDescription(),
|
|
|
1367
|
+ SortBy: val.CurrentStage.SortBy,
|
|
|
1368
|
+ PlanCompletedAt: time.Unix(int64(val.CurrentStage.PlanCompletedAt), 0).Local().Format("2006-01-02"),
|
|
|
1369
|
+ RealCompletedAt: "",
|
|
|
1370
|
+ IsRef: false,
|
|
|
1371
|
+ },
|
|
|
1372
|
+ }
|
|
|
1373
|
+ if val.LastStage.RealCompletedAt > 0 {
|
|
|
1374
|
+ tk.LastStage.RealCompletedAt = time.Unix(int64(val.LastStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
1375
|
+ }
|
|
|
1376
|
+ if val.CurrentStage.RealCompletedAt > 0 {
|
|
|
1377
|
+ tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
1378
|
+ }
|
|
|
1379
|
+ if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
1380
|
+ tk.WarnFlag = int(domain.TaskWarn)
|
|
|
1381
|
+ }
|
|
|
1382
|
+ if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
|
|
1383
|
+ tk.WarnFlag = int(domain.TaskWarn)
|
1323
|
}
|
1384
|
}
|
1324
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1385
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1325
|
"taskId": val.TaskId,
|
1386
|
"taskId": val.TaskId,
|