From 3b87010f24b8497729e6c3f37e2e4dad649dda69 Mon Sep 17 00:00:00 2001 From: ryoeiken <754264374@qq.com> Date: Mon, 11 Jan 2021 16:09:30 +0800 Subject: [PATCH] =?UTF-8?q?todo=EF=BC=9A=E6=8A=A5=E9=A4=90=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FtOrderDaoController.java | 15 ++++--- .../service/impl/FtOrderDaoServiceImpl.java | 19 +++++---- .../views/fantang/orderStatistics/index.vue | 42 ++++++++++++++++++- 3 files changed, 60 insertions(+), 16 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java index e9799a2e5..4d67a8ebb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java @@ -130,7 +130,7 @@ public class FtOrderDaoController extends BaseController { */ @PostMapping("/getStatisGetOrderOfDay") public AjaxResult getStatisGetOrderOfDay(@RequestBody JSONObject params) { - startPage(); + Date selectDay = params.getDate("selectDay"); Integer statisticsType = params.getInteger("statisticsType"); Integer pageNum = params.getInteger("pageNum"); @@ -148,15 +148,16 @@ public class FtOrderDaoController extends BaseController { */ @PostMapping("/getStatisGetOrderOfWeek") public AjaxResult getStatisGetOrderOfWeek(@RequestBody JSONObject params) { - System.out.println(params); + Date selectWeek = params.getDate("selectWeek"); Integer statisticsType = params.getInteger("statisticsType"); + Integer pageNum = params.getInteger("pageNum"); + Integer pageSize = params.getInteger("pageSize"); if (statisticsType == 1) { return iFtOrderDaoService.statisGetOrderOfWeek(selectWeek); } else { -// return iFtOrderDaoService.statisGetOrderOfWeekByPerson(selectWeek); - return null; + return iFtOrderDaoService.statisGetOrderOfWeekByPerson(selectWeek, pageNum, pageSize); } } @@ -166,14 +167,16 @@ public class FtOrderDaoController extends BaseController { */ @PostMapping("/getStatisGetOrderOfMonth") public AjaxResult getStatisGetOrderOfMonth(@RequestBody JSONObject params) { + Date selectMonth = params.getDate("selectMonth"); Integer statisticsType = params.getInteger("statisticsType"); + Integer pageNum = params.getInteger("pageNum"); + Integer pageSize = params.getInteger("pageSize"); if (statisticsType == 1) { return iFtOrderDaoService.statisGetOrderOfMonth(selectMonth); }else { -// return iFtOrderDaoService.statisGetOrderOfMonthByPerson(selectMonth); - return null; + return iFtOrderDaoService.statisGetOrderOfMonthByPerson(selectMonth, pageNum, pageSize); } } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java index 0966fabd8..a2d01da27 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtOrderDaoServiceImpl.java @@ -29,9 +29,9 @@ public class FtOrderDaoServiceImpl extends ServiceImpl 0) + if (count > 0) { return -1; - else + } else { return this.baseMapper.insert(dao); + } } @Override @@ -133,7 +134,7 @@ public class FtOrderDaoServiceImpl extends ServiceImpl @@ -133,6 +134,8 @@ export default { showSearch: true, // 总条数 total: 0, + // 查询类型 + selectType: null, // 订单管理表格数据 orderList: [], orderCountList: [], @@ -145,6 +148,8 @@ export default { pageNum: 1, pageSize: 10, selectDay: null, + selectWeek: null, + selectMonth: null, statisticsType: null, }, // 表单参数 @@ -160,6 +165,29 @@ export default { }); }, methods: { + getStatisticsList() { + if (this.selectType === 1 || this.selectType === '1') { + getStatisGetOrderOfDay(this.queryParams).then(response => { + console.log(response) + this.orderCountList = response.data; + this.selectType = 1; + this.total = response.total; + }) + } else if (this.selectType === 2 || this.selectType === '2') { + getStatisGetOrderOfWeek(this.queryParams).then(response => { + console.log(response) + this.orderCountList = response.data; + this.selectType = 2; + this.total = response.total; + }) + } else if (this.selectType === 3 || this.selectType === '3') { + getStatisGetOrderOfMonth(this.queryParams).then(response => { + this.orderCountList = response.data; + this.selectType = 3; + this.total = response.total; + }) + } + }, changeStatisticsType(item) { console.log(item) this.formDay.statisticsType = item; @@ -190,8 +218,12 @@ export default { } if (this.formMonth.selectMonth != null && this.formMonth.statisticsType != null) { console.log(this.formMonth) - getStatisGetOrderOfMonth(this.formMonth).then(response => { + this.queryParams.selectMonth = this.formMonth.selectMonth; + this.queryParams.statisticsType = this.formMonth.statisticsType; + getStatisGetOrderOfMonth(this.queryParams).then(response => { this.orderCountList = response.data; + this.selectType = 3; + this.total = response.total; }) } }, @@ -201,9 +233,13 @@ export default { } if (this.formWeek.selectWeek != null && this.formWeek.statisticsType != null) { console.log(this.formWeek) - getStatisGetOrderOfWeek(this.formWeek).then(response => { + this.queryParams.selectWeek = this.formWeek.selectWeek; + this.queryParams.statisticsType = this.formWeek.statisticsType; + getStatisGetOrderOfWeek(this.queryParams).then(response => { console.log(response) this.orderCountList = response.data; + this.selectType = 2; + this.total = response.total; }) } }, @@ -218,6 +254,8 @@ export default { getStatisGetOrderOfDay(this.queryParams).then(response => { console.log(response) this.orderCountList = response.data; + this.selectType = 1; + // this.total = response.total; }) } },