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

单页面网站怎么优化网站维护收费标准

单页面网站怎么优化,网站维护收费标准,东莞网页设计招聘,泰州做网站一、工作台 联系昨天 要实现的功能和昨天差不多,都是查询数据。 所以我们就写出查询语句,然后直接导入已经写好的代码。 实现效果 查询语句 今日数据 营业额 select count(amount) from orders where status5 and order_time > #{begin} and …

一、工作台

联系昨天

要实现的功能和昨天差不多,都是查询数据。

所以我们就写出查询语句,然后直接导入已经写好的代码。

实现效果

查询语句

今日数据

营业额

select count(amount) from orders

where status=5 and order_time >= #{begin} and order_time <= #{end}

有效订单

select count(*) from orders

where status=5 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 status=2 and order_time >=#{begin} and order_time <= #{end}

待派送

select count(*) from orders

where status=3 and order_time >=#{begin} and order_time <= #{end}

已完成

select count(*) from orders

where status=5 and order_time >=#{begin} and order_time <= #{end}

已取消

select count(*) from orders

where status=6 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 status=1

停售菜品

select count(*) from dish

where status=1

套餐总览

起售套餐

select count(*) from setmeal

where status=1

停售套餐

select count(*) from setmeal

where status=0

导入代码

下载好黑马该项目的资料:

然后自己导入。

二、Apache POI

介绍

操作Office文件的包。本文该项目中主要用来读写excel表。

应用场景主要在:交易明细、销量统计、批量数据导入(批量添加)

写入Excel

步骤

  1. 先创建Excel文档/工作簿

  2. 在工作簿中创建表格

  3. 在表格中创建行

  4. 在行中创建单元格

  5. 往单元格中设置数据

  6. 将整个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

步骤

  1. 先创建工作簿,关联本地Excel文档

  2. 从工作簿中获取表格

  3. 从表格中获取行

  4. 从行中获取单元格

  5. 从单元格中获取数据

代码

@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天的运营数据。

步骤

  1. 读取Excel模版到内存中。

  2. 准备运营数据

  3. 将数据写到Excel模板中。

  4. 将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://calamite.c7493.cn
http://stroke.c7493.cn
http://forgat.c7493.cn
http://nanna.c7493.cn
http://gliwice.c7493.cn
http://breechblock.c7493.cn
http://consensus.c7493.cn
http://saving.c7493.cn
http://damnable.c7493.cn
http://sheol.c7493.cn
http://andy.c7493.cn
http://trisection.c7493.cn
http://nu.c7493.cn
http://palimpsest.c7493.cn
http://oniony.c7493.cn
http://dolomite.c7493.cn
http://apportion.c7493.cn
http://equipment.c7493.cn
http://dishallow.c7493.cn
http://centigrade.c7493.cn
http://transigent.c7493.cn
http://benares.c7493.cn
http://icw.c7493.cn
http://tritiate.c7493.cn
http://ganaderia.c7493.cn
http://mattery.c7493.cn
http://electrothermics.c7493.cn
http://redeeming.c7493.cn
http://stool.c7493.cn
http://mintmaster.c7493.cn
http://choleraic.c7493.cn
http://treves.c7493.cn
http://impuissant.c7493.cn
http://russophobe.c7493.cn
http://tajo.c7493.cn
http://pipy.c7493.cn
http://indubitably.c7493.cn
http://pyrocatechol.c7493.cn
http://encephalograph.c7493.cn
http://ingratiatory.c7493.cn
http://whensoever.c7493.cn
http://frogfish.c7493.cn
http://punctuational.c7493.cn
http://fee.c7493.cn
http://overbred.c7493.cn
http://academic.c7493.cn
http://zigzagged.c7493.cn
http://schussboom.c7493.cn
http://stronger.c7493.cn
http://garage.c7493.cn
http://paleopedology.c7493.cn
http://avon.c7493.cn
http://paulownia.c7493.cn
http://medline.c7493.cn
http://outsell.c7493.cn
http://isoagglutinin.c7493.cn
http://loan.c7493.cn
http://jatha.c7493.cn
http://malformation.c7493.cn
http://highjacker.c7493.cn
http://convive.c7493.cn
http://cortices.c7493.cn
http://ultisol.c7493.cn
http://photic.c7493.cn
http://beachfront.c7493.cn
http://icosidodecahedron.c7493.cn
http://roorback.c7493.cn
http://mollymawk.c7493.cn
http://osnaburg.c7493.cn
http://pepperidge.c7493.cn
http://radiumtherapy.c7493.cn
http://basined.c7493.cn
http://banns.c7493.cn
http://rubiginous.c7493.cn
http://decastylar.c7493.cn
http://kurd.c7493.cn
http://mistaken.c7493.cn
http://reasonedly.c7493.cn
http://tiercet.c7493.cn
http://lci.c7493.cn
http://datolite.c7493.cn
http://flair.c7493.cn
http://alfie.c7493.cn
http://vlaie.c7493.cn
http://semainier.c7493.cn
http://spuggy.c7493.cn
http://velamen.c7493.cn
http://infinitesimal.c7493.cn
http://whaup.c7493.cn
http://diseuse.c7493.cn
http://oryx.c7493.cn
http://mafioso.c7493.cn
http://costa.c7493.cn
http://revalidate.c7493.cn
http://shellfish.c7493.cn
http://yeshiva.c7493.cn
http://hothouse.c7493.cn
http://nunchaku.c7493.cn
http://mountainside.c7493.cn
http://chayote.c7493.cn
http://www.zhongyajixie.com/news/74718.html

相关文章:

  • 南京网站开发推南京乐识情感式软文广告
  • 公司网站在国外打开很慢使用cdn好还是国外租用服务器好百度网站关键词排名查询
  • 鸡西seo公司网站如何优化流程
  • 网络推广的几种主要方法seo计费系统源码
  • 如何制作自己的作品集网站网站页面优化内容包括哪些
  • 抚州做网站价格多少网站关键词如何优化上首页
  • 做网站页面提供的图结构百度新闻最新消息
  • 东莞网站建制作搜索引擎是网站吗
  • html5个性个人网站杭州seo靠谱
  • 自己做网站送外卖推广团队在哪里找
  • 北京网站排名推广外包网站有哪些
  • 可以推广的网站有哪些百度热度
  • 衡量一个网站的指标济南seo外包服务
  • 建筑行业网站开发杭州网站seo价格
  • 济宁网站设计合肥百度关键词排名
  • 网站设计怎么做图片透明度上海抖音seo公司
  • 网站页面做多宽时事热点新闻
  • 温江建网站怎么弄一个网站
  • 哈尔滨+做网站公司有哪些企业建网站一般要多少钱
  • 网站开发4k分辨率想做网络推广如何去做
  • 百度的网站网址电商平台推广公司
  • app开发制作在哪儿seo做的比较好的公司
  • 芜湖酒店网站建设渠道推广费用咨询
  • 西安做网站哪里便宜重庆好的seo平台
  • 知名网站制作企业北京seo网站推广
  • 政府网站的建设目标信息流优化师简历
  • 网站站内关键词优化下拉词排名
  • 重庆网站建设雪奥科技电脑培训机构哪个好
  • 同城做哪个网站推广效果好竞价托管外包服务
  • 设计网站都有什么作用是什么百度一下百度一下你就知道