package com.wgcloud.controller;
|
|
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONUtil;
|
import com.github.pagehelper.PageInfo;
|
import com.wgcloud.config.CommonConfig;
|
import com.wgcloud.dto.NetIoStateDto;
|
import com.wgcloud.entity.*;
|
import com.wgcloud.service.*;
|
import com.wgcloud.util.*;
|
import com.wgcloud.util.staticvar.StaticKeys;
|
import org.apache.commons.lang3.StringUtils;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @version v3.3
|
* @ClassName:SystemInfoController.java
|
* @author: http://www.wgstart.com
|
* @date: 2021年1月16日
|
* @Description: 主机信息管理
|
* @Copyright: 2019-2021 wgcloud. All rights reserved.
|
*/
|
@Controller
|
@RequestMapping("/systemInfo")
|
public class SystemInfoController {
|
|
|
private static final Logger logger = LoggerFactory.getLogger(SystemInfoController.class);
|
|
|
@Resource
|
private SystemInfoService systemInfoService;
|
@Resource
|
private LogInfoService logInfoService;
|
@Resource
|
private DashboardService dashboardService;
|
@Resource
|
private CpuStateService cpuStateService;
|
@Resource
|
private DiskStateService diskStateService;
|
@Resource
|
private DeskIoService deskIoService;
|
@Resource
|
private DiskSmartService diskSmartService;
|
@Resource
|
private CpuTemperaturesService cpuTemperaturesService;
|
@Resource
|
private HostDiskPerService hostDiskPerService;
|
@Resource
|
private MemStateService memStateService;
|
@Resource
|
private NetIoStateService netIoStateService;
|
@Resource
|
private SysLoadStateService sysLoadStateService;
|
@Resource
|
private ExcelExportService excelExportService;
|
@Resource
|
private HostGroupService hostGroupService;
|
@Resource
|
private AccountInfoService accountInfoService;
|
@Autowired
|
private TokenUtils tokenUtils;
|
@Autowired
|
private CommonConfig commonConfig;
|
|
|
private void testThread() {
|
Runnable runnable = () -> {
|
logger.info("SystemInfoController----------testThread");
|
};
|
ThreadPoolUtil.executor.execute(runnable);
|
}
|
|
/**
|
* 数据开放接口,agent查询主机列表
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "agentList")
|
public String agentList(@RequestBody String paramBean) {
|
JSONObject agentJsonObject = (JSONObject) JSONUtil.parse(paramBean);
|
if (!tokenUtils.checkAgentToken(agentJsonObject)) {
|
logger.error(StaticKeys.TOKEN_ERROR);
|
return ResDataUtils.resetErrorJson(StaticKeys.TOKEN_ERROR);
|
}
|
|
try {
|
Map<String, Object> params = new HashMap<String, Object>();
|
if (!StringUtils.isEmpty(agentJsonObject.getStr("hostname"))) {
|
params.put("hostname", agentJsonObject.getStr("hostname").trim());
|
}
|
if (!StringUtils.isEmpty(agentJsonObject.getStr("account"))) {
|
params.put("account", agentJsonObject.getStr("account").trim());
|
}
|
if (!StringUtils.isEmpty(agentJsonObject.getStr("orderBy"))) {
|
params.put("orderBy", agentJsonObject.getStr("orderBy"));
|
params.put("orderType", agentJsonObject.getStr("orderType"));
|
}
|
PageInfo<SystemInfo> pageInfo = systemInfoService.selectByParams(params, agentJsonObject.getInt("page"), agentJsonObject.getInt("pageSize"));
|
//设置磁盘总使用率 begin
|
Map<String, Object> paramsAppInfo = new HashMap<String, Object>();
|
for (SystemInfo systemInfo1 : pageInfo.getList()) {
|
paramsAppInfo.put("hostname", systemInfo1.getHostname());
|
List<DiskState> deskStates = diskStateService.selectAllByParams(paramsAppInfo);
|
HostUtil.setDiskSumPer(deskStates, systemInfo1);
|
}
|
//设置磁盘总使用率 end
|
return ResDataUtils.resetSuccessJson(pageInfo);
|
} catch (Exception e) {
|
logger.error("agent获取主机列表信息错误", e);
|
logInfoService.save("agent获取主机列表信息错误", e.toString(), StaticKeys.LOG_XTCZ);
|
return ResDataUtils.resetErrorJson(e.toString());
|
}
|
}
|
|
/**
|
* 保存主机备注信息
|
*
|
* @param SystemInfo
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "save")
|
public String saveSystemInfo(SystemInfo SystemInfo, Model model, HttpServletRequest request) {
|
try {
|
if (!StringUtils.isEmpty(SystemInfo.getId())) {
|
SystemInfo ho = systemInfoService.selectById(SystemInfo.getId());
|
ho.setRemark(SystemInfo.getRemark());
|
systemInfoService.updateById(ho);
|
logInfoService.save(HostUtil.getAccountByRequest(request).getAccount() + "修改主机备注:" + ho.getHostname(), "主机备注:" + ho.getRemark(), StaticKeys.LOG_XTCZ);
|
}
|
|
|
} catch (Exception e) {
|
logger.error("保存主机备注信息错误", e);
|
logInfoService.save("保存主机备注信息错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return "redirect:/systemInfo/systemInfoList";
|
}
|
|
/**
|
* 保存主机windows远程url信息
|
*
|
* @param SystemInfo
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "saveWinConsole")
|
public String saveWinConsole(SystemInfo SystemInfo, Model model, HttpServletRequest request) {
|
try {
|
if (!StringUtils.isEmpty(SystemInfo.getId())) {
|
SystemInfo ho = systemInfoService.selectById(SystemInfo.getId());
|
ho.setWinConsole(SystemInfo.getWinConsole());
|
systemInfoService.updateById(ho);
|
logInfoService.save(HostUtil.getAccountByRequest(request).getAccount() + "修改主机服务:" + ho.getHostname(), "主机服务:" + ho.getWinConsole(), StaticKeys.LOG_XTCZ);
|
}
|
|
} catch (Exception e) {
|
logger.error("保存主机服务url信息错误", e);
|
logInfoService.save("保存主机主机服务url信息错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return SystemInfo.getWinConsole();
|
}
|
|
/**
|
* 保存主机列表页面需要隐藏的列名
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "saveHostListHideCols")
|
public String saveHostListHideCols(Model model, HttpServletRequest request) {
|
try {
|
// 主机列表页面需要隐藏的列,当前登录session有效
|
String[] hostListHideCols = request.getParameterValues("hostListHideCols");
|
if (null != hostListHideCols) {
|
request.getSession().setAttribute(StaticKeys.HOST_LIST_HIDE_COLS_INFO, StringUtils.join(hostListHideCols, StaticKeys.SPLIT_DH));
|
} else {
|
request.getSession().setAttribute(StaticKeys.HOST_LIST_HIDE_COLS_INFO, "");
|
}
|
} catch (Exception e) {
|
logger.error("保存主机列表需要隐藏的列错误", e);
|
logInfoService.save("保存主机列表需要隐藏的列错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return "redirect:/systemInfo/systemInfoList";
|
}
|
|
/**
|
* 保存主机分组信息
|
*
|
* @param SystemInfo
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "saveGroupId")
|
public String saveGroupId(Model model, HttpServletRequest request) {
|
try {
|
String ids = request.getParameter("ids");
|
String groupId = request.getParameter("groupId");
|
HostGroup hostGroup = hostGroupService.selectById(groupId);
|
if (!StringUtils.isEmpty(ids)) {
|
SystemInfo ho = null;
|
for (String id : ids.split(",")) {
|
ho = systemInfoService.selectById(id);
|
if (!StringUtils.isEmpty(groupId)) {
|
ho.setGroupId(groupId);
|
} else {
|
ho.setGroupId("");
|
hostGroup = new HostGroup();
|
}
|
systemInfoService.updateById(ho);
|
logInfoService.save(HostUtil.getAccountByRequest(request).getAccount() + "设置主机分组:" + ho.getHostname() + "," + ho.getRemark(), "分组:" + hostGroup.getGroupName(), StaticKeys.LOG_XTCZ);
|
}
|
}
|
} catch (Exception e) {
|
logger.error("保存主机分组信息错误", e);
|
logInfoService.save("保存主机分组信息错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return "redirect:/systemInfo/systemInfoList";
|
}
|
|
/**
|
* 根据条件查询host列表
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "systemInfoList")
|
public String systemInfoList(SystemInfo systemInfo, Model model, HttpServletRequest request) {
|
Map<String, Object> params = new HashMap<String, Object>();
|
try {
|
StringBuffer url = new StringBuffer();
|
String hostname = null;
|
if (!StringUtils.isEmpty(systemInfo.getHostname())) {
|
hostname = systemInfo.getHostname();
|
params.put("hostname", hostname.trim());
|
url.append("&hostname=").append(hostname);
|
}
|
if (!StringUtils.isEmpty(systemInfo.getState())) {
|
params.put("state", systemInfo.getState());
|
url.append("&state=").append(systemInfo.getState());
|
}
|
if (!StringUtils.isEmpty(systemInfo.getAccount())) {
|
params.put("account", systemInfo.getAccount());
|
url.append("&account=").append(systemInfo.getAccount());
|
}
|
if (!StringUtils.isEmpty(systemInfo.getGroupId())) {
|
params.put("groupId", systemInfo.getGroupId());
|
url.append("&groupId=").append(systemInfo.getGroupId());
|
}
|
if (!StringUtils.isEmpty(systemInfo.getOrderBy())) {
|
params.put("orderBy", systemInfo.getOrderBy());
|
params.put("orderType", systemInfo.getOrderType());
|
url.append("&orderBy=").append(systemInfo.getOrderBy());
|
url.append("&orderType=").append(systemInfo.getOrderType());
|
}
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
url.append("&dashView=1");
|
}
|
|
//校验是否需要添加过滤用户查询条件
|
HostUtil.addAccountquery(request, params);
|
|
PageInfo<SystemInfo> pageInfo = systemInfoService.selectByParams(params, systemInfo.getPage(), systemInfo.getPageSize());
|
|
//主机分组,若已经开启分组选项的话
|
List<HostGroup> hostGroupList = new ArrayList<>();
|
if (StaticKeys.TRUE_VAL.equals(commonConfig.getHostGroup())) {
|
params.clear();
|
params.put("groupType", StaticKeys.HOST_GROUP_1);
|
hostGroupList = hostGroupService.selectAllByParams(params);
|
}
|
|
//成员账号列表,若已经开启成员账号选项的话
|
if (StaticKeys.TRUE_VAL.equals(commonConfig.getUserInfoManage())) {
|
params.clear();
|
List<AccountInfo> accountInfoList = accountInfoService.selectAllByParams(params);
|
model.addAttribute("accountList", accountInfoList);
|
}
|
|
//添加主机附加值
|
systemInfoService.hostAddVal(pageInfo, hostGroupList);
|
|
//若是公众看板页面,未登录时,IP脱敏显示
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
systemInfoService.hideLeftIp(pageInfo, request);
|
}
|
|
PageUtil.initPageNumber(pageInfo, model);
|
model.addAttribute("pageUrl", "/systemInfo/systemInfoList?1=1" + url.toString());
|
model.addAttribute("page", pageInfo);
|
model.addAttribute("systemInfo", systemInfo);
|
model.addAttribute("hostGroupList", hostGroupList);
|
|
// 主机列表页面需要隐藏的列,当前登录session有效,若没有设置,初始化为空
|
if (null == request.getSession().getAttribute(StaticKeys.HOST_LIST_HIDE_COLS_INFO)) {
|
request.getSession().setAttribute(StaticKeys.HOST_LIST_HIDE_COLS_INFO, "");
|
}
|
|
} catch (Exception e) {
|
logger.error("查询主机列表错误", e);
|
logInfoService.save("查询主机列表错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
return "dashView/list";
|
} else {
|
return "host/list";
|
}
|
}
|
|
/**
|
* 根据条件查询host列表,异步获取
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping(value = "systemInfoListAjax")
|
public String systemInfoListAjax(SystemInfo systemInfo, Model model, HttpServletRequest request) {
|
Map<String, Object> params = new HashMap<String, Object>();
|
try {
|
List<SystemInfo> systemInfoList = systemInfoService.selectAllByParams(params);
|
for (SystemInfo sys : systemInfoList) {
|
if (StaticKeys.DOWN_STATE.equals(sys.getState())) {
|
sys.setHostname("<span class='badge bg-danger'>" + FormatUtil.getString(sys.getHostname(), 20) + "</span>");
|
}
|
//用image字段暂存下内存使用率 begin
|
if (sys.getMemPer() >= 90) {
|
sys.setImage("<span class='badge bg-danger'>" + sys.getMemPer() + "</span>");
|
}
|
if (sys.getMemPer() >= 70 && sys.getMemPer() < 90) {
|
sys.setImage("<span class='badge bg-warning'>" + sys.getMemPer() + "</span>");
|
}
|
if (sys.getMemPer() < 70) {
|
sys.setImage("<span class='badge bg-primary'>" + sys.getMemPer() + "</span>");
|
}
|
//用image字段暂存下内存使用率 end
|
|
//用主机名称字段暂存下cpu使用率 begin
|
if (sys.getCpuPer() >= 90) {
|
sys.setHostnameExt("<span class='badge bg-danger'>" + sys.getCpuPer() + "</span>");
|
}
|
if (sys.getCpuPer() >= 70 && sys.getCpuPer() < 90) {
|
sys.setHostnameExt("<span class='badge bg-warning'>" + sys.getCpuPer() + "</span>");
|
}
|
if (sys.getCpuPer() < 70) {
|
sys.setHostnameExt("<span class='badge bg-primary'>" + sys.getCpuPer() + "</span>");
|
}
|
//用主机名称字段暂存下cpu使用率 end
|
sys.setRxbyt(FormatUtil.kbToM(sys.getRxbyt()) + "/s");
|
sys.setTxbyt(FormatUtil.kbToM(sys.getTxbyt()) + "/s");
|
//用主机备注字段暂存下时间戳
|
sys.setRemark(DateUtil.getDateTimeString(sys.getCreateTime()));
|
}
|
return JSONUtil.toJsonStr(systemInfoList);
|
} catch (Exception e) {
|
logger.error("ajax查询主机列表错误", e);
|
logInfoService.save("ajax查询主机列表错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return "";
|
}
|
|
|
/**
|
* 根据IP查询服务器详情信息
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "detail")
|
public String hostDetail(Model model, HttpServletRequest request) {
|
//服务器名称
|
String id = request.getParameter("id");
|
if (StringUtils.isEmpty(id)) {
|
return "error/500";
|
}
|
try {
|
SystemInfo systemInfo = systemInfoService.selectById(id);
|
model.addAttribute("systemInfo", systemInfo);
|
Map<String, Object> params = new HashMap<String, Object>();
|
params.put("hostname", systemInfo.getHostname());
|
List<DiskState> deskStateList = diskStateService.selectAllByParams(params);
|
model.addAttribute("deskStateList", deskStateList);
|
List<DeskIo> deskIoList = deskIoService.selectAllByParams(params);
|
model.addAttribute("deskIoList", deskIoList);
|
List<DiskSmart> diskSmartList = diskSmartService.selectAllByParams(params);
|
model.addAttribute("diskSmartList", diskSmartList);
|
List<CpuTemperatures> cpuTemperaturesList = cpuTemperaturesService.selectAllByParams(params);
|
model.addAttribute("cpuTemperaturesList", cpuTemperaturesList);
|
List<HostDiskPer> hostDiskPerList = hostDiskPerService.selectAllByParams(params);
|
// 设置图表的副标题,磁盘使用率的最高、平均、最低值
|
hostDiskPerService.setSubtitle(model, hostDiskPerList);
|
model.addAttribute("hostDiskPerList", JSONUtil.parseArray(hostDiskPerList));
|
|
//若是公众看板页面,未登录时,IP脱敏显示
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
systemInfoService.hideLeftIp(systemInfo, request);
|
}
|
|
} catch (Exception e) {
|
logger.error("主机详细信息错误", e);
|
logInfoService.save("主机详细信息错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
return "dashView/view";
|
} else {
|
return "host/view";
|
}
|
|
}
|
|
/**
|
* 删除主机
|
*
|
* @param id
|
* @param model
|
* @param request
|
* @param redirectAttributes
|
* @return
|
*/
|
@RequestMapping(value = "del")
|
public String delete(Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
|
String errorMsg = "删除主机信息错误";
|
try {
|
if (!StringUtils.isEmpty(request.getParameter("id"))) {
|
String[] ids = request.getParameter("id").split(",");
|
for (String id : ids) {
|
SystemInfo sys = systemInfoService.selectById(id);
|
logInfoService.save(HostUtil.getAccountByRequest(request).getAccount() + "删除主机:" + sys.getHostname(), "主机:" + sys.getRemark(), StaticKeys.LOG_XTCZ);
|
}
|
systemInfoService.deleteById(ids);
|
}
|
} catch (Exception e) {
|
logger.error(errorMsg, e);
|
logInfoService.save(errorMsg, e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
return "redirect:/systemInfo/systemInfoList";
|
}
|
|
|
/**
|
* 根据IP查询服务器图形报表
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "chart")
|
public String hostChart(Model model, HttpServletRequest request) {
|
String id = request.getParameter("id");
|
String startTime = request.getParameter(StaticKeys.SEARCH_START_TIME);
|
String endTime = request.getParameter(StaticKeys.SEARCH_END_TIME);
|
String am = request.getParameter("am");
|
if (StringUtils.isEmpty(id)) {
|
logger.error("hostChart id is null");
|
return "error/500";
|
}
|
try {
|
SystemInfo systemInfo = systemInfoService.selectById(id);
|
model.addAttribute("systemInfo", systemInfo);
|
Map<String, Object> params = new HashMap<String, Object>();
|
params.put("hostname", systemInfo.getHostname());
|
dashboardService.setDateParam(am, startTime, endTime, params, model);
|
model.addAttribute("amList", dashboardService.getAmList());
|
List<CpuState> cpuStateList = cpuStateService.selectAllByParams(params);
|
model.addAttribute("cpuStateList", JSONUtil.parseArray(cpuStateList));
|
List<MemState> memStateList = memStateService.selectAllByParams(params);
|
model.addAttribute("memStateList", JSONUtil.parseArray(memStateList));
|
List<SysLoadState> sysLoadStateList = sysLoadStateService.selectAllByParams(params);
|
model.addAttribute("sysLoadStateList", JSONUtil.parseArray(sysLoadStateList));
|
systemInfoService.findLoadMaxVal(sysLoadStateList, model);
|
List<NetIoState> netIoStateList = netIoStateService.selectAllByParams(params);
|
List<NetIoStateDto> netIoStateDtoList = systemInfoService.toNetIoStateDto(netIoStateList);
|
model.addAttribute("netIoStateList", JSONUtil.parseArray(netIoStateDtoList));
|
systemInfoService.findNetIoStateBytMaxVal(netIoStateDtoList, model);
|
|
// 设置图表的副标题,cpu和内存的最高、平均、最低值
|
systemInfoService.setSubtitle(model, cpuStateList, memStateList);
|
|
//若是公众看板页面,未登录时,IP脱敏显示
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
systemInfoService.hideLeftIp(systemInfo, request);
|
}
|
|
} catch (Exception e) {
|
logger.error("主机图形报表错误", e);
|
logInfoService.save("主机图形报表错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
if (request.getParameter(StaticKeys.DASH_VIEW_ACCOUNT) != null) {
|
return "dashView/viewChart";
|
} else {
|
return "host/viewChart";
|
}
|
}
|
|
/**
|
* 根据IP查询服务器图形报表,导出excel
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "chartExcel")
|
public void hostChartExcel(Model model, HttpServletRequest request, HttpServletResponse response) {
|
String id = request.getParameter("id");
|
String startTime = request.getParameter(StaticKeys.SEARCH_START_TIME);
|
String endTime = request.getParameter(StaticKeys.SEARCH_END_TIME);
|
String am = request.getParameter("am");
|
if (StringUtils.isEmpty(id)) {
|
return;
|
}
|
try {
|
SystemInfo systemInfo = systemInfoService.selectById(id);
|
model.addAttribute("systemInfo", systemInfo);
|
Map<String, Object> params = new HashMap<String, Object>();
|
params.put("hostname", systemInfo.getHostname());
|
dashboardService.setDateParam(am, startTime, endTime, params, model);
|
excelExportService.exportExcel(params, response);
|
} catch (Exception e) {
|
logger.error("主机图形报表导出excel错误", e);
|
logInfoService.save("主机图形报表导出excel错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
}
|
|
|
/**
|
* 所有主机列表,导出excel
|
*
|
* @param model
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "hostListExcel")
|
public void hostListExcel(SystemInfo systemInfo, HttpServletRequest request, HttpServletResponse response) {
|
try {
|
Map<String, Object> params = new HashMap<String, Object>();
|
if (!StringUtils.isEmpty(systemInfo.getState())) {
|
params.put("state", systemInfo.getState());
|
}
|
if (!StringUtils.isEmpty(systemInfo.getGroupId())) {
|
params.put("groupId", systemInfo.getGroupId());
|
}
|
if (!StringUtils.isEmpty(systemInfo.getOrderBy())) {
|
params.put("orderBy", systemInfo.getOrderBy());
|
params.put("orderType", systemInfo.getOrderType());
|
}
|
|
//校验是否添加过滤用户查询条件
|
HostUtil.addAccountquery(request, params);
|
|
PageInfo<SystemInfo> pageInfo = systemInfoService.selectByParams(params, 1, 5000);
|
|
//主机分组
|
params.clear();
|
List<HostGroup> hostGroupList = hostGroupService.selectAllByParams(params);
|
|
//添加主机附加值
|
systemInfoService.hostAddVal(pageInfo, hostGroupList);
|
excelExportService.exportHostListExcel(pageInfo.getList(), response);
|
} catch (Exception e) {
|
logger.error("所有主机列表导出excel错误", e);
|
logInfoService.save("所有主机列表导出excel错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
}
|
|
|
}
|