| | |
| | | |
| | | @GetMapping(path="exportDevice") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("导出设备号") |
| | | @Log("导出设备号及二维码") |
| | | public void exportDevice(Long batchId, HttpServletResponse response){ |
| | | Date start = new Date() ; |
| | | List<Converter> list = new ArrayList<>(); |
| | |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | log.info("导出设备号耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | log.info("导出设备号及二维码耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileName,sheetName,list); |
| | | log.info("导出设备号及二维码耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | @GetMapping(path="exportDeviceNo") |
| | | @SsoPowerAop(power = "10200001") |
| | | @Log("导出设备号") |
| | | public void exportDeviceNo(Long batchId, HttpServletResponse response){ |
| | | Date start = new Date() ; |
| | | List<Converter> list = new ArrayList<>(); |
| | | |
| | | List<PrDevice> deviceList = sv.selectDeviceByBatchId(batchId) ; |
| | | // 使用并行流提高性能 |
| | | deviceList.parallelStream().forEach(device -> { |
| | | ExcelDeviceNoVo vo = new ExcelDeviceNoVo(); |
| | | vo.deviceNo = device.deviceNo; |
| | | list.add(vo); |
| | | }); |
| | | //根据batchid找到任务名称 |
| | | PrAssemblyPlan plan = sv.selectByBatchId(batchId); |
| | | String fileNameStr = plan.name +"-"+ fileName; |
| | | log.info("导出设备号耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileNameStr,sheetName,list); |
| | | log.info("导出设备号耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | } |