作者 tangxvhui

日常保存

@@ -449,9 +449,10 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess) @@ -449,9 +449,10 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
449 taskRecordList := []*domain.TaskRecord{} 449 taskRecordList := []*domain.TaskRecord{}
450 for _, val := range evaluationItemList { 450 for _, val := range evaluationItemList {
451 _, taskList, err := taskRepo.Find(map[string]interface{}{ 451 _, taskList, err := taskRepo.Find(map[string]interface{}{
452 - "name": val.Name,  
453 - "leaderId": projectData.PrincipalId,  
454 - "status": domain.TaskRunning, 452 + "name": val.Name,
  453 + "leaderId": projectData.PrincipalId,
  454 + "status": domain.TaskRunning,
  455 + "createdBy": 0,
455 }) 456 })
456 if err != nil { 457 if err != nil {
457 return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务task信息"+err.Error()) 458 return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务task信息"+err.Error())
@@ -508,6 +509,7 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess) @@ -508,6 +509,7 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
508 taskRecordList = append(taskRecordList, &newTaskRecord) 509 taskRecordList = append(taskRecordList, &newTaskRecord)
509 } 510 }
510 } 511 }
  512 + //TODO 设置手动创建的task
511 513
512 if err := transactionContext.CommitTransaction(); err != nil { 514 if err := transactionContext.CommitTransaction(); err != nil {
513 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 515 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -3,5 +3,5 @@ package command @@ -3,5 +3,5 @@ package command
3 type MarkTaskAnomalyCommand struct { 3 type MarkTaskAnomalyCommand struct {
4 Id int `json:"id,string"` 4 Id int `json:"id,string"`
5 CompanyId int `json:"-"` 5 CompanyId int `json:"-"`
6 - MarkType string `json:"markType"` 6 + MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导
7 } 7 }
@@ -23,6 +23,7 @@ func TestCheckYesterdayTaskRecord(t *testing.T) { @@ -23,6 +23,7 @@ func TestCheckYesterdayTaskRecord(t *testing.T) {
23 t.Log("检查每日任务反馈" + err.Error()) 23 t.Log("检查每日任务反馈" + err.Error())
24 } 24 }
25 } 25 }
  26 +
26 } 27 }
27 28
28 func TestCreatTaskAnamaly(t *testing.T) { 29 func TestCreatTaskAnamaly(t *testing.T) {
@@ -43,7 +44,7 @@ func TestCreatTaskAnamaly(t *testing.T) { @@ -43,7 +44,7 @@ func TestCreatTaskAnamaly(t *testing.T) {
43 "transactionContext": transactionContext, 44 "transactionContext": transactionContext,
44 }) 45 })
45 _, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{ 46 _, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{
46 - "ids": []int{1669736612939960320}, 47 + "ids": []int{1669011861988708352},
47 }) 48 })
48 if err != nil { 49 if err != nil {
49 t.Error(err) 50 t.Error(err)
@@ -246,6 +246,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d @@ -246,6 +246,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d
246 CreatedAt: time.Now(), 246 CreatedAt: time.Now(),
247 UpdatedAt: time.Now(), 247 UpdatedAt: time.Now(),
248 CompanyId: taskData.CompanyId, 248 CompanyId: taskData.CompanyId,
  249 + TaskRecordId: taskRecord.Id,
249 TaskId: taskData.Id, 250 TaskId: taskData.Id,
250 Category: domain.AnomalyCategoryType3, 251 Category: domain.AnomalyCategoryType3,
251 CurrentStage: taskData.CurrentStage, 252 CurrentStage: taskData.CurrentStage,
@@ -361,6 +362,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d @@ -361,6 +362,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d
361 UpdatedAt: time.Now(), 362 UpdatedAt: time.Now(),
362 CompanyId: taskData.CompanyId, 363 CompanyId: taskData.CompanyId,
363 TaskId: taskData.Id, 364 TaskId: taskData.Id,
  365 + TaskRecordId: taskRecord.Id,
364 Category: domain.AnomalyCategoryType2, 366 Category: domain.AnomalyCategoryType2,
365 CurrentStage: taskData.CurrentStage, 367 CurrentStage: taskData.CurrentStage,
366 LastStage: taskData.LastStage, 368 LastStage: taskData.LastStage,
@@ -169,6 +169,13 @@ func (t *Task) DescriptTaskStatus() string { @@ -169,6 +169,13 @@ func (t *Task) DescriptTaskStatus() string {
169 return statusNamed 169 return statusNamed
170 } 170 }
171 171
  172 +func (t *Task) Copy() Task {
  173 + t2 := *t
  174 + t2.RelatedUser = make([]int, len(t.RelatedUser))
  175 + copy(t2.RelatedUser, t.RelatedUser)
  176 + return t2
  177 +}
  178 +
172 type TaskRepository interface { 179 type TaskRepository interface {
173 Save(param *Task) error 180 Save(param *Task) error
174 Remove(id int) error 181 Remove(id int) error
@@ -78,3 +78,8 @@ func (t TaskStage) dayEndTime(now time.Time) time.Time { @@ -78,3 +78,8 @@ func (t TaskStage) dayEndTime(now time.Time) time.Time {
78 endTime := time.Date(yyyy, m, d, 23, 59, 59, 0, time.Local) 78 endTime := time.Date(yyyy, m, d, 23, 59, 59, 0, time.Local)
79 return endTime 79 return endTime
80 } 80 }
  81 +
  82 +func (t *TaskStage) Copy() TaskStage {
  83 + t2 := *t
  84 + return t2
  85 +}