|
|
@ -22,13 +22,11 @@ import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -134,15 +132,11 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<User> handleUser() { |
|
|
|
public List<User> handleUser() { |
|
|
|
R<List<Dept>> result = sysClient.getDeptByCurrentUser(); |
|
|
|
R<List<User>> users = userClient.userList(AuthUtil.getTenantId(), Long.valueOf(AuthUtil.getDeptId())); |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ |
|
|
|
if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){ |
|
|
|
throw new ServiceException("查询告警处理人失败!"); |
|
|
|
throw new ServiceException("查询告警处理人失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
List<User> users = new ArrayList<>(); |
|
|
|
return users.getData().stream().distinct().collect(Collectors.toList()); |
|
|
|
result.getData().forEach(dept->{ |
|
|
|
|
|
|
|
users.addAll(userClient.userListByDeptAndChildrenWithAuth(dept.getId()).getData()); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return users.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|