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

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

網(wǎng)站資訊建設(shè)考研培訓(xùn)

網(wǎng)站資訊建設(shè),考研培訓(xùn),中國(guó)建筑集團(tuán)有限公司董事長(zhǎng),wordpress主題 tob主題0.8Apache ECharts 介紹 Apache ECharts 介紹 Apache ECharts 是一款基于 Javascript 的數(shù)據(jù)可視化圖表庫(kù),提供直觀,生動(dòng),可交互,可個(gè)性化定制的數(shù)據(jù)可視化圖表。 官網(wǎng)地址:Apache ECharts 入門(mén)案例 Apache Echarts官方…

Apache ECharts

介紹

Apache ECharts 介紹

Apache ECharts 是一款基于 Javascript 的數(shù)據(jù)可視化圖表庫(kù),提供直觀,生動(dòng),可交互,可個(gè)性化定制的數(shù)據(jù)可視化圖表。

官網(wǎng)地址:Apache ECharts

入門(mén)案例

Apache Echarts官方提供的快速入門(mén):快速上手 - 使用手冊(cè) - Apache ECharts

實(shí)現(xiàn)步驟:

  1. 引入echarts.js 文件(當(dāng)天資料已提供)
  2. 為 ECharts 準(zhǔn)備一個(gè)設(shè)置寬高的 DOM
  3. 初始化echarts實(shí)例
  4. 指定圖表的配置項(xiàng)和數(shù)據(jù)
  5. 使用指定的配置項(xiàng)和數(shù)據(jù)顯示圖表

代碼開(kāi)發(fā)

<!DOCTYPE html>
<html><head><meta charset="utf-8" /><title>ECharts</title><!-- 引入剛剛下載的 ECharts 文件 --><script src="echarts.js"></script></head><body><!-- 為 ECharts 準(zhǔn)備一個(gè)定義了寬高的 DOM --><div id="main" style="width: 600px;height:400px;"></div><script type="text/javascript">// 基于準(zhǔn)備好的dom,初始化echarts實(shí)例var myChart = echarts.init(document.getElementById('main'));// 指定圖表的配置項(xiàng)和數(shù)據(jù)var option = {title: {text: 'ECharts 入門(mén)示例'},tooltip: {},legend: {data: ['銷(xiāo)量']},xAxis: {data: ['襯衫', '羊毛衫', '雪紡衫', '褲子', '高跟鞋', '襪子']},yAxis: {},series: [{name: '銷(xiāo)量',type: 'bar',data: [5, 20, 36, 10, 10, 20]}]};// 使用剛指定的配置項(xiàng)和數(shù)據(jù)顯示圖表。myChart.setOption(option);</script></body>
</html>

總結(jié):使用Echarts,重點(diǎn)在于研究當(dāng)前圖表所需的數(shù)據(jù)格式。通常是需要后端提供符合格式要求的動(dòng)態(tài)數(shù)據(jù),然后響應(yīng)給前端來(lái)展示圖表。

營(yíng)業(yè)額統(tǒng)計(jì)

需求分析和設(shè)計(jì)

產(chǎn)品原型

營(yíng)業(yè)額統(tǒng)計(jì)是基于折現(xiàn)圖來(lái)展現(xiàn),并且按照天來(lái)展示的。實(shí)際上,就是某一個(gè)時(shí)間范圍之內(nèi)的每一天的營(yíng)業(yè)額。同時(shí),不管光標(biāo)放在哪個(gè)點(diǎn)上,那么它就會(huì)把具體的數(shù)值展示出來(lái)。

并且還需要注意日期并不是固定寫(xiě)死的,是由上邊時(shí)間選擇器來(lái)決定。比如選擇是近7天、或者是近30日,或者是本周,就會(huì)把相應(yīng)這個(gè)時(shí)間段之內(nèi)的每一天日期通過(guò)橫坐標(biāo)展示。

業(yè)務(wù)規(guī)則:

  • 營(yíng)業(yè)額指訂單狀態(tài)為已完成的訂單金額合計(jì)
  • 基于可視化報(bào)表的折線圖展示營(yíng)業(yè)額數(shù)據(jù),X軸為日期,Y軸為營(yíng)業(yè)額
  • 根據(jù)時(shí)間選擇區(qū)間,展示每天的營(yíng)業(yè)額數(shù)據(jù)

接口設(shè)計(jì):

代碼開(kāi)發(fā)

根據(jù)接口定義設(shè)計(jì)對(duì)應(yīng)的VO

根據(jù)接口定義創(chuàng)建ReportController

創(chuàng)建ReportService接口,聲明getTurnover方法:

創(chuàng)建ReportServiceImpl實(shí)現(xiàn)類(lèi),實(shí)現(xiàn)getTurnover方法

@Service
@Slf4j
public class ReportServiceImpl implements ReportService {@Autowiredprivate OrderMapper orderMapper;/*** 根據(jù)時(shí)間區(qū)間統(tǒng)計(jì)營(yíng)業(yè)額* @param begin* @param end* @return*/public TurnoverReportVO getTurnover(LocalDate begin, LocalDate end) {List<LocalDate> dateList = new ArrayList<>();dateList.add(begin);while (!begin.equals(end)){begin = begin.plusDays(1);//日期計(jì)算,獲得指定日期后1天的日期dateList.add(begin);}List<Double> turnoverList = new ArrayList<>();for (LocalDate date : dateList) {LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);//查詢營(yíng)業(yè)額Map map = new HashMap();map.put("status", Orders.COMPLETED);map.put("begin",beginTime);map.put("end", endTime);Double turnover = orderMapper.sumByMap(map);turnover = turnover == null ? 0.0 : turnover;turnoverList.add(turnover);}//數(shù)據(jù)封裝return TurnoverReportVO.builder().dateList(StringUtils.join(dateList,",")).turnoverList(StringUtils.join(turnoverList,",")).build();}
}

OrderMapper接口聲明sumByMap方法:

OrderMapper.xml文件中編寫(xiě)動(dòng)態(tài)SQL

<select id="sumByMap" resultType="java.lang.Double">select sum(amount) from orders<where><if test="status != null">and status = #{status}</if><if test="begin != null">and order_time &gt;= #{begin}</if><if test="end != null">and order_time &lt;= #{end}</if></where>
</select>

用戶統(tǒng)計(jì)

需求分析和設(shè)計(jì)

產(chǎn)品原型:

所謂用戶統(tǒng)計(jì),實(shí)際上統(tǒng)計(jì)的是用戶的數(shù)量。通過(guò)折線圖來(lái)展示,上面這根藍(lán)色線代表的是用戶總量,下邊這根綠色線代表的是新增用戶數(shù)量,是具體到每一天。所以說(shuō)用戶統(tǒng)計(jì)主要統(tǒng)計(jì)兩個(gè)數(shù)據(jù),一個(gè)是總的用戶數(shù)量,另外一個(gè)是新增用戶數(shù)量

業(yè)務(wù)規(guī)則:

  • 基于可視化報(bào)表的折線圖展示用戶數(shù)據(jù),X軸為日期,Y軸為用戶數(shù)
  • 根據(jù)時(shí)間選擇區(qū)間,展示每天的用戶總量和新增用戶量數(shù)據(jù)

接口設(shè)計(jì):

代碼開(kāi)發(fā)

根據(jù)用戶統(tǒng)計(jì)接口的返回結(jié)果設(shè)計(jì)VO

根據(jù)接口定義,在ReportController中創(chuàng)建userStatistics方法:

ReportService接口中聲明getUserStatistics方法:

/*** 根據(jù)時(shí)間區(qū)間統(tǒng)計(jì)用戶數(shù)量* @param begin* @param end* @return*/
UserReportVO getUserStatistics(LocalDate begin, LocalDate end);

ReportServiceImpl實(shí)現(xiàn)類(lèi)中實(shí)現(xiàn)getUserStatistics方法

/*** 根據(jù)時(shí)間區(qū)間統(tǒng)計(jì)用戶數(shù)量* @param begin* @param end* @return*/
public UserReportVO getUserStatistics(LocalDate begin, LocalDate end) {List<LocalDate> dateList = new ArrayList<>();dateList.add(begin);while (!begin.equals(end)){begin = begin.plusDays(1);dateList.add(begin);}List<Integer> newUserList = new ArrayList<>(); //新增用戶數(shù)List<Integer> totalUserList = new ArrayList<>(); //總用戶數(shù)for (LocalDate date : dateList) {LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);//新增用戶數(shù)量 select count(id) from user where create_time > ? and create_time < ?Integer newUser = getUserCount(beginTime, endTime);//總用戶數(shù)量 select count(id) from user where  create_time < ?Integer totalUser = getUserCount(null, endTime);newUserList.add(newUser);totalUserList.add(totalUser);}return UserReportVO.builder().dateList(StringUtils.join(dateList,",")).newUserList(StringUtils.join(newUserList,",")).totalUserList(StringUtils.join(totalUserList,",")).build();
}

ReportServiceImpl實(shí)現(xiàn)類(lèi)中創(chuàng)建私有方法getUserCount

UserMapper接口中聲明countByMap方法:

?UserMapper.xml文件中編寫(xiě)動(dòng)態(tài)SQL

<select id="countByMap" resultType="java.lang.Integer">select count(id) from user<where><if test="begin != null">and create_time &gt;= #{begin}</if><if test="end != null">and create_time &lt;= #{end}</if></where>
</select>

訂單統(tǒng)計(jì)

需求分析和設(shè)計(jì)

產(chǎn)品原型:

訂單統(tǒng)計(jì)通過(guò)一個(gè)折現(xiàn)圖來(lái)展現(xiàn),折線圖上有兩根線,這根藍(lán)色的線代表的是訂單總數(shù),而下邊這根綠色的線代表的是有效訂單數(shù),指的就是狀態(tài)是已完成的訂單就屬于有效訂單,分別反映的是每一天的數(shù)據(jù)。上面還有3個(gè)數(shù)字,分別是訂單總數(shù)、有效訂單、訂單完成率,它指的是整個(gè)時(shí)間區(qū)間之內(nèi)總的數(shù)據(jù)。

業(yè)務(wù)規(guī)則:

  • 有效訂單指狀態(tài)為 “已完成” 的訂單
  • 基于可視化報(bào)表的折線圖展示訂單數(shù)據(jù),X軸為日期,Y軸為訂單數(shù)量
  • 根據(jù)時(shí)間選擇區(qū)間,展示每天的訂單總數(shù)和有效訂單數(shù)
  • 展示所選時(shí)間區(qū)間內(nèi)的有效訂單數(shù)、總訂單數(shù)、訂單完成率,訂單完成率 = 有效訂單數(shù) / 總訂單數(shù) * 100%

?接口設(shè)計(jì):

代碼開(kāi)發(fā)

根據(jù)訂單統(tǒng)計(jì)接口的返回結(jié)果設(shè)計(jì)VO

ReportController中根據(jù)訂單統(tǒng)計(jì)接口創(chuàng)建orderStatistics方法:

ReportService接口中聲明getOrderStatistics方法:

ReportServiceImpl實(shí)現(xiàn)類(lèi)中實(shí)現(xiàn)getOrderStatistics方法

/*** 根據(jù)時(shí)間區(qū)間統(tǒng)計(jì)訂單數(shù)量* @param begin* @param end* @return*/
public OrderReportVO getOrderStatistics(LocalDate begin, LocalDate end) {List<LocalDate> dateList = new ArrayList<>();dateList.add(begin);while (!begin.equals(end)){begin = begin.plusDays(1);dateList.add(begin);}//每天訂單總數(shù)集合List<Integer> orderCountList = new ArrayList<>();//每天有效訂單數(shù)集合List<Integer> validOrderCountList = new ArrayList<>();for (LocalDate date : dateList) {LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);//查詢每天的總訂單數(shù) select count(id) from orders where order_time > ? and order_time < ?Integer orderCount = getOrderCount(beginTime, endTime, null);//查詢每天的有效訂單數(shù) select count(id) from orders where order_time > ? and order_time < ? and status = ?Integer validOrderCount = getOrderCount(beginTime, endTime, Orders.COMPLETED);orderCountList.add(orderCount);validOrderCountList.add(validOrderCount);}//時(shí)間區(qū)間內(nèi)的總訂單數(shù)Integer totalOrderCount = orderCountList.stream().reduce(Integer::sum).get();
//時(shí)間區(qū)間內(nèi)的總有效訂單數(shù)Integer validOrderCount = validOrderCountList.stream().reduce(Integer::sum).get();//訂單完成率Double orderCompletionRate = 0.0;if(totalOrderCount != 0){orderCompletionRate = validOrderCount.doubleValue() / totalOrderCount;}return OrderReportVO.builder().dateList(StringUtils.join(dateList, ",")).orderCountList(StringUtils.join(orderCountList, ",")).validOrderCountList(StringUtils.join(validOrderCountList, ",")).totalOrderCount(totalOrderCount).validOrderCount(validOrderCount).orderCompletionRate(orderCompletionRate).build();
}

ReportServiceImpl實(shí)現(xiàn)類(lèi)中提供私有方法getOrderCount

OrderMapper接口中聲明countByMap方法:

OrderMapper.xml文件中編寫(xiě)動(dòng)態(tài)SQL

<select id="countByMap" resultType="java.lang.Integer">select count(id) from orders<where><if test="status != null">and status = #{status}</if><if test="begin != null">and order_time &gt;= #{begin}</if><if test="end != null">and order_time &lt;= #{end}</if></where>
</select>

銷(xiāo)量排名Top10

產(chǎn)品原型:

業(yè)務(wù)規(guī)則:

? 根據(jù)時(shí)間選擇區(qū)間,展示銷(xiāo)量前 10 的商品(包括菜品和套餐)
? 基于可視化報(bào)表的柱狀圖降序展示商品銷(xiāo)量
? 此處的銷(xiāo)量為商品銷(xiāo)售的份數(shù)

接口設(shè)計(jì):

代碼開(kāi)發(fā)

根據(jù)銷(xiāo)量排名接口的返回結(jié)果設(shè)計(jì)VO

ReportController中根據(jù)銷(xiāo)量排名接口創(chuàng)建top10方法:

/*** 銷(xiāo)量排名統(tǒng)計(jì)* @param begin* @param end* @return*/
@GetMapping("/top10")
@ApiOperation("銷(xiāo)量排名統(tǒng)計(jì)")
public Result<SalesTop10ReportVO> top10(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){return Result.success(reportService.getSalesTop10(begin,end));
}

ReportService接口中聲明getSalesTop10方法:

/*** 查詢指定時(shí)間區(qū)間內(nèi)的銷(xiāo)量排名top10* @param begin* @param end* @return*/
SalesTop10ReportVO getSalesTop10(LocalDate begin, LocalDate end);

ReportServiceImpl實(shí)現(xiàn)類(lèi)中實(shí)現(xiàn)getSalesTop10方法:

/*** 查詢指定時(shí)間區(qū)間內(nèi)的銷(xiāo)量排名top10* @param begin* @param end* @return*/
public SalesTop10ReportVO getSalesTop10(LocalDate begin, LocalDate end) {LocalDateTime beginTime = LocalDateTime.of(begin, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(end, LocalTime.MAX);List<GoodsSalesDTO> goodsSalesDTOList = orderMapper.getSalesTop10(beginTime, endTime);String nameList = StringUtils.join(goodsSalesDTOList.stream().map(GoodsSalesDTO::getName).collect(Collectors.toList()),",");String numberList = StringUtils.join(goodsSalesDTOList.stream().map(GoodsSalesDTO::getNumber).collect(Collectors.toList()),",");return SalesTop10ReportVO.builder().nameList(nameList).numberList(numberList).build();
}

OrderMapper接口中聲明getSalesTop10方法:

/*** 查詢商品銷(xiāo)量排名* @param begin* @param end*/
List<GoodsSalesDTO> getSalesTop10(LocalDateTime begin, LocalDateTime end);

OrderMapper.xml文件中編寫(xiě)動(dòng)態(tài)SQL

<select id="getSalesTop10" resultType="com.sky.dto.GoodsSalesDTO">select od.name name,sum(od.number) number from order_detail od ,orders owhere od.order_id = o.idand o.status = 5<if test="begin != null">and order_time &gt;= #{begin}</if><if test="end != null">and order_time &lt;= #{end}</if>group by nameorder by number desclimit 0, 10
</select>

上一節(jié):

訂單狀態(tài)定時(shí)處理、來(lái)單提醒和客戶催單(day10)-CSDN博客

下一節(jié):

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

相關(guān)文章:

  • 如何建立一個(gè)購(gòu)物網(wǎng)站播放量自助下單平臺(tái)
  • 西峰住房和城鄉(xiāng)建設(shè)局網(wǎng)站怎么建網(wǎng)站平臺(tái)賣(mài)東西
  • 門(mén)戶網(wǎng)站開(kāi)發(fā)過(guò)程百度霸屏推廣多少錢(qián)一個(gè)月
  • 網(wǎng)站制作推廣公司怎么優(yōu)化標(biāo)題和關(guān)鍵詞排名
  • 沈陽(yáng)網(wǎng)站建設(shè)seo優(yōu)化站內(nèi)關(guān)鍵詞排名軟件
  • 漯河做網(wǎng)站公司關(guān)鍵詞網(wǎng)站
  • 網(wǎng)站模版 免費(fèi)下載企業(yè)網(wǎng)絡(luò)營(yíng)銷(xiāo)系統(tǒng)分析報(bào)告
  • wordpress外貿(mào)教程網(wǎng)站推廣和優(yōu)化的原因
  • 做投票網(wǎng)站全網(wǎng)搜索引擎優(yōu)化
  • 聊城哪兒做網(wǎng)站便宜沈陽(yáng)沈河seo網(wǎng)站排名優(yōu)化
  • 海外 推廣網(wǎng)站高級(jí)seo是什么職位
  • 紀(jì)檢網(wǎng)站建設(shè)動(dòng)態(tài)主題百度一下 你知道首頁(yè)
  • 廣州網(wǎng)站建設(shè)推廣公司上海網(wǎng)站建設(shè)公司
  • php做的網(wǎng)站如何盈利重慶seo按天收費(fèi)
  • 深圳網(wǎng)站開(kāi)發(fā)學(xué)習(xí)日本積分榜最新排名
  • 在哪些網(wǎng)站上申請(qǐng)做廣告可以在百度引擎能收到關(guān)鍵字seo網(wǎng)站推廣是什么
  • 網(wǎng)站每年多少錢(qián)怎么推廣游戲代理賺錢(qián)
  • 新聞網(wǎng)站職業(yè)技能培訓(xùn)有哪些
  • 手機(jī)網(wǎng)站后臺(tái)源碼百度店鋪怎么開(kāi)通
  • 微網(wǎng)站建設(shè)訊息百度產(chǎn)品大全入口
  • 做費(fèi)網(wǎng)站營(yíng)銷(xiāo)網(wǎng)站定制
  • 北京康迪建設(shè)監(jiān)理咨詢有限公司網(wǎng)站南京seo顧問(wèn)
  • 濰坊網(wǎng)站建設(shè)哪家好外貿(mào)平臺(tái)排名
  • 找人代做網(wǎng)站需要注意什么簡(jiǎn)述常用的網(wǎng)絡(luò)營(yíng)銷(xiāo)方法
  • 如何做網(wǎng)站地圖百度官網(wǎng)首頁(yè)官網(wǎng)
  • 網(wǎng)站支付寶怎么做的營(yíng)銷(xiāo)和銷(xiāo)售的區(qū)別在哪里
  • 佛山市品牌網(wǎng)站建設(shè)哪家好網(wǎng)站建設(shè)與營(yíng)銷(xiāo)經(jīng)驗(yàn)
  • 新開(kāi)傳奇網(wǎng)站3000ok推廣游戲賺錢(qián)的平臺(tái)
  • 陜西做網(wǎng)站社會(huì)化媒體營(yíng)銷(xiāo)
  • 深圳網(wǎng)站建設(shè)sumaart精準(zhǔn)粉絲引流推廣