Browse Source

Merge remote-tracking branch 'origin/prod' into prod

zhongwei
haungxing 8 months ago
parent
commit
a66ae07913
  1. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java

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

Loading…
Cancel
Save