| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.basic.util.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.inspect.util.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.require.mapper.FeCalibrationScheduleMapper; |
| | | import com.ruoyi.require.pojo.FeCalibrationSchedule; |
| | | import com.ruoyi.require.service.FeCalibrationScheduleService; |
| | |
| | | * |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @author |
| | | * @since 2024-11-13 02:53:05 |
| | | */ |
| | | @Service |
| | |
| | | Configure configure = Configure.builder() |
| | | .bind("feCalibrationSchedule", new HackLoopTableRenderPolicy()) |
| | | .build(); |
| | | FeCalibrationSchedule feCalibrationSchedule = size > 0 ? feCalibrationSchedules.get(0) : null; |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("feCalibrationSchedule", feCalibrationSchedules); |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |