|  | @@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  | +import java.io.IOException;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
	
		
			
				|  | @@ -68,6 +69,8 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |      private SporadicChargeInfoService sporadicChargeInfoService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private PracticeGroupDao practiceGroupDao;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private CourseReviewService courseReviewService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "导出老师课酬")
 | 
	
		
			
				|  |  |      @PostMapping("export/teacherSalary")
 | 
	
	
		
			
				|  | @@ -625,4 +628,53 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |              e.printStackTrace();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "评论列表导出")
 | 
	
		
			
				|  |  | +    @RequestMapping("export/courseReviews")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@pcs.hasPermissions('export/courseReviews')")
 | 
	
		
			
				|  |  | +    public void export(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if (!sysUser.getIsSuperAdmin()) {
 | 
	
		
			
				|  |  | +            Employee employee = employeeDao.get(sysUser.getId());
 | 
	
		
			
				|  |  | +            queryInfo.setOrganId(employee.getOrganIdList());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        queryInfo.setRows(99999);
 | 
	
		
			
				|  |  | +        PageInfo<CourseReviewDto> practiceGroupReviews = courseReviewService.findPracticeGroupReviews(queryInfo);
 | 
	
		
			
				|  |  | +        if(practiceGroupReviews.getTotal() <= 0){
 | 
	
		
			
				|  |  | +            response.setStatus(500);
 | 
	
		
			
				|  |  | +            response.setContentType("Content-Type: application/json;charset=UTF-8");
 | 
	
		
			
				|  |  | +            response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
 | 
	
		
			
				|  |  | +            response.flushBuffer();
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            for (CourseReviewDto row : practiceGroupReviews.getRows()) {
 | 
	
		
			
				|  |  | +                row.setClassDateStr(DateUtil.dateToString(row.getClassDate(), "yyyy-MM-dd"));
 | 
	
		
			
				|  |  | +                if (row.getHandHomework() != null && row.getHandHomework() > 0) {
 | 
	
		
			
				|  |  | +                    row.setHandHomeworkStr("是");
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    row.setHandHomeworkStr("否");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (row.getHasLiaison() != null && row.getHasLiaison().equals("1")) {
 | 
	
		
			
				|  |  | +                    row.setHasLiaison("是");
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    row.setHasLiaison("否");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (row.getCreateTime() != null) {
 | 
	
		
			
				|  |  | +                    row.setCreateTimeStr(DateUtil.dateToString(row.getCreateTime(), "yyyy-MM-dd"));
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            String[] header = {"分部", "上课日期", "学生编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置作业)", "完成app双向沟通", "是否提交作业", "教务老师", "教务评价"};
 | 
	
		
			
				|  |  | +            String[] body = {"organName", "classDateStr", "studentId", "courseName", "teacherName", "teachingMaterial", "pronunciation", "tempo", "musicTheory", "song", "memo", "createTimeStr", "hasLiaison", "handHomeworkStr", "eduTeacherName", "courseReview"};
 | 
	
		
			
				|  |  | +            HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupReviews.getRows());
 | 
	
		
			
				|  |  | +            response.setContentType("application/octet-stream");
 | 
	
		
			
				|  |  | +            response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
 | 
	
		
			
				|  |  | +            response.flushBuffer();
 | 
	
		
			
				|  |  | +            workbook.write(response.getOutputStream());
 | 
	
		
			
				|  |  | +            workbook.close();
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |