提交 cd97652d authored 作者: 吴德鹏's avatar 吴德鹏

首页统计

上级 9fdfaa3c
......@@ -319,7 +319,13 @@ public class TbCfOrderController extends AbstractController {
amount = amount.setScale(2, BigDecimal.ROUND_UP);
return R.ok().put("amount", amount);
}
@GetMapping("/getOrderSumAmount")
@ResponseBody
public R getOrderSumAmount() {
BigDecimal amount = tbCfOrderService.getOrderSumAmount();
amount = amount.setScale(2, BigDecimal.ROUND_UP);
return R.ok().put("amount", amount);
}
//==========================================================================================================
/**
......
......@@ -94,4 +94,6 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
BigDecimal getAverageSales();
BigDecimal getOrderSumAmount();
}
......@@ -114,4 +114,5 @@ public interface TbCfOrderService {
BigDecimal getAverageSales();
BigDecimal getOrderSumAmount();
}
......@@ -190,5 +190,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return tbCfOrderDao.getAverageSales();
}
@Override
public BigDecimal getOrderSumAmount() {
return tbCfOrderDao.getOrderSumAmount();
}
}
......@@ -137,6 +137,14 @@
WHERE
pay_status = 20
</select>
<select id="getOrderSumAmount" resultType="java.math.BigDecimal">
SELECT
sum( total_price )
FROM
tb_cf_order
WHERE
pay_status = 20
</select>
<select id="queryList" resultType="com.platform.entity.TbCfOrderEntity">
select
i.order_item_id ordersId,
......
......@@ -2,6 +2,8 @@ let app = new Vue({
el: '#app',
data() {
return {
category2: null,
category3: null,
amount: 0,
orderRate: 0,
ForturnoverNumber: 0,
......@@ -236,7 +238,10 @@ let app = new Vue({
{value: 1548, name: 'Sport', price: 123, itemStyle: {color: '#36CBCB'}}
]
}
]
],
categoryList: [],
Goodstype2: [],
Goodstype3: []
}
},
computed: {
......@@ -251,6 +256,42 @@ let app = new Vue({
}
},
methods: {
//获取二级分类
changeGoodstype(id) {
let url = "../tbcfstationitem/queryByItemType?typeId=" + id;
let that = this;
Ajax.request({
url: url,
type: "get",
contentType: "application/json",
successCallback: function (r) {
if (r.code === 0) {
that.Goodstype2 = r.list
// e?setTimeout(()=>{that.changeGoodstype2()},0):void(0);
if (r.list.length === 0) {
that.category2 = null
}
}
}
});
},
changeGoodstype2(id) {
let url = "../tbcfstationitem/queryByItemTypeTwo?typeTwoId=" + id;
let that = this;
Ajax.request({
url: url,
type: "get",
contentType: "application/json",
successCallback: function (r) {
if (r.code === 0) {
that.Goodstype3 = r.descripiton
if (r.descripiton.length === 0) {
that.category3 = null
}
}
}
});
},
templateMethod(url) {
$.get(url, res => {
this.initEchartsMiddleData[0].data = []
......@@ -687,20 +728,14 @@ let app = new Vue({
}
},
getOrderNum() {
let orderNum = 0;
$.get('../tbcforder/getOrderNum', res => {
orderNum = res.count
TweenLite.to(this.$data, 1, {ForturnoverNumber: res.count});
$.get('../tbcforder/getOrderSumAmount', res => {
TweenLite.to(this.$data, 1, {ForturnoverNumber: res.amount});
})
return orderNum;
},
getOrderPaidNum() {
let orderPaidNum = 0;
$.get('../tbcforder/getOrderNum?status=20', res => {
orderPaidNum = res.count
TweenLite.to(this.$data, 1, {FrequencyOfPaymentNumber: res.count});
})
return orderPaidNum;
},
getOrderRate() {
let orderNum = 0;
......@@ -709,7 +744,6 @@ let app = new Vue({
orderNum = res.count
$.get('../tbcforder/getOrderNum?status=20', res => {
orderPaidNum = res.count
console.log(orderNum + "---" + orderPaidNum)
this.orderRate = this.Percentage(orderPaidNum, orderNum)
})
})
......@@ -724,10 +758,16 @@ let app = new Vue({
$.get('../tbcforder/getAverageSales', res => {
this.amount = res.amount;
})
},
getCategory() {
$.get('../tbcfgoodstype/queryAll', res => {
this.categoryList = res.list;
console.log(this.categoryList)
})
}
},
created() {
this.getCategory();
},
mounted() {
this.initEchartsPV();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论