作者 tangxvhui

修复 创建每日评估是 某些情况下 任务不能正常下发。

@@ -443,9 +443,9 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess) @@ -443,9 +443,9 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess)
443 if err != nil { 443 if err != nil {
444 return nil, application.ThrowError(application.ARG_ERROR, "获取评估项EvaluationItemUsed信息"+err.Error()) 444 return nil, application.ThrowError(application.ARG_ERROR, "获取评估项EvaluationItemUsed信息"+err.Error())
445 } 445 }
446 - if len(evaluationItemList) == 0 {  
447 - return nil, nil  
448 - } 446 + // if len(evaluationItemList) == 0 {
  447 + // return nil, nil
  448 + // }
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{}{
  1 +package service
  2 +
  3 +import (
  4 + "testing"
  5 +
  6 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
  7 +)
  8 +
  9 +func TestXxx(t *testing.T) {
  10 + srv := StaffAssessServeice{}
  11 + taskRecord, err := srv.buildTaskRecord(&domain.StaffAssess{
  12 + CompanyId: 8,
  13 + CycleId: 1667093923689926656,
  14 + EvaluationProjectId: 1675753960259981312,
  15 + Executor: domain.StaffDesc{
  16 + UserId: 3255361876566784,
  17 + },
  18 + })
  19 + if err != nil {
  20 + t.Error(err)
  21 + }
  22 + for _, val := range taskRecord {
  23 + t.Logf("%+v", *val)
  24 + }
  25 +
  26 +}