From 554761b5c77cc7264e0f9a3ef459a4655bb1d2ef Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Tue, 15 Oct 2024 10:18:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=9F=E8=AE=A1=E8=BF=91=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E4=BC=9A=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/count/SysMeetingnumController.java | 37 +++++++++++++++++++ .../tdmeeting/meetingnum/meetingnum.html | 28 +++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysMeetingnumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysMeetingnumController.java index 63a2b60..02c4e51 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysMeetingnumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysMeetingnumController.java @@ -64,6 +64,9 @@ public class SysMeetingnumController extends BaseController { public AjaxResult countMeetingMonth() { List recentlyTwelveMonth = ObtainLastSixMonthsUtil.getRecentlyTwelveMonth(); List yAxisData = new ArrayList<>(); + List yAxisDataW = new ArrayList<>(); + List yAxisDataXs= new ArrayList<>(); + List yAxisDataXx = new ArrayList<>(); recentlyTwelveMonth.forEach(month -> { // 获取指定月份的最大日期 String lastDayOfMonth = ObtainLastSixMonthsUtil.getLastDayOfMonth(month); @@ -82,13 +85,47 @@ public class SysMeetingnumController extends BaseController { } yAxis.set(Long.valueOf(count)); yAxisData.add(yAxis.get()); + AtomicReference yAxisW = new AtomicReference<>(0L); + Integer countW = new LambdaQueryChainWrapper<>(tdMeetingService.getBaseMapper()) + .ge(TdMeeting::getMeetingTime, minDayTime) + .le(TdMeeting::getMeetingTime, maxDayTime).eq(TdMeeting::getMeetingState,0).count(); + if (Objects.isNull(countW)) { + countW = 0; + } + yAxisW.set(Long.valueOf(countW)); + yAxisDataW.add(yAxisW.get()); + + AtomicReference yAxisXs = new AtomicReference<>(0L); + Integer countXs= new LambdaQueryChainWrapper<>(tdMeetingService.getBaseMapper()) + .ge(TdMeeting::getMeetingTime, minDayTime) + .le(TdMeeting::getMeetingTime, maxDayTime).eq(TdMeeting::getMeetingType,0).count(); + if (Objects.isNull(countXs)) { + countXs = 0; + } + yAxisXs.set(Long.valueOf(countXs)); + yAxisDataXs.add(yAxisXs.get()); + + AtomicReference yAxisXx = new AtomicReference<>(0L); + Integer countXx= new LambdaQueryChainWrapper<>(tdMeetingService.getBaseMapper()) + .ge(TdMeeting::getMeetingTime, minDayTime) + .le(TdMeeting::getMeetingTime, maxDayTime).eq(TdMeeting::getMeetingType,1).count(); + if (Objects.isNull(countXx)) { + countXx = 0; + } + yAxisXx.set(Long.valueOf(countXx)); + yAxisDataXx.add(yAxisXx.get()); + }); JSONObject obj = new JSONObject(); obj.put("xAxisData", recentlyTwelveMonth.toArray()); obj.put("yAxisData", yAxisData); + obj.put("yAxisDataW", yAxisDataW); + obj.put("yAxisDataXs", yAxisDataXs); + obj.put("yAxisDataXx", yAxisDataXx); return AjaxResult.success(obj); } + /** * 会议详情 */ diff --git a/ruoyi-admin/src/main/resources/templates/system/tdmeeting/meetingnum/meetingnum.html b/ruoyi-admin/src/main/resources/templates/system/tdmeeting/meetingnum/meetingnum.html index ef26696..86108dd 100644 --- a/ruoyi-admin/src/main/resources/templates/system/tdmeeting/meetingnum/meetingnum.html +++ b/ruoyi-admin/src/main/resources/templates/system/tdmeeting/meetingnum/meetingnum.html @@ -145,7 +145,7 @@ }, tooltip: {}, legend: { - data:['次数'] + data:['已召开','未召开','线上会议','线下会议'] }, xAxis: { data: response.data.data.xAxisData, @@ -159,12 +159,36 @@ }, series: [ { - name: '次数', + name: '已召开', type: 'bar', data: response.data.data.yAxisData, itemStyle: { color: '#38dbe0' } + }, + { + name: '未召开', + type: 'bar', + data: response.data.data.yAxisDataW, + itemStyle: { + color: '#a2ea57' + } + }, + { + name: '线上会议', + type: 'bar', + data: response.data.data.yAxisDataXs, + itemStyle: { + color: '#ead657' + } + }, + { + name: '线下会议', + type: 'bar', + data: response.data.data.yAxisDataXx, + itemStyle: { + color: '#5792ea' + } } ], });