From dc5b41c2a5629e61a42f61a06c527c6bac2c1078 Mon Sep 17 00:00:00 2001 From: "review512jwy@163.com" <“review512jwy@163.com”> Date: Fri, 31 Oct 2025 11:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- document/db/20240508.sql | 14 +- document/db/20240515.sql | 2 +- document/db/init.sql | 6 +- .../dashboard/back/common/Constants.java | 13 +- .../common/config/DataSourceAdminConfig.java | 2 +- .../common/config/DataSourceInterceptor.java | 4 +- .../back/common/config/HttpConfig.java | 26 + .../resources/config/language/msg/msg_cn.yml | 5 +- .../resources/config/language/msg/msg_en.yml | 5 +- .../resources/config/language/msg/msg_jp.yml | 5 +- .../back/controller/AIController.java | 61 ++ .../controller/DeviceDataAlarmController.java | 30 + .../controller/DeviceGroupController.java | 50 +- .../controller/LevelHierarchyController.java | 111 --- .../LevelHierarchyRoleController.java | 127 --- .../back/controller/OverviewController.java | 15 + .../dashboard/back/oidc/AutoLoginFilter.java | 114 +++ .../dongjian/dashboard/back/oidc/Jwks.java | 26 + .../dashboard/back/oidc/SecurityConfig.java | 162 ++++ .../resources/config/application.properties | 15 +- .../dao/auto/DashboardLevelRoleMapper.java | 96 --- .../auto/DashboardNoticeIgnoredMapper.java | 96 +++ .../back/dao/auto/DeviceGroupMapper.java | 22 +- .../dao/auto/DeviceGroupRelationMapper.java | 14 +- .../back/dao/ex/AlertHistoryMapperExt.java | 5 + .../back/dao/ex/BasicRoleMapperExt.java | 1 + .../dao/ex/DashboardLevelRoleMapperExt.java | 24 - .../ex/DashboardNoticeIgnoredMapperExt.java | 21 + .../dao/ex/DeviceGroupRelationMapperExt.java | 6 - .../back/dao/ex/LevelHierarchyMapperExt.java | 41 - .../mappers/auto/BasicBuildingMapper.xml | 51 +- .../mappers/auto/BasicUserMapper.xml | 29 +- ...r.xml => DashboardNoticeIgnoredMapper.xml} | 158 ++-- .../mappers/auto/DeviceGroupMapper.xml | 47 +- .../auto/DeviceGroupRelationMapper.xml | 14 +- .../mappers/ex/AlertHistoryMapperExt.xml | 46 + .../mappers/ex/BasicBuildingMapperExt.xml | 2 +- .../mappers/ex/BasicCompanyMapperExt.xml | 2 +- .../mappers/ex/BasicRoleMapperExt.xml | 5 +- .../mappers/ex/BasicUserMapperExt.xml | 8 +- .../ex/DashboardLevelRoleMapperExt.xml | 64 -- .../ex/DashboardNoticeIgnoredMapperExt.xml | 21 + .../mappers/ex/DeviceGroupMapperExt.xml | 22 +- .../mappers/ex/DeviceInfoMapperExt.xml | 61 +- .../ex/DeviceRawdataRealtimeMapperExt.xml | 9 +- .../mappers/ex/LevelHierarchyMapperExt.xml | 359 -------- .../ex/MonitoringPointCategoryMapperExt.xml | 7 +- .../mappers/ex/OperationLogMapperExt.xml | 2 +- .../mybatis-generator/generatorConfig.xml | 17 +- .../mybatisGeneratorinit.properties | 2 +- .../dashboard/back/dto/ai/AiAskParam.java | 24 + .../dashboard/back/dto/ai/AiAskResponse.java | 21 + .../back/dto/ai/AiRetrieveParam.java | 13 + .../dashboard/back/dto/ai/Citation.java | 34 + .../back/dto/ai/RetrieveResponse.java | 18 + .../back/dto/data/DataSearchParam.java | 7 +- .../back/dto/device/DeviceSearchParams.java | 5 +- .../dto/device/WindowAlertCloseRequest.java | 10 + .../dto/device/WindowAlertQueryRequest.java | 15 + .../devicegroup/DeviceGroupSearchParams.java | 5 +- .../dto/devicegroup/OptDeviceGroupParams.java | 3 - .../DeleteLevelHierarchyParam.java | 21 - .../DeleteLevelHierarchyRoleParam.java | 18 - .../OptLevelHierarchyParam.java | 46 - .../OptLevelHierarchyRoleParam.java | 40 - .../PageLevelHierarchyRoleSearchParam.java | 19 - .../PageLevelHierarchySearchParam.java | 22 - .../dashboard/back/model/BasicBuilding.java | 68 ++ .../back/model/BasicBuildingExample.java | 140 +++ .../dashboard/back/model/BasicUser.java | 34 + .../back/model/BasicUserExample.java | 60 ++ .../back/model/DashboardLevelRole.java | 302 ------- .../back/model/DashboardLevelRoleExample.java | 802 ------------------ .../back/model/DashboardNoticeIgnored.java | 166 ++++ .../model/DashboardNoticeIgnoredExample.java | 562 ++++++++++++ .../dashboard/back/model/DeviceGroup.java | 118 +-- .../back/model/DeviceGroupExample.java | 94 +- .../back/model/DeviceGroupRelation.java | 24 +- .../model/DeviceGroupRelationExample.java | 34 +- .../back/vo/data/DeviceAlarmData.java | 3 + .../back/vo/device/WindowAlertVO.java | 57 ++ .../vo/devicegroup/DeviceGroupPageVO.java | 9 +- .../levelhierarchy/LevelHierarchyPageDTO.java | 25 - .../LevelHierarchyRolePageDTO.java | 25 - .../levelhierarchy/LevelHierarchyTreeVO.java | 29 - .../back/weather/JpMeshHourlyForecasts.java | 133 +++ .../dashboard/back/weather/QueryWeather.java | 15 + .../dashboard/back/service/AIService.java | 18 + .../back/service/DeviceDataAlarmService.java | 7 + .../back/service/DeviceGroupService.java | 4 + .../service/LevelHierarchyRoleService.java | 27 - .../back/service/LevelHierarchyService.java | 24 - .../back/service/OverviewService.java | 3 + .../back/service/common/CommonOpt.java | 6 +- .../common/LevelHierarchyTreeBuilder.java | 203 ----- .../back/service/impl/AIServiceImpl.java | 145 ++++ .../impl/DeviceDataAccumulateServiceImpl.java | 2 +- .../impl/DeviceDataAlarmServiceImpl.java | 55 +- .../impl/DeviceDataBaStatusServiceImpl.java | 2 +- .../impl/DeviceDataMeasureServiceImpl.java | 2 +- .../service/impl/DeviceGroupServiceImpl.java | 71 +- .../impl/LevelHierarchyRoleServiceImpl.java | 198 ----- .../impl/LevelHierarchyServiceImpl.java | 189 ----- .../service/impl/OverviewServiceImpl.java | 58 +- .../back/service/impl/RoleServiceImpl.java | 13 + .../back/service/impl/UserServiceImpl.java | 1 + dongjian-dashboard-back-util/pom.xml | 6 + pom.xml | 9 + 108 files changed, 2789 insertions(+), 3320 deletions(-) create mode 100644 dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java create mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java delete mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java delete mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java create mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java create mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java create mode 100644 dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java delete mode 100644 dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java create mode 100644 dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java delete mode 100644 dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java create mode 100644 dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java delete mode 100644 dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java rename dongjian-dashboard-back-dao/src/main/resources/mappers/auto/{DashboardLevelRoleMapper.xml => DashboardNoticeIgnoredMapper.xml} (63%) create mode 100644 dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml delete mode 100644 dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml create mode 100644 dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml delete mode 100644 dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java delete mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java create mode 100644 dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java create mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java delete mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java delete mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java delete mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java create mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java delete mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java delete mode 100644 dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java diff --git a/document/db/20240508.sql b/document/db/20240508.sql index 3b87a30..c83fcc4 100644 --- a/document/db/20240508.sql +++ b/document/db/20240508.sql @@ -1,4 +1,4 @@ -USE `data_center_new`; +USE `data_center_aeon_admin`; DROP procedure IF EXISTS `add_column`; @@ -10,7 +10,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'aurora_flag' ) THEN @@ -21,7 +21,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'aurora_url' ) THEN @@ -32,7 +32,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'aurora_username' ) THEN @@ -43,7 +43,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'aurora_password' ) THEN @@ -54,7 +54,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'redis_db_id' ) THEN @@ -65,7 +65,7 @@ BEGIN IF NOT EXISTS ( SELECT * FROM information_schema.columns - WHERE table_schema = 'data_center_new' + WHERE table_schema = 'data_center_aeon_admin' AND table_name = 'basic_company' AND column_name = 'bearer_token' ) THEN diff --git a/document/db/20240515.sql b/document/db/20240515.sql index d731e2a..82689da 100644 --- a/document/db/20240515.sql +++ b/document/db/20240515.sql @@ -1,4 +1,4 @@ -USE `data_center_new`; +USE `data_center_aeon_admin`; /*Table structure for table `basic_menu` */ diff --git a/document/db/init.sql b/document/db/init.sql index b1cf338..5024010 100644 --- a/document/db/init.sql +++ b/document/db/init.sql @@ -1,6 +1,6 @@ /* SQLyog 企业版 - MySQL GUI v8.14 -MySQL - 8.0.28 : Database - data_center_new +MySQL - 8.0.28 : Database - data_center_aeon_admin ********************************************************************* */ @@ -13,9 +13,9 @@ MySQL - 8.0.28 : Database - data_center_new /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_new` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_aeon_admin` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; -USE `data_center_new`; +USE `data_center_aeon_admin`; /*Table structure for table `basic_company` */ diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java index 0ce104e..b8e3fd2 100644 --- a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java @@ -1,10 +1,6 @@ package com.dongjian.dashboard.back.common; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @author Mr.Jiang @@ -24,7 +20,9 @@ public class Constants { public static final String DATASOURCE_PREFIX = "dataSourceForCompany_"; - public static final String THIRD_DB_PREFIX = "data_center_dongjian_"; + public static final String THIRD_DB_PREFIX = "data_center_aeon_"; + + public static final String WINDOW_ALERT_IGNORED = "alert_window_notice:ignore:%d"; public static final int AURORA_IN_BATCH_SIZE = 1000; @@ -39,7 +37,8 @@ public class Constants { // 定义分类与设备类型的映射 public static final Map> CATEGORY_DEVICE_TYPE_MAP = new HashMap<>(); - static { + + static { CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ALARM, Arrays.asList(46, 110)); CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_MEASURE, Arrays.asList(47, 111, 121)); CATEGORY_DEVICE_TYPE_MAP.put(CATEGORY_ACCUMULATE, Arrays.asList(48, 112, 122)); diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java index 7e788d0..fd3e8d0 100644 --- a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceAdminConfig.java @@ -102,7 +102,7 @@ public class DataSourceAdminConfig { "\t\t\tbcom.id,\n" + "\t\t\tbcom.company_name companyName\n" + "\t\tFROM\n" + - "\t\t\tdata_center_new.basic_company bcom\n" + + "\t\t\tdata_center_aeon_admin.basic_company bcom\n" + "\t\tWHERE bcom.flag != 1 and (parent_id = 1 or parent_id = -1)"; jdbcTemplate.query(sql,rs->{ diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java index 70e28ed..372bc72 100644 --- a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/DataSourceInterceptor.java @@ -59,7 +59,7 @@ public class DataSourceInterceptor implements HandlerInterceptor { String sql="SELECT " + " bcom.id, bcom.parent_id parentId" - + " FROM data_center_new.basic_company bcom " + + " FROM data_center_aeon_admin.basic_company bcom " + " WHERE bcom.flag != 1 and bcom.id = " + companyId; AtomicLong parentId = new AtomicLong(0); @@ -86,7 +86,7 @@ public class DataSourceInterceptor implements HandlerInterceptor { "\t\t\tbcom.id,\n" + "\t\t\tbcom.company_name companyName\n" + "\t\tFROM\n" + - "\t\t\tdata_center_new.basic_company bcom\n" + + "\t\t\tdata_center_aeon_admin.basic_company bcom\n" + "\t\tWHERE (bcom.parent_id=1 or bcom.parent_id=-1) and bcom.flag != 1"; jdbcTemplate.query(sql,rs->{ diff --git a/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java new file mode 100644 index 0000000..b1d47f2 --- /dev/null +++ b/dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/config/HttpConfig.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + +@Configuration +public class HttpConfig { + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + + // 设置连接超时和读取超时 + SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); + factory.setConnectTimeout(10000); // 连接超时10秒 + factory.setReadTimeout(30000); // 读取超时30秒 + + restTemplate.setRequestFactory(factory); + + return restTemplate; + } + +} diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml index 7956ecb..888cd80 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_cn.yml @@ -73,8 +73,7 @@ msgcn: handleStatus_3: 完成 handleStatus_4: 自动恢复 canNotProcessed: 无法再处理 - alreadyExists: 平台已存在 - hasChildLevel: 存在下级层级,不允许删除 + processOwnRole: 不能处理自身角色 operationLogMap: addRole: 新增角色 editRole: 编辑角色 @@ -127,5 +126,7 @@ msgcn: getFavoriteList: 获取收藏设备列表 removeFavoriteDevice: 删除收藏设备 addFavoriteDevice: 新增收藏设备 + addDeviceForGroup: 给设备组设置绑定的设备 + delDeviceForGroup: 删除设备组绑定的指定设备 diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml index 1c69a47..f3deb4e 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_en.yml @@ -73,8 +73,7 @@ msgen: handleStatus_3: Completed handleStatus_4: Auto Recovered canNotProcessed: Can not be processed further - alreadyExists: 平台已存在 - hasChildLevel: 存在下级层级,不允许删除 + processOwnRole: Can not process own role. operationLogMap: addRole: Add Role editRole: Edit Role @@ -127,6 +126,8 @@ msgen: getFavoriteList: Get list of favorited devices removeFavoriteDevice: Remove favorited device addFavoriteDevice: Add favorited device + addDeviceForGroup: Set bound devices for the device group + delDeviceForGroup: Remove the specified devices bound to the device group diff --git a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml index 605a15f..4a83e3a 100644 --- a/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml +++ b/dongjian-dashboard-back-common/src/main/resources/config/language/msg/msg_jp.yml @@ -73,8 +73,7 @@ msgjp: handleStatus_3: 完了 handleStatus_4: 自動復旧 canNotProcessed: これ以上の処理はできません - alreadyExists: 平台已存在 - hasChildLevel: 存在下级层级,不允许删除 + processOwnRole: 自分のロールを操作することはできません operationLogMap: addRole: ロールを追加 editRole: ロールを編集 @@ -127,6 +126,8 @@ msgjp: getFavoriteList: お気に入りデバイス一覧を取得 removeFavoriteDevice: お気に入りデバイスを削除 addFavoriteDevice: お気に入りデバイスを追加 + addDeviceForGroup: デバイスグループにバインドされたデバイスを設定する + delDeviceForGroup: デバイスグループにバインドされた指定されたデバイスを削除する diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java new file mode 100644 index 0000000..8280384 --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/AIController.java @@ -0,0 +1,61 @@ +package com.dongjian.dashboard.back.controller; + +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.configurator.aspect.OperationLog; +import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; +import com.dongjian.dashboard.back.dto.ai.AiAskParam; +import com.dongjian.dashboard.back.dto.user.OptUserParam; +import com.dongjian.dashboard.back.service.AIService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * + * @author zhc + * + */ +@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 +//@AccessRequired //注解标识是否需要验证token +@RequestMapping("/ai") //http请求路径映射 +@Tag(name = "用户管理的相关接口",description = "用户管理的相关接口") +@SuppressWarnings("unchecked") +public class AIController { + + private static Logger logger = LoggerFactory.getLogger(AIController.class); + + @Autowired + AIService aiService; + + @OperationLog(operation = "ask", remark = "") + @Operation(summary = "提问回答") + @RequestMapping(value = "/ask",method = RequestMethod.POST) + public SimpleDataResponse ask( + @RequestBody AiAskParam param, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return aiService.ask(param, CompanyId, UserId, LanguageType); + } + + @OperationLog(operation = "retrieve", remark = "") + @Operation(summary = "文件搜索") + @RequestMapping(value = "/retrieve",method = RequestMethod.POST) + public SimpleDataResponse retrieve( + @RequestBody AiAskParam param, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, + @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ + return aiService.retrieve(param, CompanyId, UserId, LanguageType); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java index 967bdd4..7fbe789 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java @@ -12,11 +12,14 @@ import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest; +import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest; import com.dongjian.dashboard.back.easyexcel.ExportDeviceAlarmDataDTO; import com.dongjian.dashboard.back.easyexcel.LanguageDynamicHeaderAdapter; import com.dongjian.dashboard.back.service.DeviceDataAlarmService; import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import com.dongjian.dashboard.back.vo.device.WindowAlertVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; @@ -154,4 +157,31 @@ public class DeviceDataAlarmController { return pageResponse; } + + @Operation(summary = "获取弹窗告警通知列表") + @RequestMapping(value = "/window/list", method = RequestMethod.GET) + public SimpleDataResponse> windowList( + WindowAlertQueryRequest searchParams, + @Parameter(name = "LoginName", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader String LoginName, + @Parameter(name = "AccessToken", required = true) @RequestHeader String AccessToken, + @Parameter(name = "UserId", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader Long UserId, + @Parameter(name = "CompanyId", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader Integer LanguageType + ) { + return deviceDataAlarmService.windowList(searchParams, UserId, CompanyId, AccessToken, LanguageType); + } + + @Operation(summary = "关闭弹窗的指定告警") + @RequestMapping(value = "/window/dismiss", method = RequestMethod.POST) + public SimpleDataResponse windowDismiss( + @RequestBody WindowAlertCloseRequest windowAlertCloseRequest, + @Parameter(name = "LoginName", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader String LoginName, + @Parameter(name = "AccessToken", required = true) @RequestHeader String AccessToken, + @Parameter(name = "UserId", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader Long UserId, + @Parameter(name = "CompanyId", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader Integer LanguageType + ) { + return deviceDataAlarmService.windowDismiss(windowAlertCloseRequest, UserId, CompanyId, AccessToken, LanguageType); + } + } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java index 6bf3100..4e1db67 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceGroupController.java @@ -25,7 +25,7 @@ import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; import java.util.List; -@Hidden + @RestController @AccessRequired @RequestMapping("/deviceGroup") @@ -38,9 +38,10 @@ public class DeviceGroupController { @Autowired private DeviceGroupService deviceGroupService; + @Hidden @OperationLog(operation = "addDeviceGroup", remark = "") @Operation(summary = "Add deviceGroup") - @RequestMapping(value = "/deviceGroup/add", method = RequestMethod.POST) + @RequestMapping(value = "/add", method = RequestMethod.POST) public SimpleDataResponse add( @RequestBody OptDeviceGroupParams optDeviceGroupParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -51,9 +52,10 @@ public class DeviceGroupController { return deviceGroupService.add(optDeviceGroupParams, UserId, CompanyId, LanguageType); } + @Hidden @OperationLog(operation = "editDeviceGroup", remark = "") @Operation(summary = "Edit deviceGroup") - @RequestMapping(value = "/deviceGroup/edit", method = RequestMethod.POST) + @RequestMapping(value = "/edit", method = RequestMethod.POST) public SimpleDataResponse edit( @RequestBody OptDeviceGroupParams optDeviceGroupParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -64,9 +66,10 @@ public class DeviceGroupController { return deviceGroupService.edit(optDeviceGroupParams, UserId, CompanyId, LanguageType); } + @Hidden @OperationLog(operation = "deleteDeviceGroup", remark = "") @Operation(summary = "Delete deviceGroup") - @RequestMapping(value = "/deviceGroup/batchDelete", method = RequestMethod.POST) + @RequestMapping(value = "/batchDelete", method = RequestMethod.POST) public SimpleDataResponse batchDelete( @RequestBody DeleteDeviceGroupParams deleteDeviceGroupParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -79,7 +82,7 @@ public class DeviceGroupController { @OperationLog(operation = "queryDeviceGroup", remark = "") @Operation(summary = "Get deviceGroup list") - @RequestMapping(value = "/deviceGroup/getListPage", method = RequestMethod.GET) + @RequestMapping(value = "/getListPage", method = RequestMethod.GET) public PageResponse> getListPage( @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, @@ -105,9 +108,10 @@ public class DeviceGroupController { } + @Hidden @OperationLog(operation = "bindGroupForDevice", remark = "") @Operation(summary = "给设备绑定设备组") - @RequestMapping(value = "/deviceGroup/bindGroupForDevice", method = RequestMethod.POST) + @RequestMapping(value = "/bindGroupForDevice", method = RequestMethod.POST) public SimpleDataResponse bindGroupForDevice( @RequestBody BindGroupForDeviceParams bindGroupForDeviceParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -118,9 +122,10 @@ public class DeviceGroupController { return deviceGroupService.bindGroupForDevice(bindGroupForDeviceParams, UserId, CompanyId, LanguageType); } + @Hidden @OperationLog(operation = "bindDeviceForGroup", remark = "") @Operation(summary = "给设备组设置绑定的设备") - @RequestMapping(value = "/deviceGroup/bindDeviceForGroup", method = RequestMethod.POST) + @RequestMapping(value = "/bindDeviceForGroup", method = RequestMethod.POST) public SimpleDataResponse bindDeviceForGroup( @RequestBody BindDeviceForGroupParams bindDeviceForGroupParams, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -131,8 +136,9 @@ public class DeviceGroupController { return deviceGroupService.bindDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType); } + @Hidden @Operation(summary = "根据设备主键ID获取绑定的设备组") - @RequestMapping(value = "/deviceGroup/getBindedGroupByDevice/{deviceInfoId}", method = RequestMethod.GET) + @RequestMapping(value = "/getBindedGroupByDevice/{deviceInfoId}", method = RequestMethod.GET) public SimpleDataResponse> getBindedGroupByDevice( @PathVariable Integer deviceInfoId, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -144,7 +150,7 @@ public class DeviceGroupController { } @Operation(summary = "根据设备组ID获取绑定的设备") - @RequestMapping(value = "/deviceGroup/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET) + @RequestMapping(value = "/getBindedDeviceByGroup/{deviceGroupId}", method = RequestMethod.GET) public SimpleDataResponse> getBindedDeviceByGroup( @PathVariable Long deviceGroupId, @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, @@ -155,4 +161,30 @@ public class DeviceGroupController { return deviceGroupService.getBindedDeviceByGroup(deviceGroupId, UserId, CompanyId, LanguageType); } + @OperationLog(operation = "addDeviceForGroup", remark = "") + @Operation(summary = "给设备组增加绑定的设备") + @RequestMapping(value = "/addDeviceForGroup", method = RequestMethod.POST) + public SimpleDataResponse addDeviceForGroup( + @RequestBody BindDeviceForGroupParams bindDeviceForGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.addDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType); + } + + @OperationLog(operation = "delDeviceForGroup", remark = "") + @Operation(summary = "给设备组解除绑定的设备") + @RequestMapping(value = "/delDeviceForGroup", method = RequestMethod.POST) + public SimpleDataResponse delDeviceForGroup( + @RequestBody BindDeviceForGroupParams bindDeviceForGroupParams, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType) { + return deviceGroupService.delDeviceForGroup(bindDeviceForGroupParams, UserId, CompanyId, LanguageType); + } + } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java deleted file mode 100644 index 396825e..0000000 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.dongjian.dashboard.back.controller; - - -import com.dongjian.dashboard.back.common.exception.BusinessException; -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.PageResponse; -import com.dongjian.dashboard.back.common.response.ResponseCode; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.configurator.aspect.OperationLog; -import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; -import com.dongjian.dashboard.back.service.LevelHierarchyService; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * - * @author jwy-style - * - */ -@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 -@AccessRequired //注解标识是否需要验证token -@RequestMapping("/levelHierarchy") //http请求路径映射 -@Tag(name = "支社、支店等层级的相关接口",description = "支社、支店等层级的相关接口") -@SuppressWarnings("unchecked") -public class LevelHierarchyController { - - private static Logger logger = LoggerFactory.getLogger(LevelHierarchyController.class); - - @Autowired - private LevelHierarchyService levelHierarchyService; - - - @OperationLog(operation = "addLevelHierarchy", remark = "") - @Operation(summary = "添加层级") - @RequestMapping(value = "/add",method = RequestMethod.POST) - public SimpleDataResponse add( - @RequestBody OptLevelHierarchyParam optLevelHierarchyParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyService.add(optLevelHierarchyParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "editLevelHierarchy", remark = "") - @Operation(summary = "编辑层级") - @RequestMapping(value = "/edit",method = RequestMethod.POST) - public SimpleDataResponse edit( - @RequestBody OptLevelHierarchyParam optLevelHierarchyParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyService.edit(optLevelHierarchyParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "deleteLevelHierarchy", remark = "") - @Operation(summary = "删除层级") - @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) - public SimpleDataResponse batchDelete( - @RequestBody DeleteLevelHierarchyParam deleteLevelHierarchyParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyService.batchDelete(deleteLevelHierarchyParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "queryLevelHierarchy", remark = "") - @Operation(summary = "获取层级列表") - @RequestMapping(value = "/getListPage",method = RequestMethod.GET) - public PageResponse> getListPage( - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, - PageLevelHierarchySearchParam pageSearchParam - ) throws BusinessException { - - pageSearchParam.setUserId(UserId); -// pageSearchParam.setCompanyId(CompanyId); - PageResponse> pageResponse = new PageResponse>(); - try{ - pageResponse.setData(levelHierarchyService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); - pageResponse.setCode(ResponseCode.SUCCESS); - pageResponse.setMsg("success"); - }catch (Exception e){ - logger.error("查询列表报错",e); - pageResponse.setCode(ResponseCode.SERVER_ERROR); - pageResponse.setMsg("service error"); - } - return pageResponse; - } - -} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java deleted file mode 100644 index 1f051a0..0000000 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/LevelHierarchyRoleController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.dongjian.dashboard.back.controller; - - -import com.dongjian.dashboard.back.common.exception.BusinessException; -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.PageResponse; -import com.dongjian.dashboard.back.common.response.ResponseCode; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.configurator.aspect.OperationLog; -import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; -import com.dongjian.dashboard.back.service.LevelHierarchyRoleService; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * - * @author jwy-style - * - */ -@RestController//代表返回的是json格式的数据,这个注解是Spring4之后新加的注解 -@AccessRequired //注解标识是否需要验证token -@RequestMapping("/levelHierarchyRole") //http请求路径映射 -@Tag(name = "支社、支店等层级角色的相关接口",description = "支社、支店等层级角色的相关接口") -@SuppressWarnings("unchecked") -public class LevelHierarchyRoleController { - - private static Logger logger = LoggerFactory.getLogger(LevelHierarchyRoleController.class); - - @Autowired - private LevelHierarchyRoleService levelHierarchyRoleService; - - - @OperationLog(operation = "addLevelHierarchyRole", remark = "") - @Operation(summary = "添加角色") - @RequestMapping(value = "/add",method = RequestMethod.POST) - public SimpleDataResponse add( - @RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyRoleService.add(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "editLevelHierarchyRole", remark = "") - @Operation(summary = "编辑角色") - @RequestMapping(value = "/edit",method = RequestMethod.POST) - public SimpleDataResponse edit( - @RequestBody OptLevelHierarchyRoleParam optLevelHierarchyRoleParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyRoleService.edit(optLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "deleteLevelHierarchyRole", remark = "") - @Operation(summary = "删除角色") - @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) - public SimpleDataResponse batchDelete( - @RequestBody DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType){ - return levelHierarchyRoleService.batchDelete(deleteLevelHierarchyRoleParam, CompanyId, UserId, LanguageType); - } - - @OperationLog(operation = "queryLevelHierarchyRole", remark = "") - @Operation(summary = "获取角色列表") - @RequestMapping(value = "/getListPage",method = RequestMethod.GET) - public PageResponse> getListPage( - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType, - PageLevelHierarchyRoleSearchParam pageSearchParam - ) throws BusinessException { - - pageSearchParam.setUserId(UserId); -// pageSearchParam.setCompanyId(CompanyId); - PageResponse> pageResponse = new PageResponse>(); - try{ - pageResponse.setData(levelHierarchyRoleService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType)); - pageResponse.setCode(ResponseCode.SUCCESS); - pageResponse.setMsg("success"); - }catch (Exception e){ - logger.error("查询列表报错",e); - pageResponse.setCode(ResponseCode.SERVER_ERROR); - pageResponse.setMsg("service error"); - } - return pageResponse; - } - -// @Hidden - @GetMapping("/tree/{roleId}") - @Operation(summary = "查询指定层级角色对应的物件树结构") - public SimpleDataResponse> getHierarchyTree( - @PathVariable("roleId") Long roleId, - @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required=true) String LoginName, - @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required=true) String AccessToken, - @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required=true) Long UserId, - @Parameter(name = "CompanyId", description = "ID of the company to which the user belongs", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required=false) Long CompanyId, - @Parameter(name = "LanguageType", description = "Language type (0: Chinese, 1: English, 2: Japanese)", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required=true) Integer LanguageType - ) { - return levelHierarchyRoleService.getHierarchyTree(roleId, CompanyId, UserId, LanguageType); - } - -} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java index 89e908d..d15bd59 100644 --- a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/OverviewController.java @@ -4,6 +4,8 @@ import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.configurator.interceptor.AccessRequired; import com.dongjian.dashboard.back.service.OverviewService; import com.dongjian.dashboard.back.vo.data.OverviewVO; +import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts; +import com.dongjian.dashboard.back.weather.QueryWeather; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; @@ -38,4 +40,17 @@ public class OverviewController { @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { return overviewService.getOverviewInfo(UserId, CompanyId, LanguageType, UTCOffset); } + + @Operation(summary = "Get weather information") + @RequestMapping(value = "/getWeatherInfo", method = RequestMethod.GET) + public SimpleDataResponse getWeatherInfo( + QueryWeather queryWeather, + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type: 0 - Chinese, 1 - English, 2 - Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Time zone offset in minutes from GMT, e.g., +480 for UTC+8", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset) { + return overviewService.getWeatherInfo(queryWeather, UserId, CompanyId, LanguageType, UTCOffset); + } } diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java new file mode 100644 index 0000000..b8b9b9f --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/AutoLoginFilter.java @@ -0,0 +1,114 @@ +package com.dongjian.dashboard.back.oidc; + +import com.dongjian.dashboard.back.util.redis.RedisUtil; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.context.HttpSessionSecurityContextRepository; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; + +public class AutoLoginFilter extends OncePerRequestFilter { + + private static final Logger logger = LoggerFactory.getLogger(AutoLoginFilter.class); + + private String oidc_issuser; + + + private final RedisUtil redisUtil; + private final AuthenticationManager authenticationManager; + + public AutoLoginFilter(String oidc_issuser, AuthenticationManager authenticationManager, RedisUtil redisUtil) { + this.authenticationManager = authenticationManager; + this.redisUtil = redisUtil; + this.oidc_issuser = oidc_issuser; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) + throws ServletException, IOException { + + String uri = request.getRequestURI(); + + if (uri.contains("/oauth2/") && SecurityContextHolder.getContext().getAuthentication() == null) { + + String loginToken = getCookieValue(request, "auth_token"); + + if (loginToken == null || !validateLoginToken(loginToken)) { + logger.info("Main site login required, reject OIDC auto-login....."); + response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Please login first"); + return; + } + + String username = SecurityConfig.USERDETAILS_USERNAME; + String password = SecurityConfig.USERDETAILS_PASSWORD; + + UsernamePasswordAuthenticationToken authRequest = + new UsernamePasswordAuthenticationToken(username, password); + + try { + Authentication authentication = authenticationManager.authenticate(authRequest); + + SecurityContext context = SecurityContextHolder.createEmptyContext(); + context.setAuthentication(authentication); + SecurityContextHolder.setContext(context); + + HttpSession session = request.getSession(true); + session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, context); + + logger.info("Auto login success for user: {}", username); + + // 认证成功后重定向,避免 SavedRequest 失效问题 +// String redirectUri = uri + +// (request.getQueryString() != null ? "?" + request.getQueryString() : ""); + //上面的代码,在多个域名指向同一服务时,会改变域名 + String redirectUri = oidc_issuser.replace("/api", "") + + uri + (request.getQueryString() != null ? "?" + request.getQueryString() : ""); + logger.info("Set redirectUri: {}", redirectUri); + response.sendRedirect(redirectUri); + return; + + } catch (AuthenticationException ex) { + logger.error("Auto login failed", ex); + response.sendError(HttpServletResponse.SC_UNAUTHORIZED); + return; + } + } + + chain.doFilter(request, response); + } + + + private boolean validateLoginToken(String loginToken) { + Object userDataStr = redisUtil.get(loginToken); + if (null != userDataStr) { + return true; + } + return false; + } + + private String getCookieValue(HttpServletRequest request, String name) { + if (request.getCookies() != null) { + for (Cookie cookie : request.getCookies()) { + if (name.equals(cookie.getName())) { + return cookie.getValue(); + } + } + } + return null; + } + + +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java new file mode 100644 index 0000000..324e27f --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/Jwks.java @@ -0,0 +1,26 @@ +package com.dongjian.dashboard.back.oidc; + +import com.nimbusds.jose.jwk.RSAKey; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.interfaces.RSAPublicKey; +import java.security.interfaces.RSAPrivateKey; +import java.util.UUID; + +public class Jwks { + public static RSAKey generateRsa() { + try { + KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); + generator.initialize(2048); + KeyPair keyPair = generator.generateKeyPair(); + + return new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()) + .privateKey((RSAPrivateKey) keyPair.getPrivate()) + .keyID(UUID.randomUUID().toString()) + .build(); + } catch (Exception e) { + throw new IllegalStateException(e); + } + } +} diff --git a/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java new file mode 100644 index 0000000..0648dbc --- /dev/null +++ b/dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/oidc/SecurityConfig.java @@ -0,0 +1,162 @@ +package com.dongjian.dashboard.back.oidc; + +import java.util.UUID; + +import com.dongjian.dashboard.back.util.redis.RedisUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.Customizer; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.core.ClientAuthenticationMethod; +import org.springframework.security.oauth2.core.oidc.OidcScopes; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.ImmutableJWKSet; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings; +import org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext; +import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer; +import org.springframework.security.provisioning.InMemoryUserDetailsManager; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; + +@Configuration +@EnableWebSecurity +public class SecurityConfig { + + private static Logger logger = LoggerFactory.getLogger(SecurityConfig.class); + + + @Value("${oidc.issuer}") + private String oidc_issuser; + + @Value("${oidc.bimviewer-url}") + private String oidc_bimviewer_url; + + @Value("${oidc.bimviewer-cognito-auth-host}") + private String oidc_bimviewer_cognito_auth_host; + + @Autowired + private RedisUtil redisUtil; + + + public static final String USERDETAILS_USERNAME = "admin"; + public static final String USERDETAILS_PASSWORD = "pass"; + + + @Bean + public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception { + return authenticationConfiguration.getAuthenticationManager(); + } + + + @Bean + @Order(1) + public SecurityFilterChain authServerSecurityFilterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception { + // 默认授权服务器配置 + OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http); + + // 开启 OpenID Connect 支持 + http.getConfigurer(OAuth2AuthorizationServerConfigurer.class) + .oidc(Customizer.withDefaults()); + + // 添加自动登录过滤器(放在认证过滤器之前) + http.addFilterBefore(new AutoLoginFilter(oidc_issuser, authenticationManager, redisUtil), UsernamePasswordAuthenticationFilter.class); + + return http.build(); + } + + + @Bean + @Order(2) + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + http + .authorizeHttpRequests(authorize -> authorize + .anyRequest().permitAll() //放行所有请求 + ) + .formLogin(Customizer.withDefaults()) // 可有可无,决定是否提供登录页 + .csrf(csrf -> csrf.disable()); // 如果是前后端分离接口建议关闭 CSRF + + return http.build(); + } + + @Bean + public AuthorizationServerSettings authorizationServerSettings() { + return AuthorizationServerSettings.builder() + .issuer(oidc_issuser) // 替换为真实的域名 + .build(); + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString()) + .clientId("at04vt84q43nq00ueuf2l4k8b") + .clientSecret("{noop}2ih0h9h6mlt18bumiv36v0jjqfkoidlqckdcfu02mesr31d2ojia") + .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_POST) + .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE) + .authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN) + .redirectUri(oidc_bimviewer_url) + .redirectUri(oidc_bimviewer_cognito_auth_host + "/oauth2/idpresponse") + .scope(OidcScopes.OPENID) + .scope(OidcScopes.EMAIL) + .scope(OidcScopes.PHONE) + .scope(OidcScopes.PROFILE) + .build(); + + return new InMemoryRegisteredClientRepository(registeredClient); + } + + @Bean + public OAuth2TokenCustomizer tokenCustomizer() { + return context -> { + Authentication principal = context.getPrincipal(); + + // 只对 id_token 添加 claim + if ("id_token".equals(context.getTokenType().getValue())) { + if (principal != null && principal.getPrincipal() instanceof UserDetails userDetails) { + context.getClaims().claim("email", userDetails.getUsername() + "@example.com"); + context.getClaims().claim("given_name", "Test"); + context.getClaims().claim("family_name", "User"); + } + } + }; + } + + @Bean + public JWKSource jwkSource() { + RSAKey rsaKey = Jwks.generateRsa(); + JWKSet jwkSet = new JWKSet(rsaKey); + return new ImmutableJWKSet<>(jwkSet); + } + + @Bean + public UserDetailsService users() { + UserDetails user = User.builder() + .username(USERDETAILS_USERNAME) + .password("{noop}" + USERDETAILS_PASSWORD) + .roles("USER") + .build(); + return new InMemoryUserDetailsManager(user); + } +} diff --git a/dongjian-dashboard-back-controller/src/main/resources/config/application.properties b/dongjian-dashboard-back-controller/src/main/resources/config/application.properties index ec6a788..94b03ea 100644 --- a/dongjian-dashboard-back-controller/src/main/resources/config/application.properties +++ b/dongjian-dashboard-back-controller/src/main/resources/config/application.properties @@ -6,22 +6,22 @@ spring.mvc.pathmatch.matching-strategy= ANT_PATH_MATCHER mybatis.mapperLocations=classpath:mappers/**/*.xml -spring.datasource.admin.name=data_center_new -spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} +spring.datasource.admin.name=data_center_aeon_admin +spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} spring.datasource.admin.username=${datasourceUsername} spring.datasource.admin.password=${datasourcePassword} #使用druid数据源 spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver -spring.datasource.admin.hikari.schema=data_center_new +spring.datasource.admin.hikari.schema=data_center_aeon_admin spring.datasource.admin.hikari.minimum-idle: 5 spring.datasource.admin.hikari.maximum-pool-size: ${rdsMaxPool:40} spring.datasource.admin.hikari.connection-timeout:10000 dynamic.jdbc.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/%s?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} -spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} +spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} #配置log日志 @@ -107,3 +107,10 @@ amazon.aws.actionable.bucket=${awsActionableBucket} amazon.aws.actionable.directory=${awsActionableDirectory} amazon.aws.actionable.roleArn=${awsActionableRoleArn} +weather.jwa.apikey=${weatherJwaApiKey} +weather.jwa.x-apikey=${weatherJwaXApiKey} +ai.api_base=${aiApiBase:https://pdf-demo-stg.ttkdatatechbuild.com/api} + +oidc.issuer = ${oidcIssuer:https://dongjian.southwave.tech/api} +oidc.bimviewer-url = ${oidcBimviewerUrl:https://bimviewer-stg.ttkdatatechbuild.com/TTNB} +oidc.bimviewer-cognito-auth-host = ${oidcBimviewerCognitoAuthHost:https://bimviewer-stg.auth.ap-northeast-1.amazoncognito.com} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java deleted file mode 100644 index 283e458..0000000 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardLevelRoleMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.dongjian.dashboard.back.dao.auto; - -import com.dongjian.dashboard.back.model.DashboardLevelRole; -import com.dongjian.dashboard.back.model.DashboardLevelRoleExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface DashboardLevelRoleMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - long countByExample(DashboardLevelRoleExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int deleteByExample(DashboardLevelRoleExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int insert(DashboardLevelRole record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int insertSelective(DashboardLevelRole record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - List selectByExample(DashboardLevelRoleExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - DashboardLevelRole selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int updateByExampleSelective(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int updateByExample(@Param("record") DashboardLevelRole record, @Param("example") DashboardLevelRoleExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int updateByPrimaryKeySelective(DashboardLevelRole record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - int updateByPrimaryKey(DashboardLevelRole record); -} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java new file mode 100644 index 0000000..92b6adc --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DashboardNoticeIgnoredMapper.java @@ -0,0 +1,96 @@ +package com.dongjian.dashboard.back.dao.auto; + +import com.dongjian.dashboard.back.model.DashboardNoticeIgnored; +import com.dongjian.dashboard.back.model.DashboardNoticeIgnoredExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface DashboardNoticeIgnoredMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + long countByExample(DashboardNoticeIgnoredExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int deleteByExample(DashboardNoticeIgnoredExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int insert(DashboardNoticeIgnored record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int insertSelective(DashboardNoticeIgnored record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + List selectByExample(DashboardNoticeIgnoredExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + DashboardNoticeIgnored selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int updateByExampleSelective(@Param("record") DashboardNoticeIgnored record, @Param("example") DashboardNoticeIgnoredExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int updateByExample(@Param("record") DashboardNoticeIgnored record, @Param("example") DashboardNoticeIgnoredExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int updateByPrimaryKeySelective(DashboardNoticeIgnored record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + int updateByPrimaryKey(DashboardNoticeIgnored record); +} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java index f568b3c..dbb4fd0 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupMapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param; public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -16,7 +16,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -24,7 +24,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -32,7 +32,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -40,7 +40,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -48,7 +48,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -56,7 +56,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -64,7 +64,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -72,7 +72,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -80,7 +80,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -88,7 +88,7 @@ public interface DeviceGroupMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java index 3582199..4663304 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/auto/DeviceGroupRelationMapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param; public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -16,7 +16,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -24,7 +24,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -32,7 +32,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -40,7 +40,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -48,7 +48,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -56,7 +56,7 @@ public interface DeviceGroupRelationMapper { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java index 857cc5f..7c82675 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/AlertHistoryMapperExt.java @@ -1,9 +1,14 @@ package com.dongjian.dashboard.back.dao.ex; import com.dongjian.dashboard.back.dao.auto.AlertHistoryMapper; +import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest; +import com.dongjian.dashboard.back.vo.device.WindowAlertVO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface AlertHistoryMapperExt extends AlertHistoryMapper { + List getWindowList(WindowAlertQueryRequest windowAlertQueryRequest); } diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java index 2d1de8b..f42bee8 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/BasicRoleMapperExt.java @@ -20,4 +20,5 @@ public interface BasicRoleMapperExt extends BasicRoleMapper { List getListPage(PageSearchParam pageSearchParam); + Long getRoleIdByUserId(Long userId); } diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java deleted file mode 100644 index 12a9949..0000000 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardLevelRoleMapperExt.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dongjian.dashboard.back.dao.ex; - -import com.dongjian.dashboard.back.dao.auto.DashboardLevelRoleMapper; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface DashboardLevelRoleMapperExt extends DashboardLevelRoleMapper { - - long checkExist(OptLevelHierarchyRoleParam param); - - long checkBound(@Param("idList") List idList); - - void deleteUserRelation(@Param("idList") List idList); - - List getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam); - - int checkAdministrativePrivileges(Long userId); -} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java new file mode 100644 index 0000000..bac45df --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DashboardNoticeIgnoredMapperExt.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dao.ex; + +import com.dongjian.dashboard.back.dao.auto.DashboardNoticeIgnoredMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface DashboardNoticeIgnoredMapperExt extends DashboardNoticeIgnoredMapper { + + // 查询指定 key 下所有告警id + List getMembersByKey(@Param("userKey") String userKey); + + // 添加告警id + void addMember(@Param("userKey") String userKey, @Param("memberValue") String memberValue, @Param("createdAt") Long createdAt); + + // 删除告警id + void removeMember(@Param("userKey") String userKey, @Param("memberValue") String memberValue); + +} diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java index 2bd4286..903c24b 100644 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java +++ b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/DeviceGroupRelationMapperExt.java @@ -1,14 +1,8 @@ package com.dongjian.dashboard.back.dao.ex; -import com.dongjian.dashboard.back.dao.auto.DeviceGroupMapper; import com.dongjian.dashboard.back.dao.auto.DeviceGroupRelationMapper; -import com.dongjian.dashboard.back.dto.devicegroup.DeviceGroupSearchParams; -import com.dongjian.dashboard.back.dto.devicegroup.OptDeviceGroupParams; -import com.dongjian.dashboard.back.vo.devicegroup.DeviceGroupPageVO; import org.apache.ibatis.annotations.Mapper; -import java.util.List; - @Mapper public interface DeviceGroupRelationMapperExt extends DeviceGroupRelationMapper { diff --git a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java b/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java deleted file mode 100644 index 0a10a3e..0000000 --- a/dongjian-dashboard-back-dao/src/main/java/com/dongjian/dashboard/back/dao/ex/LevelHierarchyMapperExt.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.dongjian.dashboard.back.dao.ex; - -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface LevelHierarchyMapperExt { - - long checkExist(OptLevelHierarchyParam param); - - void insertHierarchy(OptLevelHierarchyParam param); - - void deleteRelations(@Param("relationType") String relationType, - @Param("childId") Long childId); - - void insertHierarchyRelation(@Param("relationType") String relationType, - @Param("parentIdList") List parentIdList, - @Param("childId") Long childId, - @Param("createdBy") Long createdBy, - @Param("createdAt") Long createdAt); - - long checkOld(OptLevelHierarchyParam param); - - void updateHierarchy(OptLevelHierarchyParam param); - - Long countChildrenByType(@Param("type") String type, - @Param("idList") List idList); - - void deleteHierarchyByType(@Param("type") String type, - @Param("idList") List idList); - - List getListPage(PageLevelHierarchySearchParam pageSearchParam); - - List selectAllHierarchyByCompanyId(@Param("companyId") Long companyId); -} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml index fa7ea51..fa6fa3e 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml @@ -20,6 +20,8 @@ + + building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time, - modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction + modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction, + latitude, longitude id, user_type, company_id, username, login_name, `password`, salt, email, mfa_secret, mfa_bind, mobile_number, last_login_time, flag, expire_time, create_time, creator_id, - modify_time, modifier_id, super_role + modify_time, modifier_id, super_role, create_platform + @@ -122,20 +118,20 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - delete from dashboard_level_role + delete from dashboard_notice_ignored where id = #{id,jdbcType=BIGINT} - + - delete from dashboard_level_role + delete from dashboard_notice_ignored - + - select count(*) from dashboard_level_role + select count(*) from dashboard_notice_ignored @@ -221,32 +191,20 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update dashboard_level_role + update dashboard_notice_ignored id = #{record.id,jdbcType=BIGINT}, - - company_id = #{record.companyId,jdbcType=BIGINT}, + + redis_key = #{record.redisKey,jdbcType=VARCHAR}, - - `name` = #{record.name,jdbcType=VARCHAR}, - - - remark = #{record.remark,jdbcType=VARCHAR}, - - - flag = #{record.flag,jdbcType=INTEGER}, - - - created_by = #{record.createdBy,jdbcType=BIGINT}, + + member_value = #{record.memberValue,jdbcType=VARCHAR}, created_at = #{record.createdAt,jdbcType=BIGINT}, - - updated_at = #{record.updatedAt,jdbcType=BIGINT}, - @@ -257,63 +215,43 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update dashboard_level_role + update dashboard_notice_ignored set id = #{record.id,jdbcType=BIGINT}, - company_id = #{record.companyId,jdbcType=BIGINT}, - `name` = #{record.name,jdbcType=VARCHAR}, - remark = #{record.remark,jdbcType=VARCHAR}, - flag = #{record.flag,jdbcType=INTEGER}, - created_by = #{record.createdBy,jdbcType=BIGINT}, - created_at = #{record.createdAt,jdbcType=BIGINT}, - updated_at = #{record.updatedAt,jdbcType=BIGINT} + redis_key = #{record.redisKey,jdbcType=VARCHAR}, + member_value = #{record.memberValue,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=BIGINT} - + - update dashboard_level_role + update dashboard_notice_ignored - - company_id = #{companyId,jdbcType=BIGINT}, + + redis_key = #{redisKey,jdbcType=VARCHAR}, - - `name` = #{name,jdbcType=VARCHAR}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - flag = #{flag,jdbcType=INTEGER}, - - - created_by = #{createdBy,jdbcType=BIGINT}, + + member_value = #{memberValue,jdbcType=VARCHAR}, created_at = #{createdAt,jdbcType=BIGINT}, - - updated_at = #{updatedAt,jdbcType=BIGINT}, - where id = #{id,jdbcType=BIGINT} - + - update dashboard_level_role - set company_id = #{companyId,jdbcType=BIGINT}, - `name` = #{name,jdbcType=VARCHAR}, - remark = #{remark,jdbcType=VARCHAR}, - flag = #{flag,jdbcType=INTEGER}, - created_by = #{createdBy,jdbcType=BIGINT}, - created_at = #{createdAt,jdbcType=BIGINT}, - updated_at = #{updatedAt,jdbcType=BIGINT} + update dashboard_notice_ignored + set redis_key = #{redisKey,jdbcType=VARCHAR}, + member_value = #{memberValue,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml index 546d02f..c39d116 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml @@ -10,7 +10,6 @@ - @@ -87,7 +86,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - id, company_id, building_id, `name`, group_type, remark, flag, created_by, created_at + id, company_id, building_id, `name`, remark, flag, created_by, created_at @@ -123,7 +122,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - delete from device_group + delete from dashboard_device_group where id = #{id,jdbcType=BIGINT} @@ -131,7 +130,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - delete from device_group + delete from dashboard_device_group @@ -144,12 +143,12 @@ SELECT LAST_INSERT_ID() - insert into device_group (company_id, building_id, `name`, - group_type, remark, flag, - created_by, created_at) + insert into dashboard_device_group (company_id, building_id, `name`, + remark, flag, created_by, + created_at) values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, - #{groupType,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, - #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}) + #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}) - select count(*) from device_group + select count(*) from dashboard_device_group @@ -228,7 +221,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group + update dashboard_device_group id = #{record.id,jdbcType=BIGINT}, @@ -242,9 +235,6 @@ `name` = #{record.name,jdbcType=VARCHAR}, - - group_type = #{record.groupType,jdbcType=INTEGER}, - remark = #{record.remark,jdbcType=VARCHAR}, @@ -267,12 +257,11 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group + update dashboard_device_group set id = #{record.id,jdbcType=BIGINT}, company_id = #{record.companyId,jdbcType=BIGINT}, building_id = #{record.buildingId,jdbcType=BIGINT}, `name` = #{record.name,jdbcType=VARCHAR}, - group_type = #{record.groupType,jdbcType=INTEGER}, remark = #{record.remark,jdbcType=VARCHAR}, flag = #{record.flag,jdbcType=INTEGER}, created_by = #{record.createdBy,jdbcType=BIGINT}, @@ -286,7 +275,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group + update dashboard_device_group company_id = #{companyId,jdbcType=BIGINT}, @@ -297,9 +286,6 @@ `name` = #{name,jdbcType=VARCHAR}, - - group_type = #{groupType,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, @@ -320,11 +306,10 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group + update dashboard_device_group set company_id = #{companyId,jdbcType=BIGINT}, building_id = #{buildingId,jdbcType=BIGINT}, `name` = #{name,jdbcType=VARCHAR}, - group_type = #{groupType,jdbcType=INTEGER}, remark = #{remark,jdbcType=VARCHAR}, flag = #{flag,jdbcType=INTEGER}, created_by = #{createdBy,jdbcType=BIGINT}, diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml index 34e61a3..4389afb 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/auto/DeviceGroupRelationMapper.xml @@ -93,7 +93,7 @@ 'true' as QUERYID, - from device_group_relation + from dashboard_device_group_relation @@ -106,7 +106,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - delete from device_group_relation + delete from dashboard_device_group_relation @@ -116,7 +116,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - insert into device_group_relation (device_info_id, device_group_id) + insert into dashboard_device_group_relation (device_info_id, device_group_id) values (#{deviceInfoId,jdbcType=INTEGER}, #{deviceGroupId,jdbcType=BIGINT}) @@ -124,7 +124,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - insert into device_group_relation + insert into dashboard_device_group_relation device_info_id, @@ -147,7 +147,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - select count(*) from device_group_relation + select count(*) from dashboard_device_group_relation @@ -157,7 +157,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group_relation + update dashboard_device_group_relation device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, @@ -175,7 +175,7 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - update device_group_relation + update dashboard_device_group_relation set device_info_id = #{record.deviceInfoId,jdbcType=INTEGER}, device_group_id = #{record.deviceGroupId,jdbcType=BIGINT} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml new file mode 100644 index 0000000..aed25a3 --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/AlertHistoryMapperExt.xml @@ -0,0 +1,46 @@ + + + + + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml index faf7188..e69017f 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml @@ -19,7 +19,7 @@ bbuilding.picture_introduction FROM basic_building bbuilding - INNER JOIN data_center_new.basic_company bcomp ON bcomp.id = bbuilding.company_id + INNER JOIN data_center_aeon_admin.basic_company bcomp ON bcomp.id = bbuilding.company_id WHERE bbuilding.flag != 1 AND bcomp.flag != 1 AND bbuilding.company_id IN #{item} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml index dd6b9a2..a2f2d18 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicCompanyMapperExt.xml @@ -75,7 +75,7 @@ aurora_username, aurora_password FROM - data_center_new.basic_company bcom + data_center_aeon_admin.basic_company bcom WHERE flag != 1 AND id = #{companyId} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml index a1f8291..0b488ea 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicRoleMapperExt.xml @@ -56,12 +56,15 @@ basic_role brole WHERE brole.flag != 1 AND brole.company_id IN #{item} - AND brole.id != IFNULL((SELECT role_id FROM basic_role_user_relation WHERE user_id = #{userId}), -9) AND brole.role_name LIKE CONCAT('%',#{roleName},'%') + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml index 9dc0a47..54f682a 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml @@ -35,7 +35,7 @@ INNER JOIN basic_role_user_relation brur ON brur.user_id = buser.id INNER JOIN basic_role brole ON brur.role_id = brole.id WHERE - buser.flag != 1 AND brole.flag != 1 AND buser.company_id IN #{item} + buser.flag != 1 AND buser.create_platform = 1 AND brole.flag != 1 AND buser.company_id IN #{item} AND buser.id != #{userId} @@ -107,9 +107,9 @@ SELECT count(1) FROM - data_center_new.basic_role_user_relation rru - INNER JOIN data_center_new.basic_role br ON br.id = rru.role_id - INNER JOIN data_center_new.basic_role_menu_relation rmr ON br.id = rmr.role_id + data_center_aeon_admin.basic_role_user_relation rru + INNER JOIN data_center_aeon_admin.basic_role br ON br.id = rru.role_id + INNER JOIN data_center_aeon_admin.basic_role_menu_relation rmr ON br.id = rmr.role_id WHERE rmr.menu_id = 52 AND br.flag != 1 AND rru.user_id = #{userId} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml deleted file mode 100644 index 06b7ee4..0000000 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardLevelRoleMapperExt.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml new file mode 100644 index 0000000..4dcfebe --- /dev/null +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DashboardNoticeIgnoredMapperExt.xml @@ -0,0 +1,21 @@ + + + + + + + + INSERT IGNORE INTO dashboard_notice_ignored (redis_key, member_value, created_at) + VALUES (#{userKey}, #{memberValue}, #{createdAt}) + + + + DELETE FROM dashboard_notice_ignored + WHERE redis_key = #{userKey} AND member_value = #{memberValue} + + + \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml index 05a397f..ac5b6ef 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceGroupMapperExt.xml @@ -18,27 +18,19 @@ diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml index ee7ff0c..d23d822 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml @@ -12,8 +12,8 @@ device_info.type_id, device_info.retain_alert, device_info.monitoring_point_name, - device_info.monitoring_point_category_id, - monitoring_point_category.name as monitoringPointCategoryName, + basic_asset_class_big.id monitoringPointCategoryId, + basic_asset_class_big.class_name as monitoringPointCategoryName, data_provider.name as dataProviderName, data_provider.thumbnail_base64 as dataProviderThumbnailBase64, device_info.gateway_info_id, @@ -30,7 +30,7 @@ left join data_provider on data_provider.id = device_info.data_provider_id left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id left join type on device_info.type_id = type.id - left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id + left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id @@ -64,7 +64,7 @@ ORDER BY - monitoring_point_category.name + basic_asset_class_big.class_name basic_floor.name @@ -113,13 +113,12 @@ 2 as classId left join device_rawdata_realtime drr on drr.device_id = device_info.device_id - left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id - left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id + left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id - and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId} + and basic_building.building_id = #{buildingId} - and mpcg.id = #{monitoringPointCategoryGroupId} + and ddgr.device_group_id = #{deviceGroupId} @@ -151,13 +150,12 @@ 3 as classId left join device_rawdata_realtime drr on drr.device_id = device_info.device_id - left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id - left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id + left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id - and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId} + and basic_building.building_id = #{buildingId} - and mpcg.id = #{monitoringPointCategoryGroupId} + and ddgr.device_group_id = #{deviceGroupId} @@ -169,7 +167,7 @@ ORDER BY - monitoring_point_category.name + basic_asset_class_big.class_name basic_floor.name @@ -222,14 +220,13 @@ bss.is_running runningStatus, 4 as classId - left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id - left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id + left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id left join ba_status_statistics bss on bss.device_info_id = device_info.id - and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId} + and basic_building.building_id = #{buildingId} - and mpcg.id = #{monitoringPointCategoryGroupId} + and ddgr.device_group_id = #{deviceGroupId} @@ -239,7 +236,7 @@ ORDER BY - monitoring_point_category.name + basic_asset_class_big.class_name basic_floor.name @@ -269,7 +266,8 @@ alert_history.confirm_status, alert_history.handle_status, alert_history.id alertHistoryId, - 1 as classId + 1 as classId, + basic_monitoring_asset.`symbol` assetSymbol from alert_history left join device_info on alert_history.device_id = device_info.device_id @@ -280,7 +278,7 @@ left join data_provider on data_provider.id = device_info.data_provider_id left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id left join type on device_info.type_id = type.id - left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id + left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id and device_info.flag = 0 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 @@ -317,7 +315,8 @@ alert_history.confirm_status, alert_history.handle_status, alert_history.id alertHistoryId, - 1 as classId + 1 as classId, + basic_monitoring_asset.`symbol` assetSymbol from alert_history left join device_info on alert_history.device_id = device_info.device_id @@ -328,16 +327,15 @@ left join data_provider on data_provider.id = device_info.data_provider_id left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id left join type on device_info.type_id = type.id - left join monitoring_point_category on monitoring_point_category.id = device_info.monitoring_point_category_id - left join monitoring_point_category_group_relation mpcgr on mpcgr.monitoring_point_category_id = monitoring_point_category.id - left join monitoring_point_category_group mpcg on mpcg.id = mpcgr.monitoring_point_category_group_id + left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id + left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id and device_info.flag = 0 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 - and basic_building.building_id = #{buildingId} and mpcg.building_id = #{buildingId} + and basic_building.building_id = #{buildingId} - and mpcg.id = #{monitoringPointCategoryGroupId} + and ddgr.device_group_id = #{deviceGroupId} @@ -381,8 +379,8 @@ basic_monitoring_asset.symbol as assetSymbol, device_info.remark, device_info.monitoring_point_name, - device_info.monitoring_point_category_id, - mpc.name as monitoringPointCategoryName, + basic_asset_class_big.id monitoringPointCategoryId, + basic_asset_class_big.class_name as monitoringPointCategoryName, device_info.data_provider_id, data_provider.name as dataProviderName, device_info.gateway_info_id, @@ -396,7 +394,7 @@ left join basic_space on basic_monitoring_asset.space_id = basic_space.space_id left join basic_floor on basic_space.floor_id = basic_floor.floor_id left join basic_building on basic_floor.building_id = basic_building.building_id - left join monitoring_point_category mpc on mpc.id = device_info.monitoring_point_category_id + left join basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id left join data_provider on data_provider.id = device_info.data_provider_id left join data_provider_gateway_info on data_provider_gateway_info.id = device_info.gateway_info_id left join type on device_info.type_id = type.id @@ -412,13 +410,16 @@ and basic_building.building_id = #{buildingId} + + and device_info.monitoring_point_name LIKE CONCAT('%',#{keyword},'%') + and device_info.company_id in #{companyId} - and device_info.flag = 0 + and device_info.flag = 0 and basic_monitoring_asset.flag != 1 and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 and device_info.type_id in #{typeId} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml index df1ed01..0d59118 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/DeviceRawdataRealtimeMapperExt.xml @@ -9,15 +9,16 @@ bbuilding.name AS buildingName, drr.device_id, drr.receive_ts, - dinfo.monitoring_point_category_id, - mpc.name AS monitoringPointCategoryName + basic_asset_class_big.id AS monitoringPointCategoryId, + basic_asset_class_big.class_name AS monitoringPointCategoryName FROM device_rawdata_realtime drr INNER JOIN basic_building bbuilding ON drr.building_id = bbuilding.building_id INNER JOIN device_info dinfo ON dinfo.device_id = drr.device_id - INNER JOIN monitoring_point_category mpc ON mpc.id = dinfo.monitoring_point_category_id + INNER JOIN basic_monitoring_asset on dinfo.asset_id = basic_monitoring_asset.equipment_id + INNER JOIN basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id WHERE - bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND dinfo.flag = 0 + bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND dinfo.flag = 0 AND basic_monitoring_asset.flag = 0 AND basic_asset_class_big.flag = 0 AND drr.status = 'alert' AND dinfo.type_id in diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml deleted file mode 100644 index 16b52b9..0000000 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/LevelHierarchyMapperExt.xml +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - - INSERT INTO - - dashboard_branch - dashboard_store - dashboard_area - dashboard_site - - (company_id, `name`, remark, created_by, created_at) - VALUES (#{companyId}, #{levelHierarchyName}, #{remark}, #{createdBy}, #{createdAt}) - - - - - - - - DELETE FROM dashboard_branch_store - WHERE store_id = #{childId} - - - - - DELETE FROM dashboard_store_area - WHERE area_id = #{childId} - - - - - DELETE FROM dashboard_area_site - WHERE site_id = #{childId} - - - - - DELETE FROM dashboard_site_building - WHERE building_id = #{childId} - - - - - - - - - - INSERT INTO dashboard_branch_store (branch_id, store_id, created_by, created_at) - VALUES - - (#{pid}, #{childId}, #{createdBy}, #{createdAt}) - - - - - - INSERT INTO dashboard_store_area (store_id, area_id, created_by, created_at) - VALUES - - (#{pid}, #{childId}, #{createdBy}, #{createdAt}) - - - - - - INSERT INTO dashboard_area_site (area_id, site_id, created_by, created_at) - VALUES - - (#{pid}, #{childId}, #{createdBy}, #{createdAt}) - - - - - - INSERT INTO dashboard_site_building (site_id, building_id, created_by, created_at) - VALUES - - (#{pid}, #{childId}, #{createdBy}, #{createdAt}) - - - - - - - - UPDATE - - dashboard_branch - dashboard_store - dashboard_area - dashboard_site - - - - name = #{levelHierarchyName}, - - - remark = #{remark}, - - updated_at = #{updatedAt} - - WHERE id = #{id} - - - - - - - - - - - - UPDATE dashboard_branch SET flag = 1 - WHERE id IN - - #{id} - - - - - UPDATE dashboard_store SET flag = 1 - WHERE id IN - - #{id} - - - - - UPDATE dashboard_area SET flag = 1 - WHERE id IN - - #{id} - - - - - UPDATE dashboard_site SET flag = 1 - WHERE id IN - - #{id} - - - - - - - - - - - \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml index fd3f7a1..26edaf6 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/MonitoringPointCategoryMapperExt.xml @@ -24,10 +24,9 @@ mpc.company_id, mpc.thumbnail_normal_base64, mpc.thumbnail_alarm_base64, - mpc.`name`, - mpc.remark + mpc.class_name AS `name` FROM - monitoring_point_category mpc + basic_asset_class_big mpc WHERE mpc.flag != 1 AND mpc.company_id IN #{item} @@ -35,7 +34,7 @@ AND mpc.id IN #{item} - AND mpc.`name` LIKE CONCAT('%',#{name},'%') + AND mpc.class_name LIKE CONCAT('%',#{name},'%') order by mpc.id desc diff --git a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml index c29e84f..4aa436b 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml @@ -19,7 +19,7 @@ buser.login_name `user` FROM dashboard_operation_log dolog - INNER JOIN data_center_new.basic_user buser ON buser.id = dolog.user_id + INNER JOIN data_center_aeon_admin.basic_user buser ON buser.id = dolog.user_id WHERE dolog.company_id IN #{item} AND dolog.created_at >= #{startTime} diff --git a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml index 005e232..a51a05c 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml +++ b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/generatorConfig.xml @@ -71,12 +71,12 @@ - +
- +
@@ -130,10 +130,19 @@ - +
+ +
+ +
- + + + + +
+ \ No newline at end of file diff --git a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties index 17318c4..8b9516c 100644 --- a/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties +++ b/dongjian-dashboard-back-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties @@ -2,6 +2,6 @@ project =src/main/java resources=src/main/resources jdbc_driver =com.mysql.cj.jdbc.Driver -jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai +jdbc_url=jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai jdbc_user=zhc jdbc_password=Youqu48bnb1 \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java new file mode 100644 index 0000000..9992396 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskParam.java @@ -0,0 +1,24 @@ +package com.dongjian.dashboard.back.dto.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +/** +* @author zhc +* @time 2022年6月14日10:56:38 +*/ +@Setter +@Getter +public class AiAskParam { + + + @Schema(description = "问题详情",example = "111", required = true) + private String question; + + @Schema(description = "会话ID",example = "111", required = false) + private String session_id; + + @Schema(description = "返回多少文档信息",example = "1", required = false) + private Integer topK; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java new file mode 100644 index 0000000..b3644ee --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiAskResponse.java @@ -0,0 +1,21 @@ +package com.dongjian.dashboard.back.dto.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class AiAskResponse { + @Schema(description = "AI生成的回答") + private String answer; + + @Schema(description = "引用的文档片段数组") + private List citations; + + @Schema(description = "响应时间(毫秒)") + private Long latencyMs; + + @Schema(description = "Bedrock返回的会话ID") + private String session_id; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java new file mode 100644 index 0000000..fd28d1a --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/AiRetrieveParam.java @@ -0,0 +1,13 @@ +package com.dongjian.dashboard.back.dto.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AiRetrieveParam { + @Schema(description = "检索查询", example = "设备维护", required = true) + private String question; + + @Schema(description = "检索结果数量", example = "3", required = false) + private Integer topK = 5; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java new file mode 100644 index 0000000..e4d98bd --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/Citation.java @@ -0,0 +1,34 @@ +package com.dongjian.dashboard.back.dto.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +@Data +public class Citation { + @Schema(description = "引用索引") + private Integer index; + + @Schema(description = "文档标题") + private String title; + + @Schema(description = "相关度评分 (0-1)") + private Double score; + + @Schema(description = "引用内容") + private String content; + + @Schema(description = "内容长度") + private Integer contentLength; + + @Schema(description = "文件名") + private String filename; + + @Schema(description = "S3路径") + private String s3Path; + + @Schema(description = "元数据信息") + private Map metadata; + +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java new file mode 100644 index 0000000..728030c --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/ai/RetrieveResponse.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.dto.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class RetrieveResponse { + @Schema(description = "检索结果数组") + private List results; + + @Schema(description = "检索时间(毫秒)") + private Long latencyMs; + + @Schema(description = "结果总数") + private Integer total; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java index 697239b..d2ec368 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/data/DataSearchParam.java @@ -14,8 +14,11 @@ public class DataSearchParam extends BaseSearchParams { @Schema(description = "楼宇ID",example = "122") private Long buildingId; - @Schema(description = "分组ID",example = "122") - private Long monitoringPointCategoryGroupId; +// @Schema(description = "分组ID",example = "122") +// private Long monitoringPointCategoryGroupId; + + @Schema(description = "设备分组ID",example = "122") + private Long deviceGroupId; @Schema(description = "设备类型",example = "[]", hidden = true) private List typeIdList; diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java index 83257d1..804020c 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/DeviceSearchParams.java @@ -14,7 +14,10 @@ public class DeviceSearchParams extends BaseSearchParams { @Schema(description = "building ID") private Long buildingId; - @Schema(description = "设备类型",example = "[]", hidden = true) + @Schema(description = "device type",example = "[]", hidden = true) private List typeIdList; + @Schema(description = "Monitoring point name", example = "Device-Monitoring") + private String monitoringPointName; + } diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java new file mode 100644 index 0000000..5a93b8b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertCloseRequest.java @@ -0,0 +1,10 @@ +package com.dongjian.dashboard.back.dto.device; + +import lombok.Data; + +import java.util.List; + +@Data +public class WindowAlertCloseRequest { + private List alertIdList; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java new file mode 100644 index 0000000..1620ac4 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/WindowAlertQueryRequest.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.dto.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class WindowAlertQueryRequest { + + private Long startTime; + + @Schema(hidden = true) + private Long companyId; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java index f383885..221ac86 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/DeviceGroupSearchParams.java @@ -12,14 +12,11 @@ import java.util.List; @Data public class DeviceGroupSearchParams extends BaseSearchParams { - @Schema(description = "楼宇ID",example = "222") + @Schema(description = "楼宇ID",example = "222", hidden = true) private Long buildingId; @Schema(description = "设备组名",example = "张三李四") private String name; - - @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1") - private Integer groupType; @Schema(description = "设备组id,多个逗号连接",example = "1,47") private String deviceGroupIds; diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java index c086409..98b289e 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/devicegroup/OptDeviceGroupParams.java @@ -12,9 +12,6 @@ public class OptDeviceGroupParams{ @Schema(description = "楼宇ID",example = "222") private Long buildingId; - - @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "2738967") - private Integer groupType; @Schema(description = "所属企业ID",example = "2738967", hidden = true) private Long companyId; diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java deleted file mode 100644 index 975f3fc..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyParam.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -/** -* @author Mr.Jiang -* @time 2022年4月23日 下午1:59:33 -*/ -@Setter -@Getter -public class DeleteLevelHierarchyParam { - - @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) - private String ids; - - @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) - private String type; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java deleted file mode 100644 index 10052ff..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/DeleteLevelHierarchyRoleParam.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -/** -* @author Mr.Jiang -* @time 2022年4月23日 下午1:59:33 -*/ -@Setter -@Getter -public class DeleteLevelHierarchyRoleParam { - - @Schema(description = "Id,多个使用逗号连接",example = "3,5", required = true) - private String ids; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java deleted file mode 100644 index a52fc49..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyParam.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -import java.util.List; - -/** -* @author zhc -* @time 2022年6月14日10:56:38 -*/ -@Setter -@Getter -public class OptLevelHierarchyParam { - - - @Schema(description = "层级ID, 新增时无此参数",example = "111", required = false) - private Long id; - - @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) - private String type; - - @Schema(description = "层级名称",example = "管理员", required = true) - private String levelHierarchyName; - - @Schema(description = "描述",example = "这是管理员描述") - private String remark; - - @Schema(description = "所属上一层级的id列表(支持多个上级)",example = "[1,2,3,4]", required = true) - private List parentIdList; - - @Schema(description = "所属企业ID",example = "2", hidden = true) - private Long companyId; - - @Schema(hidden = true) - private Long createdBy; - - @Schema(hidden = true) - private Long createdAt; - - @Schema(hidden = true) - private Long updatedAt; - - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java deleted file mode 100644 index 90920fd..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/OptLevelHierarchyRoleParam.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -import java.util.List; - -/** -* @author zhc -* @time 2022年6月14日10:56:38 -*/ -@Setter -@Getter -public class OptLevelHierarchyRoleParam { - - - @Schema(description = "ID, 新增时无此参数",example = "111", required = false) - private Long id; - - @Schema(description = "名称",example = "管理员", required = true) - private String name; - - @Schema(description = "描述",example = "这是管理员描述", required = false) - private String remark; - - @Schema(description = "所属企业ID",example = "2", hidden = true) - private Long companyId; - - @Schema(hidden = true) - private Long createdBy; - - @Schema(hidden = true) - private Long createdAt; - - @Schema(hidden = true) - private Long updatedAt; - - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java deleted file mode 100644 index a49d540..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchyRoleSearchParam.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import com.dongjian.dashboard.back.dto.BaseSearchParams; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -/** -* @author Mr.zhc -* @time 2022年7月27日12:06:35 -*/ -@Setter -@Getter -public class PageLevelHierarchyRoleSearchParam extends BaseSearchParams{ - - @Schema(description = "名称",example = "test", required = false) - private String name; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java deleted file mode 100644 index f2753b9..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/levelhierarchy/PageLevelHierarchySearchParam.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.dongjian.dashboard.back.dto.levelhierarchy; - -import com.dongjian.dashboard.back.dto.BaseSearchParams; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -/** -* @author Mr.zhc -* @time 2022年7月27日12:06:35 -*/ -@Setter -@Getter -public class PageLevelHierarchySearchParam extends BaseSearchParams{ - - @Schema(description = "层级名称",example = "test", required = false) - private String levelHierarchyName; - - @Schema(description = "层级类型,BRANCH=支社,STORE=支店,AREA=area,SITE=site",example = "SITE", required = true) - private String type; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java index 1650980..94c22bd 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuilding.java @@ -129,6 +129,24 @@ public class BasicBuilding implements Serializable { */ private String briefIntroduction; + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.latitude + * + * @mbg.generated + */ + private String latitude; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_building.longitude + * + * @mbg.generated + */ + private String longitude; + /** * * This field was generated by MyBatis Generator. @@ -491,6 +509,54 @@ public class BasicBuilding implements Serializable { this.briefIntroduction = briefIntroduction == null ? null : briefIntroduction.trim(); } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.latitude + * + * @return the value of basic_building.latitude + * + * @mbg.generated + */ + public String getLatitude() { + return latitude; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.latitude + * + * @param latitude the value for basic_building.latitude + * + * @mbg.generated + */ + public void setLatitude(String latitude) { + this.latitude = latitude == null ? null : latitude.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_building.longitude + * + * @return the value of basic_building.longitude + * + * @mbg.generated + */ + public String getLongitude() { + return longitude; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_building.longitude + * + * @param longitude the value for basic_building.longitude + * + * @mbg.generated + */ + public void setLongitude(String longitude) { + this.longitude = longitude == null ? null : longitude.trim(); + } + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column basic_building.floor_info_list @@ -565,6 +631,8 @@ public class BasicBuilding implements Serializable { sb.append(", thumbnailNum=").append(thumbnailNum); sb.append(", showSwitch2d3d=").append(showSwitch2d3d); sb.append(", briefIntroduction=").append(briefIntroduction); + sb.append(", latitude=").append(latitude); + sb.append(", longitude=").append(longitude); sb.append(", floorInfoList=").append(floorInfoList); sb.append(", pictureIntroduction=").append(pictureIntroduction); sb.append(", serialVersionUID=").append(serialVersionUID); diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java index 5b8c433..a330f4a 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicBuildingExample.java @@ -1083,6 +1083,146 @@ public class BasicBuildingExample { addCriterion("brief_introduction not between", value1, value2, "briefIntroduction"); return (Criteria) this; } + + public Criteria andLatitudeIsNull() { + addCriterion("latitude is null"); + return (Criteria) this; + } + + public Criteria andLatitudeIsNotNull() { + addCriterion("latitude is not null"); + return (Criteria) this; + } + + public Criteria andLatitudeEqualTo(String value) { + addCriterion("latitude =", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotEqualTo(String value) { + addCriterion("latitude <>", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeGreaterThan(String value) { + addCriterion("latitude >", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeGreaterThanOrEqualTo(String value) { + addCriterion("latitude >=", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLessThan(String value) { + addCriterion("latitude <", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLessThanOrEqualTo(String value) { + addCriterion("latitude <=", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLike(String value) { + addCriterion("latitude like", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotLike(String value) { + addCriterion("latitude not like", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeIn(List values) { + addCriterion("latitude in", values, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotIn(List values) { + addCriterion("latitude not in", values, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeBetween(String value1, String value2) { + addCriterion("latitude between", value1, value2, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotBetween(String value1, String value2) { + addCriterion("latitude not between", value1, value2, "latitude"); + return (Criteria) this; + } + + public Criteria andLongitudeIsNull() { + addCriterion("longitude is null"); + return (Criteria) this; + } + + public Criteria andLongitudeIsNotNull() { + addCriterion("longitude is not null"); + return (Criteria) this; + } + + public Criteria andLongitudeEqualTo(String value) { + addCriterion("longitude =", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotEqualTo(String value) { + addCriterion("longitude <>", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeGreaterThan(String value) { + addCriterion("longitude >", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeGreaterThanOrEqualTo(String value) { + addCriterion("longitude >=", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLessThan(String value) { + addCriterion("longitude <", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLessThanOrEqualTo(String value) { + addCriterion("longitude <=", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLike(String value) { + addCriterion("longitude like", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotLike(String value) { + addCriterion("longitude not like", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeIn(List values) { + addCriterion("longitude in", values, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotIn(List values) { + addCriterion("longitude not in", values, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeBetween(String value1, String value2) { + addCriterion("longitude between", value1, value2, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotBetween(String value1, String value2) { + addCriterion("longitude not between", value1, value2, "longitude"); + return (Criteria) this; + } } /** diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java index 3edad96..9c6439c 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java @@ -174,6 +174,15 @@ public class BasicUser implements Serializable { */ private Integer superRole; + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column basic_user.create_platform + * + * @mbg.generated + */ + private Integer createPlatform; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database table basic_user @@ -638,6 +647,30 @@ public class BasicUser implements Serializable { this.superRole = superRole; } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column basic_user.create_platform + * + * @return the value of basic_user.create_platform + * + * @mbg.generated + */ + public Integer getCreatePlatform() { + return createPlatform; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column basic_user.create_platform + * + * @param createPlatform the value for basic_user.create_platform + * + * @mbg.generated + */ + public void setCreatePlatform(Integer createPlatform) { + this.createPlatform = createPlatform; + } + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table basic_user @@ -669,6 +702,7 @@ public class BasicUser implements Serializable { sb.append(", modifyTime=").append(modifyTime); sb.append(", modifierId=").append(modifierId); sb.append(", superRole=").append(superRole); + sb.append(", createPlatform=").append(createPlatform); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java index c49f7fc..b0e3aa7 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java @@ -1403,6 +1403,66 @@ public class BasicUserExample { addCriterion("super_role not between", value1, value2, "superRole"); return (Criteria) this; } + + public Criteria andCreatePlatformIsNull() { + addCriterion("create_platform is null"); + return (Criteria) this; + } + + public Criteria andCreatePlatformIsNotNull() { + addCriterion("create_platform is not null"); + return (Criteria) this; + } + + public Criteria andCreatePlatformEqualTo(Integer value) { + addCriterion("create_platform =", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformNotEqualTo(Integer value) { + addCriterion("create_platform <>", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformGreaterThan(Integer value) { + addCriterion("create_platform >", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformGreaterThanOrEqualTo(Integer value) { + addCriterion("create_platform >=", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformLessThan(Integer value) { + addCriterion("create_platform <", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformLessThanOrEqualTo(Integer value) { + addCriterion("create_platform <=", value, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformIn(List values) { + addCriterion("create_platform in", values, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformNotIn(List values) { + addCriterion("create_platform not in", values, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformBetween(Integer value1, Integer value2) { + addCriterion("create_platform between", value1, value2, "createPlatform"); + return (Criteria) this; + } + + public Criteria andCreatePlatformNotBetween(Integer value1, Integer value2) { + addCriterion("create_platform not between", value1, value2, "createPlatform"); + return (Criteria) this; + } } /** diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java deleted file mode 100644 index 6aa918e..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRole.java +++ /dev/null @@ -1,302 +0,0 @@ -package com.dongjian.dashboard.back.model; - -import java.io.Serializable; - -public class DashboardLevelRole implements Serializable { - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.id - * - * @mbg.generated - */ - private Long id; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.company_id - * - * @mbg.generated - */ - private Long companyId; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.name - * - * @mbg.generated - */ - private String name; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.remark - * - * @mbg.generated - */ - private String remark; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.flag - * - * @mbg.generated - */ - private Integer flag; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.created_by - * - * @mbg.generated - */ - private Long createdBy; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.created_at - * - * @mbg.generated - */ - private Long createdAt; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column dashboard_level_role.updated_at - * - * @mbg.generated - */ - private Long updatedAt; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - private static final long serialVersionUID = 1L; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.id - * - * @return the value of dashboard_level_role.id - * - * @mbg.generated - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.id - * - * @param id the value for dashboard_level_role.id - * - * @mbg.generated - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.company_id - * - * @return the value of dashboard_level_role.company_id - * - * @mbg.generated - */ - public Long getCompanyId() { - return companyId; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.company_id - * - * @param companyId the value for dashboard_level_role.company_id - * - * @mbg.generated - */ - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.name - * - * @return the value of dashboard_level_role.name - * - * @mbg.generated - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.name - * - * @param name the value for dashboard_level_role.name - * - * @mbg.generated - */ - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.remark - * - * @return the value of dashboard_level_role.remark - * - * @mbg.generated - */ - public String getRemark() { - return remark; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.remark - * - * @param remark the value for dashboard_level_role.remark - * - * @mbg.generated - */ - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.flag - * - * @return the value of dashboard_level_role.flag - * - * @mbg.generated - */ - public Integer getFlag() { - return flag; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.flag - * - * @param flag the value for dashboard_level_role.flag - * - * @mbg.generated - */ - public void setFlag(Integer flag) { - this.flag = flag; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.created_by - * - * @return the value of dashboard_level_role.created_by - * - * @mbg.generated - */ - public Long getCreatedBy() { - return createdBy; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.created_by - * - * @param createdBy the value for dashboard_level_role.created_by - * - * @mbg.generated - */ - public void setCreatedBy(Long createdBy) { - this.createdBy = createdBy; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.created_at - * - * @return the value of dashboard_level_role.created_at - * - * @mbg.generated - */ - public Long getCreatedAt() { - return createdAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.created_at - * - * @param createdAt the value for dashboard_level_role.created_at - * - * @mbg.generated - */ - public void setCreatedAt(Long createdAt) { - this.createdAt = createdAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column dashboard_level_role.updated_at - * - * @return the value of dashboard_level_role.updated_at - * - * @mbg.generated - */ - public Long getUpdatedAt() { - return updatedAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column dashboard_level_role.updated_at - * - * @param updatedAt the value for dashboard_level_role.updated_at - * - * @mbg.generated - */ - public void setUpdatedAt(Long updatedAt) { - this.updatedAt = updatedAt; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getSimpleName()); - sb.append(" ["); - sb.append("Hash = ").append(hashCode()); - sb.append(", id=").append(id); - sb.append(", companyId=").append(companyId); - sb.append(", name=").append(name); - sb.append(", remark=").append(remark); - sb.append(", flag=").append(flag); - sb.append(", createdBy=").append(createdBy); - sb.append(", createdAt=").append(createdAt); - sb.append(", updatedAt=").append(updatedAt); - sb.append(", serialVersionUID=").append(serialVersionUID); - sb.append("]"); - return sb.toString(); - } -} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java deleted file mode 100644 index 5b213e8..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardLevelRoleExample.java +++ /dev/null @@ -1,802 +0,0 @@ -package com.dongjian.dashboard.back.model; - -import java.util.ArrayList; -import java.util.List; - -public class DashboardLevelRoleExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public DashboardLevelRoleExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andCompanyIdIsNull() { - addCriterion("company_id is null"); - return (Criteria) this; - } - - public Criteria andCompanyIdIsNotNull() { - addCriterion("company_id is not null"); - return (Criteria) this; - } - - public Criteria andCompanyIdEqualTo(Long value) { - addCriterion("company_id =", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdNotEqualTo(Long value) { - addCriterion("company_id <>", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdGreaterThan(Long value) { - addCriterion("company_id >", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { - addCriterion("company_id >=", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdLessThan(Long value) { - addCriterion("company_id <", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdLessThanOrEqualTo(Long value) { - addCriterion("company_id <=", value, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdIn(List values) { - addCriterion("company_id in", values, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdNotIn(List values) { - addCriterion("company_id not in", values, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdBetween(Long value1, Long value2) { - addCriterion("company_id between", value1, value2, "companyId"); - return (Criteria) this; - } - - public Criteria andCompanyIdNotBetween(Long value1, Long value2) { - addCriterion("company_id not between", value1, value2, "companyId"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("`name` is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("`name` is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("`name` =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("`name` <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("`name` >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("`name` >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("`name` <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("`name` <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("`name` like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("`name` not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("`name` in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("`name` not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("`name` between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("`name` not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andRemarkIsNull() { - addCriterion("remark is null"); - return (Criteria) this; - } - - public Criteria andRemarkIsNotNull() { - addCriterion("remark is not null"); - return (Criteria) this; - } - - public Criteria andRemarkEqualTo(String value) { - addCriterion("remark =", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotEqualTo(String value) { - addCriterion("remark <>", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThan(String value) { - addCriterion("remark >", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThanOrEqualTo(String value) { - addCriterion("remark >=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThan(String value) { - addCriterion("remark <", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThanOrEqualTo(String value) { - addCriterion("remark <=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLike(String value) { - addCriterion("remark like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotLike(String value) { - addCriterion("remark not like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkIn(List values) { - addCriterion("remark in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotIn(List values) { - addCriterion("remark not in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkBetween(String value1, String value2) { - addCriterion("remark between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotBetween(String value1, String value2) { - addCriterion("remark not between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andFlagIsNull() { - addCriterion("flag is null"); - return (Criteria) this; - } - - public Criteria andFlagIsNotNull() { - addCriterion("flag is not null"); - return (Criteria) this; - } - - public Criteria andFlagEqualTo(Integer value) { - addCriterion("flag =", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagNotEqualTo(Integer value) { - addCriterion("flag <>", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagGreaterThan(Integer value) { - addCriterion("flag >", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagGreaterThanOrEqualTo(Integer value) { - addCriterion("flag >=", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagLessThan(Integer value) { - addCriterion("flag <", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagLessThanOrEqualTo(Integer value) { - addCriterion("flag <=", value, "flag"); - return (Criteria) this; - } - - public Criteria andFlagIn(List values) { - addCriterion("flag in", values, "flag"); - return (Criteria) this; - } - - public Criteria andFlagNotIn(List values) { - addCriterion("flag not in", values, "flag"); - return (Criteria) this; - } - - public Criteria andFlagBetween(Integer value1, Integer value2) { - addCriterion("flag between", value1, value2, "flag"); - return (Criteria) this; - } - - public Criteria andFlagNotBetween(Integer value1, Integer value2) { - addCriterion("flag not between", value1, value2, "flag"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNull() { - addCriterion("created_by is null"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNotNull() { - addCriterion("created_by is not null"); - return (Criteria) this; - } - - public Criteria andCreatedByEqualTo(Long value) { - addCriterion("created_by =", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotEqualTo(Long value) { - addCriterion("created_by <>", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThan(Long value) { - addCriterion("created_by >", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThanOrEqualTo(Long value) { - addCriterion("created_by >=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThan(Long value) { - addCriterion("created_by <", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThanOrEqualTo(Long value) { - addCriterion("created_by <=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByIn(List values) { - addCriterion("created_by in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotIn(List values) { - addCriterion("created_by not in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByBetween(Long value1, Long value2) { - addCriterion("created_by between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotBetween(Long value1, Long value2) { - addCriterion("created_by not between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNull() { - addCriterion("created_at is null"); - return (Criteria) this; - } - - public Criteria andCreatedAtIsNotNull() { - addCriterion("created_at is not null"); - return (Criteria) this; - } - - public Criteria andCreatedAtEqualTo(Long value) { - addCriterion("created_at =", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotEqualTo(Long value) { - addCriterion("created_at <>", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThan(Long value) { - addCriterion("created_at >", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { - addCriterion("created_at >=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThan(Long value) { - addCriterion("created_at <", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtLessThanOrEqualTo(Long value) { - addCriterion("created_at <=", value, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtIn(List values) { - addCriterion("created_at in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotIn(List values) { - addCriterion("created_at not in", values, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtBetween(Long value1, Long value2) { - addCriterion("created_at between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andCreatedAtNotBetween(Long value1, Long value2) { - addCriterion("created_at not between", value1, value2, "createdAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIsNull() { - addCriterion("updated_at is null"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIsNotNull() { - addCriterion("updated_at is not null"); - return (Criteria) this; - } - - public Criteria andUpdatedAtEqualTo(Long value) { - addCriterion("updated_at =", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotEqualTo(Long value) { - addCriterion("updated_at <>", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtGreaterThan(Long value) { - addCriterion("updated_at >", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtGreaterThanOrEqualTo(Long value) { - addCriterion("updated_at >=", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtLessThan(Long value) { - addCriterion("updated_at <", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtLessThanOrEqualTo(Long value) { - addCriterion("updated_at <=", value, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtIn(List values) { - addCriterion("updated_at in", values, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotIn(List values) { - addCriterion("updated_at not in", values, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtBetween(Long value1, Long value2) { - addCriterion("updated_at between", value1, value2, "updatedAt"); - return (Criteria) this; - } - - public Criteria andUpdatedAtNotBetween(Long value1, Long value2) { - addCriterion("updated_at not between", value1, value2, "updatedAt"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table dashboard_level_role - * - * @mbg.generated do_not_delete_during_merge - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table dashboard_level_role - * - * @mbg.generated - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java new file mode 100644 index 0000000..9ae4203 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnored.java @@ -0,0 +1,166 @@ +package com.dongjian.dashboard.back.model; + +import java.io.Serializable; + +public class DashboardNoticeIgnored implements Serializable { + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_notice_ignored.id + * + * @mbg.generated + */ + private Long id; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_notice_ignored.redis_key + * + * @mbg.generated + */ + private String redisKey; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_notice_ignored.member_value + * + * @mbg.generated + */ + private String memberValue; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column dashboard_notice_ignored.created_at + * + * @mbg.generated + */ + private Long createdAt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_notice_ignored.id + * + * @return the value of dashboard_notice_ignored.id + * + * @mbg.generated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_notice_ignored.id + * + * @param id the value for dashboard_notice_ignored.id + * + * @mbg.generated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_notice_ignored.redis_key + * + * @return the value of dashboard_notice_ignored.redis_key + * + * @mbg.generated + */ + public String getRedisKey() { + return redisKey; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_notice_ignored.redis_key + * + * @param redisKey the value for dashboard_notice_ignored.redis_key + * + * @mbg.generated + */ + public void setRedisKey(String redisKey) { + this.redisKey = redisKey == null ? null : redisKey.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_notice_ignored.member_value + * + * @return the value of dashboard_notice_ignored.member_value + * + * @mbg.generated + */ + public String getMemberValue() { + return memberValue; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_notice_ignored.member_value + * + * @param memberValue the value for dashboard_notice_ignored.member_value + * + * @mbg.generated + */ + public void setMemberValue(String memberValue) { + this.memberValue = memberValue == null ? null : memberValue.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column dashboard_notice_ignored.created_at + * + * @return the value of dashboard_notice_ignored.created_at + * + * @mbg.generated + */ + public Long getCreatedAt() { + return createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column dashboard_notice_ignored.created_at + * + * @param createdAt the value for dashboard_notice_ignored.created_at + * + * @mbg.generated + */ + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", redisKey=").append(redisKey); + sb.append(", memberValue=").append(memberValue); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java new file mode 100644 index 0000000..1d6c2a6 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DashboardNoticeIgnoredExample.java @@ -0,0 +1,562 @@ +package com.dongjian.dashboard.back.model; + +import java.util.ArrayList; +import java.util.List; + +public class DashboardNoticeIgnoredExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public DashboardNoticeIgnoredExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andRedisKeyIsNull() { + addCriterion("redis_key is null"); + return (Criteria) this; + } + + public Criteria andRedisKeyIsNotNull() { + addCriterion("redis_key is not null"); + return (Criteria) this; + } + + public Criteria andRedisKeyEqualTo(String value) { + addCriterion("redis_key =", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyNotEqualTo(String value) { + addCriterion("redis_key <>", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyGreaterThan(String value) { + addCriterion("redis_key >", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyGreaterThanOrEqualTo(String value) { + addCriterion("redis_key >=", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyLessThan(String value) { + addCriterion("redis_key <", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyLessThanOrEqualTo(String value) { + addCriterion("redis_key <=", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyLike(String value) { + addCriterion("redis_key like", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyNotLike(String value) { + addCriterion("redis_key not like", value, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyIn(List values) { + addCriterion("redis_key in", values, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyNotIn(List values) { + addCriterion("redis_key not in", values, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyBetween(String value1, String value2) { + addCriterion("redis_key between", value1, value2, "redisKey"); + return (Criteria) this; + } + + public Criteria andRedisKeyNotBetween(String value1, String value2) { + addCriterion("redis_key not between", value1, value2, "redisKey"); + return (Criteria) this; + } + + public Criteria andMemberValueIsNull() { + addCriterion("member_value is null"); + return (Criteria) this; + } + + public Criteria andMemberValueIsNotNull() { + addCriterion("member_value is not null"); + return (Criteria) this; + } + + public Criteria andMemberValueEqualTo(String value) { + addCriterion("member_value =", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueNotEqualTo(String value) { + addCriterion("member_value <>", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueGreaterThan(String value) { + addCriterion("member_value >", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueGreaterThanOrEqualTo(String value) { + addCriterion("member_value >=", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueLessThan(String value) { + addCriterion("member_value <", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueLessThanOrEqualTo(String value) { + addCriterion("member_value <=", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueLike(String value) { + addCriterion("member_value like", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueNotLike(String value) { + addCriterion("member_value not like", value, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueIn(List values) { + addCriterion("member_value in", values, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueNotIn(List values) { + addCriterion("member_value not in", values, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueBetween(String value1, String value2) { + addCriterion("member_value between", value1, value2, "memberValue"); + return (Criteria) this; + } + + public Criteria andMemberValueNotBetween(String value1, String value2) { + addCriterion("member_value not between", value1, value2, "memberValue"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Long value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Long value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Long value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Long value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Long value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Long value1, Long value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Long value1, Long value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table dashboard_notice_ignored + * + * @mbg.generated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java index 5e79e38..27028cd 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroup.java @@ -6,7 +6,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.id + * This field corresponds to the database column dashboard_device_group.id * * @mbg.generated */ @@ -15,7 +15,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.company_id + * This field corresponds to the database column dashboard_device_group.company_id * * @mbg.generated */ @@ -24,7 +24,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.building_id + * This field corresponds to the database column dashboard_device_group.building_id * * @mbg.generated */ @@ -33,7 +33,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.name + * This field corresponds to the database column dashboard_device_group.name * * @mbg.generated */ @@ -42,16 +42,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.group_type - * - * @mbg.generated - */ - private Integer groupType; - - /** - * - * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.remark + * This field corresponds to the database column dashboard_device_group.remark * * @mbg.generated */ @@ -60,7 +51,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.flag + * This field corresponds to the database column dashboard_device_group.flag * * @mbg.generated */ @@ -69,7 +60,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.created_by + * This field corresponds to the database column dashboard_device_group.created_by * * @mbg.generated */ @@ -78,7 +69,7 @@ public class DeviceGroup implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group.created_at + * This field corresponds to the database column dashboard_device_group.created_at * * @mbg.generated */ @@ -86,7 +77,7 @@ public class DeviceGroup implements Serializable { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group + * This field corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -94,9 +85,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.id + * This method returns the value of the database column dashboard_device_group.id * - * @return the value of device_group.id + * @return the value of dashboard_device_group.id * * @mbg.generated */ @@ -106,9 +97,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.id + * This method sets the value of the database column dashboard_device_group.id * - * @param id the value for device_group.id + * @param id the value for dashboard_device_group.id * * @mbg.generated */ @@ -118,9 +109,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.company_id + * This method returns the value of the database column dashboard_device_group.company_id * - * @return the value of device_group.company_id + * @return the value of dashboard_device_group.company_id * * @mbg.generated */ @@ -130,9 +121,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.company_id + * This method sets the value of the database column dashboard_device_group.company_id * - * @param companyId the value for device_group.company_id + * @param companyId the value for dashboard_device_group.company_id * * @mbg.generated */ @@ -142,9 +133,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.building_id + * This method returns the value of the database column dashboard_device_group.building_id * - * @return the value of device_group.building_id + * @return the value of dashboard_device_group.building_id * * @mbg.generated */ @@ -154,9 +145,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.building_id + * This method sets the value of the database column dashboard_device_group.building_id * - * @param buildingId the value for device_group.building_id + * @param buildingId the value for dashboard_device_group.building_id * * @mbg.generated */ @@ -166,9 +157,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.name + * This method returns the value of the database column dashboard_device_group.name * - * @return the value of device_group.name + * @return the value of dashboard_device_group.name * * @mbg.generated */ @@ -178,9 +169,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.name + * This method sets the value of the database column dashboard_device_group.name * - * @param name the value for device_group.name + * @param name the value for dashboard_device_group.name * * @mbg.generated */ @@ -190,33 +181,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.group_type - * - * @return the value of device_group.group_type - * - * @mbg.generated - */ - public Integer getGroupType() { - return groupType; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.group_type - * - * @param groupType the value for device_group.group_type - * - * @mbg.generated - */ - public void setGroupType(Integer groupType) { - this.groupType = groupType; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.remark + * This method returns the value of the database column dashboard_device_group.remark * - * @return the value of device_group.remark + * @return the value of dashboard_device_group.remark * * @mbg.generated */ @@ -226,9 +193,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.remark + * This method sets the value of the database column dashboard_device_group.remark * - * @param remark the value for device_group.remark + * @param remark the value for dashboard_device_group.remark * * @mbg.generated */ @@ -238,9 +205,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.flag + * This method returns the value of the database column dashboard_device_group.flag * - * @return the value of device_group.flag + * @return the value of dashboard_device_group.flag * * @mbg.generated */ @@ -250,9 +217,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.flag + * This method sets the value of the database column dashboard_device_group.flag * - * @param flag the value for device_group.flag + * @param flag the value for dashboard_device_group.flag * * @mbg.generated */ @@ -262,9 +229,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.created_by + * This method returns the value of the database column dashboard_device_group.created_by * - * @return the value of device_group.created_by + * @return the value of dashboard_device_group.created_by * * @mbg.generated */ @@ -274,9 +241,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.created_by + * This method sets the value of the database column dashboard_device_group.created_by * - * @param createdBy the value for device_group.created_by + * @param createdBy the value for dashboard_device_group.created_by * * @mbg.generated */ @@ -286,9 +253,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group.created_at + * This method returns the value of the database column dashboard_device_group.created_at * - * @return the value of device_group.created_at + * @return the value of dashboard_device_group.created_at * * @mbg.generated */ @@ -298,9 +265,9 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group.created_at + * This method sets the value of the database column dashboard_device_group.created_at * - * @param createdAt the value for device_group.created_at + * @param createdAt the value for dashboard_device_group.created_at * * @mbg.generated */ @@ -310,7 +277,7 @@ public class DeviceGroup implements Serializable { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -324,7 +291,6 @@ public class DeviceGroup implements Serializable { sb.append(", companyId=").append(companyId); sb.append(", buildingId=").append(buildingId); sb.append(", name=").append(name); - sb.append(", groupType=").append(groupType); sb.append(", remark=").append(remark); sb.append(", flag=").append(flag); sb.append(", createdBy=").append(createdBy); diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java index 5451787..bd7bd5a 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupExample.java @@ -6,7 +6,7 @@ import java.util.List; public class DeviceGroupExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group + * This field corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -14,7 +14,7 @@ public class DeviceGroupExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group + * This field corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -22,7 +22,7 @@ public class DeviceGroupExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group + * This field corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -30,7 +30,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -40,7 +40,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -50,7 +50,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -60,7 +60,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -70,7 +70,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -80,7 +80,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -90,7 +90,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -100,7 +100,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -112,7 +112,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -126,7 +126,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -137,7 +137,7 @@ public class DeviceGroupExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group + * This method corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -149,7 +149,7 @@ public class DeviceGroupExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group + * This class corresponds to the database table dashboard_device_group * * @mbg.generated */ @@ -444,66 +444,6 @@ public class DeviceGroupExample { return (Criteria) this; } - public Criteria andGroupTypeIsNull() { - addCriterion("group_type is null"); - return (Criteria) this; - } - - public Criteria andGroupTypeIsNotNull() { - addCriterion("group_type is not null"); - return (Criteria) this; - } - - public Criteria andGroupTypeEqualTo(Integer value) { - addCriterion("group_type =", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeNotEqualTo(Integer value) { - addCriterion("group_type <>", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeGreaterThan(Integer value) { - addCriterion("group_type >", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeGreaterThanOrEqualTo(Integer value) { - addCriterion("group_type >=", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeLessThan(Integer value) { - addCriterion("group_type <", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeLessThanOrEqualTo(Integer value) { - addCriterion("group_type <=", value, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeIn(List values) { - addCriterion("group_type in", values, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeNotIn(List values) { - addCriterion("group_type not in", values, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeBetween(Integer value1, Integer value2) { - addCriterion("group_type between", value1, value2, "groupType"); - return (Criteria) this; - } - - public Criteria andGroupTypeNotBetween(Integer value1, Integer value2) { - addCriterion("group_type not between", value1, value2, "groupType"); - return (Criteria) this; - } - public Criteria andRemarkIsNull() { addCriterion("remark is null"); return (Criteria) this; @@ -757,7 +697,7 @@ public class DeviceGroupExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group + * This class corresponds to the database table dashboard_device_group * * @mbg.generated do_not_delete_during_merge */ @@ -770,7 +710,7 @@ public class DeviceGroupExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group + * This class corresponds to the database table dashboard_device_group * * @mbg.generated */ diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java index e019434..87783db 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelation.java @@ -6,7 +6,7 @@ public class DeviceGroupRelation implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group_relation.device_info_id + * This field corresponds to the database column dashboard_device_group_relation.device_info_id * * @mbg.generated */ @@ -15,7 +15,7 @@ public class DeviceGroupRelation implements Serializable { /** * * This field was generated by MyBatis Generator. - * This field corresponds to the database column device_group_relation.device_group_id + * This field corresponds to the database column dashboard_device_group_relation.device_group_id * * @mbg.generated */ @@ -23,7 +23,7 @@ public class DeviceGroupRelation implements Serializable { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group_relation + * This field corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -31,9 +31,9 @@ public class DeviceGroupRelation implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group_relation.device_info_id + * This method returns the value of the database column dashboard_device_group_relation.device_info_id * - * @return the value of device_group_relation.device_info_id + * @return the value of dashboard_device_group_relation.device_info_id * * @mbg.generated */ @@ -43,9 +43,9 @@ public class DeviceGroupRelation implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group_relation.device_info_id + * This method sets the value of the database column dashboard_device_group_relation.device_info_id * - * @param deviceInfoId the value for device_group_relation.device_info_id + * @param deviceInfoId the value for dashboard_device_group_relation.device_info_id * * @mbg.generated */ @@ -55,9 +55,9 @@ public class DeviceGroupRelation implements Serializable { /** * This method was generated by MyBatis Generator. - * This method returns the value of the database column device_group_relation.device_group_id + * This method returns the value of the database column dashboard_device_group_relation.device_group_id * - * @return the value of device_group_relation.device_group_id + * @return the value of dashboard_device_group_relation.device_group_id * * @mbg.generated */ @@ -67,9 +67,9 @@ public class DeviceGroupRelation implements Serializable { /** * This method was generated by MyBatis Generator. - * This method sets the value of the database column device_group_relation.device_group_id + * This method sets the value of the database column dashboard_device_group_relation.device_group_id * - * @param deviceGroupId the value for device_group_relation.device_group_id + * @param deviceGroupId the value for dashboard_device_group_relation.device_group_id * * @mbg.generated */ @@ -79,7 +79,7 @@ public class DeviceGroupRelation implements Serializable { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java index 6aedd2a..036c48b 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/DeviceGroupRelationExample.java @@ -6,7 +6,7 @@ import java.util.List; public class DeviceGroupRelationExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group_relation + * This field corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -14,7 +14,7 @@ public class DeviceGroupRelationExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group_relation + * This field corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -22,7 +22,7 @@ public class DeviceGroupRelationExample { /** * This field was generated by MyBatis Generator. - * This field corresponds to the database table device_group_relation + * This field corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -30,7 +30,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -40,7 +40,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -50,7 +50,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -60,7 +60,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -70,7 +70,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -80,7 +80,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -90,7 +90,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -100,7 +100,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -112,7 +112,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -126,7 +126,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -137,7 +137,7 @@ public class DeviceGroupRelationExample { /** * This method was generated by MyBatis Generator. - * This method corresponds to the database table device_group_relation + * This method corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -149,7 +149,7 @@ public class DeviceGroupRelationExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group_relation + * This class corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ @@ -317,7 +317,7 @@ public class DeviceGroupRelationExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group_relation + * This class corresponds to the database table dashboard_device_group_relation * * @mbg.generated do_not_delete_during_merge */ @@ -330,7 +330,7 @@ public class DeviceGroupRelationExample { /** * This class was generated by MyBatis Generator. - * This class corresponds to the database table device_group_relation + * This class corresponds to the database table dashboard_device_group_relation * * @mbg.generated */ diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java index 21651db..2cf2a15 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/data/DeviceAlarmData.java @@ -30,5 +30,8 @@ public class DeviceAlarmData extends BaseData{ @Schema(description = "确认状态", example = "未確認") private String confirmStatusStr; + @Schema(description = "资产记号",example = "122") + private String assetSymbol; + } diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java new file mode 100644 index 0000000..c23beef --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/device/WindowAlertVO.java @@ -0,0 +1,57 @@ +package com.dongjian.dashboard.back.vo.device; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class WindowAlertVO { + + private Long alertId; + + @Schema(description = "device name", example = "Device-Monitoring") + private String deviceName; + + @Schema(description = "device Id", example = "Device-Monitoring") + private String deviceId; + + @Schema(description = "device sn", example = "Device-Monitoring") + private String deviceSn; + + private Long buildingId; + + private String buildingName; + + private Long floorId; + + private String floorName; + + private Long spaceId; + + private String spaceName; + + private Long assetId; + + private String assetSymbol; + + @Schema(description = "Monitoring point name", example = "Device-Monitoring") + private String monitoringPointName; + + @Schema(description = "monitoring point category id", example = "22") + private Long monitoringPointCategoryId; + + @Schema(description = "monitoring point category name", example = "2name") + private String monitoringPointCategoryName; + + @Schema(description = "data provider id", example = "33") + private Long dataProviderId; + + @Schema(description = "data provider", example = "33") + private String dataProviderName; + + @Schema(description = "gateway info id", example = "44") + private Long gatewayInfoId; + + @Schema(description = "gateway info", example = "33") + private String gatewayInfoName; +} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java index 72abc3f..7e7a527 100644 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/devicegroup/DeviceGroupPageVO.java @@ -9,16 +9,13 @@ public class DeviceGroupPageVO { @Schema(description = "项目唯一标识ID,新增时无此参数",example = "2738967") private Long deviceGroupId; - @Schema(description = "楼宇ID",example = "222") + @Schema(description = "楼宇ID",example = "222", hidden = true) private Long buildingId; - @Schema(description = "楼宇名称",example = "楼宇222") + @Schema(description = "楼宇名称",example = "楼宇222", hidden = true) private String buildingName; - - @Schema(description = "分组下的设备分类, 1-报警、2-累积、3-计测、4-振动",example = "1") - private Integer groupType; - @Schema(description = "所属企业ID",example = "2738967") + @Schema(description = "所属企业ID",example = "2738967", hidden = true) private Long companyId; @Schema(description = "项目名称",example = "testDeviceGroup1", required = true) diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java deleted file mode 100644 index 05517a0..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyPageDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.dongjian.dashboard.back.vo.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** -* @author Mr.Jiang -* @time 2022年5月22日 下午10:37:02 -*/ -@Data -public class LevelHierarchyPageDTO { - - @Schema(description = "层级ID",example = "111", required = true) - private Long id; - - @Schema(description = "层级名称",example = "建筑A", required = true) - private String levelHierarchyName; - - @Schema(description = "描述",example = "这是管理员描述", required = true) - private String remark; - - @Schema(description = "创建时间",example = "1700011000110", required = false) - private Long createdAt; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java deleted file mode 100644 index 9bc98c8..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyRolePageDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.dongjian.dashboard.back.vo.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** -* @author Mr.Jiang -* @time 2022年5月22日 下午10:37:02 -*/ -@Data -public class LevelHierarchyRolePageDTO { - - @Schema(description = "层级ID",example = "111", required = true) - private Long id; - - @Schema(description = "名称",example = "建筑A", required = true) - private String name; - - @Schema(description = "描述",example = "这是管理员描述", required = true) - private String remark; - - @Schema(description = "创建时间",example = "1700011000110", required = false) - private Long createdAt; - -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java deleted file mode 100644 index db29397..0000000 --- a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/levelhierarchy/LevelHierarchyTreeVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.dongjian.dashboard.back.vo.levelhierarchy; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data -public class LevelHierarchyTreeVO { - - @Schema(description = "层级ID", example = "1") - private Long id; - - @Schema(description = "层级名称", example = "东京支社") - private String name; - - @Schema(description = "层级类型", example = "BRANCH/STORE/AREA/SITE/BUILDING") - private String type; - - @Schema(description = "备注") - private String remark; - - @Schema(description = "父级ID(内存组装用)") - private Long parentId; - - @Schema(description = "子节点") - private List children = new ArrayList<>(); -} diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java new file mode 100644 index 0000000..af26a15 --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/JpMeshHourlyForecasts.java @@ -0,0 +1,133 @@ +package com.dongjian.dashboard.back.weather; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import java.util.List; + +/** + * Japan Weather Association - jp_mesh_hourly_forecasts 数据结构(兼容 error 响应) + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) // 忽略为 null 的字段 +public class JpMeshHourlyForecasts { + + /** 正常返回的元数据 */ + @JsonProperty("metadata") + private Metadata metadata; + + /** 正常返回的结果集 */ + @JsonProperty("results") + private Results results; + + /** 错误返回 */ + @JsonProperty("error") + private ErrorResponse error; + + @Data + public static class Metadata { + @JsonProperty("author") + private String author; + + @JsonProperty("title") + private String title; + + @JsonProperty("detail") + private String detail; + + @JsonProperty("parameter") + private Parameter parameter; + + @JsonProperty("resultset") + private Resultset resultset; + } + + @Data + public static class Parameter { + @JsonProperty("point") + private String point; + + @JsonProperty("format") + private String format; + } + + @Data + public static class Resultset { + @JsonProperty("count") + private int count; + } + + @Data + public static class Results { + @JsonProperty("mesh_code") + private String meshCode; + + @JsonProperty("reference_time") + private String referenceTime; + + @JsonProperty("initial_time") + private String initialTime; + + @JsonProperty("time_zone") + private String timeZone; + + @JsonProperty("elevation") + private String elevation; + + @JsonProperty("data") + private List data; + } + + @Data + public static class WeatherData { + @JsonProperty("time") + private String time; + + @JsonProperty("temperature") + private Double temperature; + + @JsonProperty("sunshine_duration") + private Double sunshineDuration; + + @JsonProperty("wind_speed") + private Double windSpeed; + + @JsonProperty("wind_direction_code") + private Integer windDirectionCode; + + @JsonProperty("wind_direction") + private String windDirection; + + @JsonProperty("precipitation") + private Double precipitation; + + @JsonProperty("snowfall") + private Double snowfall; + + @JsonProperty("humidity") + private Integer humidity; + + @JsonProperty("weather_code") + private Integer weatherCode; + + @JsonProperty("weather") + private String weather; + + @JsonProperty("probability_precipitation") + private Integer probabilityPrecipitation; + } + + /** 错误响应结构 */ + @Data + public static class ErrorResponse { + @JsonProperty("code") + private int code; + + @JsonProperty("title") + private String title; + + @JsonProperty("detail") + private String detail; + } +} + diff --git a/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java new file mode 100644 index 0000000..0fb208b --- /dev/null +++ b/dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/weather/QueryWeather.java @@ -0,0 +1,15 @@ +package com.dongjian.dashboard.back.weather; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class QueryWeather { + + @Schema(description = "latitude",example = "22.54466") + private String lat; + + @Schema(description = "longitude",example = "114.054540") + private String lng; + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java new file mode 100644 index 0000000..f475420 --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/AIService.java @@ -0,0 +1,18 @@ +package com.dongjian.dashboard.back.service; + +import com.dongjian.dashboard.back.common.response.PageInfo; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.ai.AiAskParam; +import com.dongjian.dashboard.back.dto.user.*; +import com.dongjian.dashboard.back.vo.user.UserPageDTO; + +/** + * Agent Service. + */ +public interface AIService { + + SimpleDataResponse ask(AiAskParam param, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse retrieve(AiAskParam param, Long companyId, Long userId, Integer languageType); + +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java index 1414885..e382cc5 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceDataAlarmService.java @@ -5,8 +5,11 @@ import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest; +import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest; import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import com.dongjian.dashboard.back.vo.device.WindowAlertVO; import java.util.List; @@ -22,4 +25,8 @@ public interface DeviceDataAlarmService { SimpleDataResponse handleAlarm(HandleAlarmParams handleAlarmParams, Long userId, Long companyId, Integer languageType); PageInfo getHandleHistory(HandleHistorySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); + + SimpleDataResponse> windowList(WindowAlertQueryRequest searchParams, Long userId, Long companyId, String accessToken, Integer languageType); + + SimpleDataResponse windowDismiss(WindowAlertCloseRequest windowAlertCloseRequest, Long userId, Long companyId, String accessToken, Integer languageType); } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java index b43740b..e8863d9 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/DeviceGroupService.java @@ -29,4 +29,8 @@ public interface DeviceGroupService { SimpleDataResponse getBindedGroupByDevice(Integer deviceInfoId, Long userId, Long companyId, Integer languageType); SimpleDataResponse getBindedDeviceByGroup(Long deviceGroupId, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse addDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse delDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType); } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java deleted file mode 100644 index ca9257f..0000000 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyRoleService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dongjian.dashboard.back.service; - -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; - -import java.util.List; - -/** - * Service. - */ -public interface LevelHierarchyRoleService { - - SimpleDataResponse add(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType); - - SimpleDataResponse edit(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType); - - SimpleDataResponse batchDelete(DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, Long companyId, Long userId, Integer languageType); - - PageInfo getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); - - SimpleDataResponse> getHierarchyTree(Long roleId, Long companyId, Long userId, Integer languageType); -} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java deleted file mode 100644 index a5fd6c6..0000000 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/LevelHierarchyService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dongjian.dashboard.back.service; - -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; - -/** - * Service. - */ -public interface LevelHierarchyService { - - SimpleDataResponse add(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType); - - SimpleDataResponse edit(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType); - - SimpleDataResponse batchDelete(DeleteLevelHierarchyParam deleteLevelHierarchyParam, Long companyId, Long userId, Integer languageType); - - PageInfo getListPage(PageLevelHierarchySearchParam pageSearchParam, Long companyId, Long userId, Integer languageType); - - -} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java index 865a40c..46993c2 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/OverviewService.java @@ -2,6 +2,8 @@ package com.dongjian.dashboard.back.service; import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.vo.data.OverviewVO; +import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts; +import com.dongjian.dashboard.back.weather.QueryWeather; import java.util.List; @@ -12,4 +14,5 @@ public interface OverviewService { SimpleDataResponse> getOverviewInfo(Long userId, Long companyId, Integer languageType, Integer UTCOffset); + SimpleDataResponse getWeatherInfo(QueryWeather queryWeather, Long userId, Long companyId, Integer languageType, Integer utcOffset); } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java index 866df73..f78f9ca 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/CommonOpt.java @@ -138,7 +138,7 @@ public class CommonOpt { } public String buildAuroraJdbcUrl(String dbUrl, String auroraHost) { - String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)"; + String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)"; return dbUrl.replaceAll(regex, "$1" + auroraHost + "$3"); } @@ -203,7 +203,7 @@ public class CommonOpt { if (StringUtils.isNotBlank(apikeyInfo.getAuroraUrl())) { Class.forName("com.mysql.cj.jdbc.Driver"); - String regex = "(jdbc:mysql://)([^/]+)(/data_center_new.*)"; + String regex = "(jdbc:mysql://)([^/]+)(/data_center_aeon_admin.*)"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(dbUrl); String newJdbcUrl = ""; @@ -212,7 +212,7 @@ public class CommonOpt { } try (Connection conn = DriverManager.getConnection( - newJdbcUrl.replace("data_center_new", "third") + "&allowPublicKeyRetrieval=true", + newJdbcUrl.replace("data_center_aeon_admin", "third") + "&allowPublicKeyRetrieval=true", DESUtil.decrypt(apikeyInfo.getAuroraUsername(), Constants.DES_SALT), DESUtil.decrypt(apikeyInfo.getAuroraPassword(), Constants.DES_SALT))) { diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java deleted file mode 100644 index 2db50ee..0000000 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/common/LevelHierarchyTreeBuilder.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.dongjian.dashboard.back.service.common; - -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * 动态层级树构建器(支持从任意层级开始的结构) - * 如果某个 BUILDING 没有对应的 SITE 上级,则该 BUILDING 不会被返回(避免单独楼宇作为根) - */ -public class LevelHierarchyTreeBuilder { - - // 层级顺序 - private static final List TYPE_ORDER = Arrays.asList("BRANCH", "STORE", "AREA", "SITE", "BUILDING"); - - /** - * 从 SQL 返回的所有节点构建树,剔除孤立的 BUILDING - * @param allList SQL 返回的所有节点(每项包含 id,name,type,remark,parentId) - * @return 层级树(roots) - */ - public static List buildHierarchyTree(List allList) { - if (allList == null || allList.isEmpty()) { - return Collections.emptyList(); - } - - // 1) 分组按 type - Map> grouped = - allList.stream().collect(Collectors.groupingBy(LevelHierarchyTreeVO::getType)); - - // 2) 构建 type+id -> node 映射(use list to allow duplicate ids across rows if needed) - Map> typeIdMap = new HashMap<>(); - for (LevelHierarchyTreeVO node : allList) { - String key = typeIdKey(node.getType(), node.getId()); - typeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node); - } - - // 3) 剔除孤立 BUILDING:如果某个 building 的 parentId 指向的 SITE 在数据里不存在,则不要返回该 building(也不作为子节点) - // 这里我们从 allList 中制作一个 filteredList - Set siteKeys = allList.stream() - .filter(n -> "SITE".equals(n.getType())) - .map(n -> typeIdKey(n.getType(), n.getId())) - .collect(Collectors.toSet()); - - List filtered = new ArrayList<>(); - for (LevelHierarchyTreeVO node : allList) { - if ("BUILDING".equals(node.getType())) { - // 如果 building 的 parentId 对应 site 存在,则保留;否则丢弃 - if (node.getParentId() != null) { - String parentSiteKey = typeIdKey("SITE", node.getParentId()); - if (siteKeys.contains(parentSiteKey)) { - filtered.add(node); - } else { - // 父 site 不存在 => 丢弃该孤立 building - } - } else { - // parentId null 的 building 也直接丢弃 - } - } else { - filtered.add(node); - } - } - - // 4) 用 filtered 做后续处理(避免孤立 building 干扰 parent detection) - Map> filteredTypeIdMap = new HashMap<>(); - for (LevelHierarchyTreeVO node : filtered) { - String key = typeIdKey(node.getType(), node.getId()); - filteredTypeIdMap.computeIfAbsent(key, k -> new ArrayList<>()).add(node); - } - - // 5) 构建 parentId -> children 索引(针对每个层级) - Map>> indexByType = new HashMap<>(); - for (String type : TYPE_ORDER) { - List list = filtered.stream() - .filter(n -> type.equals(n.getType())) - .collect(Collectors.toList()); - Map> idx = list.stream() - .filter(n -> n.getParentId() != null) - .collect(Collectors.groupingBy(LevelHierarchyTreeVO::getParentId)); - indexByType.put(type, idx); - } - - // 6) 找 root candidates: - // root = 节点的 parentType 不存在 或 parentId 为 null 或 parent 不在 filtered 集合中 - List rootCandidates = new ArrayList<>(); - for (LevelHierarchyTreeVO node : filtered) { - String parentType = getParentType(node.getType()); - if (parentType == null || node.getParentId() == null) { - // BRANCH 或 没有 parentId => root candidate - rootCandidates.add(node); - } else { - // 检查 parent 是否存在于 filtered - String parentKey = typeIdKey(parentType, node.getParentId()); - if (!filteredTypeIdMap.containsKey(parentKey)) { - rootCandidates.add(node); - } - } - } - - // 7) 去重 rootCandidates(按 type+id 去重) - List rootsUnique = rootCandidates.stream() - .collect(Collectors.collectingAndThen( - Collectors.toMap(n -> typeIdKey(n.getType(), n.getId()), n -> n, (a, b) -> a), - m -> new ArrayList<>(m.values()) - )); - - // 8) 为每个 root 递归构建子树(使用 indexByType) - List roots = new ArrayList<>(); - for (LevelHierarchyTreeVO root : rootsUnique) { - LevelHierarchyTreeVO built = buildSubTreeRecursive(copyNode(root), indexByType); - roots.add(built); - } - - // 9) 按 type 顺序排序根节点(BRANCH 首) - roots.sort(Comparator.comparingInt(n -> typeOrderIndex(n.getType()))); - - // 10) 最终 deep copy,防止引用问题 - return deepCopyList(roots); - } - - /** 递归构造某个节点的子树(依据 indexByType) */ - private static LevelHierarchyTreeVO buildSubTreeRecursive(LevelHierarchyTreeVO parent, - Map>> indexByType) { - String nextType = getNextType(parent.getType()); - if (nextType == null) { - return parent; - } - Map> nextIdx = indexByType.get(nextType); - if (nextIdx != null && parent.getId() != null) { - List children = nextIdx.get(parent.getId()); - if (children != null && !children.isEmpty()) { - List childCopies = new ArrayList<>(); - for (LevelHierarchyTreeVO ch : children) { - LevelHierarchyTreeVO childNode = copyNode(ch); - // 递归为 child 构建更深层次的子树 - LevelHierarchyTreeVO builtChild = buildSubTreeRecursive(childNode, indexByType); - childCopies.add(builtChild); - } - parent.setChildren(childCopies); - } - } - return parent; - } - - /* ----------------- 辅助方法 ------------------ */ - - private static String getParentType(String type) { - int idx = TYPE_ORDER.indexOf(type); - return (idx > 0) ? TYPE_ORDER.get(idx - 1) : null; - } - - private static String getNextType(String type) { - int idx = TYPE_ORDER.indexOf(type); - return (idx >= 0 && idx < TYPE_ORDER.size() - 1) ? TYPE_ORDER.get(idx + 1) : null; - } - - private static String typeIdKey(String type, Long id) { - return (type == null ? "null" : type) + "_" + (id == null ? "null" : id.toString()); - } - - private static LevelHierarchyTreeVO copyNode(LevelHierarchyTreeVO src) { - LevelHierarchyTreeVO copy = new LevelHierarchyTreeVO(); - copy.setId(src.getId()); - copy.setName(src.getName()); - copy.setType(src.getType()); - copy.setRemark(src.getRemark()); - copy.setParentId(src.getParentId()); - copy.setChildren(null); - return copy; - } - - private static List deepCopyList(List list) { - List out = new ArrayList<>(); - for (LevelHierarchyTreeVO n : list) { - out.add(deepCopyNode(n)); - } - return out; - } - - private static LevelHierarchyTreeVO deepCopyNode(LevelHierarchyTreeVO src) { - if (src == null) return null; - LevelHierarchyTreeVO copy = copyNode(src); - if (src.getChildren() != null) { - List ch = new ArrayList<>(); - for (LevelHierarchyTreeVO c : src.getChildren()) { - ch.add(deepCopyNode(c)); - } - copy.setChildren(ch); - } - return copy; - } - - private static int typeOrderIndex(String type) { - switch (type) { - case "BRANCH": return 0; - case "STORE": return 1; - case "AREA": return 2; - case "SITE": return 3; - case "BUILDING": return 4; - default: return 10; - } - } -} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java new file mode 100644 index 0000000..8b3a12b --- /dev/null +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/AIServiceImpl.java @@ -0,0 +1,145 @@ +package com.dongjian.dashboard.back.service.impl; + +import com.alibaba.excel.util.StringUtils; +import com.dongjian.dashboard.back.common.Constants; +import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.ResponseCode; +import com.dongjian.dashboard.back.common.response.SimpleDataResponse; +import com.dongjian.dashboard.back.dto.ai.AiAskParam; +import com.dongjian.dashboard.back.dto.ai.AiAskResponse; +import com.dongjian.dashboard.back.dto.ai.RetrieveResponse; +import com.dongjian.dashboard.back.service.AIService; +import com.dongjian.dashboard.back.service.S3FileService; +import com.dongjian.dashboard.back.util.DESUtil; +import com.dongjian.dashboard.back.vo.s3.TemporaryCredentials; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; +import org.springframework.web.client.ResourceAccessException; +import org.springframework.web.client.RestTemplate; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.sts.StsClient; +import software.amazon.awssdk.services.sts.model.AssumeRoleRequest; +import software.amazon.awssdk.services.sts.model.AssumeRoleResponse; +import software.amazon.awssdk.services.sts.model.Credentials; + +import java.util.HashMap; +import java.util.Map; + +@Service +public class AIServiceImpl implements AIService { + + private static final Logger logger = LoggerFactory.getLogger(AIServiceImpl.class); + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private MsgLanguageChange msgLanguageChange; + + @Value("${ai.api_base}") + private String ASK_BASE_URL; + + + @Override + public SimpleDataResponse ask(AiAskParam param, Long companyId, Long userId, Integer languageType) { + try { + // 参数校验 + if (param == null || StringUtils.isBlank(param.getQuestion())) { + throw new IllegalArgumentException("问题不能为空"); + } + + // 构建请求体 + Map requestBody = new HashMap<>(); + requestBody.put("question", param.getQuestion()); + requestBody.put("topK", param.getTopK() != null ? param.getTopK() : 5); + if (StringUtils.isNotBlank(param.getSession_id())) { + requestBody.put("session_id", param.getSession_id()); + } + + // 设置请求头 + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.set("Company-Id", String.valueOf(companyId)); + headers.set("User-Id", String.valueOf(userId)); + headers.set("Language-Type", String.valueOf(languageType)); + + HttpEntity> requestEntity = new HttpEntity<>(requestBody, headers); + + // 发送POST请求,返回String类型(直接获取对方接口的响应) + ResponseEntity responseEntity = restTemplate.postForEntity( + ASK_BASE_URL+"/ask", + requestEntity, + AiAskResponse.class // 返回原始JSON字符串 + ); + + if (responseEntity.getStatusCode().is2xxSuccessful()) { + // 直接返回对方接口的响应 + return SimpleDataResponse.success(responseEntity.getBody()); + } else { + logger.error("调用Bedrock问答接口失败,状态码:{}", responseEntity.getStatusCode()); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + + }catch (Exception e) { + logger.error("调用Bedrock问答接口异常", e); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR,msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } + + @Override + public SimpleDataResponse retrieve(AiAskParam param, Long companyId, Long userId, Integer languageType) { + try { + // 参数校验 + if (param == null || StringUtils.isBlank(param.getQuestion())) { + throw new IllegalArgumentException("问题不能为空"); + } + + // 构建请求体 + Map requestBody = new HashMap<>(); + requestBody.put("question", param.getQuestion()); + requestBody.put("topK", param.getTopK() != null ? param.getTopK() : 5); + + // 设置请求头 + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.set("Company-Id", String.valueOf(companyId)); + headers.set("User-Id", String.valueOf(userId)); + headers.set("Language-Type", String.valueOf(languageType)); + + HttpEntity> requestEntity = new HttpEntity<>(requestBody, headers); + + // 发送POST请求到检索接口 + ResponseEntity responseEntity = restTemplate.postForEntity( + ASK_BASE_URL+"/retrieve", // 检索接口URL + requestEntity, + RetrieveResponse.class + ); + + if (responseEntity.getStatusCode().is2xxSuccessful()) { + // 返回检索结果对象 + return SimpleDataResponse.success(responseEntity.getBody()); + } else { + logger.error("调用Bedrock检索接口失败,状态码:{}", responseEntity.getStatusCode()); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR, + msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + + } catch (Exception e) { + logger.error("调用Bedrock检索接口异常", e); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR, + msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } +} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java index 2ea3ca1..508e736 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAccumulateServiceImpl.java @@ -71,7 +71,7 @@ public class DeviceDataAccumulateServiceImpl implements DeviceDataAccumulateServ List resultList; pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ACCUMULATE)); - if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + if (null != pageSearchParam.getDeviceGroupId()){ resultList = deviceInfoMapperExt.getDevice4AccumulateDataByGroup(pageSearchParam); } else { resultList = deviceInfoMapperExt.getDevice4AccumulateData(pageSearchParam); diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java index 37fabdd..a0f2bec 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataAlarmServiceImpl.java @@ -9,6 +9,8 @@ import com.dongjian.dashboard.back.dao.ex.*; import com.dongjian.dashboard.back.dto.data.AlarmDataSearchParam; import com.dongjian.dashboard.back.dto.data.HandleAlarmParams; import com.dongjian.dashboard.back.dto.data.HandleHistorySearchParam; +import com.dongjian.dashboard.back.dto.device.WindowAlertCloseRequest; +import com.dongjian.dashboard.back.dto.device.WindowAlertQueryRequest; import com.dongjian.dashboard.back.model.AlertHandleHistory; import com.dongjian.dashboard.back.model.AlertHistory; import com.dongjian.dashboard.back.model.DeviceRawdataRealtime; @@ -16,27 +18,27 @@ import com.dongjian.dashboard.back.service.DeviceDataAlarmService; import com.dongjian.dashboard.back.service.common.CommonOpt; import com.dongjian.dashboard.back.vo.data.DeviceAlarmData; import com.dongjian.dashboard.back.vo.data.HandleHistoryDataVO; +import com.dongjian.dashboard.back.vo.device.WindowAlertVO; import com.github.pagehelper.PageHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.util.*; +import java.util.stream.Collectors; @Service public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService { private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmServiceImpl.class); - @Value("${spring.datasource.url}") - private String dbUrl; - + @Autowired + private DashboardNoticeIgnoredMapperExt dashboardNoticeIgnoredMapperExt; @Autowired private DeviceInfoMapperExt deviceInfoMapperExt; @Autowired @@ -77,7 +79,7 @@ public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService { List resultList; pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_ALARM)); - if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + if (null != pageSearchParam.getDeviceGroupId()){ resultList = deviceInfoMapperExt.getDevice4AlarmDataByGroup(pageSearchParam); } else { resultList = deviceInfoMapperExt.getDevice4AlarmData(pageSearchParam); @@ -165,4 +167,47 @@ public class DeviceDataAlarmServiceImpl implements DeviceDataAlarmService { return new PageInfo<>(list); } + @Override + public SimpleDataResponse> windowList(WindowAlertQueryRequest searchParams, Long userId, Long companyId, String accessToken, Integer languageType) { + List alerts = new ArrayList<>(); + try { + searchParams.setCompanyId(companyId); + alerts = alertHistoryMapperExt.getWindowList(searchParams); + + // 过滤掉当前 AccessToken 已关闭的告警 + String userKey = String.format(Constants.WINDOW_ALERT_IGNORED, userId); + List ignoredList = dashboardNoticeIgnoredMapperExt.getMembersByKey(userKey); + Set ignored = new HashSet<>(ignoredList); + if (!ignored.isEmpty()) { + alerts = alerts.stream() + .filter(a -> !ignored.contains(String.valueOf(a.getAlertId()))) + .collect(Collectors.toList()); + } + + return SimpleDataResponse.success(alerts); + } catch (Exception e) { + logger.error("windowList error", e); + } + return SimpleDataResponse.success(alerts); + } + + @Override + public SimpleDataResponse windowDismiss(WindowAlertCloseRequest windowAlertCloseRequest, Long userId, Long companyId, String accessToken, Integer languageType) { + try { + String userKey = String.format(Constants.WINDOW_ALERT_IGNORED, userId); + long currentTime = System.currentTimeMillis(); + + // 插入表,防止重复 + for (Long alertId : windowAlertCloseRequest.getAlertIdList()){ + dashboardNoticeIgnoredMapperExt.addMember(userKey, String.valueOf(alertId), currentTime); + } + + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("windowDismiss error", e); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java index d20f48f..199016e 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataBaStatusServiceImpl.java @@ -63,7 +63,7 @@ public class DeviceDataBaStatusServiceImpl implements DeviceDataBaStatusService List resultList; pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_STATUS)); - if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + if (null != pageSearchParam.getDeviceGroupId()){ resultList = deviceInfoMapperExt.getDevice4BaStatusDataByGroup(pageSearchParam); } else { resultList = deviceInfoMapperExt.getDevice4BaStatusData(pageSearchParam); diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java index 783f7b6..22823c9 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceDataMeasureServiceImpl.java @@ -75,7 +75,7 @@ public class DeviceDataMeasureServiceImpl implements DeviceDataMeasureService { List resultList; pageSearchParam.setTypeIdList(Constants.CATEGORY_DEVICE_TYPE_MAP.get(Constants.CATEGORY_MEASURE)); - if (null != pageSearchParam.getMonitoringPointCategoryGroupId()){ + if (null != pageSearchParam.getDeviceGroupId()){ resultList = deviceInfoMapperExt.getDevice4MeasureDataByGroup(pageSearchParam); } else { resultList = deviceInfoMapperExt.getDevice4MeasureData(pageSearchParam); diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java index ebda27e..b91ecba 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceGroupServiceImpl.java @@ -234,10 +234,10 @@ public class DeviceGroupServiceImpl implements DeviceGroupService { return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device and group are not in the same building"); } - Integer groupType = deviceGroup.getGroupType(); - if (groupType == null || isNotTypeMatch(groupType, deviceTypeId)) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "groupTypeNotMatch")); - } +// Integer groupType = deviceGroup.getGroupType(); +// if (groupType == null || isNotTypeMatch(groupType, deviceTypeId)) { +// return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "groupTypeNotMatch")); +// } } } @@ -281,7 +281,8 @@ public class DeviceGroupServiceImpl implements DeviceGroupService { return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not set"); } - Integer groupType = deviceGroup.getGroupType(); +// Integer groupType = deviceGroup.getGroupType(); + Integer groupType = null; Long groupBuildingId = deviceGroup.getBuildingId(); if (groupType == null || groupBuildingId == null) { return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Invalid device group info"); @@ -344,4 +345,64 @@ public class DeviceGroupServiceImpl implements DeviceGroupService { public SimpleDataResponse> getBindedDeviceByGroup(Long deviceGroupId, Long userId, Long companyId, Integer languageType) { return SimpleDataResponse.success(deviceGroupMapperExt.getBindedDeviceByGroup(deviceGroupId)); } + + @Override + @Transactional + public SimpleDataResponse addDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType) { + try { + // 1. 获取目标分组信息 + DeviceGroup deviceGroup = deviceGroupMapperExt.selectByPrimaryKey(bindDeviceForGroupParams.getDeviceGroupId()); + if (deviceGroup == null || deviceGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not set"); + } + + List deviceInfoIdList = CommonUtil.commaStr2LongList(bindDeviceForGroupParams.getDeviceInfoIds()); + + // 4. 插入新绑定关系 + if (CollectionUtils.isNotEmpty(deviceInfoIdList)) { + for (Long deviceInfoId : deviceInfoIdList){ + DeviceGroupRelation deviceGroupRelation = new DeviceGroupRelation(); + deviceGroupRelation.setDeviceGroupId(bindDeviceForGroupParams.getDeviceGroupId()); + deviceGroupRelation.setDeviceInfoId(deviceInfoId.intValue()); + deviceGroupRelationMapperExt.insertSelective(deviceGroupRelation); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("addDeviceForGroup error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + + @Override + @Transactional + public SimpleDataResponse delDeviceForGroup(BindDeviceForGroupParams bindDeviceForGroupParams, Long userId, Long companyId, Integer languageType) { + try { + // 1. 获取目标分组信息 + DeviceGroup deviceGroup = deviceGroupMapperExt.selectByPrimaryKey(bindDeviceForGroupParams.getDeviceGroupId()); + if (deviceGroup == null || deviceGroup.getFlag() != 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Device group not set"); + } + + List deviceInfoIdList = CommonUtil.commaStr2LongList(bindDeviceForGroupParams.getDeviceInfoIds()); + + // 4. 解除绑定关系 + if (CollectionUtils.isNotEmpty(deviceInfoIdList)) { + for (Long deviceInfoId : deviceInfoIdList){ + DeviceGroupRelationExample example = new DeviceGroupRelationExample(); + example.createCriteria().andDeviceGroupIdEqualTo(bindDeviceForGroupParams.getDeviceGroupId()).andDeviceInfoIdEqualTo(deviceInfoId.intValue()); + deviceGroupRelationMapperExt.deleteByExample(example); + } + } + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("delDeviceForGroup error", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } + } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java deleted file mode 100644 index 5a74759..0000000 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyRoleServiceImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.dongjian.dashboard.back.service.impl; - -import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.ResponseCode; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.dao.ex.DashboardLevelRoleMapperExt; -import com.dongjian.dashboard.back.dao.ex.LevelHierarchyMapperExt; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyRoleParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchyRoleSearchParam; -import com.dongjian.dashboard.back.model.DashboardLevelRole; -import com.dongjian.dashboard.back.model.DashboardLevelRoleExample; -import com.dongjian.dashboard.back.service.LevelHierarchyRoleService; -import com.dongjian.dashboard.back.service.common.CommonOpt; -import com.dongjian.dashboard.back.service.common.LevelHierarchyTreeBuilder; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyRolePageDTO; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyTreeVO; -import com.github.pagehelper.PageHelper; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.transaction.interceptor.TransactionAspectSupport; - -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class LevelHierarchyRoleServiceImpl implements LevelHierarchyRoleService { - - private static Logger logger = LoggerFactory.getLogger(LevelHierarchyRoleServiceImpl.class); - - @Autowired - private DashboardLevelRoleMapperExt dashboardLevelRoleMapperExt; - @Autowired - private LevelHierarchyMapperExt levelHierarchyMapperExt; - @Autowired - private MsgLanguageChange msgLanguageChange; - @Autowired - private CommonOpt commonOpt; - - - - @Override - @Transactional - public SimpleDataResponse add(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType) { - try { - param.setCompanyId(companyId); - param.setId(null); - //校验参数 - SimpleDataResponse checkResult = checkParam(param, languageType); - if (200 != checkResult.getCode()) { - return checkResult; - } - //重复校验 - if (checkExist(param) > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); - } - - long currentUnix = System.currentTimeMillis(); - - DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); - BeanUtils.copyProperties(param, dashboardLevelRole); - dashboardLevelRole.setCreatedBy(userId); - dashboardLevelRole.setCreatedAt(currentUnix); - - dashboardLevelRoleMapperExt.insertSelective(dashboardLevelRole); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("添加层级角色报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - private long checkExist(OptLevelHierarchyRoleParam param) { - return dashboardLevelRoleMapperExt.checkExist(param); - } - - private SimpleDataResponse checkParam(OptLevelHierarchyRoleParam param, Integer languageType) { - if(StringUtils.isBlank(param.getName()) || param.getName().length() > 100){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [name] error"); - } - if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 255){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [remark] length error"); - } - return SimpleDataResponse.success(); - } - - @Override - @Transactional - public SimpleDataResponse edit(OptLevelHierarchyRoleParam param, Long companyId, Long userId, Integer languageType) { - try { -// param.setCompanyId(companyId); - //校验参数 - SimpleDataResponse checkResult = checkParam(param, languageType); - if (200 != checkResult.getCode()) { - return checkResult; - } - - DashboardLevelRole oldBR= dashboardLevelRoleMapperExt.selectByPrimaryKey(param.getId()); - //不存在, 这基本不可能,给个英文提示就行,省得翻译 - if (ObjectUtils.isEmpty(oldBR) || 1 == oldBR.getFlag()){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); - } - - param.setCompanyId(oldBR.getCompanyId()); - //重复校验 - if (checkExist(param) > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); - } - - long currentUnix = System.currentTimeMillis(); - DashboardLevelRole dashboardLevelRole = new DashboardLevelRole(); - BeanUtils.copyProperties(param, dashboardLevelRole); - dashboardLevelRole.setId(param.getId()); - dashboardLevelRole.setUpdatedAt(currentUnix); - dashboardLevelRoleMapperExt.updateByPrimaryKeySelective(dashboardLevelRole); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("编辑层级角色报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - @Override - @Transactional - public SimpleDataResponse batchDelete(DeleteLevelHierarchyRoleParam deleteLevelHierarchyRoleParam, Long companyId, Long userId, - Integer languageType) { - try { - List idList = Arrays.stream(deleteLevelHierarchyRoleParam.getIds().split(",")) - .map(Long::valueOf) - .collect(Collectors.toList()); - - // 检查是否有下级 - long checkCount = dashboardLevelRoleMapperExt.checkBound(idList); - if (checkCount > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "roleHasBinded")); - } - - // 执行删除 - DashboardLevelRoleExample roleExample = new DashboardLevelRoleExample(); - DashboardLevelRoleExample.Criteria roleCriteria = roleExample.createCriteria(); - roleCriteria.andIdIn(idList).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); - DashboardLevelRole record = new DashboardLevelRole(); - record.setFlag(1); - dashboardLevelRoleMapperExt.updateByExampleSelective(record, roleExample); - - dashboardLevelRoleMapperExt.deleteUserRelation(idList); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("删除层级角色报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - @Override - public PageInfo getListPage(PageLevelHierarchyRoleSearchParam pageSearchParam, Long companyId, Long userId, - Integer languageType) { - //list防${}注入 - if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { - pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); - } else { - pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); - } - - PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); - List resultList = dashboardLevelRoleMapperExt.getListPage(pageSearchParam); - return new PageInfo<>(resultList); - } - - @Override - public SimpleDataResponse> getHierarchyTree(Long roleId, Long companyId, Long userId, Integer languageType) { - //先判断当前用户有没有物件管理权限,有物件管理权限就是全部,没有物件管理权限就看绑定的层级角色 - int checkPermission = dashboardLevelRoleMapperExt.checkAdministrativePrivileges(userId); - - List allList = new ArrayList<>(); - if (checkPermission > 0) { - allList = levelHierarchyMapperExt.selectAllHierarchyByCompanyId(companyId); - } else { - - } - List tree = LevelHierarchyTreeBuilder.buildHierarchyTree(allList); - - return SimpleDataResponse.success(tree); - } - -} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java deleted file mode 100644 index d58acae..0000000 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/LevelHierarchyServiceImpl.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.dongjian.dashboard.back.service.impl; - -import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; -import com.dongjian.dashboard.back.common.response.PageInfo; -import com.dongjian.dashboard.back.common.response.ResponseCode; -import com.dongjian.dashboard.back.common.response.SimpleDataResponse; -import com.dongjian.dashboard.back.dao.ex.LevelHierarchyMapperExt; -import com.dongjian.dashboard.back.dto.levelhierarchy.DeleteLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.OptLevelHierarchyParam; -import com.dongjian.dashboard.back.dto.levelhierarchy.PageLevelHierarchySearchParam; -import com.dongjian.dashboard.back.service.LevelHierarchyService; -import com.dongjian.dashboard.back.service.common.CommonOpt; -import com.dongjian.dashboard.back.vo.levelhierarchy.LevelHierarchyPageDTO; -import com.github.pagehelper.PageHelper; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.transaction.interceptor.TransactionAspectSupport; - -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class LevelHierarchyServiceImpl implements LevelHierarchyService { - - private static Logger logger = LoggerFactory.getLogger(LevelHierarchyServiceImpl.class); - - @Autowired - private LevelHierarchyMapperExt levelHierarchyMapperExt; - @Autowired - private MsgLanguageChange msgLanguageChange; - @Autowired - private CommonOpt commonOpt; - - - - @Override - @Transactional - public SimpleDataResponse add(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType) { - try { - param.setCompanyId(companyId); - param.setId(null); - //校验参数 - SimpleDataResponse checkResult = checkParam(param, languageType); - if (200 != checkResult.getCode()) { - return checkResult; - } - //重复校验 - if (checkExist(param) > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); - } - - long currentUnix = System.currentTimeMillis(); - param.setCreatedBy(userId); - param.setCreatedAt(currentUnix); - - levelHierarchyMapperExt.insertHierarchy(param); - - insertRelation(param.getType(), param.getParentIdList(), param.getId(), param.getCreatedBy(), param.getCreatedAt()); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("添加层级报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - private void insertRelation(String type, List parentIdList, Long childId, Long createdBy, Long createdAt) { - String relationType = switch (type) { - case "STORE" -> "BRANCH_STORE"; - case "AREA" -> "STORE_AREA"; - case "SITE" -> "AREA_SITE"; - case "BUILDING" -> "SITE_BUILDING"; - default -> null; - }; - if (null != relationType){ - levelHierarchyMapperExt.deleteRelations(relationType, childId); - if (CollectionUtils.isNotEmpty(parentIdList)) { - levelHierarchyMapperExt.insertHierarchyRelation(relationType, parentIdList, childId, createdBy, createdAt); - } - } - } - - private long checkExist(OptLevelHierarchyParam param) { - return levelHierarchyMapperExt.checkExist(param); - } - - private SimpleDataResponse checkParam(OptLevelHierarchyParam param, Integer languageType) { - if(StringUtils.isBlank(param.getLevelHierarchyName()) || param.getLevelHierarchyName().length() > 255){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [levelHierarchyName] error"); - } - if(StringUtils.isBlank(param.getType())){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [type] error"); - } else if(!param.getType().equals("BRANCH") && !param.getType().equals("STORE") && !param.getType().equals("AREA") && !param.getType().equals("SITE")){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [type] error"); - } - if(StringUtils.isNotBlank(param.getRemark()) && param.getRemark().length() > 255){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [remark] length error"); - } - if (!param.getType().equals("BRANCH") && CollectionUtils.isEmpty(param.getParentIdList())){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "parentIdList is required"); - } - return SimpleDataResponse.success(); - } - - @Override - @Transactional - public SimpleDataResponse edit(OptLevelHierarchyParam param, Long companyId, Long userId, Integer languageType) { - try { -// param.setCompanyId(companyId); - //校验参数 - SimpleDataResponse checkResult = checkParam(param, languageType); - if (200 != checkResult.getCode()) { - return checkResult; - } - - long exist = levelHierarchyMapperExt.checkOld(param); - //不存在, 这基本不可能,给个英文提示就行,省得翻译 - if (0 == exist){ - return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); - } - - //重复校验 - if (checkExist(param) > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "alreadyExists")); - } - - long currentUnix = System.currentTimeMillis(); - param.setUpdatedAt(currentUnix); - - levelHierarchyMapperExt.updateHierarchy(param); - - insertRelation(param.getType(), param.getParentIdList(), param.getId(), userId, currentUnix); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("编辑层级报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - @Override - @Transactional - public SimpleDataResponse batchDelete(DeleteLevelHierarchyParam deleteLevelHierarchyParam, Long companyId, Long userId, - Integer languageType) { - try { - List idList = Arrays.stream(deleteLevelHierarchyParam.getIds().split(",")) - .map(Long::valueOf) - .collect(Collectors.toList()); - - // 检查是否有下级 - Long childCount = levelHierarchyMapperExt.countChildrenByType(deleteLevelHierarchyParam.getType(), idList); - if (childCount != null && childCount > 0) { - return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "hasChildLevel")); - } - - // 执行删除 - levelHierarchyMapperExt.deleteHierarchyByType(deleteLevelHierarchyParam.getType(), idList); - - return SimpleDataResponse.success(); - } catch (Exception e) { - logger.error("删除层级报错", e); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return new SimpleDataResponse(ResponseCode.SERVER_ERROR, e.getMessage()); - } - } - - @Override - public PageInfo getListPage(PageLevelHierarchySearchParam pageSearchParam, Long companyId, Long userId, - Integer languageType) { - //list防${}注入 - if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) { - pageSearchParam.setCompanyIdList(Collections.singletonList(companyId)); - } else { - pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds())); - } - - PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); - List resultList = levelHierarchyMapperExt.getListPage(pageSearchParam); - return new PageInfo<>(resultList); - } - -} diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java index 7d5394a..7d03af2 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java @@ -2,20 +2,27 @@ package com.dongjian.dashboard.back.service.impl; import com.dongjian.dashboard.back.common.Constants; import com.dongjian.dashboard.back.common.language.msg.MsgLanguageChange; +import com.dongjian.dashboard.back.common.response.ResponseCode; import com.dongjian.dashboard.back.common.response.SimpleDataResponse; import com.dongjian.dashboard.back.dao.ex.DeviceRawdataRealtimeMapperExt; import com.dongjian.dashboard.back.service.OverviewService; import com.dongjian.dashboard.back.service.common.CommonOpt; -import com.dongjian.dashboard.back.util.CommonUtil; import com.dongjian.dashboard.back.vo.data.OverviewInfo; import com.dongjian.dashboard.back.vo.data.OverviewVO; +import com.dongjian.dashboard.back.weather.JpMeshHourlyForecasts; +import com.dongjian.dashboard.back.weather.QueryWeather; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; import java.time.Clock; import java.time.LocalDate; import java.time.ZoneOffset; @@ -28,6 +35,11 @@ public class OverviewServiceImpl implements OverviewService { private static final Logger logger = LoggerFactory.getLogger(OverviewServiceImpl.class); + @Value("${weather.jwa.apikey}") + private String weatherApiKey; + @Value("${weather.jwa.x-apikey}") + private String weatherXApiKey; + @Autowired @@ -140,4 +152,46 @@ public class OverviewServiceImpl implements OverviewService { result.sort(Comparator.comparing(OverviewVO::getBuildingId).reversed()); return result; } + + @Override + public SimpleDataResponse getWeatherInfo(QueryWeather queryWeather, Long userId, Long companyId, Integer languageType, Integer utcOffset) { + try { + String url = String.format( + "https://api.jwa.or.jp/v3/jpmesh/forecasts/pro/hourly/point/%s,%s.json", + queryWeather.getLat(), queryWeather.getLng() + ); +// String url = String.format( +// "https://api.jwa.or.jp/v3/jpmesh/forecasts/public/daily/point/%s,%s.json", +// queryWeather.getLat(), queryWeather.getLng() +// ); + + logger.info("getWeatherInfo url: {}", url); + + HttpClient client = HttpClient.newHttpClient(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create(url)) + .header("Apikey", weatherApiKey) + .header("X-api-key", weatherXApiKey) + .header("Content-Type", "application/json") + .GET() + .build(); + + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + logger.info("getWeatherInfo http code: {}", response.statusCode()); + if (response.statusCode() != 200) { + String errorBody = response.body(); + logger.error("getWeatherInfo failed, response: {}", errorBody); + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR, errorBody != null ? errorBody : ResponseCode.SERVER_ERROR_MSG); + } else { + ObjectMapper mapper = new ObjectMapper(); + JpMeshHourlyForecasts result = mapper.readValue(response.body(), JpMeshHourlyForecasts.class); + return SimpleDataResponse.success(result); + } + } catch (Exception e) { + logger.error("HTTP 请求失败: " + e.getMessage()); + } + + return SimpleDataResponse.fail(ResponseCode.SERVER_ERROR, ResponseCode.SERVER_ERROR_MSG); + } + } diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java index 737957a..0645fc6 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/RoleServiceImpl.java @@ -170,6 +170,12 @@ public class RoleServiceImpl implements RoleService { if (ObjectUtils.isEmpty(oldBR) || 1 == oldBR.getFlag()){ return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); } + //不能处理自身角色 + Long selfRoleId = basicRoleMapperExt.getRoleIdByUserId(userId); + if (selfRoleId.equals(param.getRoleId())){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "processOwnRole")); + } + /**一些权限校验操作**/ try { List selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); @@ -212,6 +218,13 @@ public class RoleServiceImpl implements RoleService { Integer languageType) { try { List idList = Arrays.asList(deleteRoleParam.getRoleIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); + + //不能处理自身角色 + Long selfRoleId = basicRoleMapperExt.getRoleIdByUserId(userId); + if (idList.contains(selfRoleId)){ + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "processOwnRole")); + } + //先判断该角色有没有用户绑定 BasicRoleUserRelationExample basicRoleUserRelationExample = new BasicRoleUserRelationExample(); BasicRoleUserRelationExample.Criteria criteria = basicRoleUserRelationExample.createCriteria(); diff --git a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java index bff70e6..0d06e5b 100644 --- a/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java +++ b/dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java @@ -117,6 +117,7 @@ public class UserServiceImpl implements UserService { String rawPwd = generateRandomPwd(); basicUser.setPassword(DESUtil.encrypt(rawPwd, basicUser.getSalt())); basicUser.setUserType(2); + basicUser.setCreatePlatform(1); basicUserMapperExt.insertSelective(basicUser); diff --git a/dongjian-dashboard-back-util/pom.xml b/dongjian-dashboard-back-util/pom.xml index 47871f2..011be30 100644 --- a/dongjian-dashboard-back-util/pom.xml +++ b/dongjian-dashboard-back-util/pom.xml @@ -75,6 +75,12 @@ 1.5.0-b01 + + org.springframework.security + spring-security-oauth2-authorization-server + 1.5.1 + + software.amazon.awssdk diff --git a/pom.xml b/pom.xml index 0e9c101..c0b41d6 100644 --- a/pom.xml +++ b/pom.xml @@ -326,6 +326,9 @@ datacenter-storeage/ arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + 5flwNuRxpzdtZOQ3u5yDkbZRwlVmhvzj + A69F3epxEhPtTVrMAdM7T4zGhLa6Y4 + stg @@ -381,6 +384,9 @@ datacenter-storeage/ arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + 5flwNuRxpzdtZOQ3u5yDkbZRwlVmhvzj + A69F3epxEhPtTVrMAdM7T4zGhLa6Y4 + stg @@ -436,6 +442,9 @@ tokyobuild-stg-databucket-923770123186 datacenter-storeage/ arn:aws:iam::923770123186:role/tokyo-build-access-ec2-role + + 5flwNuRxpzdtZOQ3u5yDkbZRwlVmhvzj + A69F3epxEhPtTVrMAdM7T4zGhLa6Y4 stg