...
|
...
|
@@ -829,6 +829,12 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
userDao := dao.NewUserDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// 获取员工全部子集
|
|
|
childUser, err := userDao.AllChildUser(param.UserId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, nil
|
|
|
}
|
...
|
...
|
@@ -877,16 +883,55 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a |
|
|
TaskEndTime: taskData.EndTime,
|
|
|
TaskSortBy: int(taskData.SortBy),
|
|
|
RecordBegin: anomalyData.RecordBegin,
|
|
|
CreatedAt: anomalyData.CreatedAt.Local().Format("066-017"),
|
|
|
MarkA: anomalyData.Marks["a"],
|
|
|
MarkB: anomalyData.Marks["b"],
|
|
|
MarkC: anomalyData.Marks["c"],
|
|
|
MarkD: anomalyData.Marks["d"],
|
|
|
CreatedAt: anomalyData.CreatedAt.Local().Format("2006-01-02"),
|
|
|
MarkA: "",
|
|
|
MarkB: "",
|
|
|
MarkC: "",
|
|
|
MarkD: "",
|
|
|
AnomalyDesc: "",
|
|
|
AnomalyDesc2: map[string]string{
|
|
|
"": "",
|
|
|
},
|
|
|
}
|
|
|
// 设置操作标记
|
|
|
{
|
|
|
isChildUser := false
|
|
|
for _, child := range childUser {
|
|
|
if int64(child.Id) == taskData.Leader.Id {
|
|
|
isChildUser = true
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
switch anomalyData.Category {
|
|
|
case domain.AnomalyCategoryType1:
|
|
|
// 里程碑异常
|
|
|
if param.UserId == int(taskData.Leader.Id) {
|
|
|
// 去更新
|
|
|
result.MarkA = anomalyData.Marks["a"]
|
|
|
// 找上级
|
|
|
result.MarkC = anomalyData.Marks["c"]
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
result.MarkD = anomalyData.Marks["d"]
|
|
|
}
|
|
|
case domain.AnomalyCategoryType2:
|
|
|
if param.UserId == int(taskData.Leader.Id) {
|
|
|
// 去反馈
|
|
|
result.MarkB = anomalyData.Marks["b"]
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
result.MarkD = anomalyData.Marks["d"]
|
|
|
}
|
|
|
case domain.AnomalyCategoryType3:
|
|
|
if param.UserId == int(taskData.Leader.Id) {
|
|
|
//空
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
result.MarkD = anomalyData.Marks["d"]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
noticeWho := []string{}
|
|
|
for _, val2 := range anomalyData.NoticeWho {
|
|
|
if name, ok := val2["name"]; ok {
|
...
|
...
|
|