|
@@ -73,6 +73,44 @@ public class ExportController extends BaseController {
|
|
|
@Autowired
|
|
|
private TenantPaymentOrderService tenantPaymentOrderService;
|
|
|
|
|
|
+ @ApiOperation(value = "网管课购买列表")
|
|
|
+ @PostMapping("export/studentBuyPractice")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/studentBuyPractice')")
|
|
|
+ public void studentBuyPractice(HttpServletResponse response, StudentBuyPracticeQueryInfo queryInfo) {
|
|
|
+ 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<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
|
|
|
+ try {
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员名称", "所属分部", "联系电话", "购买网管课",
|
|
|
+ "免费课结束日期", "首次购买日期", "时间差"}, new String[]{
|
|
|
+ "studentId", "studentName", "organName", "phone", "buyPractice.msg",
|
|
|
+ "lastClassDate", "firstBuyTime", "intervalDay"}, rows);
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "导出对外订单列表")
|
|
|
@PostMapping("export/tenantPaymentOrder")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/tenantPaymentOrder')")
|
|
@@ -83,9 +121,6 @@ public class ExportController extends BaseController {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
List<TenantPaymentOrder> paymentOrders = tenantPaymentOrderService.queryPage(queryInfo).getRows();
|
|
|
-// if (paymentOrders.size() > 50000) {
|
|
|
-// throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
-// }
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"交易流水号", "订单号", "订单日期", "交易类型", "应付金额",
|
|
|
"实付金额", "用户姓名", "交易方式", "收款账户", "交易状态", "备注", "交易方式"}, new String[]{
|