From ca85f1b36d12a4b82b326cc1d4c107304c3679f4 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Tue, 8 Oct 2024 17:02:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/system/check/checknum/checknum.html | 12 ++++++++++++ .../templates/system/checkReport/checkReport.html | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ruoyi-admin/src/main/resources/templates/system/check/checknum/checknum.html b/ruoyi-admin/src/main/resources/templates/system/check/checknum/checknum.html index f881a1b..d3007b9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/check/checknum/checknum.html +++ b/ruoyi-admin/src/main/resources/templates/system/check/checknum/checknum.html @@ -234,6 +234,18 @@ { field: 'checkStartTime', title: '检查开始时间', + formatter: function (value){ + let date = new Date(value); + return date.toISOString().split('T')[0]; + } + }, + { + field: 'checkEndTime', + title: '检查结束时间', + formatter: function (value){ + let date = new Date(value); + return date.toISOString().split('T')[0]; + } }, { field: 'createTime', diff --git a/ruoyi-admin/src/main/resources/templates/system/checkReport/checkReport.html b/ruoyi-admin/src/main/resources/templates/system/checkReport/checkReport.html index fc09c1e..c57f415 100644 --- a/ruoyi-admin/src/main/resources/templates/system/checkReport/checkReport.html +++ b/ruoyi-admin/src/main/resources/templates/system/checkReport/checkReport.html @@ -134,6 +134,18 @@ { field: 'checkStartTime', title: '检查开始时间', + formatter: function (value){ + let date = new Date(value); + return date.toISOString().split('T')[0]; + } + }, + { + field: 'checkEndTime', + title: '检查结束时间', + formatter: function (value){ + let date = new Date(value); + return date.toISOString().split('T')[0]; + } }, { field: 'createTime', From 7c908b27eae9cac417f6ef8d116f45a3cb90549b Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Tue, 8 Oct 2024 17:08:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E6=A3=80=E6=9F=A5=E8=BF=916=E4=B8=AA?= =?UTF-8?q?=E6=9C=88=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../count/SysPropertynumController.java | 41 ++++++++++++++++++- .../mapper/TdPropertyManagerMapper.java | 2 + .../service/ITdPropertyManagerService.java | 3 ++ .../impl/TdPropertyManagerServiceImpl.java | 5 +++ .../mapper/system/TdPropertyManagerMapper.xml | 9 +++- 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java index 47c0485..d21d5d3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java @@ -188,7 +188,44 @@ public class SysPropertynumController extends BaseController { /** * - *检查近6个月统计 + *近6个月统计涉密信息设备 + * @return + */ + @PostMapping("/countMessageMonth") + @ResponseBody + public AjaxResult countMessageMonth() { + List recentlySixMonth = ObtainLastSixMonthsUtil.getRecentlySixMonth(); + List yAxisData = new ArrayList<>(); + recentlySixMonth.forEach(month -> { + // 获取指定月份的最大日期 + String lastDayOfMonth = ObtainLastSixMonthsUtil.getLastDayOfMonth(month); + // 获取指定天的最大时间 + Date date = Date.from(LocalDate.parse(lastDayOfMonth).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + Date maxDayTime = ObtainLastSixMonthsUtil.getEndOfDay(date); + // 获取最小时间 + date = Date.from(LocalDate.parse(month.concat(StrPool.DASHED).concat("01")).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + Date minDayTime = ObtainLastSixMonthsUtil.getStartOfDay(date); + AtomicReference yAxis = new AtomicReference<>(0L); + PropertyManagerDTO tdPropertyManager = new PropertyManagerDTO(); + tdPropertyManager.setMinDayTime(minDayTime); + tdPropertyManager.setMaxDayTime(maxDayTime); + tdPropertyManager.setSecretsType("1"); + Integer count = tdPropertyManagerService.countMessageMonth(tdPropertyManager); + if(Objects.isNull(count)){ + count = 0; + } + yAxis.set(Long.valueOf(count)); + yAxisData.add(yAxis.get()); + }); + JSONObject obj = new JSONObject(); + obj.put("xAxisData", recentlySixMonth.toArray()); + obj.put("yAxisData", yAxisData); + return AjaxResult.success(obj); + } + + /** + * + *检查近6个月统计涉密设备 * @return */ @PostMapping("/countSecretsMonth") @@ -209,7 +246,7 @@ public class SysPropertynumController extends BaseController { PropertyManagerDTO tdPropertyManager = new PropertyManagerDTO(); tdPropertyManager.setMinDayTime(minDayTime); tdPropertyManager.setMaxDayTime(maxDayTime); - tdPropertyManager.setSecretsType("1"); + tdPropertyManager.setSecretsType("2"); Integer count = tdPropertyManagerService.countSecretsMonth(tdPropertyManager); if(Objects.isNull(count)){ count = 0; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java index 9a01b43..1b3cee4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java @@ -66,5 +66,7 @@ public interface TdPropertyManagerMapper extends BaseMapper public int deleteTdPropertyManagerByUseIds(String[] useIds); + public Integer countMessageMonth(PropertyManagerDTO propertyManagerDTO); + public Integer countSecretsMonth(PropertyManagerDTO propertyManagerDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java index 94a07e0..d37d9a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java @@ -66,5 +66,8 @@ public interface ITdPropertyManagerService extends IService public int deleteTdPropertyManagerByUseId(String useId); + public Integer countMessageMonth(PropertyManagerDTO propertyManagerDTO); + + public Integer countSecretsMonth(PropertyManagerDTO propertyManagerDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java index 05929cb..0ad6f36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java @@ -99,6 +99,11 @@ public class TdPropertyManagerServiceImpl extends ServiceImpl - SELECT COUNT(t.*) from td_property_manager t RIGHT JOIN td_property_info d on t.use_id = d.use_id where t.secrets_type=#{secretsType} AND t.recover_date >= #{minDayTime} AND t.recover_date <= #{maxDayTime} and d.destory_state is null + \ No newline at end of file