作者 tangxvhui

修复bug 3916 , 3906,3905

... ... @@ -460,10 +460,9 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
continue
}
if taskList[0].UseEndTime == 1 {
if staffAssess.BeginTime.Unix() > taskList[0].EndTime {
if staffAssess.BeginTime.Local().Unix() > taskList[0].EndTime {
continue
}
}
//获取里程碑数据
_, taskStageList, err := taskStageRepo.Find(map[string]interface{}{
... ...
... ... @@ -30,20 +30,21 @@ func (t *TaskItem) GenStatusDescript() {
if domain.TaskState(t.Status) == domain.TaskRunning {
statusNamed = "进行中"
}
if t.CurrentStage.Id == 0 && t.LastStage.PlanCompletedAt < t.LastStage.RealCompletedAt {
statusNamed = "逾期完成"
if t.Anomaly > 0 {
statusNamed = "反馈异常"
}
if t.CurrentStage.Id == 0 && t.LastStage.PlanCompletedAt >= t.LastStage.RealCompletedAt {
statusNamed = "如期完成"
if domain.TaskWarnFlag(t.WarnFlag) == domain.TaskWarn {
statusNamed = "里程碑异常"
}
if domain.TaskState(t.Status) == domain.TaskStop {
statusNamed = "已停止"
}
if domain.TaskWarnFlag(t.WarnFlag) == domain.TaskWarn {
statusNamed = "里程碑异常"
if t.CurrentStage.Id == 0 && t.LastStage.PlanCompletedAt < t.LastStage.RealCompletedAt {
statusNamed = "逾期完成"
}
if t.Anomaly > 0 {
statusNamed = "反馈异常"
if t.CurrentStage.Id == 0 && t.LastStage.PlanCompletedAt >= t.LastStage.RealCompletedAt {
statusNamed = "如期完成"
}
t.StatusDescript = statusNamed
}
... ...
... ... @@ -67,9 +67,7 @@ func checkTaskRecord(param *domain.TaskRecord) error {
} else {
taskData.Anomaly = 0
}
// if param.CanTaskAnomaly() {
// taskData.Anomaly = 0
// }
err = taskRepo.Save(taskData)
if err != nil {
return fmt.Errorf("保存任务数据:%s", err)
... ...
... ... @@ -160,7 +160,10 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er
and task.company_id =?
and task.deleted_at isnull
and (
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
(
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)>0 and
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
)
or
task.warn_flag = 1
)
... ... @@ -199,7 +202,10 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err
and task.deleted_at isnull
and t_task_ignore.id isnull
and (
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
(
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)>0 and
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
)
or
task.warn_flag = 1
)`
... ...