Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
zyx.net
2022-08-02 14:08:26 +08:00
2 changed files with 51 additions and 13 deletions
@@ -548,4 +548,9 @@ CREATE TABLE `ext_repo_data` (
`file_description` varchar(255) DEFAULT NULL COMMENT '文件说明', `file_description` varchar(255) DEFAULT NULL COMMENT '文件说明',
`sup_folder` varchar(36) DEFAULT NULL COMMENT '所属文件夹', `sup_folder` varchar(36) DEFAULT NULL COMMENT '所属文件夹',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 参数项收集清单 认证类别取消列表显示 2022-08-02
UPDATE `laws_weilai`.`onl_cgform_field`
SET `is_show_list` = 0, `update_by` = 'admin', `update_time` = '2022-08-02 09:36:09'
WHERE `id` = '7b8ef9f8da124ed93e5c10a14b903390';
@@ -499,9 +499,9 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
OutputStream os = null; OutputStream os = null;
OutputStream excelOS = null; OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook(); XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "上报库参数项常规导出信息"; String fileOriName = "常规导出";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) { if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
fileOriName = "Params report normal data"; fileOriName = "normal";
} }
if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) { if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) {
fileOriName = paramsReportDetailVO.getExportName(); fileOriName = paramsReportDetailVO.getExportName();
@@ -516,7 +516,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
try{ try{
String fileName = fileOriName + ".xlsx"; String fileName = fileOriName + ".xlsx";
// 设置表格相关属性 // 设置表格相关属性
XSSFSheet sheetItems = workbook.createSheet("上报库参数项信息"); String sheetName = "参数项信息";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
sheetName = "Params data";
}
XSSFSheet sheetItems = workbook.createSheet(sheetName);
String[] titles = getWorkbookTitleForExport(paramsReportDetailVO); // 获取表头 String[] titles = getWorkbookTitleForExport(paramsReportDetailVO); // 获取表头
String[] headers = titles[1].split(","); String[] headers = titles[1].split(",");
@@ -550,7 +554,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
cell.setCellValue(text); cell.setCellValue(text);
cell.setCellStyle(cellStyle1); cell.setCellStyle(cellStyle1);
// 设置单元格宽度 // 设置单元格宽度
if("参数值".equals(headers[i])) { String ParamsValues = "参数值";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
ParamsValues = "Params Values";
}
if(ParamsValues.equals(headers[i])) {
sheetItems.setColumnWidth(i, 80 * 256); sheetItems.setColumnWidth(i, 80 * 256);
} else { } else {
sheetItems.setColumnWidth(i, 20 * 256); sheetItems.setColumnWidth(i, 20 * 256);
@@ -582,7 +590,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
//下载关联文件内容 //下载关联文件内容
if (allRelevFileList != null && !allRelevFileList.isEmpty()) { if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList()); allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPath + File.separator + "导出文件"); String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList,fileNowPath + File.separator + exportFile);
} }
String repFileName = fileName.replaceAll("/","_"); String repFileName = fileName.replaceAll("/","_");
@@ -620,7 +632,12 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
fis.close(); // 先开后关 fis.close(); // 先开后关
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new JeroBootException("下载文件失败,请重试"); if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
throw new JeroBootException("Failed to download file, please try again");
} else {
throw new JeroBootException("下载文件失败,请重试");
}
} finally { } finally {
IOUtils.closeQuietly(os); IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS); IOUtils.closeQuietly(excelOS);
@@ -677,9 +694,9 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
public void exportCustomWord(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request) { public void exportCustomWord(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null; OutputStream os = null;
OutputStream wordOS = null; OutputStream wordOS = null;
String fileOriName = "上报库参数项自定义导出信息"; String fileOriName = "自定义导出";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) { if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
fileOriName = "Params report custom data"; fileOriName = "custom";
} }
if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) { if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) {
fileOriName = paramsReportDetailVO.getExportName(); fileOriName = paramsReportDetailVO.getExportName();
@@ -711,7 +728,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll"); List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) { if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList()); allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPath + File.separator + "导出文件"); String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList,fileNowPath + File.separator + exportFile);
} }
// 拿取模板 // 拿取模板
@@ -764,7 +785,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new JeroBootException("下载文件失败,请重试"); if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
throw new JeroBootException("Failed to download file, please try again");
} else {
throw new JeroBootException("下载文件失败,请重试");
}
} finally { } finally {
IOUtils.closeQuietly(os); IOUtils.closeQuietly(os);
@@ -814,7 +839,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll"); List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) { if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList()); allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPath + File.separator + "导出文件"); String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList,fileNowPath + File.separator + exportFile);
} }
// 拿取模板 // 拿取模板
@@ -881,7 +910,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new JeroBootException("下载文件失败,请重试"); if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
throw new JeroBootException("Failed to download file, please try again");
} else {
throw new JeroBootException("下载文件失败,请重试");
}
} finally { } finally {
IOUtils.closeQuietly(os); IOUtils.closeQuietly(os);