...
|
...
|
@@ -392,7 +392,61 @@ func (srv TaskService) ListTaskAnomaly3(param *command.ListTaskAnomalyCommand) ( |
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.UserItem {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
if param.SubLevel == 0 {
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, userList, err := userRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
})
|
|
|
selectList := []adapter.UserItem{}
|
|
|
if err != nil {
|
|
|
return selectList
|
|
|
}
|
|
|
for _, val := range userList {
|
|
|
selectList = append(selectList, adapter.UserItem{
|
|
|
Id: val.Id,
|
|
|
Name: val.Name,
|
|
|
})
|
|
|
}
|
|
|
return selectList
|
|
|
}
|
|
|
|
|
|
userDao := dao.NewUserDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
userList, err := userDao.AllChildUser(param.UserId)
|
|
|
selectList := []adapter.UserItem{}
|
|
|
if err != nil {
|
|
|
return selectList
|
|
|
}
|
|
|
for _, val := range userList {
|
|
|
selectList = append(selectList, adapter.UserItem{
|
|
|
Id: int64(val.Id),
|
|
|
Name: val.Name,
|
|
|
Level: val.Level,
|
|
|
})
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return selectList
|
|
|
}
|
|
|
return selectList
|
|
|
}
|
|
|
|
|
|
// 对异常记录的操作标记
|
|
|
func (srv TaskService) MarkTaskAnomaly() error {
|
|
|
return nil
|
|
|
func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (map[string]string, error) {
|
|
|
|
|
|
return nil, nil
|
|
|
} |
...
|
...
|
|