中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

二維碼圖片個人網(wǎng)站seo入門

二維碼圖片,個人網(wǎng)站seo入門,河北最近發(fā)生了什么事,母嬰微網(wǎng)站設(shè)計規(guī)劃一、工作臺 聯(lián)系昨天 要實現(xiàn)的功能和昨天差不多,都是查詢數(shù)據(jù)。 所以我們就寫出查詢語句,然后直接導(dǎo)入已經(jīng)寫好的代碼。 實現(xiàn)效果 查詢語句 今日數(shù)據(jù) 營業(yè)額 select count(amount) from orders where status5 and order_time > #{begin} and …

一、工作臺

聯(lián)系昨天

要實現(xiàn)的功能和昨天差不多,都是查詢數(shù)據(jù)。

所以我們就寫出查詢語句,然后直接導(dǎo)入已經(jīng)寫好的代碼。

實現(xiàn)效果

查詢語句

今日數(shù)據(jù)

營業(yè)額

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}

訂單完成率 = 有效訂單 / 所有訂單

平均客單價

平均客單價 = 營業(yè)額 / 有效訂單

新增用戶數(shù)

select count(*) from user

where create_time >= #{begin} and create_time <= #{end}

訂單數(shù)據(jù)

待接單

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

導(dǎo)入代碼

下載好黑馬該項目的資料:

然后自己導(dǎo)入。

二、Apache POI

介紹

操作Office文件的包。本文該項目中主要用來讀寫excel表。

應(yīng)用場景主要在:交易明細(xì)、銷量統(tǒng)計、批量數(shù)據(jù)導(dǎo)入(批量添加)

寫入Excel

步驟

  1. 先創(chuàng)建Excel文檔/工作簿

  2. 在工作簿中創(chuàng)建表格

  3. 在表格中創(chuàng)建行

  4. 在行中創(chuàng)建單元格

  5. 往單元格中設(shè)置數(shù)據(jù)

  6. 將整個Excel文檔寫到硬盤上

代碼

直接在測試類中寫例子的測試的。

@Test
public void testWrite() throws IOException {// 1. 創(chuàng)建整個工作簿XSSFWorkbook workbook = new XSSFWorkbook();// 2. 在工作簿中創(chuàng)建表格XSSFSheet sheet1 = workbook.createSheet("表格1");// 3. 在表格中創(chuàng)建行XSSFRow row_1 = sheet1.createRow(1);// 4. 在行中創(chuàng)建單元格XSSFCell cell_1_0 = row_1.createCell(0);// 5. 網(wǎng)單元格中設(shè)置數(shù)據(jù)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. 先創(chuàng)建工作簿,關(guān)聯(lián)本地Excel文檔

  2. 從工作簿中獲取表格

  3. 從表格中獲取行

  4. 從行中獲取單元格

  5. 從單元格中獲取數(shù)據(jù)

代碼

@Test
public void testRead() throws IOException {// 1. 先創(chuàng)建工作簿,關(guān)聯(lián)本地Excel文檔XSSFWorkbook workbook = new XSSFWorkbook("D:/a.xlsx");// 2. 從工作簿中獲取表格XSSFSheet sheet = workbook.getSheetAt(0);// 3. 從表格中獲取行XSSFRow row4 = sheet.getRow(3);// 4. 從行中獲取單元格 以及 5. 從單元格中獲取數(shù)據(jù)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();
}

三、導(dǎo)出運營數(shù)據(jù)

需求分析

導(dǎo)出近30天的運營數(shù)據(jù)。

步驟

  1. 讀取Excel模版到內(nèi)存中。

  2. 準(zhǔn)備運營數(shù)據(jù)

  3. 將數(shù)據(jù)寫到Excel模板中。

  4. 將Excel文檔響應(yīng)回瀏覽器(文件下載)

代碼

Controller:

@GetMapping("/export")
@ApiOperation("導(dǎo)出運營數(shù)據(jù)報表")
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("運營數(shù)據(jù)報表模板.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構(gòu)建管理的complie編譯一下,才能保證類加載器ClassLoader加載到。

創(chuàng)建的POI與Office對應(yīng)的下標(biāo)

下標(biāo)中g(shù)etRow(0)與getCell(1)對應(yīng)的分別是第一列第2行的數(shù)據(jù)。

http://www.risenshineclean.com/news/48340.html

相關(guān)文章:

  • 寶坻做網(wǎng)站上海關(guān)鍵詞優(yōu)化排名哪家好
  • wordpress無法新建頁面網(wǎng)站優(yōu)化+山東
  • 中國做爰網(wǎng)站外鏈工具軟件
  • web軟件開發(fā)工具百度seo插件
  • 廣州建委網(wǎng)站google推廣一年的費用
  • 網(wǎng)站建設(shè)經(jīng)典范例萬網(wǎng)域名注冊查詢網(wǎng)
  • 格爾木有做網(wǎng)站的嗎seo網(wǎng)站推廣杭州
  • 行業(yè)軟件公司外包南京seo全網(wǎng)營銷
  • div css3網(wǎng)站布局鄭州制作網(wǎng)站公司
  • 網(wǎng)站建設(shè)進(jìn)度表怎么做看廣告收益最高的軟件
  • 國際新聞最新消息戰(zhàn)爭視頻網(wǎng)站關(guān)鍵字排名優(yōu)化
  • 百度云盤做網(wǎng)站百度新聞客戶端
  • 動態(tài)網(wǎng)站開發(fā)報告seo推廣優(yōu)化
  • 網(wǎng)站建設(shè)app平臺關(guān)鍵詞排名優(yōu)化
  • 網(wǎng)站建設(shè)公司怎么宣傳廈門百度seo
  • 重慶第一門戶網(wǎng)站附子seo教程
  • 重慶論壇網(wǎng)站建設(shè)企業(yè)營銷策劃
  • wordpress綁定百家號鼓樓網(wǎng)頁seo搜索引擎優(yōu)化
  • 網(wǎng)站開發(fā)工程師職業(yè)定位成品網(wǎng)站貨源1
  • 常平網(wǎng)站仿做網(wǎng)址大全瀏覽器下載
  • 男女做污視頻在線觀看網(wǎng)站安徽seo網(wǎng)絡(luò)推廣
  • 網(wǎng)站創(chuàng)建域名臨沂網(wǎng)站建設(shè)方案服務(wù)
  • 公司網(wǎng)站是否做地方分站如何找做網(wǎng)站的公司
  • it運維需要學(xué)哪些知識搜索優(yōu)化師
  • 哪個網(wǎng)站反盜版做的最好域名注冊網(wǎng)站查詢
  • 免費企業(yè)建站源代碼搜索引擎廣告推廣
  • 廈門做網(wǎng)站優(yōu)化多少錢百度競價排名什么意思
  • 做網(wǎng)站 最好的開源cms哈爾濱seo服務(wù)
  • 網(wǎng)站管理助手 ftp2021年網(wǎng)絡(luò)十大關(guān)鍵詞
  • wordpress sparklingseo關(guān)鍵詞優(yōu)化怎么收費