| 
					
				 | 
			
			
				@@ -104,6 +104,8 @@ public class ExportController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private MusicGroupBuildLogDao musicGroupBuildLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private SellOrderService sellOrderService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @ApiOperation(value = "乐团管理--修改--缴费设置--缴费记录导出") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @PostMapping("export/musicGroupPaymentCalenderDetail") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2326,4 +2328,59 @@ public class ExportController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @ApiOperation(value = "销售列表导出") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @RequestMapping("export/exportSellOrders") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PreAuthorize("@pcs.hasPermissions('export/exportSellOrders')") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void exportSellOrders(HttpServletResponse response, SellOrderQueryInfo queryInfo) throws IOException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (sysUser == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BizException("用户信息获取失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!sysUser.getIsSuperAdmin()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Employee employee = employeeDao.get(sysUser.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                queryInfo.setOrganIdList(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.getOrganIdList().split(",")))) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    throw new BizException("非法请求"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (queryInfo.getEndTime() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryInfo.setPage(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryInfo.setRows(49999); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SellOrder> rows = sellOrderService.queryPage(queryInfo).getRows(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        OutputStream outputStream = response.getOutputStream(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "交易流水号", "订单号", "销售日期", "销售类型", "商品名称", "数量","应付金额(元)", "余额支付(元)", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "现金支付(元)", "销售成本(元)", "学员姓名","交易方式", "收款账户", "账户类型", "扣减库存", "所属分部", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "所属学校", "教务老师", "确认收货", "状态"}, new String[]{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "transNo", "orderId", "sellTime", "type.desc", "goodsName", "num", "expectAmount", "balanceAmount", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "actualAmount", "sellCost", "userName", "paymentChannel", "merNo", "accountType.msg", "stockType.msg", "organName", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    "schoolName", "eduTeacher", "receiveStatus", "status.msg"}, 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(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |