作者 tangxvhui

修复bug

... ... @@ -756,10 +756,24 @@ func (srv *MessagePersonalService) TodayMessageTaskAnomaly(param *command.GetUse
}
resp := map[string]interface{}{
"needNotify": false,
"pageSkip": "0",
}
if (num1 + num2 + num3) == 1 {
resp["needNotify"] = true
resp["list"] = []adapter.MessageListAdapter{{Content: msg}}
if num1 > 0 {
//跳我负责的任务
resp["pageSkip"] = "1"
}
if num2 > 0 {
//跳我的下级任务
resp["pageSkip"] = "2"
}
if num3 > 0 {
//跳我的相关的任务
resp["pageSkip"] = "3"
}
} else if (num1 + num2 + num3) > 1 {
resp["needNotify"] = true
str := []string{}
... ...
... ... @@ -509,20 +509,25 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
taskRecordList = append(taskRecordList, &newTaskRecord)
}
}
//TODO 设置手动创建的task
_, taskList, err := taskRepo.Find(map[string]interface{}{
//设置手动创建的task
_, taskList2, err := taskRepo.Find(map[string]interface{}{
"leaderId": projectData.PrincipalId,
"status": domain.TaskRunning,
"createdBy": 1,
"gtEndTime": time.Now().Unix(),
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务task信息"+err.Error())
}
for index := range taskList {
nowTime := time.Now()
for index := range taskList2 {
if taskList2[index].UseEndTime > 0 {
if !(taskList2[index].EndTime > nowTime.Unix()) {
continue
}
}
//获取里程碑数据
_, taskStageList, err := taskStageRepo.Find(map[string]interface{}{
"taskId": taskList[index].Id,
"taskId": taskList2[index].Id,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务里程碑TaskStage信息"+err.Error())
... ... @@ -531,18 +536,18 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
Id: 0,
CompanyId: staffAssess.CompanyId,
StaffAssessId: staffAssess.Id,
TaskId: taskList[index].Id,
TaskId: taskList2[index].Id,
TaskCategory: "",
TaskName: taskList[index].Name,
TaskAlias: taskList[index].Alias,
TaskLeader: taskList[index].Leader,
TaskName: taskList2[index].Name,
TaskAlias: taskList2[index].Alias,
TaskLeader: taskList2[index].Leader,
AssistLevel: 0,
AssistContent: "",
AnomalyState: domain.AnomalyStateInit,
AssistState: domain.AssistStateInit,
TaskStages: []domain.TaskStage{},
TaskStageCheck: domain.TaskStage{},
TaskCreatedBy: taskList[index].CreatedBy,
TaskCreatedBy: taskList2[index].CreatedBy,
}
sort.Slice(taskStageList, func(i, j int) bool {
return taskStageList[i].SortBy < taskStageList[j].SortBy
... ...
... ... @@ -1174,7 +1174,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
for _, val := range taskListData {
_, listData, err := taskAnomalyRepo.Find(map[string]interface{}{
"taskId": val.TaskId,
"is_last": 1,
"isLast": 1,
})
if err == nil {
taskAnomalyList = append(taskAnomalyList, listData...)
... ... @@ -1456,7 +1456,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
for _, val := range taskListData {
_, listData, err := taskAnomalyRepo.Find(map[string]interface{}{
"taskId": val.TaskId,
"is_last": 1,
"isLast": 1,
})
if err == nil {
taskAnomalyList = append(taskAnomalyList, listData...)
... ...
... ... @@ -573,7 +573,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
)select *
from t_task_1
order by t_task_1.status,
t_task_1.warn_flag
t_task_1.warn_flag,
t_task_1.sort_by_1,
t_task_1.anomaly desc,
t_task_1.sort_by,t_task_1."created_at"
... ... @@ -800,6 +800,9 @@ and (task.leader ->>'id' in(?) or task.related_user @>?)
`
relatedUser := fmt.Sprintf("[%d]", relatedUserId)
if len(leaderId) == 0 {
leaderId = []string{"-1"}
}
condition := []interface{}{companyId, pg.In(leaderId), relatedUser}
result := []TaskData6{}
tx := d.transactionContext.PgTx
... ...
... ... @@ -169,9 +169,9 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d
}
}
//大于end_time
if val, ok := queryOptions["gtEndTime"]; ok {
query.Where(" end_time>=?", val)
}
// if val, ok := queryOptions["gtEndTime"]; ok {
// query.Where(" end_time>=?", val)
// }
if val, ok := queryOptions["offset"]; ok {
if offset, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
query.Offset(offset)
... ...