常见问题记录(一)

1、mysql生成32位的UUID:SELECT REPLACE(UUID(), '-', '');
2、Git生成秘钥(git已安装):ssh-keygen -t rsa -C "配置邮箱地址",直接回撤即可。

配置账户信息

git config --list
git config --global user.name "username"
git config --global user.email useremail@qq.com
3、java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

在数据库驱动的url后加上serverTimezone=UTC参数。
4、解决EasyPOI导出图片存在合并单元格只填充一个单元格问题:新建一个类 EasypoiService 存放cn.afterturn.easypoi.excel.export.template.ExcelExportOfTemplateUtil代码(同样需继承BaseExportService类)
并重写父类的 createImageCell 方法,调用自定义类的方法即可 new EasyPoiService().createExcleByTemplate(templateParams, null, null, dataMap); @Override public void createImageCell(Cell cell, double height, String imagePath, byte[] data) throws Exception { if (height > (double) cell.getRow().getHeight()) { cell.getRow().setHeight((short) ((int) height)); } //获取当前单元格所在的sheet Sheet sheet = cell.getRow().getSheet(); //获取当前sheet页中的所有合并单元格信息 List<CellRangeAddress> mergedRegions = sheet.getMergedRegions(); //获取当前单元格的开始列号 int firstColumn = (short) cell.getColumnIndex(); //获取当前单元格的开始行号 int firstRow = cell.getRow().getRowNum(); //获取当前单元格的结束列号 int lastColumn = (short) (cell.getColumnIndex()); //获取当前单元格的结束行号 int lastRow = cell.getRow().getRowNum(); for (CellRangeAddress mergedRegion : mergedRegions) { //判断当前单元格是否包含合并行或和并列 当前单元格的所有行号和列号都包含在合并域内 则认为当前单元格存在合并行或和并列 if (cell.getColumnIndex() >= mergedRegion.getFirstColumn() && cell.getColumnIndex() <= mergedRegion.getLastColumn() && cell.getRow().getRowNum() >= mergedRegion.getFirstRow() && cell.getRow().getRowNum() <= mergedRegion.getLastRow()) { //获取合并域的开始行号 firstRow = mergedRegion.getFirstRow(); //获取合并域的结束行号 lastRow = mergedRegion.getLastRow(); //获取合并域的开始列号 firstColumn = mergedRegion.getFirstColumn(); //获取合并域的结束列号 lastColumn = mergedRegion.getLastColumn(); break; } } Object anchor; if (this.type.equals(ExcelType.HSSF)) { anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) firstColumn, firstRow, (short) (lastColumn + 1), lastRow + 1); } else { anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) firstColumn, firstRow, (short) (lastColumn + 1), lastRow + 1); } if (StringUtils.isNotEmpty(imagePath)) { data = ImageCache.getImage(imagePath); } if (data != null) { PoiExcelGraphDataUtil.getDrawingPatriarch(cell.getSheet()).createPicture((ClientAnchor) anchor, cell.getSheet().getWorkbook().addPicture(data, this.getImageType(data))); } }

 idea各种文件打开后页面凌乱或者看到的不是正常的代码,或报错No IDEA annotations attached to the JDK 1.8

解决方案参考:https://blog.csdn.net/zhang5690800/article/details/84291940

 

posted @ 2021-03-15 14:56  聚散彡流沙  阅读(150)  评论(0编辑  收藏  举报