Commit 72a9b992 by Cat
parents bfa8cec8 72ae3d83
......@@ -113,14 +113,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers( "/webSocket/**").anonymous()
.antMatchers("/login", "/register", "/captchaImage").anonymous()
.antMatchers("/wx/user/login","/wx/user/getRoleType/**").permitAll()
.antMatchers("/wx/teacherLeave/**").permitAll()
.antMatchers("/teacherFiles/notice/**").permitAll()
.antMatchers("/wx/level/expriment/**").permitAll()
.antMatchers("/dd/user/login").permitAll()
.antMatchers( "/common/**").permitAll()
.antMatchers( "/dd/school/**").permitAll()
......
package yangtz.cs.liu.campus.controller.teacherFiles;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
......@@ -15,7 +16,9 @@ import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 教师档案Controller
......@@ -91,14 +94,15 @@ public class TeacherFilesController extends BaseController
/**
*
* @param userId
* @param
* @param
* @return
*/
@GetMapping("getTeachList/{userId}")
public TableDataInfo teachList(@PathVariable("userId") Long userId,TeacherFilesNotice teacherFilesNotice){
@GetMapping("/getTeachList")
public TableDataInfo teachList(TeacherFiles teacherFiles){
startPage();
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(userId,teacherFilesNotice);
Map map = new HashMap();
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(teacherFiles);
return getDataTable(teacherFilesNotices);
}
......
......@@ -11,8 +11,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNoticeTotal;
import yangtz.cs.liu.campus.service.impl.teacherFiles.TeacherFilesExcelUtil;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService;
import javax.annotation.security.DenyAll;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -29,10 +32,13 @@ public class TeacherFilesNoticeController extends BaseController
@Autowired
private ITeacherFilesNoticeService teacherFilesNoticeService;
@Autowired
private TeacherFilesExcelUtil teacherFilesExcelUtil;
/**
* 查询教师档案通知列表
*/
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:list')")
// @PreAuthorize("@ss.hasPermi('teacherFiles:notice:list')")
@GetMapping("/list")
public TableDataInfo list(TeacherFilesNotice teacherFilesNotice)
{
......@@ -45,14 +51,11 @@ public class TeacherFilesNoticeController extends BaseController
/**
* 导出教师档案通知列表
*/
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:export')")
@Log(title = "教室档案通知", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@GetMapping("/export")
@PermitAll
public void export(HttpServletResponse response, TeacherFilesNotice teacherFilesNotice)
{
List<TeacherFilesNoticeTotal> list = teacherFilesNoticeService.selectTeacherFilesNoticeList(teacherFilesNotice);
ExcelUtil<TeacherFilesNoticeTotal> util = new ExcelUtil<TeacherFilesNoticeTotal>(TeacherFilesNoticeTotal.class);
util.exportExcel(response, list, "教室档案通知数据");
teacherFilesExcelUtil.getExcel(teacherFilesNotice.getId(),response);
}
/**
......
......@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.domain.teacherFiles;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -11,6 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author ruoyi
* @date 2023-09-05
*/
@Data
public class TeacherFiles extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -104,238 +106,9 @@ public class TeacherFiles extends BaseEntity
private Long gradeTeacherId;
public Long getGradeTeacherId() {
return gradeTeacherId;
}
private String userId;
public void setGradeTeacherId(Long gradeTeacherId) {
this.gradeTeacherId = gradeTeacherId;
}
private String noticeName;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setNoticeId(String noticeId)
{
this.noticeId = noticeId;
}
public String getNoticeId()
{
return noticeId;
}
public void setFilesSemester(String filesSemester)
{
this.filesSemester = filesSemester;
}
public String getFilesSemester()
{
return filesSemester;
}
public void setTeacherId(Long teacherId)
{
this.teacherId = teacherId;
}
public Long getTeacherId()
{
return teacherId;
}
public void setTeacherName(String teacherName)
{
this.teacherName = teacherName;
}
public String getTeacherName()
{
return teacherName;
}
public void setGradeId(Long gradeId)
{
this.gradeId = gradeId;
}
public Long getGradeId()
{
return gradeId;
}
public void setGradeName(String gradeName)
{
this.gradeName = gradeName;
}
public String getGradeName()
{
return gradeName;
}
public void setIdCard(String idCard)
{
this.idCard = idCard;
}
public String getIdCard()
{
return idCard;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setAge(Integer age)
{
this.age = age;
}
public Integer getAge()
{
return age;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setEducation(String education)
{
this.education = education;
}
public String getEducation()
{
return education;
}
public void setAppearance(String appearance)
{
this.appearance = appearance;
}
public String getAppearance()
{
return appearance;
}
public void setCourseName(String courseName)
{
this.courseName = courseName;
}
public String getCourseName()
{
return courseName;
}
public void setClassName(String className)
{
this.className = className;
}
public String getClassName()
{
return className;
}
public void setBzrClassName(String bzrClassName)
{
this.bzrClassName = bzrClassName;
}
public String getBzrClassName()
{
return bzrClassName;
}
public void setFbzrClassName(String fbzrClassName)
{
this.fbzrClassName = fbzrClassName;
}
public String getFbzrClassName()
{
return fbzrClassName;
}
public void setIsTeachingGroupLeader(String isTeachingGroupLeader)
{
this.isTeachingGroupLeader = isTeachingGroupLeader;
}
public String getIsTeachingGroupLeader()
{
return isTeachingGroupLeader;
}
public void setIsResearchGroupLeader(String isResearchGroupLeader)
{
this.isResearchGroupLeader = isResearchGroupLeader;
}
public String getIsResearchGroupLeader()
{
return isResearchGroupLeader;
}
public void setClassHour(Integer classHour)
{
this.classHour = classHour;
}
public Integer getClassHour()
{
return classHour;
}
public void setClassTeacherDetails(String classTeacherDetails)
{
this.classTeacherDetails = classTeacherDetails;
}
public String getClassTeacherDetails()
{
return classTeacherDetails;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("noticeId", getNoticeId())
.append("filesSemester", getFilesSemester())
.append("teacherId", getTeacherId())
.append("teacherName", getTeacherName())
.append("gradeId", getGradeId())
.append("gradeName", getGradeName())
.append("idCard", getIdCard())
.append("sex", getSex())
.append("age", getAge())
.append("title", getTitle())
.append("education", getEducation())
.append("appearance", getAppearance())
.append("courseName", getCourseName())
.append("className", getClassName())
.append("bzrClassName", getBzrClassName())
.append("fbzrClassName", getFbzrClassName())
.append("isTeachingGroupLeader", getIsTeachingGroupLeader())
.append("isResearchGroupLeader", getIsResearchGroupLeader())
.append("classHour", getClassHour())
.append("classTeacherDetails", getClassTeacherDetails())
.append("state", getState())
.toString();
}
}
......@@ -5,8 +5,10 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.Date;
import java.util.List;
/**
* 教师档案获奖情况对象 teacher_files_award
......@@ -46,6 +48,16 @@ public class TeacherFilesAward extends BaseEntity
@Excel(name = "发证机关")
private String licenseIssuingAuthority;
private List<SchoolAccessory> accessories;
public List<SchoolAccessory> getAccessories() {
return accessories;
}
public void setAccessories(List<SchoolAccessory> accessories) {
this.accessories = accessories;
}
public void setId(Long id)
{
this.id = id;
......
......@@ -5,8 +5,10 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.Date;
import java.util.List;
/**
* 教师档案课题编写情况对象 teacher_files_material
......@@ -38,6 +40,16 @@ public class TeacherFilesMaterial extends BaseEntity
@Excel(name = "发表时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date publishTime;
private List<SchoolAccessory> accessories;
public List<SchoolAccessory> getAccessories() {
return accessories;
}
public void setAccessories(List<SchoolAccessory> accessories) {
this.accessories = accessories;
}
public void setId(Long id)
{
this.id = id;
......
......@@ -5,8 +5,10 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.Date;
import java.util.List;
/**
* 教师档案论文情况对象 teacher_files_thesis
......@@ -46,6 +48,16 @@ public class TeacherFilesThesis extends BaseEntity
@Excel(name = "发表时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date publishTime;
private List<SchoolAccessory> schoolAccessoryList ;
public List<SchoolAccessory> getSchoolAccessoryList() {
return schoolAccessoryList;
}
public void setSchoolAccessoryList(List<SchoolAccessory> schoolAccessoryList) {
this.schoolAccessoryList = schoolAccessoryList;
}
public void setId(Long id)
{
this.id = id;
......
......@@ -5,8 +5,10 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import java.util.Date;
import java.util.List;
/**
* 教师档案培训情况对象 teacher_files_training
......@@ -42,6 +44,16 @@ public class TeacherFilesTraining extends BaseEntity
@Excel(name = "是否合格", readConverterExp = "1=合格,0不合格")
private String isQualified;
private List<SchoolAccessory> accessories;
public List<SchoolAccessory> getAccessories() {
return accessories;
}
public void setAccessories(List<SchoolAccessory> accessories) {
this.accessories = accessories;
}
public void setId(Long id)
{
this.id = id;
......
......@@ -9,6 +9,7 @@ import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolGradeByClassVo;
import java.util.List;
import java.util.Map;
/**
* 教师档案通知Mapper接口
......@@ -43,7 +44,7 @@ public interface TeacherFilesNoticeMapper
public int insertTeacherFilesNotice(TeacherFilesNotice teacherFilesNotice);
public List<TeacherFilesNotice> selctTeacherByUserId(@Param("userId") Long userId, @Param("teacherFiles") TeacherFilesNotice teacherFiles);
public List<TeacherFilesNotice> selctTeacherByUserId(TeacherFiles teacherFiles);
/**
* 修改教师档案通知
......
//package yangtz.cs.liu.campus.service.impl.teacherFiles;
//
//import com.ruoyi.common.config.RuoYiConfig;
//import com.ruoyi.common.core.domain.AjaxResult;
//import org.apache.poi.hssf.util.HSSFColor;
//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 java.io.File;
//import java.io.FileOutputStream;
//import java.text.ParseException;
//import java.util.*;
//
//@Service
//public class TeacherFilesExcelUtil {
//
// @Autowired
// private RuoYiConfig ruoYiConfig;
//
//
//// private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// private SimpleDateFormat sdfS = new SimpleDateFormat("yyyy年MM月dd日");
//// private SimpleDateFormat sdfMS = new SimpleDateFormat("yyyy年MM月");
//
// public AjaxResult getExcel(String noticeId)
// throws Exception {
// // 创建新的Excel 工作簿
// XSSFWorkbook workbook = new XSSFWorkbook();
// /**
// * 主标题
// */
// XSSFCellStyle mainTitle = workbook.createCellStyle();
// //垂直居中
// mainTitle.setVerticalAlignment(VerticalAlignment.CENTER);
// //水平居中
// mainTitle.setAlignment(HorizontalAlignment.CENTER);
// Font mainfont = workbook.createFont();
// mainfont.setFontHeightInPoints((short) 28);
// mainTitle.setFont(mainfont);
//
// /**
// * 标题
// */
// XSSFCellStyle datetitle = workbook.createCellStyle();
// //垂直居中
// datetitle.setVerticalAlignment(VerticalAlignment.CENTER);
// Font datefont = workbook.createFont();
// datefont.setFontHeightInPoints((short) 14);
// datetitle.setFont(datefont);
//
// /**
// * 标题
// */
// XSSFCellStyle title = workbook.createCellStyle();
// //垂直居中
// title.setVerticalAlignment(VerticalAlignment.CENTER);
// //水平居中
// title.setAlignment(HorizontalAlignment.CENTER);
// Font font0 = workbook.createFont();
// font0.setFontHeightInPoints((short) 16);
// font0.setBold(true);
// title.setFont(font0);
// title.setBorderBottom(BorderStyle.THIN); //下边框
// title.setBorderLeft(BorderStyle.THIN);//左边框
// title.setBorderTop(BorderStyle.THIN);//上边框
// title.setBorderRight(BorderStyle.THIN);//右边框
//
// /**
// * 正常格
// */
// XSSFCellStyle cellStyle = workbook.createCellStyle();
// //垂直居中
// cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// //水平居中
// cellStyle.setAlignment(HorizontalAlignment.CENTER);
// cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
// cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
// cellStyle.setBorderTop(BorderStyle.THIN);//上边框
// cellStyle.setBorderRight(BorderStyle.THIN);//右边框
// cellStyle.setWrapText(true);
// Font font = workbook.createFont();
// font.setFontHeightInPoints((short) 12);
// cellStyle.setFont(font);
//
// /**
// * 黄背景格
// */
// XSSFCellStyle yellowFont = workbook.createCellStyle();
// yellowFont.setWrapText(true);
// yellowFont.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GOLD.getIndex());
// yellowFont.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// //垂直居中
// yellowFont.setVerticalAlignment(VerticalAlignment.CENTER);
// //水平居中
// yellowFont.setAlignment(HorizontalAlignment.CENTER);
// yellowFont.setBorderBottom(BorderStyle.THIN); //下边框
// yellowFont.setBorderLeft(BorderStyle.THIN);//左边框
// yellowFont.setBorderTop(BorderStyle.THIN);//上边框
// yellowFont.setBorderRight(BorderStyle.THIN);//右边框
// yellowFont.setFont(font);
//
// /**
// * 红字体格
// */
// XSSFCellStyle redFont = workbook.createCellStyle();
// //垂直居中
// redFont.setVerticalAlignment(VerticalAlignment.CENTER);
// //水平居中
// redFont.setAlignment(HorizontalAlignment.CENTER);
// Font font1 = workbook.createFont();
// font1.setColor(HSSFColor.HSSFColorPredefined.DARK_RED.getIndex());
// font1.setFontHeightInPoints((short) 12);
// redFont.setFont(font1);
// redFont.setBorderBottom(BorderStyle.THIN); //下边框
// redFont.setBorderLeft(BorderStyle.THIN);//左边框
// redFont.setBorderTop(BorderStyle.THIN);//上边框
// redFont.setBorderRight(BorderStyle.THIN);//右边框
//
// List<Long> depaList = getDepaList(request.getDepartment());
// /**
// * 时间集合
// */
// List<AttendanceDatePoi> dateDes = getDateDes(request.getStartTime(), request.getEndTime());
//
// for (int t = 0; t < dateDes.size(); t++) {
//
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(dateDes.get(t).getStartDate());
// int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
// int month = calendar.get(Calendar.MONTH);
// int year = calendar.get(Calendar.YEAR);
//
// XSSFSheet sheet = workbook.createSheet();
// workbook.setSheetName(t, dateDes.get(t).getMonth());
// /**
// * 第一行
// */
// XSSFRow row0 = sheet.createRow(0);
// row0.setHeightInPoints(51);
// sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 4 + actualMaximum));
// XSSFCell cell0 = row0.createCell(0);
// cell0.setCellStyle(mainTitle);
// cell0.setCellValue("考勤表");
//
// /**
// * 第二行
// */
// XSSFRow row1 = sheet.createRow(1);
// sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 4));
// XSSFCell cel1 = row1.createCell(0);
// cel1.setCellStyle(datetitle);
// cel1.setCellValue(sdfS.format(dateDes.get(t).getStartDate()) + "-" + sdfS.format(dateDes.get(t).getEndDate()));
//
// XSSFCell cel22 = row1.createCell(actualMaximum - 11);
// cel22.setCellValue("√");
// XSSFCell cel33 = row1.createCell(actualMaximum - 10);
// cel33.setCellValue("出勤");
// XSSFCell cel2 = row1.createCell(actualMaximum - 9);
// cel2.setCellValue("●");
// XSSFCell cel3 = row1.createCell(actualMaximum - 8);
// cel3.setCellValue("未签到");
// XSSFCell cel4 = row1.createCell(actualMaximum - 7);
// cel4.setCellValue("□");
// XSSFCell cel5 = row1.createCell(actualMaximum - 6);
// cel5.setCellValue("事假");
// XSSFCell cel6 = row1.createCell(actualMaximum - 5);
// cel6.setCellValue("☆");
// XSSFCell cel7 = row1.createCell(actualMaximum - 4);
// cel7.setCellValue("节假日");
// XSSFCell cel8 = row1.createCell(actualMaximum - 3);
// cel8.setCellValue("△");
// XSSFCell cel9 = row1.createCell(actualMaximum - 2);
// cel9.setCellValue("迟到");
// XSSFCell cel10 = row1.createCell(actualMaximum - 1);
// cel10.setCellValue("○");
// XSSFCell cel11 = row1.createCell(actualMaximum);
// cel11.setCellValue("早退");
// XSSFCell cel12 = row1.createCell(actualMaximum + 1);
// cel12.setCellValue("×");
// XSSFCell cel13 = row1.createCell(actualMaximum + 2);
// cel13.setCellValue("旷工");
// XSSFCell cel14 = row1.createCell(actualMaximum + 3);
// cel14.setCellValue("#");
// XSSFCell cel15 = row1.createCell(actualMaximum + 4);
// cel15.setCellValue("外勤");
// /**
// * 第三行
// */
// XSSFRow row2 = sheet.createRow(2);
// XSSFCell cell = row2.createCell(0);
// cell.setCellValue("序号");
// cell.setCellStyle(title);
// sheet.setColumnWidth(0, 34 * 45);
//
//
// XSSFCell cell1 = row2.createCell(1);
// cell1.setCellValue("姓名");
// cell1.setCellStyle(title);
// sheet.setColumnWidth(1, 34 * 65);
//
// XSSFCell cell2 = row2.createCell(2);
// cell2.setCellValue("科室名");
// cell2.setCellStyle(title);
// sheet.setColumnWidth(2, 34 * 75);
//
// XSSFCell cell3 = row2.createCell(3);
// cell3.setCellValue("签到异常天数");
// cell3.setCellStyle(title);
// sheet.setColumnWidth(3, 34 * 130);
//
// XSSFCell cell4 = row2.createCell(4);
// cell4.setCellValue("事假");
// cell4.setCellStyle(title);
// sheet.setColumnWidth(4, 34 * 45);
//
// for (int i = 1; i <= actualMaximum; i++) {
// XSSFCell cell5 = row2.createCell(4 + i);
// cell5.setCellValue(i);
// cell5.setCellStyle(title);
// sheet.setColumnWidth(4 + i, 34 * 34);
// }
//
// /**
// * 职工集合
// */
// int x = 3;
// int id = 1;
// for (Long depaid : depaList) {
// System.out.println("查询"+depaid);
// List<XxdjEmployees> xxdjEmployeesList = employeesMapper.SelectByDepartment(String.valueOf(depaid));
// System.out.println("职工集合查询"+xxdjEmployeesList);
// Dept dept = deptMapper.selectDeptById(depaid);
// for (XxdjEmployees xxdjEmployees : xxdjEmployeesList) {
// XSSFRow xrow1 = sheet.createRow(x);
// XSSFRow xrow2 = sheet.createRow(x + 1);
// XSSFRow xrow3 = sheet.createRow(x + 2);
// XSSFRow xrow4 = sheet.createRow(x + 3);
// //序号
// XSSFCell xcell0 = xrow1.createCell(0);
// XSSFCell x2cell0 = xrow2.createCell(0);
// XSSFCell x3cell0 = xrow3.createCell(0);
// XSSFCell x4cell0 = xrow4.createCell(0);
// xcell0.setCellStyle(cellStyle);
// x2cell0.setCellStyle(cellStyle);
// x3cell0.setCellStyle(cellStyle);
// x4cell0.setCellStyle(cellStyle);
// xcell0.setCellValue(id);
// //姓名
// XSSFCell xcell1 = xrow1.createCell(1);
// XSSFCell x2cell1 = xrow2.createCell(1);
// XSSFCell x3cell1 = xrow3.createCell(1);
// XSSFCell x4cell1 = xrow4.createCell(1);
// xcell1.setCellStyle(cellStyle);
// x2cell1.setCellStyle(cellStyle);
// x3cell1.setCellStyle(cellStyle);
// x4cell1.setCellStyle(cellStyle);
// xcell1.setCellValue(xxdjEmployees.getName());
// //科室名
// XSSFCell xcell2 = xrow1.createCell(2);
// XSSFCell x2cell2 = xrow2.createCell(2);
// XSSFCell x3cell2 = xrow3.createCell(2);
// XSSFCell x4cell2 = xrow4.createCell(2);
// xcell2.setCellStyle(cellStyle);
// x2cell2.setCellStyle(cellStyle);
// x3cell2.setCellStyle(cellStyle);
// x4cell2.setCellStyle(cellStyle);
// xcell2.setCellValue(dept.getDeptName());
// //签到异常天数
// XSSFCell xcell3 = xrow1.createCell(3);
// XSSFCell x2cell3 = xrow2.createCell(3);
// XSSFCell x3cell3 = xrow3.createCell(3);
// XSSFCell x4cell3 = xrow4.createCell(3);
// xcell3.setCellStyle(cellStyle);
// x2cell3.setCellStyle(cellStyle);
// x3cell3.setCellStyle(cellStyle);
// x4cell3.setCellStyle(cellStyle);
// //事假
// XSSFCell xcell4 = xrow1.createCell(4);
// XSSFCell x2cell4 = xrow2.createCell(4);
// XSSFCell x3cell4 = xrow3.createCell(4);
// XSSFCell x4cell4 = xrow4.createCell(4);
// xcell4.setCellStyle(redFont);
// x2cell4.setCellStyle(redFont);
// x3cell4.setCellStyle(redFont);
// x4cell4.setCellStyle(redFont);
//
// sheet.addMergedRegion(new CellRangeAddress(x, x + 3, 0, 0));
// sheet.addMergedRegion(new CellRangeAddress(x, x + 3, 1, 1));
// sheet.addMergedRegion(new CellRangeAddress(x, x + 3, 2, 2));
// sheet.addMergedRegion(new CellRangeAddress(x, x + 3, 3, 3));
// sheet.addMergedRegion(new CellRangeAddress(x, x + 3, 4, 4));
//
// String idcard = xxdjEmployees.getIdcard();
// if (idcard != null && !"".equals(idcard)) {
// Map map = new HashMap();
// map.put("idCard", idcard);
// map.put("startDay", sdf.format(dateDes.get(t).getStartDate()));
// map.put("endDay", sdf.format(dateDes.get(t).getEndDate()));
// List<XxdjAttendance> xxdjAttendances = attendanceMapper.selectMonth(map);
// Map<String, XxdjAttendance> attendanceMap = new HashMap();
// for (XxdjAttendance xxdjAttendance : xxdjAttendances) {
// attendanceMap.put(xxdjAttendance.getAttendanceDay(), xxdjAttendance);
// }
// int leaveDate = 0;
// int errorDate = 0;
// for (int i = 1; i <= actualMaximum; i++) {
// XSSFCell xcell5 = xrow1.createCell(4 + i);
// XSSFCell x2cell5 = xrow2.createCell(4 + i);
// XSSFCell x3cell5 = xrow3.createCell(4 + i);
// XSSFCell x4cell5 = xrow4.createCell(4 + i);
// Calendar xcalendar = Calendar.getInstance();
// xcalendar.set(year, month, i);
// int weekDay = xcalendar.get(Calendar.DAY_OF_WEEK);
// if (weekDay == 7 || weekDay == 1) {
// xcell5.setCellStyle(yellowFont);
// x2cell5.setCellStyle(yellowFont);
// x3cell5.setCellStyle(yellowFont);
// x4cell5.setCellStyle(yellowFont);
// } else {
// xcell5.setCellStyle(cellStyle);
// x2cell5.setCellStyle(cellStyle);
// x3cell5.setCellStyle(cellStyle);
// x4cell5.setCellStyle(cellStyle);
// }
// XxdjAttendance xxdjAttendance = attendanceMap.get(sdf.format(xcalendar.getTime()));
// if (xxdjAttendance != null) {
// xcell5.setCellValue(toFHstate(xxdjAttendance.getForenoonStart()) + toFHoutside(xxdjAttendance.getForenoonStartOutside()));
// x2cell5.setCellValue(toFHstate(xxdjAttendance.getForenoonEnd()) + toFHoutside(xxdjAttendance.getForenoonEndOutside()));
// x3cell5.setCellValue(toFHstate(xxdjAttendance.getAfternoonStart()) + toFHoutside(xxdjAttendance.getAfternoonStartOutside()));
// x4cell5.setCellValue(toFHstate(xxdjAttendance.getAfternoonEnd()) + toFHoutside(xxdjAttendance.getAfternoonEndOutside()));
// if ("1".equals(xxdjAttendance.getLeaveDate())) {
// leaveDate++;
// }
// if ("1".equals(xxdjAttendance.getErrorDate())) {
// errorDate++;
// }
//
// }
// }
// xcell3.setCellValue(errorDate);
// xcell4.setCellValue(leaveDate);
//
// }
// x = x + 4;
// id++;
// }
// }
// }
//
// FileOutputStream fos = new FileOutputStream(getAbsoluteFile("签到表.xlsx"));
// // 把相应的Excel 工作簿存盘
// workbook.write(fos);
// fos.flush();
// // 操作结束,关闭文件
// fos.close();
// return AjaxResult.success("签到表.xlsx");
// }
//
// /**
// * 获取下载路径
// *
// * @param filename 文件名称
// */
// public String getAbsoluteFile(String filename) {
// String downloadPath = ruoYiConfig.getDownloadPath() + filename;
// File desc = new File(downloadPath);
// if (!desc.getParentFile().exists()) {
// desc.getParentFile().mkdirs();
// }
// return downloadPath;
// }
//
// //(1.正常 2.迟到 3.早退 4.请假 5.未签到 6.节假日 7.旷工)
// private String toFHstate(String state) {
// if (state == null) {
// return "●";
// }
// switch (state) {
// case "1":
// return "√";
// case "2":
// return "△";
// case "3":
// return "○";
// case "4":
// return "□";
// case "6":
// return "☆";
// case "7":
// return "×";
// default:
// return "●";
// }
// }
//
// private String toFHoutside(String outside) {
// if (outside == null) {
// return "";
// }
// switch (outside) {
// case "1":
// return "#";
// default:
// return "";
// }
// }
//
// public List<AttendanceDatePoi> getDateDes(String startDate, String endDate) {
// List<AttendanceDatePoi> datePois = new ArrayList<>();
// try {
//
// Date start = sdf.parse(startDate);
// Date end = sdf.parse(endDate);
// Calendar startCalendar = Calendar.getInstance();
// startCalendar.setTime(start);
// int startYear = startCalendar.get(Calendar.YEAR);
// int startMonth = startCalendar.get(Calendar.MONTH);
// int startDay = startCalendar.get(Calendar.DAY_OF_MONTH);
// Calendar endCalendar = Calendar.getInstance();
// endCalendar.setTime(end);
// int endYear = endCalendar.get(Calendar.YEAR);
// int endMonth = endCalendar.get(Calendar.MONTH);
// int endDay = endCalendar.get(Calendar.DAY_OF_MONTH);
// for (int year = startYear; year <= endYear; year++) {
//
// if (year != startYear)
// startMonth = 1;
// int maxMonth = 12;
// if (year == endYear) {
// maxMonth = endMonth;
// }
// for (int month = startMonth; month <= maxMonth; month++) {
// Calendar calendar = Calendar.getInstance();
// calendar.set(Calendar.YEAR, year);
// calendar.set(Calendar.MONTH, month);
// int actualMaximum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
// AttendanceDatePoi datePoi = new AttendanceDatePoi();
// if (month != startMonth)
// startDay = 1;
// if (month == endMonth && year == endYear)
// actualMaximum = endDay;
// datePoi.setMonth(sdfMS.format(calendar.getTime()));
// calendar.set(Calendar.DAY_OF_MONTH, startDay);
// datePoi.setStartDate(calendar.getTime());
// calendar.set(Calendar.DAY_OF_MONTH, actualMaximum);
// datePoi.setEndDate(calendar.getTime());
// datePois.add(datePoi);
// }
// }
// } catch (ParseException e) {
// e.printStackTrace();
// }
// return datePois;
// }
//
// //获取 单位id集合
// public List<Long> getDepaList(Long department) {
// List<Long> depaList = new ArrayList<>();
// List<Dept> depts = deptMapper.selectChildrenDeptById(department);
// if (depts == null || depts.size() == 0) {
// depaList.add(department);
// } else {
// for (Dept dept : depts) {
// List<Long> todepaList = getDepaList(dept.getDeptId());
// depaList.addAll(todepaList);
// }
// }
// return depaList;
// }
//}
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.*;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class TeacherFilesExcelUtil {
@Autowired
private RuoYiConfig ruoYiConfig;
@Autowired
private ITeacherFilesService teacherFilesService;
@Autowired
private ISysDictDataService sysDictDataService;
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
public void getExcel(String noticeId, HttpServletResponse response) {
TeacherFiles teacherFiles = new TeacherFiles();
teacherFiles.setNoticeId(noticeId);
List<TeacherFiles> teacherFilesList = teacherFilesService.selectTeacherFilesList(teacherFiles);
// 创建新的Excel 工作簿
XSSFWorkbook workbook = new XSSFWorkbook();
/**
* 主标题
*/
XSSFCellStyle mainTitle = workbook.createCellStyle();
//垂直居中
mainTitle.setVerticalAlignment(VerticalAlignment.CENTER);
//水平居中
mainTitle.setAlignment(HorizontalAlignment.CENTER);
Font mainfont = workbook.createFont();
mainfont.setFontHeightInPoints((short) 12);
mainfont.setBold(true);
mainTitle.setFont(mainfont);
mainTitle.setBorderBottom(BorderStyle.THIN); //下边框
mainTitle.setBorderLeft(BorderStyle.THIN);//左边框
mainTitle.setBorderTop(BorderStyle.THIN);//上边框
mainTitle.setBorderRight(BorderStyle.THIN);//右边框
/**
* 正文
*/
XSSFCellStyle title = workbook.createCellStyle();
//垂直居中
title.setVerticalAlignment(VerticalAlignment.CENTER);
//水平居中
title.setAlignment(HorizontalAlignment.CENTER);
Font font0 = workbook.createFont();
font0.setFontHeightInPoints((short) 12);
title.setFont(font0);
title.setBorderBottom(BorderStyle.THIN); //下边框
title.setBorderLeft(BorderStyle.THIN);//左边框
title.setBorderTop(BorderStyle.THIN);//上边框
title.setBorderRight(BorderStyle.THIN);//右边框
for (int t = 0; t < teacherFilesList.size(); t++) {
TeacherFilesVO files = teacherFilesService.selectTeacherFilesById(teacherFilesList.get(t).getId());
XSSFSheet sheet = workbook.createSheet();
workbook.setSheetName(t, files.getTeacherName()+t);
/**
* 第一行
*/
XSSFRow row0 = sheet.createRow(0);
row0.setHeightInPoints(34);
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 5));
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);
sheet.setColumnWidth(2, 34 * 100);
sheet.setColumnWidth(3, 34 * 140);
sheet.setColumnWidth(4, 34 * 100);
sheet.setColumnWidth(5, 34 * 100);
/**
* 第二行
*/
for(int i=1;i<=8;i++){
XSSFRow row2 = sheet.createRow(i);
row2.setHeightInPoints(20);
XSSFCell cell = row2.createCell(0);
String cellValue1 = "";
switch (i){
case 1:
cellValue1="学年学期";
break;
case 2:
cellValue1="姓名";
break;
case 3:
cellValue1="年龄";
break;
case 4:
cellValue1="学历";
break;
case 5:
cellValue1="任教学科";
break;
case 6:
cellValue1="任正班主任班级";
break;
case 7:
cellValue1="是否教学组长";
break;
case 8:
cellValue1="设计课时量";
break;
}
cell.setCellValue(cellValue1);
cell.setCellStyle(title);
sheet.addMergedRegion(new CellRangeAddress(i, i, 1, 2));
XSSFCell cell1 = row2.createCell(1);
String cellValue2 = "";
switch (i){
case 1:
cellValue2=files.getFilesSemester();
break;
case 2:
cellValue2=files.getTeacherName();
break;
case 3:
if(files.getAge()!=null){
cellValue2=String.valueOf(files.getAge());
}
break;
case 4:
cellValue2=files.getEducation();
break;
case 5:
cellValue2=files.getCourseName();
break;
case 6:
cellValue2=files.getBzrClassName();
break;
case 7:
cellValue2=files.getIsTeachingGroupLeader();
break;
case 8:
if(files.getClassHour()!=null){
cellValue2=String.valueOf(files.getClassHour());
}
break;
}
cell1.setCellValue(cellValue2);
cell1.setCellStyle(title);
XSSFCell cell3 = row2.createCell(2);
cell3.setCellStyle(title);
XSSFCell cell2 = row2.createCell(3);
String cellValue3 = "";
switch (i){
case 1:
cellValue3="级部";
break;
case 2:
cellValue3="性别";
break;
case 3:
cellValue3="职称";
break;
case 4:
cellValue3="政治面貌";
break;
case 5:
cellValue3="任教班级";
break;
case 6:
cellValue3="任副班主任班级";
break;
case 7:
cellValue3="是否教研组长";
break;
case 8:
cellValue3="班主任情况";
break;
}
cell2.setCellValue(cellValue3);
cell2.setCellStyle(title);
sheet.addMergedRegion(new CellRangeAddress(i, i, 4, 5));
XSSFCell cell4 = row2.createCell(4);
String cellValue4 = "";
switch (i){
case 1:
cellValue4=files.getGradeName();
break;
case 2:
if(files.getSex()!=null){
if(files.getSex().equals("0")){
cellValue4="男";
}else{
cellValue4="女";
}
}
break;
case 3:
cellValue4=files.getTitle();
break;
case 4:
cellValue4=files.getAppearance();
break;
case 5:
cellValue4=files.getClassName();
break;
case 6:
cellValue4=files.getFbzrClassName();
break;
case 7:
cellValue4=files.getIsResearchGroupLeader();
break;
case 8:
cellValue4=files.getClassTeacherDetails();
break;
}
cell4.setCellValue(cellValue4);
cell4.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++;
}
}
// 把相应的Excel 工作簿存盘
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
try {
workbook.write(response.getOutputStream());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* 获取下载路径
*
* @param filename 文件名称
*/
public String getAbsoluteFile(String filename) {
String downloadPath = ruoYiConfig.getDownloadPath() + filename;
File desc = new File(downloadPath);
if (!desc.getParentFile().exists()) {
desc.getParentFile().mkdirs();
}
return downloadPath;
}
}
package yangtz.cs.liu.campus.service.impl.teacherFiles;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.TermRange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.award.Award;
import yangtz.cs.liu.campus.domain.material.Material;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
......@@ -13,6 +15,7 @@ import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.teacherFiles.*;
import yangtz.cs.liu.campus.domain.thesis.Thesis;
import yangtz.cs.liu.campus.domain.training.Training;
import yangtz.cs.liu.campus.mapper.accessory.AccessoryMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
......@@ -64,6 +67,10 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Autowired
private SchoolClassMentorMapper classMentorMapper;
@Autowired
private AccessoryMapper accessoryMapper;
/**
* 查询教师档案
*
......@@ -73,11 +80,49 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Override
public TeacherFilesVO selectTeacherFilesById(Long id)
{
TeacherFilesVO teacherFiles = teacherFilesMapper.selectTeacherFilesById(id);
teacherFiles.setMaterialList(FmaterialMapper.selectTeacherFilesMaterialListByFilesId(id));
teacherFiles.setThesisList(FthesisMapper.selectTeacherFilesThesisListByFilesId(id));
teacherFiles.setTrainingList(FtrainingMapper.selectTeacherFilesTrainingListByFilesId(id));
teacherFiles.setAwardList(FawardMapper.selectTeacherFilesAwardListByFilesId(id));
//教师档案课题编写情况
List<TeacherFilesMaterial> teacherFilesMaterials = FmaterialMapper.selectTeacherFilesMaterialListByFilesId(id);
for (TeacherFilesMaterial date :teacherFilesMaterials){
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,date.gettId())
.eq(SchoolAccessory::getAccessoryType,"材料编写附件");
List<SchoolAccessory> accessories = accessoryMapper.selectList(wrapper);
date.setAccessories(accessories);
}
teacherFiles.setMaterialList(teacherFilesMaterials);
//论文
List<TeacherFilesThesis> teacherFilesTheses = FthesisMapper.selectTeacherFilesThesisListByFilesId(id);
for (TeacherFilesThesis date : teacherFilesTheses){
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,date.gettId())
.eq(SchoolAccessory::getAccessoryType,"论文情况附件");
List<SchoolAccessory> accessories = accessoryMapper.selectList(wrapper);
date.setSchoolAccessoryList(accessories);
}
teacherFiles.setThesisList(teacherFilesTheses);
//教师档案培训情况
List<TeacherFilesTraining> teacherFilesTrainings = FtrainingMapper.selectTeacherFilesTrainingListByFilesId(id);
for (TeacherFilesTraining date :teacherFilesTrainings){
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,date.gettId())
.eq(SchoolAccessory::getAccessoryType,"培训情况附件");
List<SchoolAccessory> accessories = accessoryMapper.selectList(wrapper);
date.setAccessories(accessories);
}
teacherFiles.setTrainingList(teacherFilesTrainings);
//教师档案获奖情况
List<TeacherFilesAward> teacherFilesAwards = FawardMapper.selectTeacherFilesAwardListByFilesId(id);
for (TeacherFilesAward date :teacherFilesAwards){
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolAccessory::getBusinessId,date.gettId())
.eq(SchoolAccessory::getAccessoryType,"获奖情况附件");
List<SchoolAccessory> accessories = accessoryMapper.selectList(wrapper);
date.setAccessories(accessories);
}
teacherFiles.setAwardList(teacherFilesAwards);
return teacherFiles;
}
......@@ -114,9 +159,8 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
}
@Override
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId,TeacherFilesNotice teacherFiles) {
return teacherFilesNoticeMapper.selctTeacherByUserId(userId,teacherFiles);
public List<TeacherFilesNotice> selctTeacherByUserId(TeacherFiles teacherFiles) {
return teacherFilesNoticeMapper.selctTeacherByUserId(teacherFiles);
}
/**
......
......@@ -6,6 +6,7 @@ import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO;
import java.util.List;
import java.util.Map;
/**
* 教师档案Service接口
......@@ -45,7 +46,6 @@ public interface ITeacherFilesService
* @return 教师档案集合
*/
public int countYqr(TeacherFiles teacherFiles);
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId,TeacherFilesNotice teacherFiles);
public List<TeacherFilesDeletRecord> getTeacherRocer(String tId);
/**
......@@ -54,6 +54,7 @@ public interface ITeacherFilesService
* @return
*/
public Integer teacherAdd(Long[] ids);
public List<TeacherFilesNotice> selctTeacherByUserId(TeacherFiles teacherFiles);
/**
* 新增教师档案
......
......@@ -80,6 +80,7 @@
</if>
and r.student_id = #{studentId} and d.dcwj_zt = '2' and d.del_flag = '0' and r.del_flag = '0'
</where>
order by d.create_time desc
</select>
<select id="teacherGetDcwjList" resultType="yangtz.cs.liu.wechat.vo.schoolDcwj.Vo_SchoolDcwj">
......@@ -95,6 +96,7 @@
</if>
and r.teacher_id = #{teacherId} and d.dcwj_zt = '2' and d.del_flag = '0' and r.del_flag = '0'
</where>
order by d.create_time desc
</select>
<select id="queryList" resultType="yangtz.cs.liu.campus.vo.schoolDcwj.DawjVo">
......
......@@ -45,19 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selctTeacherByUserId" resultType="yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice">
SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId}
and fn.notice_state = 2
<if test="teacherFiles.noticeRange != null and teacherFiles.noticeRange != ''"> and fn.notice_range = #{teacherFiles.noticeRange}</if>
<if test="teacherFiles.noticeYear != null and teacherFiles.noticeYear != ''"> and fn.notice_year = #{teacherFiles.noticeYear}</if>
<if test="teacherFiles.noticeSemester != null and teacherFiles.noticeSemester != ''"> and fn.notice_semester = #{teacherFiles.noticeSemester}</if>
<if test="teacherFiles.noticeName != null and teacherFiles.noticeName != ''"> and fn.notice_name like concat('%', #{teacherFiles.noticeName}, '%')</if>
<if test="teacherFiles.noticeState != null and teacherFiles.noticeState != ''"> and fn.notice_state = #{teacherFiles.noticeState}</if>
<if test="teacherFiles.startTime != null "> and start_time = #{teacherFiles.startTime}</if>
<if test="teacherFiles.endTime != null "> and end_time = #{teacherFiles.endTime}</if>
</select>
<select id="selectTeacherFilesNoticeListByUser" parameterType="TeacherFilesNotice" resultType="TeacherFilesNoticeTotal">
<include refid="selectTeacherFilesNoticeTotalVo"/>
<where>
......@@ -78,6 +65,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="selctTeacherByUserId" parameterType="TeacherFiles" resultType="yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice">
SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId}
and fn.notice_state = 2
<if test="noticeName != null "> and fn.notice_name LIKE concat('%', #{noticeName}, '%') </if>
</select>
<insert id="insertTeacherFilesNotice" parameterType="TeacherFilesNotice">
insert into teacher_files_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
......
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