Browse Source

--修复没有数据报错问题

develop
mengff 10 months ago
parent
commit
65572c6833
  1. 4
      zc-business/src/main/java/com/zc/business/controller/StatusController.java

4
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<Integer, List<Status>> map = listStatus.stream()
.collect(Collectors.groupingBy(Status -> Status.getTime().getHour()));
if(StringUtils.isEmpty(map)){
return AjaxResult.success("暂无数据");
}
Map<Integer, List<Status>> ipMap = new TreeMap<>(map);
Integer lastKey = Collections.max(ipMap.keySet());
List<Status> lastEntry = ipMap.get(lastKey);

Loading…
Cancel
Save