|  | @@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomMemberVo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.constant.CommonConstants;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.controller.BaseController;
 | 
	
	
		
			
				|  | @@ -17,10 +18,12 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.date.DateUtil;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.excel.POIUtil;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiImplicitParam;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiImplicitParams;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @@ -30,13 +33,11 @@ import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import javax.annotation.Resource;
 | 
	
		
			
				|  |  |  import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import java.io.IOException;
 | 
	
		
			
				|  |  |  import java.io.OutputStream;
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.util.*;
 | 
	
		
			
				|  |  | -import java.util.concurrent.CompletableFuture;
 | 
	
		
			
				|  |  | -import java.util.concurrent.ExecutorService;
 | 
	
		
			
				|  |  | -import java.util.concurrent.Executors;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @RequestMapping
 | 
	
	
		
			
				|  | @@ -138,6 +139,9 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |      private MusicGroupService musicGroupService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysTenantConfigService sysTenantConfigService;
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ImLiveBroadcastRoomMemberService imLiveBroadcastRoomMemberService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "获取可导出字段")
 | 
	
		
			
				|  |  |      @RequestMapping("export/getFields")
 | 
	
	
		
			
				|  | @@ -2925,4 +2929,43 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "直播间人员列表导出")
 | 
	
		
			
				|  |  | +    @PostMapping("export/liveBroadcastRoomMember")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@pcs.hasPermissions('export/liveBroadcastRoomMember')")
 | 
	
		
			
				|  |  | +    public void exportLiveBroadcastRoomMember(HttpServletResponse response, LiveBroadcastRoomMemberQueryInfo queryInfo) throws IOException {
 | 
	
		
			
				|  |  | +        queryInfo.setPage(1);
 | 
	
		
			
				|  |  | +        queryInfo.setRows(49999);
 | 
	
		
			
				|  |  | +        Map<String, Object> params = new HashMap<String, Object>();
 | 
	
		
			
				|  |  | +        MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  | +        List<ImLiveBroadcastRoomMemberVo> rows = imLiveBroadcastRoomMemberService.queryRoomMember(params).getRows();
 | 
	
		
			
				|  |  | +        if (rows.size() < 1) {
 | 
	
		
			
				|  |  | +            throw new BizException("没有可导出数据");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        OutputStream outputStream = response.getOutputStream();
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"直播间编号", "直播间标题", "主讲人", "学生编号", "学生姓名",
 | 
	
		
			
				|  |  | +                    "手机号", "声部", "所在分部", "所在乐团", "加入时间", "观看时长(分钟)"}, new String[]{
 | 
	
		
			
				|  |  | +                    "roomUid", "roomTitle", "speakerName", "studentId", "studentName", "phone", "subName",
 | 
	
		
			
				|  |  | +                    "organName", "musicGroupName", "joinTime"
 | 
	
		
			
				|  |  | +                    , "totalViewTime"}, rows);
 | 
	
		
			
				|  |  | +            response.setContentType("application/octet-stream");
 | 
	
		
			
				|  |  | +            response.setHeader("Content-Disposition", "attac:wq" +
 | 
	
		
			
				|  |  | +                    "hment;filename=liveroomMember-" + DateUtil.getDate(new Date()) + ".xls");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            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();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |