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

河南省百城建设提质网站微信h5

河南省百城建设提质网站,微信h5,如何建立一个网站及app,小白学剪辑从哪里开始一、工作台 联系昨天 要实现的功能和昨天差不多#xff0c;都是查询数据。 所以我们就写出查询语句#xff0c;然后直接导入已经写好的代码。 实现效果 查询语句 今日数据 营业额 select count(amount) from orders where status5 and order_time #{begin} and …一、工作台 联系昨天 要实现的功能和昨天差不多都是查询数据。 所以我们就写出查询语句然后直接导入已经写好的代码。 实现效果 查询语句 今日数据 营业额 select count(amount) from orders where status5 and order_time #{begin} and order_time #{end} 有效订单 select count(*) from orders where status5 and order_time #{begin} and order_time #{end} 订单完成率 所有订单 select count(*) from orders where order_time #{begin} and order_time #{end} 订单完成率 有效订单 / 所有订单 平均客单价 平均客单价 营业额 / 有效订单 新增用户数 select count(*) from user where create_time #{begin} and create_time #{end} 订单数据 待接单 select count(*) from orders where status2 and order_time #{begin} and order_time #{end} 待派送 select count(*) from orders where status3 and order_time #{begin} and order_time #{end} 已完成 select count(*) from orders where status5 and order_time #{begin} and order_time #{end} 已取消 select count(*) from orders where status6 and order_time #{begin} and order_time #{end} 全部订单 select count(*) from orders where order_time #{begin} and order_time #{end} 菜品总览 起售菜品 select count(*) from dish where status1 停售菜品 select count(*) from dish where status1 套餐总览 起售套餐 select count(*) from setmeal where status1 停售套餐 select count(*) from setmeal where status0 导入代码 下载好黑马该项目的资料 然后自己导入。 二、Apache POI 介绍 操作Office文件的包。本文该项目中主要用来读写excel表。 应用场景主要在交易明细、销量统计、批量数据导入批量添加 写入Excel 步骤 先创建Excel文档/工作簿 在工作簿中创建表格 在表格中创建行 在行中创建单元格 往单元格中设置数据 将整个Excel文档写到硬盘上 代码 直接在测试类中写例子的测试的。 Test public void testWrite() throws IOException {// 1. 创建整个工作簿XSSFWorkbook workbook new XSSFWorkbook();// 2. 在工作簿中创建表格XSSFSheet sheet1 workbook.createSheet(表格1);// 3. 在表格中创建行XSSFRow row_1 sheet1.createRow(1);// 4. 在行中创建单元格XSSFCell cell_1_0 row_1.createCell(0);// 5. 网单元格中设置数据cell_1_0.setCellValue(哈哈我是cell_1_0);// 6. 将整个Excel文档写到硬盘上FileOutputStream fos new FileOutputStream(D:/a.xlsx);workbook.write(fos);// 7. 释放资源fos.close();workbook.close(); } 读出Excel 步骤 先创建工作簿关联本地Excel文档 从工作簿中获取表格 从表格中获取行 从行中获取单元格 从单元格中获取数据 代码 Test public void testRead() throws IOException {// 1. 先创建工作簿关联本地Excel文档XSSFWorkbook workbook new XSSFWorkbook(D:/a.xlsx);// 2. 从工作簿中获取表格XSSFSheet sheet workbook.getSheetAt(0);// 3. 从表格中获取行XSSFRow row4 sheet.getRow(3);// 4. 从行中获取单元格 以及 5. 从单元格中获取数据String name row4.getCell(0).getStringCellValue();String age row4.getCell(1).getStringCellValue();System.out.println(name);System.out.println(age);XSSFRow row5 sheet.getRow(4);System.out.println(row5.getCell(0).getStringCellValue());System.out.println(row5.getCell(1).getNumericCellValue());workbook.close(); } 三、导出运营数据 需求分析 导出近30天的运营数据。 步骤 读取Excel模版到内存中。 准备运营数据 将数据写到Excel模板中。 将Excel文档响应回浏览器(文件下载) 代码 Controller GetMapping(/export) ApiOperation(导出运营数据报表) public String export(HttpServletResponse response) throws IOException {reportService.exportBusinessData(response);return OK; } Service Override public void exportBusinessData(HttpServletResponse response) throws IOException{InputStream is ClassLoader.getSystemResourceAsStream(运营数据报表模板.xlsx);XSSFWorkbook workbook new XSSFWorkbook(is);LocalDate begin LocalDate.now().plusDays(-30);LocalDate end LocalDate.now().plusDays(-1);BusinessDataVO businessDataVO workspaceService.getBusinessData(LocalDateTime.of(begin, LocalTime.MIN),LocalDateTime.of(end, LocalTime.MAX));XSSFSheet sheet workbook.getSheetAt(0);sheet.getRow(1).getCell(1).setCellValue(时间 begin 至 end);XSSFRow row4 sheet.getRow(3);row4.getCell(2).setCellValue(businessDataVO.getTurnover());row4.getCell(4).setCellValue(businessDataVO.getOrderCompletionRate());row4.getCell(6).setCellValue(businessDataVO.getNewUsers());XSSFRow row5 sheet.getRow(4);row5.getCell(2).setCellValue(businessDataVO.getValidOrderCount());row5.getCell(4).setCellValue(businessDataVO.getUnitPrice());int i 0;while (begin.compareTo(end) 0) {BusinessDataVO businessData workspaceService.getBusinessData(LocalDateTime.of(begin, LocalTime.MIN),LocalDateTime.of(begin, LocalTime.MAX));XSSFRow row sheet.getRow(7 i);row.getCell(1).setCellValue(begin.toString());row.getCell(2).setCellValue(businessData.getTurnover());row.getCell(3).setCellValue(businessData.getValidOrderCount());row.getCell(4).setCellValue(businessData.getOrderCompletionRate());row.getCell(5).setCellValue(businessData.getUnitPrice());row.getCell(6).setCellValue(businessData.getNewUsers());begin begin.plusDays(1);}workbook.write(response.getOutputStream());} 注意的点 ClassLoader能加载的文件位置 ClassLoader能加载的文件位置在resources下。 放入resources后需要的操作 需要用maven构建管理的complie编译一下才能保证类加载器ClassLoader加载到。 创建的POI与Office对应的下标 下标中getRow(0)与getCell(1)对应的分别是第一列第2行的数据。
http://www.hkea.cn/news/14265389/

相关文章:

  • 如何让自己网站排名提高手机在线做ppt的网站
  • 360网站空间做商业地产常用的网站
  • 网站流量超了网络广告的优势有哪些
  • 网站举报能不能查到举报人做网站小程序的客户是怎么找的
  • 郑州网站制作公司怎么样前端开发语言
  • 安防公司网站模板做前端网站用什么工具
  • 合肥网站建设与设计平台与网站有什么区别
  • 网站设计借鉴其它网站侵权吗单位网站服务的建设及维护
  • 上线公司 企业网站本地网站模版批量修改网站字符
  • WORDPRESS导购主题:WYZDG网站优化流程图
  • 学做网站教程WordPress图片投稿插件
  • 滨州网站建设sdshiya广告设计排行榜
  • 网站内容检测做网站前端多少钱
  • 网页制作与网站建设自考齐齐哈尔城市建设档案馆网站
  • 网站推广的优势知名网站建设代理
  • 汽车网站建设背景宁波seo网络推广选哪家
  • 有经验的网站建设推广二级域名网站建设
  • 英文二手汽车网站建设学生制作网页教程
  • 建设厅八大员报名网站外包公司什么意思
  • 网站开发的报告自己做的工艺品在哪个网站上可以卖
  • 梅林网站建设公司物联网官网
  • 网站建设优化服务多少钱中超联赛山东泰山直播
  • 三雷网站程序北京海淀区是几环
  • 南京网站seo服务有没有类似wordpress
  • 自媒体网站源码wordpress 管理文件
  • 怎么做视频解析的网站怎样做企业的网站建设
  • 国外设计师个人网站沈阳网页设计培训
  • 怎么查看网站开发语言制作图片的软件加字体
  • 网站快照历史软件开发者英语
  • 百度做网站不给FTP密码北京专业响应式网站建设