|
|
@ -6,11 +6,14 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.img.ImgUtil; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.*; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.time.DayOfWeek; |
|
|
|
import java.time.Period; |
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
|
|
|
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
import cn.hutool.extra.qrcode.QrCodeUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
@ -34,9 +37,8 @@ import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoods; |
|
|
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo; |
|
|
|
import com.yxt.yyth.api.lpkgiftcard.*; |
|
|
|
import com.yxt.yyth.api.lpkgoods.LpkGoods; |
|
|
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsDto; |
|
|
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo; |
|
|
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo; |
|
|
|
import com.yxt.yyth.api.lpkgiftcard.CardStatisticsExportVo; |
|
|
|
import com.yxt.yyth.api.lpkreserveorder.*; |
|
|
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods; |
|
|
|
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo; |
|
|
|
import com.yxt.yyth.api.lpkstore.StoreSelect; |
|
|
@ -50,28 +52,20 @@ import com.yxt.yyth.biz.lpkgoods.LpkGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService; |
|
|
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import com.yxt.yyth.utils.StyleUtils; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
|
import org.apache.poi.ss.usermodel.Sheet; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.apache.poi.ss.usermodel.*; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.*; |
|
|
@ -1390,4 +1384,50 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp |
|
|
|
// System.out.println(date);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
public void cardStatisticsListExport(LpkGiftCardListQuery query) { |
|
|
|
ResultBean rb=new ResultBean(); |
|
|
|
QueryWrapper<LpkGiftCardListQuery> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
List<CardStatisticsExportVo> statisticsExportVos=baseMapper.cardStatisticsListExport(qw); |
|
|
|
String excelName = "支行汇总信息.xlsx"; |
|
|
|
String fileNameURL = "1"; |
|
|
|
response.setContentType( "application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding("utf8"); |
|
|
|
response.setHeader("Content-disposition","attachment;filename="+ excelName ); |
|
|
|
ServletOutputStream outputStream = null; |
|
|
|
try { |
|
|
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置头居中
|
|
|
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
//内容策略
|
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置 水平居中
|
|
|
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); |
|
|
|
|
|
|
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), CardStatisticsExportVo.class) |
|
|
|
//是否自动关闭输入流
|
|
|
|
.autoCloseStream(Boolean.TRUE) |
|
|
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
|
|
|
.registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(statisticsExportVos); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
public ResultBean cardStatisticsList(PagerQuery<LpkReserveOrderQuery> pq) { |
|
|
|
ResultBean rb=new ResultBean(); |
|
|
|
LpkReserveOrderQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LpkGiftCardListQuery> qw = new QueryWrapper<>(); |
|
|
|
// QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>();
|
|
|
|
qw.eq("1", "1"); |
|
|
|
IPage<LpkGiftCardListQuery> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<CardStatisticsExportVo> pagging = baseMapper.cardStatisticsList(page, qw); |
|
|
|
|
|
|
|
return rb.success().setData(pagging); |
|
|
|
} |
|
|
|
} |
|
|
|