...
|
...
|
@@ -909,26 +909,24 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada |
|
|
srv.recoverAssessCache(transactionContext, assessData.Id, assessContentList)
|
|
|
}
|
|
|
|
|
|
// 获取项目信息
|
|
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": assessData.EvaluationProjectId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目错误:"+err.Error())
|
|
|
}
|
|
|
|
|
|
taskRecords := make([]*domain.TaskRecord, 0)
|
|
|
// 任务负责人才能显示里程碑数据
|
|
|
if project.PrincipalId == strconv.Itoa(assessData.TargetUser.UserId) {
|
|
|
// 获取里程碑数据
|
|
|
taskRecords := make([]*domain.TaskRecord, 0) // 类别任务反馈记录
|
|
|
//categoryTaskRecords := make([]*domain.TaskRecord, 0) // 类别任务反馈记录
|
|
|
//assessTaskRecords := make([]*domain.TaskRecord, 0) // 评估项任务反馈记录
|
|
|
// 如果评估类型为自评、目标是登录用户时,获取所有任务记录数据
|
|
|
if assessData.Types == domain.AssessSelf || param.UserId == assessData.TargetUser.UserId {
|
|
|
taskRecordRepository := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, taskRecords, err = taskRecordRepository.Find(map[string]interface{}{"staffAssessId": assessData.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
|
|
|
}
|
|
|
|
|
|
//// 恢复缓存数据(里程碑记录)这里可以不用恢复任务里程碑数据
|
|
|
//if param.AcquireCache != 0 {
|
|
|
// srv.recoverCacheWithTaskRecord(cache, taskRecords)
|
|
|
//// 区分任务来源分类
|
|
|
//for i := range taskRecords {
|
|
|
// it := taskRecords[i]
|
|
|
// if it.TaskCreatedBy == 0 {
|
|
|
// categoryTaskRecords = append(categoryTaskRecords, it)
|
|
|
// } else {
|
|
|
// assessTaskRecords = append(assessTaskRecords, it)
|
|
|
// }
|
|
|
//}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -954,6 +952,8 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada |
|
|
SupperUser: "",
|
|
|
DutyTime: "",
|
|
|
AssessContent: assessContentList,
|
|
|
//CategoryTaskRecords: categoryTaskRecords,
|
|
|
//AssessTaskRecords: assessTaskRecords,
|
|
|
TaskRecords: taskRecords,
|
|
|
}
|
|
|
if len(assessContentList) == 0 {
|
...
|
...
|
@@ -1255,16 +1255,6 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) |
|
|
|
|
|
// 更新里程碑数据
|
|
|
if len(in.AssessTaskStages) > 0 {
|
|
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": assessData.EvaluationProjectId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目错误:"+err.Error())
|
|
|
}
|
|
|
// 任务负责人才能提交里程碑数据
|
|
|
if project.PrincipalId != strconv.Itoa(in.ExecutorId) {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "当前用户没有里程碑提交权限")
|
|
|
}
|
|
|
|
|
|
recordMap := map[int]domain.AssessTaskStage{}
|
|
|
recordIds := make([]int, 0)
|
|
|
for i := range in.AssessTaskStages {
|
...
|
...
|
@@ -1289,9 +1279,9 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) |
|
|
|
|
|
var anomalyState = domain.AnomalyState0
|
|
|
key := fmt.Sprintf("%s-%s", v.Category, v.Name)
|
|
|
// 反馈内容填写
|
|
|
if item, ok := contentCategoryMap[key]; ok {
|
|
|
it.RemarkContent = append(it.RemarkContent, item.Remark...)
|
|
|
|
|
|
for _, remark := range item.Remark {
|
|
|
trimSpace := strings.TrimLeft(remark.RemarkText, "\n") // 去掉前换行符
|
|
|
trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符
|
...
|
...
|
@@ -1301,6 +1291,8 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) |
|
|
break
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
it.RemarkContent = append(it.RemarkContent, v.RemarkContent...)
|
|
|
}
|
|
|
//if anomalyState == domain.AnomalyState0 {
|
|
|
// trimSpace := strings.TrimLeft(it.AssistContent, "\n") // 去掉前换行符
|
...
|
...
|
@@ -1418,6 +1410,8 @@ func (srv StaffAssessServeice) recoverCacheWithTaskRecord(cache *domain.StaffAss |
|
|
if item, ok := cacheMap[it.Id]; ok {
|
|
|
it.AssistLevel = item.AssistLevel
|
|
|
it.AssistContent = item.AssistContent
|
|
|
it.RemarkContent = make([]domain.RemarkText, 0)
|
|
|
it.RemarkContent = append(it.RemarkContent, item.RemarkContent...)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|