作者 tangxvhui

日常保存

... ... @@ -449,9 +449,10 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
taskRecordList := []*domain.TaskRecord{}
for _, val := range evaluationItemList {
_, taskList, err := taskRepo.Find(map[string]interface{}{
"name": val.Name,
"leaderId": projectData.PrincipalId,
"status": domain.TaskRunning,
"name": val.Name,
"leaderId": projectData.PrincipalId,
"status": domain.TaskRunning,
"createdBy": 0,
})
if err != nil {
return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务task信息"+err.Error())
... ... @@ -508,6 +509,7 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
taskRecordList = append(taskRecordList, &newTaskRecord)
}
}
//TODO 设置手动创建的task
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ...
... ... @@ -3,5 +3,5 @@ package command
type MarkTaskAnomalyCommand struct {
Id int `json:"id,string"`
CompanyId int `json:"-"`
MarkType string `json:"markType"`
MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导
}
... ...
... ... @@ -23,6 +23,7 @@ func TestCheckYesterdayTaskRecord(t *testing.T) {
t.Log("检查每日任务反馈" + err.Error())
}
}
}
func TestCreatTaskAnamaly(t *testing.T) {
... ... @@ -43,7 +44,7 @@ func TestCreatTaskAnamaly(t *testing.T) {
"transactionContext": transactionContext,
})
_, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{
"ids": []int{1669736612939960320},
"ids": []int{1669011861988708352},
})
if err != nil {
t.Error(err)
... ...
... ... @@ -246,6 +246,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
CompanyId: taskData.CompanyId,
TaskRecordId: taskRecord.Id,
TaskId: taskData.Id,
Category: domain.AnomalyCategoryType3,
CurrentStage: taskData.CurrentStage,
... ... @@ -361,6 +362,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d
UpdatedAt: time.Now(),
CompanyId: taskData.CompanyId,
TaskId: taskData.Id,
TaskRecordId: taskRecord.Id,
Category: domain.AnomalyCategoryType2,
CurrentStage: taskData.CurrentStage,
LastStage: taskData.LastStage,
... ...
... ... @@ -169,6 +169,13 @@ func (t *Task) DescriptTaskStatus() string {
return statusNamed
}
func (t *Task) Copy() Task {
t2 := *t
t2.RelatedUser = make([]int, len(t.RelatedUser))
copy(t2.RelatedUser, t.RelatedUser)
return t2
}
type TaskRepository interface {
Save(param *Task) error
Remove(id int) error
... ...
... ... @@ -78,3 +78,8 @@ func (t TaskStage) dayEndTime(now time.Time) time.Time {
endTime := time.Date(yyyy, m, d, 23, 59, 59, 0, time.Local)
return endTime
}
func (t *TaskStage) Copy() TaskStage {
t2 := *t
return t2
}
... ...