作者 tangxvhui

调整任务列表标记

@@ -1243,6 +1243,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1243,6 +1243,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1243 if val.WarnFlag > 0 { 1243 if val.WarnFlag > 0 {
1244 val.WarnFlag = 1 1244 val.WarnFlag = 1
1245 } 1245 }
  1246 + if val.CurrentStage.Id == 0 {
  1247 + tk.WarnFlag = 0
  1248 + }
1246 // if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt { 1249 // if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
1247 // tk.WarnFlag = int(domain.TaskWarn) 1250 // tk.WarnFlag = int(domain.TaskWarn)
1248 // } 1251 // }
@@ -1528,6 +1531,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1528,6 +1531,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1528 if val.CurrentStage.RealCompletedAt > 0 { 1531 if val.CurrentStage.RealCompletedAt > 0 {
1529 tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02") 1532 tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
1530 } 1533 }
  1534 + if tk.WarnFlag > 0 {
  1535 + tk.WarnFlag = 1
  1536 + }
  1537 + if val.CurrentStage.Id == 0 {
  1538 + tk.WarnFlag = 0
  1539 + }
1531 // if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt { 1540 // if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
1532 // tk.WarnFlag = int(domain.TaskWarn) 1541 // tk.WarnFlag = int(domain.TaskWarn)
1533 // } 1542 // }
@@ -1779,7 +1788,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result @@ -1779,7 +1788,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
1779 taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{ 1788 taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
1780 "transactionContext": transactionContext, 1789 "transactionContext": transactionContext,
1781 }) 1790 })
1782 - nowTime := time.Now().Unix() 1791 +
1783 for _, val := range taskListData { 1792 for _, val := range taskListData {
1784 tk := adapter.TaskItem{ 1793 tk := adapter.TaskItem{
1785 Id: val.TaskId, 1794 Id: val.TaskId,
@@ -1791,7 +1800,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result @@ -1791,7 +1800,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
1791 LevelName: val.LevelName, 1800 LevelName: val.LevelName,
1792 UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"), 1801 UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
1793 Anomaly: val.Anomaly, 1802 Anomaly: val.Anomaly,
1794 - WarnFlag: 0, 1803 + WarnFlag: val.WarnFlag,
1795 LastStage: adapter.TaskStage{ 1804 LastStage: adapter.TaskStage{
1796 Id: val.LastStage.Id, 1805 Id: val.LastStage.Id,
1797 Name: val.LastStage.Name, 1806 Name: val.LastStage.Name,
@@ -1815,13 +1824,19 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result @@ -1815,13 +1824,19 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
1815 if val.CurrentStage.RealCompletedAt > 0 { 1824 if val.CurrentStage.RealCompletedAt > 0 {
1816 tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02") 1825 tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
1817 } 1826 }
1818 - if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {  
1819 - // tk.WarnFlag = int(domain.TaskWarn) 1827 + // if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
  1828 + // // tk.WarnFlag = int(domain.TaskWarn)
  1829 + // tk.WarnFlag = 1
  1830 + // }
  1831 + // if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
  1832 + // // tk.WarnFlag = int(domain.TaskWarn)
  1833 + // tk.WarnFlag = 1
  1834 + // }
  1835 + if tk.WarnFlag > 0 {
1820 tk.WarnFlag = 1 1836 tk.WarnFlag = 1
1821 } 1837 }
1822 - if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {  
1823 - // tk.WarnFlag = int(domain.TaskWarn)  
1824 - tk.WarnFlag = 1 1838 + if val.CurrentStage.Id == 0 {
  1839 + tk.WarnFlag = 0
1825 } 1840 }
1826 _, stageList, err := taskStageRepo.Find(map[string]interface{}{ 1841 _, stageList, err := taskStageRepo.Find(map[string]interface{}{
1827 "taskId": val.TaskId, 1842 "taskId": val.TaskId,
@@ -422,6 +422,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) ( @@ -422,6 +422,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (
422 taskAnomalyDao := dao.NewTaskAnomalyDao(map[string]interface{}{ 422 taskAnomalyDao := dao.NewTaskAnomalyDao(map[string]interface{}{
423 "transactionContext": transactionContext, 423 "transactionContext": transactionContext,
424 }) 424 })
  425 +
425 limit := 1000 426 limit := 1000
426 offset := 0 427 offset := 0
427 cnt, anomalyList, err := taskAnomalyDao.List1(param.UserId, param.CompanyId, param.TaskName, param.Category, param.DayTime, limit, offset) 428 cnt, anomalyList, err := taskAnomalyDao.List1(param.UserId, param.CompanyId, param.TaskName, param.Category, param.DayTime, limit, offset)
@@ -364,7 +364,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ @@ -364,7 +364,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
364 where t_task_ignore.id isnull and task.deleted_at isnull 364 where t_task_ignore.id isnull and task.deleted_at isnull
365 and task_anomaly.company_id = ? 365 and task_anomaly.company_id = ?
366 and task.related_user@> ? 366 and task.related_user@> ?
367 - and task.leader->>'id' not in (select id::text from t_user where t_user."level" <3) 367 + and not exists (select t_user.id::text from t_user where t_user."level" <3 and task.leader->>'id'=t_user.id::text )
368 and task_anomaly.is_last=1 368 and task_anomaly.is_last=1
369 ` 369 `
370 370
@@ -395,7 +395,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ @@ -395,7 +395,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
395 where t_task_ignore.id isnull and task.deleted_at isnull 395 where t_task_ignore.id isnull and task.deleted_at isnull
396 and task_anomaly.company_id = ? 396 and task_anomaly.company_id = ?
397 and task.related_user@> ? 397 and task.related_user@> ?
398 - and task.leader->>'id' not in (select id::text from t_user where t_user."level" <3) 398 + and not exists (select t_user.id::text from t_user where t_user."level" <3 and task.leader->>'id'=t_user.id::text )
399 and task_anomaly.is_last=1 399 and task_anomaly.is_last=1
400 ` 400 `
401 401