|
@@ -135,6 +135,45 @@ public class ExportController extends BaseController {
|
|
private SellOrderDao sellOrderDao;
|
|
private SellOrderDao sellOrderDao;
|
|
@Autowired
|
|
@Autowired
|
|
private VipGroupActivityService vipGroupActivityService;
|
|
private VipGroupActivityService vipGroupActivityService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private GoodsService goodsService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "商品列表导出")
|
|
|
|
+ @PostMapping("export/goods")
|
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/goods')")
|
|
|
|
+ public void exportGoods(HttpServletResponse response, GoodsQueryInfo queryInfo) throws IOException {
|
|
|
|
+ queryInfo.setPage(1);
|
|
|
|
+ queryInfo.setRows(49999);
|
|
|
|
+ List<Goods> rows = goodsService.queryPage(queryInfo).getRows();
|
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
|
+ try {
|
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"商品编号", "货号", "品牌", "商品名称",
|
|
|
|
+ "是否组合商品", "学员是否展示", "教务端是否展示", "乐团是否展示", "是否库存预警",
|
|
|
|
+ "商品类型", "商品分类", "具体型号", "内部库存", "税务库存", "库存类型", "市场价(元)",
|
|
|
|
+ "零售价(元)", "商品团购价(元)", "商品描述", "商品详情", "是否上下架"}, new String[]{
|
|
|
|
+ "id", "sn", "brand", "name",
|
|
|
|
+ "complementGoodsIdList == null || complementGoodsIdList == '' ? '否':'是'", "clientShow.msg", "educationalShow.msg", "musicGroupShow.msg", "stockWarning.msg",
|
|
|
|
+ "type.desc", "goodsCategoryName", "specification", "stockCount", "taxStockCount", "stockType.msg", "marketPrice",
|
|
|
|
+ "discountPrice", "groupPurchasePrice", "brief", "desc", "status.msg"}, rows);
|
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
|
+ response.setHeader("Content-Disposition", "attac:wq" +
|
|
|
|
+ "hment;filename=goods-" + 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 = "VIP活动导出")
|
|
@ApiOperation(value = "VIP活动导出")
|
|
@PostMapping("export/vipGroupActivity")
|
|
@PostMapping("export/vipGroupActivity")
|