add: 政策课题政策资料模板下载

This commit is contained in:
wxyclub
2023-10-31 11:27:55 +08:00
parent 3b4d167afa
commit a8f10f075c
2 changed files with 55 additions and 15 deletions
@@ -21,9 +21,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils;
@@ -173,19 +171,53 @@ public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
HSSFSheet sheetItems = workbook.createSheet("模板");
sheetItems.setDefaultColumnWidth(13);
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 13));
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 21));
Row row2 = sheetItems.createRow(0);//开始创建填写说明
String exportFieldName = FieldConvertUtil.exportFieldLawsTopic;
if (StringUtils.isNotBlank(exportFieldName)) {
String[] headerArr = exportFieldName.split(",");
for (int i=0;i < headerArr.length; i++) {
rowHeader.createCell(i).setCellValue(headerArr[i]);
}
// 表头样式
HSSFCellStyle cellStyle1 = workbook.createCellStyle();
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
String exportFieldName = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元)";
String[] headerArr = exportFieldName.split(",");
for (int i=0;i < headerArr.length; i++) {
Cell cell = rowHeader.createCell(i);
cell.setCellValue(headerArr[i]);
sheetItems.addMergedRegion(new CellRangeAddress(1,2,i,i));
cell.setCellStyle(cellStyle1);
}
String exportFieldListName = "课题组会议列表,课题组联系方式,内部联系方式";
String[] headerListArr = exportFieldListName.split(",");
for (int i=0;i < headerListArr.length; i++) {
Cell cell = rowHeader.createCell(7 + (i * 5));
cell.setCellValue(headerListArr[i]);
sheetItems.addMergedRegion(new CellRangeAddress(1,1,7+(i*5),7+(i*5)+4));
cell.setCellStyle(cellStyle1);
}
HSSFRow rowHeader2 = sheetItems.createRow(2);
String exportFieldMeetingName = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容";
String[] headerMeetingListArr = exportFieldMeetingName.split(",");
for (int i=0;i < headerMeetingListArr.length; i++) {
Cell cell = rowHeader2.createCell(7 + i);
cell.setCellValue(headerMeetingListArr[i]);
cell.setCellStyle(cellStyle1);
}
String exportFieldContactName = "姓名,单位,电话,邮箱,身份";
String[] headerContactListArr = exportFieldContactName.split(",");
for (int i=0;i < headerContactListArr.length; i++) {
Cell cell1 = rowHeader2.createCell(12 + i);
cell1.setCellValue(headerContactListArr[i]);
cell1.setCellStyle(cellStyle1);
Cell cell2 = rowHeader2.createCell(17 + i);
cell2.setCellValue(headerContactListArr[i]);
cell2.setCellStyle(cellStyle1);
}
Cell cellA2 = row2.createCell(0);
cellA2.setCellValue(FieldConvertUtil.exportLawsInformationDesc);
cellA2.setCellValue(FieldConvertUtil.exportLawsTopicDesc);
//sheetItems.setColumnWidth(0, 20 * 150);
row2.setHeight((short) (100 * 25));
row2.setHeight((short) (50 * 22));
// 说明样式
HSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setAlignment(HorizontalAlignment.LEFT);
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
@@ -93,10 +93,18 @@ public class FieldConvertUtil {
"7.关联模块-乘用车VPPS编码和关联模块--卡车VPPS编码是填写数据库中已有的编码从而带出乘用车VPPS名称和卡车VPPS名称\n" +
"8.发布稿,编制说明,历史版本,其他文件,修改单,关联文件为附件文件,需要放在Excel文档同级目录中";
// TODO
public static String exportInsideOutsideMeetingDesc = "内部会议,外部会议";
public static String exportInsideOutsideMeetingDesc ="填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.会议分类按照系统下拉菜单中的分类填写\n" +
"3.会议议题如果存在多条,则在下面以此填写,新的内外部会议另起一行填写";
public static String exportLawsInformationDesc = "";
public static String exportLawsInformationDesc = "填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.资料分类按照系统下拉菜单中的分类填写\n";
public static String exportLawsTopicDesc = "填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.课题组会议、课题组联系方式、内部联系方式如果存在多条,则在下面一次填写,新的课题组会议、课题组联系方式、内部联系方式在下面依次填写";
public static String exportFieldName = "*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,";