...
|
...
|
@@ -808,7 +808,18 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a |
|
|
taskStatgeRepo := factory.CreateTaskStageRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, me, err := userRepo.Find(map[string]interface{}{"id": param.UserId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的信息"+err.Error())
|
|
|
}
|
|
|
if len(me) == 0 {
|
|
|
return nil, nil
|
|
|
}
|
|
|
var meParent []*domain.User
|
|
|
if me[0].ParentId > 0 {
|
|
|
_, meParent, _ = userRepo.Find(map[string]interface{}{"id": me[0].ParentId})
|
|
|
}
|
|
|
_, anomalyList, err := taskAnomalyRepo.Find(map[string]interface{}{"id": param.Id, "companyId": param.CompanyId, "limit": 1})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -874,25 +885,23 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a |
|
|
PlanCompletedAt: time.Unix(anomalyData.TaskStageCheck.PlanCompletedAt, 0).Format("2006-01-02"),
|
|
|
RealCompletedAt: "",
|
|
|
},
|
|
|
ListStage: []adapter.TaskStage{},
|
|
|
AssessFlag: anomalyData.AssessFlag,
|
|
|
WarnFlag: anomalyData.WarnFlag,
|
|
|
AssistFlag: anomalyData.AssistFlag,
|
|
|
TaskLevel: taskData.LevelName,
|
|
|
TaskName: taskData.Name,
|
|
|
TaskAlias: taskData.Alias,
|
|
|
TaskEndTime: taskData.EndTime,
|
|
|
TaskSortBy: int(taskData.SortBy),
|
|
|
RecordBegin: anomalyData.RecordBegin,
|
|
|
CreatedAt: anomalyData.CreatedAt.Local().Format("2006-01-02"),
|
|
|
MarkA: "",
|
|
|
MarkB: "",
|
|
|
MarkC: "",
|
|
|
MarkD: "",
|
|
|
AnomalyDesc: "",
|
|
|
AnomalyDesc2: map[string]string{
|
|
|
"": "",
|
|
|
},
|
|
|
ListStage: []adapter.TaskStage{},
|
|
|
AssessFlag: anomalyData.AssessFlag,
|
|
|
WarnFlag: anomalyData.WarnFlag,
|
|
|
AssistFlag: anomalyData.AssistFlag,
|
|
|
TaskLevel: taskData.LevelName,
|
|
|
TaskName: taskData.Name,
|
|
|
TaskAlias: taskData.Alias,
|
|
|
TaskEndTime: taskData.EndTime,
|
|
|
TaskSortBy: int(taskData.SortBy),
|
|
|
RecordBegin: anomalyData.RecordBegin,
|
|
|
CreatedAt: anomalyData.CreatedAt.Local().Format("2006-01-02"),
|
|
|
MarkA: "",
|
|
|
MarkB: "",
|
|
|
MarkC: "",
|
|
|
MarkD: "",
|
|
|
AnomalyDesc: "",
|
|
|
AnomalyDesc2: map[string]string{},
|
|
|
}
|
|
|
// 设置操作标记
|
|
|
{
|
...
|
...
|
@@ -909,8 +918,10 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a |
|
|
if param.UserId == int(taskData.Leader.Id) {
|
|
|
// 去更新
|
|
|
result.MarkA = anomalyData.Marks["a"]
|
|
|
// 找上级
|
|
|
result.MarkC = anomalyData.Marks["c"]
|
|
|
if len(meParent) > 0 {
|
|
|
// 找上级
|
|
|
result.MarkC = anomalyData.Marks["c"]
|
|
|
}
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
result.MarkD = anomalyData.Marks["d"]
|
...
|
...
|
|