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

首页统计

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