首页数据接口+图标移除

This commit is contained in:
zhanghan11 2024-05-09 18:16:07 +08:00
parent 4cde6327e9
commit 54a59a9d86
11 changed files with 375 additions and 185 deletions

View File

@ -46,4 +46,13 @@ public class OmOrderAnalysisController extends BaseController {
public void fileDownload(HttpServletResponse response, HttpServletRequest request) {
omOrderAnalysisService.downloadReport(response);
}
/**
* 系统首页
*/
@GetMapping("/homepageData")
public AjaxResult homepage() {
return AjaxResult.success(omOrderAnalysisService.homepage());
}
}

View File

@ -36,4 +36,48 @@ public interface OmOrderAnalysisMapper
* @return
*/
public List<Map<String,Object>> selectCountAndAmountByDate(String tenantId);
/**
* 查询统计数据
*
* @return
*/
public Map<String,Object> selectTotalData();
/**
* 查询知识库统计数据
*
* @return
*/
public Map<String,Long> selectKnowledgeTotalData();
/**
* 查询课程统计数据
*
* @return
*/
public Map<String,Long> selectCourseTotalData();
/**
* 查询每月订单统计数据
*
* @return
*/
public List<Integer> selectMonthOrderTotalData();
/**
* 查询每月帖子统计数据
*
* @return
*/
public List<Integer> selectMonthPostTotalData();
/**
* 查询每月考试统计数据
*
* @return
*/
public List<Map<String,Object>> selectMonthExamTotalData();
}

View File

@ -27,4 +27,10 @@ public interface IOmOrderAnalysisService
*/
void downloadReport(HttpServletResponse response);
/**
* 首页数据
*
*/
public Map<String,Object> homepage();
}

View File

@ -50,6 +50,7 @@ public class OmOrderAnalysisServiceImpl implements IOmOrderAnalysisService {
private OmOrderAnalysisMapper omOrderAnalysisMapper;
@Autowired
private IOmTeamInfoService omTeamInfoService;
/**
* 查询分析数据
*
@ -287,4 +288,36 @@ public class OmOrderAnalysisServiceImpl implements IOmOrderAnalysisService {
return ChartFactory.createPieChart(title, dataset,
true, true, true);
}
/**
* 首页数据
*/
@Override
public Map<String, Object> homepage() {
Map<String, Object> map = new HashMap<>();
// 知识库数量
Map<String, Long> kbMap = omOrderAnalysisMapper.selectKnowledgeTotalData();
map.put("pieKbNum", kbMap);
// 课程数量
Map<String, Long> courseMap = omOrderAnalysisMapper.selectCourseTotalData();
map.put("piecourseNum", courseMap);
// 统计总数
Map<String, Object> totalMap = omOrderAnalysisMapper.selectTotalData();
totalMap.put("kbNum", kbMap.values().stream(). mapToLong(Long::longValue).sum());
totalMap.put("courseNUm", courseMap.values().stream(). mapToLong(Long::longValue).sum());
map.put("totalNum", totalMap);
// 每月订单数量
map.put("monthOrderNum", omOrderAnalysisMapper.selectMonthOrderTotalData());
// 每月帖子数量
map.put("monthPostNum", omOrderAnalysisMapper.selectMonthPostTotalData());
// 每月考试通过率及考生人数
List<Map<String, Object>> list = omOrderAnalysisMapper.selectMonthExamTotalData();
map.put("monthExamPassRate", list.stream()
.map(itemMap -> itemMap.get("rate"))
.collect(Collectors.toList()));
map.put("monthExamPassNum", list.stream()
.map(itemMap -> itemMap.get("total"))
.collect(Collectors.toList()));
return map;
}
}

View File

@ -39,4 +39,80 @@
> (YEAR (SYSDATE()) - 3)
GROUP BY date_year_month
</select>
<select id="selectKnowledgeTotalData" resultType="map">
SELECT (SELECT COUNT(0) FROM kb_history) history,
(SELECT COUNT(0) FROM kb_ceramics) ceramics,
(SELECT COUNT(0) FROM kb_papermaking) papermaking,
(SELECT COUNT(0) FROM kb_chemical_industry) chemicalIndustry
</select>
<select id="selectCourseTotalData" resultType="map">
SELECT (SELECT COUNT(0) FROM course_online_info) onlineNum,
(SELECT COUNT(0) FROM course_video_info) videoNum,
(SELECT COUNT(0) FROM course_document_info) documentNum
</select>
<select id="selectTotalData" resultType="map">
SELECT (SELECT COUNT(0) FROM om_team_info WHERE del_flag = '0') teamNum,
(SELECT COUNT(0) FROM om_order_info WHERE del_flag = '0') orderNum,
(SELECT COUNT(0) FROM exam_paper_info) examinerNum,
(SELECT COUNT(0) FROM community_post_info) postNum
</select>
<select id="selectMonthOrderTotalData" resultType="int">
SELECT IFNULL(o.num, 0) num
FROM month_data m
LEFT JOIN (
SELECT COUNT(0) num,
(MONTH (create_time)) AS date_month
FROM `om_order_info`
WHERE (YEAR (create_time)) = YEAR (
SYSDATE())
GROUP BY date_month ) o
ON m.month_num = o.date_month
ORDER BY
m.month_num
</select>
<select id="selectMonthPostTotalData" resultType="int">
SELECT IFNULL(p.num, 0) num
FROM month_data m
LEFT JOIN
(SELECT COUNT(0) num,
(MONTH (post_time)) AS date_month
FROM `community_post_info`
WHERE (YEAR (post_time)) = YEAR (
SYSDATE())
GROUP BY date_month)p
ON m.month_num=p.date_month
ORDER BY
m.month_num
</select>
<select id="selectMonthExamTotalData" resultType="map">
SELECT m.month_num,
CASE
WHEN IFNULL(p.num, 0) = 0 THEN
0
ELSE ROUND((p.num / (p.num + IFNULL(up.num, 0)) * 100), 2)
END rate,
IFNULL(p.num, 0) + IFNULL(up.num, 0) total
FROM month_data m
LEFT JOIN (
SELECT COUNT(0) num,
(MONTH (exam_start_time)) AS month_num
FROM `exam_paper_info`
WHERE STATUS = 1
AND (YEAR (exam_start_time)) = YEAR (SYSDATE())
GROUP BY month_num ) p
ON m.month_num = p.month_num
LEFT JOIN (
SELECT COUNT(0) num,
(MONTH ( exam_start_time )) AS month_num
FROM
`exam_paper_info`
WHERE
STATUS = 0
AND (YEAR ( exam_start_time )) = YEAR (SYSDATE())
GROUP BY
month_num
) up ON m.month_num = up.month_num
ORDER BY
m.month_num
</select>
</mapper>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,13 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<!--[if lt IE 11
]><script>
window.location.href = "/html/ie.html";
</script><!
[endif]-->
<style>
html,
body,
@ -42,7 +49,7 @@
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
@ -60,7 +67,7 @@
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
@ -77,7 +84,7 @@
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
@ -85,7 +92,6 @@
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
@ -112,13 +118,12 @@
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
background: #7171c6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
@ -133,21 +138,20 @@
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader {
@ -174,8 +178,8 @@
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
font-family: "Open Sans";
color: #fff;
font-size: 19px;
width: 100%;
text-align: center;
@ -190,7 +194,7 @@
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
color: #fff;
opacity: 0.5;
}
</style>

View File

@ -7,3 +7,11 @@ export function getData() {
method: "get",
});
}
// 首页数据查询
export function getHomepageData() {
return request({
url: "/order/analysis/homepageData",
method: "get",
});
}

View File

@ -65,7 +65,7 @@ export default {
data() {
return {
title: process.env.VUE_APP_TITLE,
logo: logoImg,
logo: null, //logoImg,
};
},
};

View File

@ -1,14 +1,24 @@
<template>
<div>首页</div>
<div> <el-button @click="getData">首页</el-button>
</div>
</template>
<script>
import { getHomepageData } from "@/api/order/analysis";
export default {
name: "Index",
data() {
return {};
},
created() {
this.getData();
},
methods: {
getData() {
getHomepageData().then((res) => {
console.log(res);
});
},
goTarget(href) {
window.open(href, "_blank");
},