Commit 6924810d by 朱莹

教师档案导出

parent fcf5a12d
......@@ -38,7 +38,7 @@ public class TeacherFilesNoticeController extends BaseController
/**
* 查询教师档案通知列表
*/
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:list')")
// @PreAuthorize("@ss.hasPermi('teacherFiles:notice:list')")
@GetMapping("/list")
public TableDataInfo list(TeacherFilesNotice teacherFilesNotice)
{
......
package yangtz.cs.liu.campus.service.impl.teacherFiles;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.system.service.ISysDictDataService;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO;
import yangtz.cs.liu.campus.domain.teacherFiles.*;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
import javax.servlet.http.HttpServletResponse;
......@@ -25,6 +25,9 @@ public class TeacherFilesExcelUtil {
@Autowired
private ITeacherFilesService teacherFilesService;
@Autowired
private ISysDictDataService sysDictDataService;
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
......@@ -83,6 +86,8 @@ public class TeacherFilesExcelUtil {
XSSFCell cell0 = row0.createCell(0);
cell0.setCellStyle(mainTitle);
cell0.setCellValue("基本信息");
XSSFCell cell05 = row0.createCell(5);
cell05.setCellStyle(mainTitle);
sheet.setColumnWidth(0, 34 * 140);
sheet.setColumnWidth(1, 34 * 100);
......@@ -170,7 +175,6 @@ public class TeacherFilesExcelUtil {
cell3.setCellStyle(title);
XSSFCell cell2 = row2.createCell(3);
String cellValue3 = "";
switch (i){
......@@ -202,9 +206,6 @@ public class TeacherFilesExcelUtil {
cell2.setCellValue(cellValue3);
cell2.setCellStyle(title);
sheet.addMergedRegion(new CellRangeAddress(i, i, 4, 5));
XSSFCell cell4 = row2.createCell(4);
String cellValue4 = "";
......@@ -243,14 +244,245 @@ public class TeacherFilesExcelUtil {
cell4.setCellValue(cellValue4);
cell4.setCellStyle(title);
XSSFCell cell5 = row2.createCell(5);
cell5.setCellStyle(title);
XSSFCell cell5 = row2.createCell(5);
cell5.setCellStyle(title);
}
int h =9;
XSSFRow row9 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 0, 5));
row9.setHeightInPoints(34);
XSSFCell cell90 = row9.createCell(0);
cell90.setCellStyle(mainTitle);
cell90.setCellValue("发表成就奖论文情况");
XSSFCell cell95 = row9.createCell(5);
cell95.setCellStyle(mainTitle);
h++;
XSSFRow row10 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
row10.setHeightInPoints(20);
XSSFCell cell100 = row10.createCell(0);
cell100.setCellStyle(title);
cell100.setCellValue("序号");
XSSFCell cell101 = row10.createCell(1);
cell101.setCellStyle(title);
cell101.setCellValue("论文名称");
XSSFCell cell102 = row10.createCell(2);
cell102.setCellStyle(title);
XSSFCell cell103 = row10.createCell(3);
cell103.setCellStyle(title);
cell103.setCellValue("级别");
XSSFCell cell104 = row10.createCell(4);
cell104.setCellStyle(title);
cell104.setCellValue("等级");
XSSFCell cell105 = row10.createCell(5);
cell105.setCellStyle(title);
cell105.setCellValue("发表时间");
h++;
List<TeacherFilesThesis> thesisList = files.getThesisList();
int thesisxh=1;
for(TeacherFilesThesis thesis : thesisList){
XSSFRow row11 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
row11.setHeightInPoints(20);
XSSFCell cell110 = row11.createCell(0);
cell110.setCellStyle(title);
cell110.setCellValue(thesisxh);
XSSFCell cell111 = row11.createCell(1);
cell111.setCellStyle(title);
cell111.setCellValue(thesis.getThesisName());
XSSFCell cell112 = row11.createCell(2);
cell112.setCellStyle(title);
XSSFCell cell113 = row11.createCell(3);
cell113.setCellStyle(title);
cell113.setCellValue(sysDictDataService.selectDictLabel("level",thesis.getLevel()));
XSSFCell cell114 = row11.createCell(4);
cell114.setCellStyle(title);
cell114.setCellValue(sysDictDataService.selectDictLabel("grade_type1",thesis.getGrade()));
XSSFCell cell115 = row11.createCell(5);
cell115.setCellStyle(title);
cell115.setCellValue(sdf.format(thesis.getPublishTime()));
thesisxh++;
h++;
}
XSSFRow row12 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 0, 5));
row12.setHeightInPoints(34);
XSSFCell cell120 = row12.createCell(0);
cell120.setCellStyle(mainTitle);
cell120.setCellValue("课题、结题、专著、校本教材编写情况");
XSSFCell cell125 = row12.createCell(5);
cell125.setCellStyle(mainTitle);
h++;
XSSFRow row13 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 3));
sheet.addMergedRegion(new CellRangeAddress(h, h, 4, 5));
row13.setHeightInPoints(20);
XSSFCell cell130 = row13.createCell(0);
cell130.setCellStyle(title);
cell130.setCellValue("序号");
XSSFCell cell131 = row13.createCell(1);
cell131.setCellStyle(title);
cell131.setCellValue("名称");
XSSFCell cell132 = row13.createCell(2);
cell132.setCellStyle(title);
XSSFCell cell133 = row13.createCell(3);
cell133.setCellStyle(title);
XSSFCell cell134 = row13.createCell(4);
cell134.setCellStyle(title);
cell134.setCellValue("发表时间");
XSSFCell cell135 = row13.createCell(5);
cell135.setCellStyle(title);
h++;
List<TeacherFilesMaterial> materialList = files.getMaterialList();
int materialxh=1;
for(TeacherFilesMaterial material : materialList){
XSSFRow row11 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 3));
sheet.addMergedRegion(new CellRangeAddress(h, h, 4, 5));
row11.setHeightInPoints(20);
XSSFCell cell110 = row11.createCell(0);
cell110.setCellStyle(title);
cell110.setCellValue(materialxh);
XSSFCell cell111 = row11.createCell(1);
cell111.setCellStyle(title);
cell111.setCellValue(material.getName());
XSSFCell cell112 = row11.createCell(2);
cell112.setCellStyle(title);
XSSFCell cell113 = row11.createCell(3);
cell113.setCellStyle(title);
XSSFCell cell114 = row11.createCell(4);
cell114.setCellStyle(title);
cell114.setCellValue(sdf.format(material.getPublishTime()));
XSSFCell cell115 = row11.createCell(5);
cell115.setCellStyle(title);
materialxh++;
h++;
}
XSSFRow row14 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 0, 5));
row14.setHeightInPoints(34);
XSSFCell cell140 = row14.createCell(0);
cell140.setCellStyle(mainTitle);
cell140.setCellValue("培训情况");
XSSFCell cell145 = row14.createCell(5);
cell145.setCellStyle(mainTitle);
h++;
XSSFRow row15 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
sheet.addMergedRegion(new CellRangeAddress(h, h, 3, 4));
row15.setHeightInPoints(20);
XSSFCell cell150 = row15.createCell(0);
cell150.setCellStyle(title);
cell150.setCellValue("序号");
XSSFCell cell151 = row15.createCell(1);
cell151.setCellStyle(title);
cell151.setCellValue("培训时间");
XSSFCell cell152 = row15.createCell(2);
cell152.setCellStyle(title);
XSSFCell cell153 = row15.createCell(3);
cell153.setCellValue("培训名称");
cell153.setCellStyle(title);
XSSFCell cell154 = row15.createCell(4);
cell154.setCellStyle(title);
XSSFCell cell155 = row15.createCell(5);
cell155.setCellValue("是否合格");
cell155.setCellStyle(title);
h++;
List<TeacherFilesTraining> trainingList = files.getTrainingList();
int trainingxh=1;
for (TeacherFilesTraining training:trainingList){
XSSFRow row11 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
sheet.addMergedRegion(new CellRangeAddress(h, h, 3, 4));
row15.setHeightInPoints(20);
XSSFCell cell110 = row11.createCell(0);
cell110.setCellStyle(title);
cell110.setCellValue(trainingxh);
XSSFCell cell111 = row11.createCell(1);
cell111.setCellStyle(title);
cell111.setCellValue(sdf.format(training.getTrainingTime()));
XSSFCell cell112 = row11.createCell(2);
cell112.setCellStyle(title);
XSSFCell cell113 = row11.createCell(3);
cell113.setCellValue(training.getTrainingName());
cell113.setCellStyle(title);
XSSFCell cell114 = row11.createCell(4);
cell114.setCellStyle(title);
XSSFCell cell115 = row11.createCell(5);
cell115.setCellValue(sysDictDataService.selectDictLabel("is_qualified",training.getIsQualified()));
cell115.setCellStyle(title);
trainingxh++;
h++;
}
XSSFRow row16 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 0, 5));
row16.setHeightInPoints(34);
XSSFCell cell160 = row16.createCell(0);
cell160.setCellStyle(mainTitle);
cell160.setCellValue("业务获奖情况");
XSSFCell cell165 = row16.createCell(5);
cell165.setCellStyle(mainTitle);
h++;
XSSFRow row17 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
row15.setHeightInPoints(20);
XSSFCell cell170 = row17.createCell(0);
cell170.setCellStyle(title);
cell170.setCellValue("序号");
XSSFCell cell171 = row17.createCell(1);
cell171.setCellStyle(title);
cell171.setCellValue("获奖名称");
XSSFCell cell172 = row17.createCell(2);
cell172.setCellStyle(title);
XSSFCell cell173 = row17.createCell(3);
cell173.setCellValue("获奖时间");
cell173.setCellStyle(title);
XSSFCell cell174 = row17.createCell(4);
cell174.setCellValue("获奖等级");
cell174.setCellStyle(title);
XSSFCell cell175 = row17.createCell(5);
cell175.setCellValue("发证机关");
cell175.setCellStyle(title);
h++;
List<TeacherFilesAward> awardList = files.getAwardList();
int awardxh =1;
for (TeacherFilesAward award : awardList){
XSSFRow row11 = sheet.createRow(h);
sheet.addMergedRegion(new CellRangeAddress(h, h, 1, 2));
XSSFCell cell110 = row11.createCell(0);
cell110.setCellStyle(title);
cell110.setCellValue(awardxh);
XSSFCell cell111 = row11.createCell(1);
cell111.setCellStyle(title);
cell111.setCellValue(award.getAwardName());
XSSFCell cell112 = row11.createCell(2);
cell112.setCellStyle(title);
XSSFCell cell113 = row11.createCell(3);
cell113.setCellValue(sdf.format(award.getAwardTime()));
cell113.setCellStyle(title);
XSSFCell cell114 = row11.createCell(4);
cell114.setCellValue(sysDictDataService.selectDictLabel("grade_type1",award.getGradeOfAward()));
cell114.setCellStyle(title);
XSSFCell cell115 = row11.createCell(5);
cell115.setCellValue(award.getLicenseIssuingAuthority());
cell115.setCellStyle(title);
awardxh++;
h++;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment