当前位置: 首页 > news >正文

中国电子工程师网优化深圳seo

中国电子工程师网,优化深圳seo,自己做网站费用,wordpress如何qq登录界面虽然标题叫标准化#xff0c;只不过是我自己的习惯#xff0c;当一件事情变得流程标准化之后#xff0c;开发程序就会飞快#xff0c;开发评估工作总是 搞个1~2天#xff0c;实则前端后端一起开发#xff0c;1个小时就可以搞定。 1 前端 const exportXls async () …虽然标题叫标准化只不过是我自己的习惯当一件事情变得流程标准化之后开发程序就会飞快开发评估工作总是 搞个1~2天实则前端后端一起开发1个小时就可以搞定。 1 前端 const exportXls async () {var now moment(new Date()).format(YYYYMMDDHHMMSS)let name 商品收发明细表.xlsconst res await proxy.$api.invOrder.goodsRdDetail.export({...condForm.value})let data res.data;let url window.URL.createObjectURL(new Blob([data], ))let link document.createElement(a)link.style.display nonelink.href url;console.log(link);link.setAttribute(download, now name)document.body.appendChild(link)link.click()document.body.removeChild(link) }请求的代码如下 public postOnlyFile (url: string, data {} , config: AxiosRequestConfigany {}): Promiseany axios({...this.baseConfig,headers:{...this.baseConfig.headers,Content-Type: application/json},responseType:blob,url,method: post,data,...config,})2 后端 controller层基本就是复制粘贴传参数给到service层而已。 PostMapping(export)ApiOperation(导出商品收发明细表)public void export(RequestBody PsiInvOrderReportCondDto condDto, HttpServletResponse response){//设置响应头response.setContentType(application/vnd.ms-excel);response.setCharacterEncoding(utf-8);//设置防止文件名中文乱码try {//设置防止文件名中文乱码String fileName URLEncoder.encode(商品收发明细表, utf-8);response.setHeader(Content-disposition, attachment;filename fileName .xlsx);//if (!CheckEmptyUtil.isEmpty(condDto.getBillDateRange())){condDto.setStartBillDate(condDto.getBillDateRange().get(0));condDto.setEndBillDate(condDto.getBillDateRange().get(1));}goodsRdDetailService.export(response.getOutputStream(),xls/GoodsRdDetail.xls, condDto);} catch (Exception e) {log.error(e.getMessage(), e);}}service层主要通过easyexcel填充数据 import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.fill.FillConfig;Overridepublic void export(OutputStream outputStream, String pathName, PsiInvOrderReportCondDto condDto) {ListGoodsRdDetailListDto goodsRdDetailListDtos select(condDto);int line 1;for (GoodsRdDetailListDto goodsRdDetailListDto:goodsRdDetailListDtos){goodsRdDetailListDto.setLine(String.valueOf(line));goodsRdDetailListDto.setBillDateStr(DateUtil.formatDate(goodsRdDetailListDto.getBillDate()));BusinessTypeEnum businessTypeEnum BusinessTypeEnum.getInvBusinessTypeEnum(goodsRdDetailListDto.getBusiType());goodsRdDetailListDto.setBusiType(businessTypeEnum.display());}org.springframework.core.io.Resource resource new ClassPathResource(pathName);InputStream inputStream null;String fileName DateUtil.getDateRandom() .xls;File file new File(TmpDic.url File.separator fileName);try {inputStream resource.getInputStream();FileUtils.copyInputStreamToFile(inputStream, file);} catch (IOException e) {e.printStackTrace();}ExcelWriter excelWriter EasyExcel.write(outputStream).withTemplate(file).build();FillConfig fillConfig FillConfig.builder().forceNewRow(Boolean.TRUE).build();//WriteSheet sheet0 EasyExcel.writerSheet(0,单据明细不合并表头)//单元格 // .registerWriteHandler(new CustomCellWriteHandler()).build();excelWriter.fill(goodsRdDetailListDtos, fillConfig, sheet0);//PsiAccountSet psiAccountSet psiAccountSetService.getById(condDto.getAsId());GoodsRdDetailExcelHeaderDto excelHeaderDto new GoodsRdDetailExcelHeaderDto();excelHeaderDto.setCompanyName(psiAccountSet.getName());excelHeaderDto.setStartBillDate(DateUtil.formatDate(condDto.getStartBillDate()));excelHeaderDto.setEndBillDate(DateUtil.formatDate(condDto.getEndBillDate()));excelWriter.fill(excelHeaderDto,sheet0);//excelWriter.finish();file.delete();}3 excel模板 定义excel模板就是上面的xls/GoodsRdDetail.xls
http://www.zqtcl.cn/news/644162/

相关文章:

  • app地推网企业seo解决方案
  • php网站转移网吧手机网站模版
  • 北京建设教育网站今天的国内新闻
  • 江苏省建设银行网站天心区网站建设公司
  • 网站分享设计网站备案收费么
  • 手机网站专题关于asp sql网站开发的书籍
  • 网站建设属于什么领域小米发布会在哪里看
  • 免费空间访客领取网站提高网站互动性
  • 湖北省市政工程建设网站汉中网站建设电话
  • 宁波大型网站推广服务丁香花在线电影小说观看
  • 合肥的网站建设公司哪家好百度旗下产品
  • 墨星写作网站阿里云购买网站登录
  • 做微网站公司知名网站设计
  • 宁波中科网站建设有限公司天津市建设 银行网站
  • 长沙建个网站一般需要多少钱化妆品网站建设方案项目书
  • 宁波外贸网站推广做网站如何选域名
  • 如何在百度上搜索到自己的网站提升关键词
  • asp net做网站建设英文网站的公司
  • 旅游英文网站 建设需求WordPress首页id
  • 南宁网站如何制作网站seo查询站长之家
  • 网站备案太麻烦门户网站模板
  • 九江建网站多少钱打开云南省住房和城乡建设厅网站
  • 合肥市门户网站wordpress登陆不上
  • 摄影网站在线建设办公室设计装修
  • 深圳市移动端网站建设游戏网站建设与策划方案
  • wap版网站 加app提示厦门网站seo优化
  • 旅游网站 功能建设银行网站会员
  • 公园网站建设wordpress 分类目录使用英文
  • 苏州高端网站设计制作wordpress改固定连接
  • 门户网站开源sae安装wordpress