数据统计
- {{sjtjTitle}}
+ {{ sjtjTitle }}
-
-
-
-
- {{item}}
+
+
+
+
+ {{ item }}
+
@@ -256,19 +261,28 @@ import {parseTime} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
import {getNotificationlogList} from "@/api/sys/sysNotificationlog";
import {employeeSalesApi} from "@/api/indexStatistics";
-import {getDataAnalysis, getDataBoard, getDataCount, getDataShow, getTotalAmount} from "@/api/allOrder";
+import {
+ getDataAnalysis,
+ getDataBoard,
+ getDataCount,
+ getDataShow,
+ getTotalAmount,
+ getOilPercentage,
+ getOilAndGoodsPercentage,
+ getOilAndGoodsAndVipAndPoints
+} from "@/api/allOrder";
export default {
props: ["accountId"],
data() {
return {
- amountList:[
+ amountList: [
// "今日" ,
// "昨日" ,
- "近一周" ,
- "本月" ,
- "本季度" ,
+ "近一周",
+ "本月",
+ "本季度",
"本年"
],
@@ -278,7 +292,7 @@ export default {
sjtjTitle: "近一周",
xShow: false,
timeShow: false,
- dataTimeShow : false,
+ dataTimeShow: false,
showTimeShow: false,
countTimeShow: false,
form: {},
@@ -307,8 +321,8 @@ export default {
}],
value: '',
value1: [],
- showValue:[],
- countValue:[],
+ showValue: [],
+ countValue: [],
value2: [],
imagePath: process.env.VUE_APP_SERVER_URL,
queryParams: {},
@@ -362,35 +376,35 @@ export default {
},
methods: {
- sjkbStoreAmount(e){
+ sjkbStoreAmount(e) {
console.log(e)
this.sjkbTitle = e
let command = e
- if (command=='今日'){
+ if (command == '今日') {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
- this.value1 = [parseTime(new Date()),parseTime(new Date())]
- }else if (command=='昨日'){
+ this.value1 = [parseTime(new Date()), parseTime(new Date())]
+ } else if (command == '昨日') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
- this.value1 = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
- } else if (command=='近一周'){
+ this.value1 = [parseTime(oneWeekAgo), parseTime(oneWeekAgo)]
+ } else if (command == '近一周') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
- this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
- } else if (command=='本月'){
+ this.value1 = [parseTime(oneWeekAgo), parseTime(nowDate)]
+ } else if (command == '本月') {
const [startTime, endTime] = this.getMonthStartAndToday();
- this.value1 = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='本季度'){
+ this.value1 = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '本季度') {
const [startTime, endTime] = this.getQuarterStartAndEnd();
this.value1 = [parseTime(startTime), parseTime(endTime)];
- } else if (command=='本年'){
+ } else if (command == '本年') {
const [startTime, endTime] = this.getYearStartAndEnd();
- this.value1 = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='自定义'){
+ this.value1 = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '自定义') {
this.disabled = false
}
this.getStoreAmount()
@@ -399,108 +413,108 @@ export default {
goList() {
this.$router.push('/notificationList/index')
},
- editShow(e){
+ editShow(e) {
this.disabled = true
console.log(e)
this.ypjyTitle = e
let command = e
- if (command=='今日'){
+ if (command == '今日') {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
- this.showValue = [parseTime(new Date()),parseTime(new Date())]
- }else if (command=='昨日'){
+ this.showValue = [parseTime(new Date()), parseTime(new Date())]
+ } else if (command == '昨日') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
- this.showValue = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
- } else if (command=='近一周'){
+ this.showValue = [parseTime(oneWeekAgo), parseTime(oneWeekAgo)]
+ } else if (command == '近一周') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
- this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
- } else if (command=='本月'){
+ this.showValue = [parseTime(oneWeekAgo), parseTime(nowDate)]
+ } else if (command == '本月') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
const [startTime, endTime] = this.getMonthStartAndToday();
- this.showValue = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='本季度'){
+ this.showValue = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '本季度') {
const [startTime, endTime] = this.getQuarterStartAndEnd();
this.showValue = [parseTime(startTime), parseTime(endTime)];
- } else if (command=='本年'){
+ } else if (command == '本年') {
const [startTime, endTime] = this.getYearStartAndEnd();
- this.showValue = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='自定义'){
+ this.showValue = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '自定义') {
this.disabled = false
}
- this.getDataShow()
+ this.getDataShow()
},
- editCount(e){
+ editCount(e) {
this.disabled = true
this.sjtjTitle = e
- console.log("e",e)
+ console.log("e", e)
let command = e
- if (command=='今日'){
+ if (command == '今日') {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
// this.countValue = [start,new Date()]
- this.countValue = [parseTime(new Date()),parseTime(new Date())]
- }else if (command=='昨日'){
+ this.countValue = [parseTime(new Date()), parseTime(new Date())]
+ } else if (command == '昨日') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
- this.countValue = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
- } else if (command=='近一周'){
+ this.countValue = [parseTime(oneWeekAgo), parseTime(oneWeekAgo)]
+ } else if (command == '近一周') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
- this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
- } else if (command=='本月'){
+ this.countValue = [parseTime(oneWeekAgo), parseTime(nowDate)]
+ } else if (command == '本月') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
const [startTime, endTime] = this.getMonthStartAndToday();
- this.countValue = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='本季度'){
+ this.countValue = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '本季度') {
const [startTime, endTime] = this.getQuarterStartAndEnd();
this.countValue = [parseTime(startTime), parseTime(endTime)];
- } else if (command=='本年'){
+ } else if (command == '本年') {
const [startTime, endTime] = this.getYearStartAndEnd();
- this.countValue = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='自定义'){
+ this.countValue = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '自定义') {
this.disabled = false
}
- this.getDataCount()
+ this.getDataCount()
},
- editColor(command){
+ editColor(command) {
this.disabled = true
this.ygphTitle = command
- if (command=='今日'){
+ if (command == '今日') {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
- this.value2 = [start,new Date()]
- } else if (command=='近一周'){
+ this.value2 = [start, new Date()]
+ } else if (command == '近一周') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
- this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
- } else if (command=='本月'){
+ this.value2 = [parseTime(oneWeekAgo), parseTime(nowDate)]
+ } else if (command == '本月') {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
const [startTime, endTime] = this.getMonthStartAndToday();
- this.value2 = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='本季度'){
+ this.value2 = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '本季度') {
const [startTime, endTime] = this.getQuarterStartAndEnd();
this.value2 = [parseTime(startTime), parseTime(endTime)];
- } else if (command=='本年'){
+ } else if (command == '本年') {
const [startTime, endTime] = this.getYearStartAndEnd();
- this.value2 = [parseTime(startTime),parseTime(endTime)]
- }else if (command=='自定义'){
+ this.value2 = [parseTime(startTime), parseTime(endTime)]
+ } else if (command == '自定义') {
this.disabled = false
}
- this.getEmployeList()
+ this.getEmployeList()
},
getMonthStartAndToday() {
const now = new Date();
@@ -600,26 +614,20 @@ export default {
startTime: this.value1[0],
endTime: this.value1[1]
}
- getDataAnalysis(data).then(res => {
- // console.log('数据分析的数据', res)
- this.dataAnalysisAllList = []
- this.dataAnalysisOilNumberList = []
- this.dataAnalysisIfOilList = []
- if (res.code == 200) {
- for (let i = 0; i < res.data.length; i++) {
- if (res.data[i].type == 1) {
- this.dataAnalysisOilNumberList.push(res.data[i])
- } else if (res.data[i].type == 2) {
- this.dataAnalysisIfOilList.push(res.data[i])
- } else if (res.data[i].type == 3) {
- this.dataAnalysisAllList.push(res.data[i])
- }
- }
- // console.log('dataAnalysisOilNumberList', this.dataAnalysisOilNumberList)
- // console.log('dataAnalysisIfOilList', this.dataAnalysisIfOilList)
- // console.log('dataAnalysisAllList', this.dataAnalysisAllList)
- this.initChart()
- }
+ //获取第一个饼状图数据
+ getOilPercentage(data).then(res => {
+ this.dataAnalysisOilNumberList = res.data
+ console.log("饼状图一数据",this.dataAnalysisOilNumberList )
+ })
+ //获取第二个饼状图数据
+ getOilAndGoodsPercentage(data).then(res => {
+ this.dataAnalysisIfOilList = res.data
+ console.log("饼状图二数据",this.dataAnalysisIfOilList)
+ })
+ //获取第三个饼状图数据
+ getOilAndGoodsAndVipAndPoints(data).then(res => {
+ this.dataAnalysisAllList = res.data
+ console.log("饼状图三数据",this.dataAnalysisAllList )
})
},
//油站首页数据展示
@@ -629,7 +637,7 @@ export default {
"endTime": this.showValue[1].split(' ')[0]
}
getDataShow(data).then(res => {
- // console.log('首页数据展示', res.data)
+ console.log('首页数据展示', res.data)
this.dataShows = res.data
this.initChart()
})
@@ -758,13 +766,13 @@ export default {
let countType = []
count.push(c)
this.dataCount.oilNames.forEach(item => {
- let type={
+ let type = {
type: 'bar'
}
countType.push(type)
})
this.dataCount.oilData.forEach(item => {
- let a =[item.time, ...item.money]
+ let a = [item.time, ...item.money]
count.push(a)
})
@@ -776,19 +784,19 @@ export default {
let showCountType = []
console.log("看看执行")
this.dataShows.oilNames.forEach(item => {
- let type={
+ let type = {
type: 'bar'
}
showCountType.push(type)
})
console.log(this.dataShows.oilData)
this.dataShows.oilData.forEach(item => {
- let a =[item.day, ...item.oilPrices]
+ let a = [item.day, ...item.oilPrices]
showCount.push(a)
- console.log("showCount",a)
+ console.log("showCount", a)
})
- console.log("showCount",showCount)
- console.log("showCountType",showCountType)
+ console.log("showCount", showCount)
+ console.log("showCountType", showCountType)
const option = {
color: [
@@ -802,32 +810,31 @@ export default {
trigger: 'item'
},
legend: {
- type:'scroll',
+ type: 'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
- left:'right',
- size:8
+ left: 'right',
+ size: 8
},
series: [
{
name: '',
type: 'pie',
itemStyle: {
- borderRadius:8,
- borderColor:'#fff',
- borderWidth:4
+ borderRadius: 8,
+ borderColor: '#fff',
+ borderWidth: 4
},
radius: ['40%', '80%'],
data: this.dataAnalysisOilNumberList,
label: {
show: true,
position: "inside",
- color:'#fff',
+ color: '#fff',
formatter: `{d}%`,
},
},
-
]
};
const option1 = {
@@ -839,12 +846,12 @@ export default {
trigger: 'item'
},
legend: {
- type:'scroll',
+ type: 'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
- left:'right',
- size:8
+ left: 'right',
+ size: 8
},
series: [
{
@@ -863,7 +870,7 @@ export default {
label: {
show: true,
position: "inside",
- color:'#fff',
+ color: '#fff',
formatter: `{d}%`,
},
},
@@ -882,12 +889,12 @@ export default {
trigger: 'item'
},
legend: {
- type:'scroll',
+ type: 'scroll',
orient: 'vertical',
right: '0%',
bottom: '0%',
- left:'right',
- size:8
+ left: 'right',
+ size: 8
},
series: [
{
@@ -906,7 +913,7 @@ export default {
label: {
show: true,
position: "inside",
- color:'#fff',
+ color: '#fff',
formatter: `{d}%`,
},
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java
index db581caee..f44e03024 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java
@@ -354,7 +354,7 @@ public class AllOrderInfoController extends BaseController {
}
/**
- * 油站首页 数据展示
+ * 油站首页 数据看板
* @return
*/
@GetMapping("getDataBoard")
@@ -375,6 +375,48 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(allOrderInfoService.getDataAnalysis(map));
}
+ /**
+ * 油站首页 数据分析 第一个饼状图
+ * @param map
+ * @return
+ */
+ @GetMapping("/getOilPercentage")
+ public ResponseObject getOilPercentage(String startTime, String endTime){
+ Map
map = new HashMap<>();
+ map.put("startTime", startTime);
+ map.put("endTime", endTime);
+ return getSuccessResult(allOrderInfoService.getOilPercentage(map));
+ }
+
+
+
+ /**
+ * 油站首页 数据分析 第二个饼状图
+ * @param map
+ * @return
+ */
+ @GetMapping("/getOilAndGoodsPercentage")
+ public ResponseObject getOilAndGoodsPercentage(String startTime, String endTime){
+ Map map = new HashMap<>();
+ map.put("startTime", startTime);
+ map.put("endTime", endTime);
+ return getSuccessResult(allOrderInfoService.getOilAndGoodsPercentage(map));
+ }
+
+
+ /**
+ * 油站首页 数据分析 第三个饼状图
+ * @param map
+ * @return
+ */
+ @GetMapping("/getOilAndGoodsAndVipAndPoints")
+ public ResponseObject getOilAndGoodsAndVipAndPoints(String startTime, String endTime){
+ Map map = new HashMap<>();
+ map.put("startTime", startTime);
+ map.put("endTime", endTime);
+ return getSuccessResult(allOrderInfoService.getOilAndGoodsAndVipAndPoints(map));
+ }
+
/**
* 油站首页数据展示
* @param map
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java
index 6077a7235..f3f65abfc 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java
@@ -165,6 +165,10 @@ public interface AllOrderInfoService {
*/
List getDataAnalysis(Map map);
+
+ Object getOilPercentage(Map map);
+ Object getOilAndGoodsPercentage(Map map);
+ Object getOilAndGoodsAndVipAndPoints(Map map);
/**
* 油站首页数据展示
* @param map
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
index 20ed96e2d..ba28893ef 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
@@ -79,6 +79,7 @@ import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.mapper.SysDeptMapper;
import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.dept.vo.SysDeptVo;
+import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -140,10 +141,11 @@ public class AllOrderInfoServiceImpl extends ServiceImpl orderStatistics(AllOrderInfoRes allOrderInfoRes) {
- return allOrderInfoMapper.orderStatistics(allOrderInfoRes, allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
- allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
+ return allOrderInfoMapper.orderStatistics(allOrderInfoRes, allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[0],
+ allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[1]);
}
@Override
@@ -852,7 +854,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl pageList = allOrderInfoMapper.gettradingListPage(page, allOrderInfo,
- allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[0],
- allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[1]);
+ allOrderInfo.getDataRange() == null ? "" : allOrderInfo.getDataRange()[0],
+ allOrderInfo.getDataRange() == null ? "" : allOrderInfo.getDataRange()[1]);
return pageList;
}
-
@Override
public IPage transactionList(Page page, AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
IPage allOrderInfoVoIPage = super.baseMapper.transactionList(page, allOrderInfoRes,
- allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
- allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
+ allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[0],
+ allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[1]);
return allOrderInfoVoIPage;
}
@@ -1916,6 +1916,78 @@ public class AllOrderInfoServiceImpl extends ServiceImpl map) {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ map.put("storeId", nowAccountInfo.getStoreId());
+ List