| | |
| | | return mv; |
| | | } |
| | | |
| | | @Override |
| | | public ModelAndView batchExportXls(MdcEquipmentRunningSectionVo equipmentRunningSectionVo) { |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | List<MdcEquipmentRunningSectionDto> mdcEquipmentRunningSectionDtos = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(equipmentRunningSectionVo.getStartTime()) && StringUtils.isNotBlank(equipmentRunningSectionVo.getEndTime()) ) { |
| | | Date startDate = DateUtils.toDate(equipmentRunningSectionVo.getStartTime(), DateUtils.STR_DATE); |
| | | Date endDate = DateUtils.toDate(equipmentRunningSectionVo.getEndTime(), DateUtils.STR_DATE); |
| | | List<String> datesStringList = DateUtils.getDatesStringList(startDate, endDate); |
| | | datesStringList.forEach(date -> { |
| | | equipmentRunningSectionVo.setCollectTimeStr(date); |
| | | List<MdcEquipmentRunningSectionDto> equipmentRunningSectionDtos = this.logList(equipmentRunningSectionVo); |
| | | if (equipmentRunningSectionDtos != null && !equipmentRunningSectionDtos.isEmpty()) { |
| | | mdcEquipmentRunningSectionDtos.addAll(equipmentRunningSectionDtos); |
| | | } |
| | | }); |
| | | } |
| | | // 导出文件名称 |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "设备日志"); |
| | | mv.addObject(NormalExcelConstants.CLASS, MdcEquipmentRunningSectionDto.class); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("设备日志列表数据", "导出人:" + user.getRealname(), "设备日志")); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, mdcEquipmentRunningSectionDtos); |
| | | return mv; |
| | | } |
| | | |
| | | private Map<String, List<MdcEquipmentRunningSectionDto>> logCharts(MdcEquipmentRunningSectionVo equipmentRunningSectionVo, String date) { |
| | | Map<String, List<MdcEquipmentRunningSectionDto>> map = new HashMap<>(); |
| | | List<MdcEquipmentRunningSectionDto> normal = new ArrayList<>(); |