diff --git a/zc-business/src/main/java/com/zc/business/controller/StatusController.java b/zc-business/src/main/java/com/zc/business/controller/StatusController.java index 35300a31..568f8a3a 100644 --- a/zc-business/src/main/java/com/zc/business/controller/StatusController.java +++ b/zc-business/src/main/java/com/zc/business/controller/StatusController.java @@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.domain.Status; import com.zc.business.service.impl.StatusService; @@ -125,6 +126,9 @@ public class StatusController extends BaseController { //根据时间分组 Map> map = listStatus.stream() .collect(Collectors.groupingBy(Status -> Status.getTime().getHour())); + if(StringUtils.isEmpty(map)){ + return AjaxResult.success("暂无数据"); + } Map> ipMap = new TreeMap<>(map); Integer lastKey = Collections.max(ipMap.keySet()); List lastEntry = ipMap.get(lastKey);