|
@@ -81,8 +81,59 @@ public class ExportController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private TeacherSalaryComplaintsService teacherSalaryComplaintsService;
|
|
private TeacherSalaryComplaintsService teacherSalaryComplaintsService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private TeacherAttendanceService teacherAttendanceService;
|
|
|
|
+ @Autowired
|
|
private TeacherCourseRewardService teacherCourseRewardService;
|
|
private TeacherCourseRewardService teacherCourseRewardService;
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "导出教师考勤列表")
|
|
|
|
+ @PostMapping("export/queryTeacherAttendances")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/queryTeacherAttendances')")
|
|
|
|
+ public void exportTeacherAttendances(HttpServletResponse response, TeacherCloseQueryInfo queryInfo) throws IOException {
|
|
|
|
+ queryInfo.setRows(49999);
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if (sysUser == null) {
|
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
|
+ }
|
|
|
|
+ if(!sysUser.getIsSuperAdmin()){
|
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
|
+ }else if(StringUtils.isEmpty(employee.getOrganIdList())){
|
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
|
+ }else {
|
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
|
+ if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
|
|
|
|
+ throw new BizException("非法请求");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List rows = teacherAttendanceService.queryTeacherAttendances(queryInfo).getRows();
|
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
|
+ try {
|
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "老师编号", "老师姓名", "课程编号", "课程名称", "上课日期",
|
|
|
|
+ "课程开始时间","课程结束时间","课程类型","签到时间","签到状态","签退时间","签退状态","备注"}, new String[]{
|
|
|
|
+ "organName", "teacherId", "teacherName", "courseScheduleId", "courseScheduleName", "classDate",
|
|
|
|
+ "startClassTime", "endClassTime", "courseScheduleType", "signInTime", "signInStatus", "signOutTime", "signOutStatus",
|
|
|
|
+ "remark"}, rows);
|
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
|
+ response.flushBuffer();
|
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
|
+ workbook.write(outputStream);
|
|
|
|
+ outputStream.flush();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } finally {
|
|
|
|
+ if (outputStream != null) {
|
|
|
|
+ try {
|
|
|
|
+ outputStream.close();
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "导出申述处理列表")
|
|
@ApiOperation(value = "导出申述处理列表")
|
|
@PostMapping("export/teacherSalaryComplaints")
|
|
@PostMapping("export/teacherSalaryComplaints")
|
|
@PreAuthorize("@pcs.hasPermissions('export/teacherSalaryComplaints')")
|
|
@PreAuthorize("@pcs.hasPermissions('export/teacherSalaryComplaints')")
|