From a8bc50f67ca4b3a90ec78d1c753a334078a77a87 Mon Sep 17 00:00:00 2001 From: xxmfl <34223241+xxmfl@users.noreply.github.com> Date: Thu, 2 Sep 2021 10:08:27 +0800 Subject: [PATCH] =?UTF-8?q?2021=E5=B9=B49=E6=9C=882=E6=97=A510:07:12=201.?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202.4G=E5=BC=80=E5=85=B3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spring-boot/.gitignore | 39 +- .../.mvn/wrapper/MavenWrapperDownloader.java | 117 + spring-boot/.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 50710 bytes .../.mvn/wrapper/maven-wrapper.properties | 2 + spring-boot/mvnw | 310 +++ spring-boot/mvnw.cmd | 182 ++ spring-boot/pom.xml | 9 +- spring-boot/ruoyi-admin/pom.xml | 25 +- .../main/java/com/ruoyi/RuoYiApplication.java | 10 +- .../com/ruoyi/RuoYiServletInitializer.java | 8 +- .../controller/common/CaptchaController.java | 25 +- .../controller/common/CommonController.java | 49 +- .../controller/monitor/CacheController.java | 9 +- .../controller/monitor/ServerController.java | 8 +- .../monitor/SysLogininforController.java | 18 +- .../monitor/SysOperlogController.java | 18 +- .../monitor/SysUserOnlineController.java | 39 +- .../system/SysConfigController.java | 36 +- .../controller/system/SysDeptController.java | 58 +- .../system/SysDictDataController.java | 33 +- .../system/SysDictTypeController.java | 36 +- .../controller/system/SysLoginController.java | 42 +- .../controller/system/SysMenuController.java | 56 +- .../system/SysNoticeController.java | 21 +- .../controller/system/SysPostController.java | 43 +- .../system/SysProfileController.java | 36 +- .../controller/system/SysRoleController.java | 59 +- .../controller/system/SysUserController.java | 84 +- .../controller/tool/SwaggerController.java | 8 +- .../web/controller/tool/TestController.java | 78 +- .../ruoyi/web/core/config/SwaggerConfig.java | 33 +- .../src/main/resources/application-druid.yml | 110 +- .../src/main/resources/application.yml | 66 +- .../main/resources/i18n/messages.properties | 5 - .../src/main/resources/logback.xml | 92 +- .../main/resources/mybatis/mybatis-config.xml | 22 +- spring-boot/ruoyi-common/pom.xml | 27 +- .../ruoyi/common/annotation/DataScope.java | 5 +- .../ruoyi/common/annotation/DataSource.java | 8 +- .../com/ruoyi/common/annotation/Excel.java | 32 +- .../com/ruoyi/common/annotation/Excels.java | 5 +- .../java/com/ruoyi/common/annotation/Log.java | 11 +- .../ruoyi/common/annotation/RepeatSubmit.java | 6 +- .../com/ruoyi/common/config/RuoYiConfig.java | 74 +- .../com/ruoyi/common/config/WxConfig.java | 36 + .../com/ruoyi/common/config/WxMpConfig.java | 50 + .../com/ruoyi/common/config/WxProperties.java | 69 + .../com/ruoyi/common/constant/Constants.java | 11 +- .../ruoyi/common/constant/GenConstants.java | 165 +- .../com/ruoyi/common/constant/HttpStatus.java | 5 +- .../common/constant/ScheduleConstants.java | 34 +- .../ruoyi/common/constant/UserConstants.java | 69 +- .../core/controller/BaseController.java | 34 +- .../ruoyi/common/core/domain/AjaxResult.java | 84 +- .../ruoyi/common/core/domain/BaseEntity.java | 79 +- .../ruoyi/common/core/domain/TreeEntity.java | 55 +- .../ruoyi/common/core/domain/TreeSelect.java | 45 +- .../common/core/domain/entity/SysDept.java | 160 +- .../core/domain/entity/SysDictData.java | 133 +- .../core/domain/entity/SysDictType.java | 70 +- .../common/core/domain/entity/SysMenu.java | 200 +- .../common/core/domain/entity/SysRole.java | 172 +- .../common/core/domain/entity/SysUser.java | 259 +- .../common/core/domain/model/LoginBody.java | 29 +- .../common/core/domain/model/LoginUser.java | 97 +- .../common/core/domain/model/MpLoginBody.java | 17 + .../ruoyi/common/core/page/PageDomain.java | 51 +- .../ruoyi/common/core/page/TableDataInfo.java | 55 +- .../ruoyi/common/core/page/TableSupport.java | 11 +- .../ruoyi/common/core/redis/RedisCache.java | 86 +- .../ruoyi/common/core/text/CharsetKit.java | 65 +- .../com/ruoyi/common/core/text/Convert.java | 573 ++-- .../ruoyi/common/core/text/StrFormatter.java | 46 +- .../ruoyi/common/enums/BusinessStatus.java | 6 +- .../com/ruoyi/common/enums/BusinessType.java | 7 +- .../ruoyi/common/enums/DataSourceType.java | 5 +- .../com/ruoyi/common/enums/HttpMethod.java | 16 +- .../com/ruoyi/common/enums/OperatorType.java | 5 +- .../com/ruoyi/common/enums/UserStatus.java | 14 +- .../ruoyi/common/exception/BaseException.java | 41 +- .../common/exception/CustomException.java | 20 +- .../common/exception/DemoModeException.java | 8 +- .../ruoyi/common/exception/UtilException.java | 14 +- .../common/exception/file/FileException.java | 8 +- .../FileNameLengthLimitExceededException.java | 10 +- .../file/FileSizeLimitExceededException.java | 10 +- .../file/InvalidExtensionException.java | 36 +- .../common/exception/job/TaskException.java | 17 +- .../exception/user/CaptchaException.java | 8 +- .../user/CaptchaExpireException.java | 8 +- .../common/exception/user/UserException.java | 8 +- .../user/UserPasswordNotMatchException.java | 8 +- .../ruoyi/common/filter/RepeatableFilter.java | 25 +- .../filter/RepeatedlyRequestWrapper.java | 30 +- .../com/ruoyi/common/filter/XssFilter.java | 42 +- .../filter/XssHttpServletRequestWrapper.java | 47 +- .../java/com/ruoyi/common/utils/Arith.java | 55 +- .../com/ruoyi/common/utils/DateUtils.java | 72 +- .../com/ruoyi/common/utils/DictUtils.java | 101 +- .../com/ruoyi/common/utils/ExceptionUtil.java | 16 +- .../java/com/ruoyi/common/utils/LogUtils.java | 11 +- .../com/ruoyi/common/utils/MessageUtils.java | 8 +- .../com/ruoyi/common/utils/SecurityUtils.java | 42 +- .../com/ruoyi/common/utils/ServletUtils.java | 61 +- .../com/ruoyi/common/utils/StringUtils.java | 252 +- .../java/com/ruoyi/common/utils/Threads.java | 62 +- .../ruoyi/common/utils/VerifyCodeUtils.java | 80 +- .../ruoyi/common/utils/bean/BeanUtils.java | 58 +- .../common/utils/file/FileTypeUtils.java | 38 +- .../common/utils/file/FileUploadUtils.java | 102 +- .../ruoyi/common/utils/file/FileUtils.java | 104 +- .../ruoyi/common/utils/file/ImageUtils.java | 51 +- .../common/utils/file/MimeTypeUtils.java | 23 +- .../ruoyi/common/utils/html/EscapeUtil.java | 81 +- .../ruoyi/common/utils/html/HTMLFilter.java | 211 +- .../ruoyi/common/utils/http/HttpHelper.java | 33 +- .../ruoyi/common/utils/http/HttpUtils.java | 148 +- .../ruoyi/common/utils/ip/AddressUtils.java | 24 +- .../com/ruoyi/common/utils/ip/IpUtils.java | 89 +- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 576 ++-- .../common/utils/reflect/ReflectUtils.java | 225 +- .../com/ruoyi/common/utils/sign/Base64.java | 128 +- .../com/ruoyi/common/utils/sign/Md5Utils.java | 38 +- .../common/utils/spring/SpringUtils.java | 49 +- .../com/ruoyi/common/utils/sql/SqlUtil.java | 14 +- .../com/ruoyi/common/utils/uuid/IdUtils.java | 25 +- .../com/ruoyi/common/utils/uuid/UUID.java | 163 +- spring-boot/ruoyi-framework/pom.xml | 8 +- .../framework/aspectj/DataScopeAspect.java | 68 +- .../framework/aspectj/DataSourceAspect.java | 28 +- .../ruoyi/framework/aspectj/LogAspect.java | 100 +- .../framework/config/ApplicationConfig.java | 7 +- .../ruoyi/framework/config/CaptchaConfig.java | 13 +- .../ruoyi/framework/config/DruidConfig.java | 52 +- .../config/FastJson2JsonRedisSerializer.java | 30 +- .../ruoyi/framework/config/FilterConfig.java | 14 +- .../framework/config/KaptchaTextCreator.java | 38 +- .../ruoyi/framework/config/MyBatisConfig.java | 64 +- .../ruoyi/framework/config/RedisConfig.java | 10 +- .../framework/config/ResourcesConfig.java | 14 +- .../framework/config/SecurityConfig.java | 25 +- .../ruoyi/framework/config/ServerConfig.java | 14 +- .../framework/config/ThreadPoolConfig.java | 16 +- .../config/properties/DruidProperties.java | 8 +- .../datasource/DynamicDataSource.java | 12 +- .../DynamicDataSourceContextHolder.java | 16 +- .../interceptor/RepeatSubmitInterceptor.java | 20 +- .../impl/SameUrlDataInterceptor.java | 41 +- .../ruoyi/framework/manager/AsyncManager.java | 20 +- .../framework/manager/ShutdownManager.java | 17 +- .../manager/factory/AsyncFactory.java | 41 +- .../filter/JwtAuthenticationTokenFilter.java | 12 +- .../handle/AuthenticationEntryPointImpl.java | 9 +- .../handle/LogoutSuccessHandlerImpl.java | 14 +- .../ruoyi/framework/web/domain/Server.java | 79 +- .../framework/web/domain/server/Cpu.java | 41 +- .../framework/web/domain/server/Jvm.java | 51 +- .../framework/web/domain/server/Mem.java | 26 +- .../framework/web/domain/server/Sys.java | 35 +- .../framework/web/domain/server/SysFile.java | 47 +- .../web/exception/GlobalExceptionHandler.java | 38 +- .../framework/web/service/AuthService.java | 106 + .../web/service/PermissionService.java | 85 +- .../web/service/SysLoginService.java | 120 +- .../web/service/SysPermissionService.java | 30 +- .../framework/web/service/TokenService.java | 59 +- .../web/service/UserDetailsServiceImpl.java | 42 +- spring-boot/ruoyi-generator/pom.xml | 9 + .../com/ruoyi/generator/SggCodeGenerator.java | 70 + .../com/ruoyi/generator/config/GenConfig.java | 47 +- .../generator/controller/GenController.java | 45 +- .../com/ruoyi/generator/domain/GenTable.java | 263 +- .../generator/domain/GenTableColumn.java | 259 +- .../mapper/GenTableColumnMapper.java | 18 +- .../generator/mapper/GenTableMapper.java | 24 +- .../service/GenTableColumnServiceImpl.java | 72 +- .../service/GenTableServiceImpl.java | 220 +- .../service/IGenTableColumnService.java | 14 +- .../generator/service/IGenTableService.java | 34 +- .../com/ruoyi/generator/util/GenUtils.java | 126 +- .../generator/util/VelocityInitializer.java | 16 +- .../ruoyi/generator/util/VelocityUtils.java | 163 +- .../src/main/resources/generator.yml | 4 +- .../mapper/generator/GenTableColumnMapper.xml | 162 +- .../mapper/generator/GenTableMapper.xml | 337 +-- .../main/resources/vm/java/controller.java.vm | 53 +- .../src/main/resources/vm/java/domain.java.vm | 126 +- .../src/main/resources/vm/java/mapper.java.vm | 68 +- .../main/resources/vm/java/service.java.vm | 18 +- .../resources/vm/java/serviceImpl.java.vm | 176 +- .../main/resources/vm/java/sub-domain.java.vm | 104 +- .../src/main/resources/vm/js/api.js.vm | 56 +- .../main/resources/vm/vue/index-tree.vue.vm | 1063 ++++---- .../src/main/resources/vm/vue/index.vue.vm | 1304 ++++----- .../src/main/resources/vm/xml/mapper.xml.vm | 219 +- .../ruoyi/quartz/config/ScheduleConfig.java | 9 +- .../quartz/controller/SysJobController.java | 36 +- .../controller/SysJobLogController.java | 23 +- .../java/com/ruoyi/quartz/domain/SysJob.java | 122 +- .../com/ruoyi/quartz/domain/SysJobLog.java | 118 +- .../ruoyi/quartz/mapper/SysJobLogMapper.java | 16 +- .../com/ruoyi/quartz/mapper/SysJobMapper.java | 20 +- .../quartz/service/ISysJobLogService.java | 16 +- .../ruoyi/quartz/service/ISysJobService.java | 28 +- .../service/impl/SysJobLogServiceImpl.java | 34 +- .../service/impl/SysJobServiceImpl.java | 102 +- .../java/com/ruoyi/quartz/task/RyTask.java | 14 +- .../ruoyi/quartz/util/AbstractQuartzJob.java | 36 +- .../java/com/ruoyi/quartz/util/CronUtils.java | 30 +- .../com/ruoyi/quartz/util/JobInvokeUtil.java | 95 +- .../QuartzDisallowConcurrentExecution.java | 9 +- .../ruoyi/quartz/util/QuartzJobExecution.java | 9 +- .../com/ruoyi/quartz/util/ScheduleUtils.java | 30 +- .../mapper/quartz/SysJobLogMapper.xml | 168 +- .../resources/mapper/quartz/SysJobMapper.xml | 209 +- spring-boot/ruoyi-system/pom.xml | 24 +- .../controller/IotCategoryController.java | 27 +- .../controller/IotDeviceController.java | 149 +- .../controller/IotDeviceSetController.java | 86 +- .../controller/IotDeviceStatusController.java | 81 +- .../IotDeviceUserRelationController.java | 97 + .../system/controller/IotGroupController.java | 27 +- .../system/controller/MqttController.java | 7 +- .../TUserAccountInfoController.java | 97 + .../controller/TUserLoginLogController.java | 97 + .../com/ruoyi/system/domain/IotCategory.java | 57 +- .../com/ruoyi/system/domain/IotDevice.java | 168 +- .../com/ruoyi/system/domain/IotDeviceSet.java | 311 ++- .../ruoyi/system/domain/IotDeviceStatus.java | 266 +- .../system/domain/IotDeviceUserRelation.java | 136 + .../com/ruoyi/system/domain/IotGroup.java | 83 +- .../com/ruoyi/system/domain/SysConfig.java | 82 +- .../ruoyi/system/domain/SysLogininfor.java | 96 +- .../com/ruoyi/system/domain/SysNotice.java | 80 +- .../com/ruoyi/system/domain/SysOperLog.java | 176 +- .../java/com/ruoyi/system/domain/SysPost.java | 92 +- .../com/ruoyi/system/domain/SysRoleDept.java | 35 +- .../com/ruoyi/system/domain/SysRoleMenu.java | 35 +- .../ruoyi/system/domain/SysUserOnline.java | 85 +- .../com/ruoyi/system/domain/SysUserPost.java | 35 +- .../com/ruoyi/system/domain/SysUserRole.java | 35 +- .../ruoyi/system/domain/TUserAccountInfo.java | 327 +++ .../ruoyi/system/domain/TUserLoginLog.java | 146 + .../system/domain/vo/DeviceControlCMD.java | 16 + .../system/domain/vo/IotDeviceListDto.java | 281 +- .../com/ruoyi/system/domain/vo/MetaVo.java | 32 +- .../com/ruoyi/system/domain/vo/RouterVo.java | 54 +- .../system/mapper/IotCategoryMapper.java | 20 +- .../ruoyi/system/mapper/IotDeviceMapper.java | 28 +- .../system/mapper/IotDeviceSetMapper.java | 20 +- .../system/mapper/IotDeviceStatusMapper.java | 20 +- .../mapper/IotDeviceUserRelationMapper.java | 63 + .../ruoyi/system/mapper/IotGroupMapper.java | 20 +- .../ruoyi/system/mapper/SysConfigMapper.java | 22 +- .../ruoyi/system/mapper/SysDeptMapper.java | 36 +- .../system/mapper/SysDictDataMapper.java | 30 +- .../system/mapper/SysDictTypeMapper.java | 24 +- .../system/mapper/SysLogininforMapper.java | 16 +- .../ruoyi/system/mapper/SysMenuMapper.java | 10 +- .../ruoyi/system/mapper/SysNoticeMapper.java | 20 +- .../ruoyi/system/mapper/SysOperLogMapper.java | 16 +- .../ruoyi/system/mapper/SysPostMapper.java | 30 +- .../system/mapper/SysRoleDeptMapper.java | 16 +- .../ruoyi/system/mapper/SysRoleMapper.java | 32 +- .../system/mapper/SysRoleMenuMapper.java | 16 +- .../ruoyi/system/mapper/SysUserMapper.java | 32 +- .../system/mapper/SysUserPostMapper.java | 16 +- .../system/mapper/SysUserRoleMapper.java | 22 +- .../system/mapper/TUserAccountInfoMapper.java | 63 + .../system/mapper/TUserLoginLogMapper.java | 63 + .../ruoyi/system/mqtt/config/MqttConfig.java | 56 +- .../system/mqtt/config/MqttPushClient.java | 6 + .../system/mqtt/config/PushCallback.java | 46 +- .../system/service/IIotCategoryService.java | 18 +- .../system/service/IIotDeviceService.java | 38 +- .../system/service/IIotDeviceSetService.java | 18 +- .../service/IIotDeviceStatusService.java | 18 +- .../IIotDeviceUserRelationService.java | 68 + .../system/service/IIotGroupService.java | 18 +- .../system/service/ISysConfigService.java | 20 +- .../ruoyi/system/service/ISysDeptService.java | 30 +- .../system/service/ISysDictDataService.java | 20 +- .../system/service/ISysDictTypeService.java | 24 +- .../system/service/ISysLogininforService.java | 12 +- .../ruoyi/system/service/ISysMenuService.java | 38 +- .../system/service/ISysNoticeService.java | 20 +- .../system/service/ISysOperLogService.java | 14 +- .../ruoyi/system/service/ISysPostService.java | 28 +- .../ruoyi/system/service/ISysRoleService.java | 36 +- .../system/service/ISysUserOnlineService.java | 21 +- .../ruoyi/system/service/ISysUserService.java | 48 +- .../service/ITUserAccountInfoService.java | 61 + .../system/service/ITUserLoginLogService.java | 61 + .../service/impl/IotCategoryServiceImpl.java | 36 +- .../service/impl/IotDeviceServiceImpl.java | 277 +- .../service/impl/IotDeviceSetServiceImpl.java | 39 +- .../impl/IotDeviceStatusServiceImpl.java | 42 +- .../IotDeviceUserRelationServiceImpl.java | 113 + .../service/impl/IotGroupServiceImpl.java | 36 +- .../service/impl/SysConfigServiceImpl.java | 79 +- .../service/impl/SysDeptServiceImpl.java | 129 +- .../service/impl/SysDictDataServiceImpl.java | 47 +- .../service/impl/SysDictTypeServiceImpl.java | 84 +- .../impl/SysLogininforServiceImpl.java | 24 +- .../service/impl/SysMenuServiceImpl.java | 203 +- .../service/impl/SysNoticeServiceImpl.java | 36 +- .../service/impl/SysOperLogServiceImpl.java | 29 +- .../service/impl/SysPostServiceImpl.java | 73 +- .../service/impl/SysRoleServiceImpl.java | 122 +- .../impl/SysUserOnlineServiceImpl.java | 48 +- .../service/impl/SysUserServiceImpl.java | 194 +- .../impl/TUserAccountInfoServiceImpl.java | 87 + .../impl/TUserLoginLogServiceImpl.java | 87 + .../mapper/system/IotCategoryMapper.xml | 32 +- .../mapper/system/IotDeviceMapper.xml | 265 +- .../mapper/system/IotDeviceSetMapper.xml | 95 +- .../mapper/system/IotDeviceStatusMapper.xml | 83 +- .../system/IotDeviceUserRelationMapper.xml | 126 + .../mapper/system/IotGroupMapper.xml | 49 +- .../mapper/system/SysConfigMapper.xml | 139 +- .../resources/mapper/system/SysDeptMapper.xml | 280 +- .../mapper/system/SysDictDataMapper.xml | 237 +- .../mapper/system/SysDictTypeMapper.xml | 194 +- .../mapper/system/SysLogininforMapper.xml | 96 +- .../resources/mapper/system/SysMenuMapper.xml | 363 +-- .../mapper/system/SysNoticeMapper.xml | 113 +- .../mapper/system/SysOperLogMapper.xml | 147 +- .../resources/mapper/system/SysPostMapper.xml | 228 +- .../mapper/system/SysRoleDeptMapper.xml | 56 +- .../resources/mapper/system/SysRoleMapper.xml | 289 +- .../mapper/system/SysRoleMenuMapper.xml | 56 +- .../resources/mapper/system/SysUserMapper.xml | 363 +-- .../mapper/system/SysUserPostMapper.xml | 56 +- .../mapper/system/SysUserRoleMapper.xml | 76 +- .../mapper/system/TUserAccountInfoMapper.xml | 148 ++ .../mapper/system/TUserLoginLogMapper.xml | 86 + spring-boot/sql/develop_xiaoyi_wumei.sql | 2340 +++++++++++++++++ 337 files changed, 16032 insertions(+), 12055 deletions(-) create mode 100644 spring-boot/.mvn/wrapper/MavenWrapperDownloader.java create mode 100644 spring-boot/.mvn/wrapper/maven-wrapper.jar create mode 100644 spring-boot/.mvn/wrapper/maven-wrapper.properties create mode 100644 spring-boot/mvnw create mode 100644 spring-boot/mvnw.cmd create mode 100644 spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxConfig.java create mode 100644 spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxMpConfig.java create mode 100644 spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxProperties.java create mode 100644 spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/MpLoginBody.java create mode 100644 spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AuthService.java create mode 100644 spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/SggCodeGenerator.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceUserRelationController.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserAccountInfoController.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserLoginLogController.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceUserRelation.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserAccountInfo.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserLoginLog.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/DeviceControlCMD.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceUserRelationMapper.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserAccountInfoMapper.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserLoginLogMapper.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceUserRelationService.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserAccountInfoService.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserLoginLogService.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceUserRelationServiceImpl.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserAccountInfoServiceImpl.java create mode 100644 spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserLoginLogServiceImpl.java create mode 100644 spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceUserRelationMapper.xml create mode 100644 spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserAccountInfoMapper.xml create mode 100644 spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserLoginLogMapper.xml create mode 100644 spring-boot/sql/develop_xiaoyi_wumei.sql diff --git a/spring-boot/.gitignore b/spring-boot/.gitignore index 2c0e049a..549e00a2 100644 --- a/spring-boot/.gitignore +++ b/spring-boot/.gitignore @@ -1,15 +1,8 @@ -###################################################################### -# Build Tools - -.gradle -/build/ -!gradle/wrapper/gradle-wrapper.jar - +HELP.md target/ !.mvn/wrapper/maven-wrapper.jar - -###################################################################### -# IDE +!**/src/main/**/target/ +!**/src/test/**/target/ ### STS ### .apt_generated @@ -18,6 +11,7 @@ target/ .project .settings .springBeans +.sts4-cache ### IntelliJ IDEA ### .idea @@ -26,19 +20,14 @@ target/ *.ipr ### NetBeans ### -nbproject/private/ -build/* -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ -###################################################################### -# Others -*.log -*.xml.versionsBackup -*.swp - -!*/build/*.java -!*/build/*.html -!*/build/*.xml +### VS Code ### +.vscode/ diff --git a/spring-boot/.mvn/wrapper/MavenWrapperDownloader.java b/spring-boot/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 00000000..e76d1f32 --- /dev/null +++ b/spring-boot/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/spring-boot/.mvn/wrapper/maven-wrapper.jar b/spring-boot/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054 GIT binary patch literal 50710 zcmbTd1CVCTmM+|7+wQV$+qP}n>auOywyU~q+qUhh+uxis_~*a##hm*_WW?9E7Pb7N%LRFiwbEGCJ0XP=%-6oeT$XZcYgtzC2~q zk(K08IQL8oTl}>>+hE5YRgXTB@fZ4TH9>7=79e`%%tw*SQUa9~$xKD5rS!;ZG@ocK zQdcH}JX?W|0_Afv?y`-NgLum62B&WSD$-w;O6G0Sm;SMX65z)l%m1e-g8Q$QTI;(Q z+x$xth4KFvH@Bs6(zn!iF#nenk^Y^ce;XIItAoCsow38eq?Y-Auh!1in#Rt-_D>H^ z=EjbclGGGa6VnaMGmMLj`x3NcwA43Jb(0gzl;RUIRAUDcR1~99l2SAPkVhoRMMtN} zXvC<tOmX83grD8GSo_Lo?%lNfhD#EBgPo z*nf@ppMC#B!T)Ae0RG$mlJWmGl7CkuU~B8-==5i;rS;8i6rJ=PoQxf446XDX9g|c> zU64ePyMlsI^V5Jq5A+BPe#e73+kpc_r1tv#B)~EZ;7^67F0*QiYfrk0uVW;Qb=NsG zN>gsuCwvb?s-KQIppEaeXtEMdc9dy6Dfduz-tMTms+i01{eD9JE&h?Kht*$eOl#&L zJdM_-vXs(V#$Ed;5wyNWJdPNh+Z$+;$|%qR(t`4W@kDhd*{(7-33BOS6L$UPDeE_53j${QfKN-0v-HG z(QfyvFNbwPK%^!eIo4ac1;b>c0vyf9}Xby@YY!lkz-UvNp zwj#Gg|4B~?n?G^{;(W;|{SNoJbHTMpQJ*Wq5b{l9c8(%?Kd^1?H1om1de0Da9M;Q=n zUfn{f87iVb^>Exl*nZ0hs(Yt>&V9$Pg`zX`AI%`+0SWQ4Zc(8lUDcTluS z5a_KerZWe}a-MF9#Cd^fi!y3%@RFmg&~YnYZ6<=L`UJ0v={zr)>$A;x#MCHZy1st7 ztT+N07NR+vOwSV2pvWuN1%lO!K#Pj0Fr>Q~R40{bwdL%u9i`DSM4RdtEH#cW)6}+I-eE< z&tZs+(Ogu(H_;$a$!7w`MH0r%h&@KM+<>gJL@O~2K2?VrSYUBbhCn#yy?P)uF3qWU z0o09mIik+kvzV6w>vEZy@&Mr)SgxPzUiDA&%07m17udz9usD82afQEps3$pe!7fUf z0eiidkJ)m3qhOjVHC_M(RYCBO%CZKZXFb8}s0-+}@CIn&EF(rRWUX2g^yZCvl0bI} zbP;1S)iXnRC&}5-Tl(hASKqdSnO?ASGJ*MIhOXIblmEudj(M|W!+I3eDc}7t`^mtg z)PKlaXe(OH+q-)qcQ8a@!llRrpGI8DsjhoKvw9T;TEH&?s=LH0w$EzI>%u;oD@x83 zJL7+ncjI9nn!TlS_KYu5vn%f*@qa5F;| zEFxY&B?g=IVlaF3XNm_03PA)=3|{n-UCgJoTr;|;1AU9|kPE_if8!Zvb}0q$5okF$ zHaJdmO&gg!9oN|M{!qGE=tb|3pVQ8PbL$}e;NgXz<6ZEggI}wO@aBP**2Wo=yN#ZC z4G$m^yaM9g=|&!^ft8jOLuzc3Psca*;7`;gnHm}tS0%f4{|VGEwu45KptfNmwxlE~ z^=r30gi@?cOm8kAz!EylA4G~7kbEiRlRIzwrb~{_2(x^$-?|#e6Bi_**(vyr_~9Of z!n>Gqf+Qwiu!xhi9f53=PM3`3tNF}pCOiPU|H4;pzjcsqbwg*{{kyrTxk<;mx~(;; z1NMrpaQ`57yn34>Jo3b|HROE(UNcQash!0p2-!Cz;{IRv#Vp5!3o$P8!%SgV~k&Hnqhp`5eLjTcy93cK!3Hm-$`@yGnaE=?;*2uSpiZTs_dDd51U%i z{|Zd9ou-;laGS_x=O}a+ zB||za<795A?_~Q=r=coQ+ZK@@ zId~hWQL<%)fI_WDIX#=(WNl!Dm$a&ROfLTd&B$vatq!M-2Jcs;N2vps$b6P1(N}=oI3<3luMTmC|0*{ zm1w8bt7vgX($!0@V0A}XIK)w!AzUn7vH=pZEp0RU0p?}ch2XC-7r#LK&vyc2=-#Q2 z^L%8)JbbcZ%g0Du;|8=q8B>X=mIQirpE=&Ox{TiuNDnOPd-FLI^KfEF729!!0x#Es z@>3ursjFSpu%C-8WL^Zw!7a0O-#cnf`HjI+AjVCFitK}GXO`ME&on|^=~Zc}^LBp9 zj=-vlN;Uc;IDjtK38l7}5xxQF&sRtfn4^TNtnzXv4M{r&ek*(eNbIu!u$>Ed%` z5x7+&)2P&4>0J`N&ZP8$vcR+@FS0126s6+Jx_{{`3ZrIMwaJo6jdrRwE$>IU_JTZ} z(||hyyQ)4Z1@wSlT94(-QKqkAatMmkT7pCycEB1U8KQbFX&?%|4$yyxCtm3=W`$4fiG0WU3yI@c zx{wfmkZAYE_5M%4{J-ygbpH|(|GD$2f$3o_Vti#&zfSGZMQ5_f3xt6~+{RX=$H8at z?GFG1Tmp}}lmm-R->ve*Iv+XJ@58p|1_jRvfEgz$XozU8#iJS})UM6VNI!3RUU!{5 zXB(+Eqd-E;cHQ>)`h0(HO_zLmzR3Tu-UGp;08YntWwMY-9i^w_u#wR?JxR2bky5j9 z3Sl-dQQU$xrO0xa&>vsiK`QN<$Yd%YXXM7*WOhnRdSFt5$aJux8QceC?lA0_if|s> ze{ad*opH_kb%M&~(~&UcX0nFGq^MqjxW?HJIP462v9XG>j(5Gat_)#SiNfahq2Mz2 zU`4uV8m$S~o9(W>mu*=h%Gs(Wz+%>h;R9Sg)jZ$q8vT1HxX3iQnh6&2rJ1u|j>^Qf`A76K%_ubL`Zu?h4`b=IyL>1!=*%!_K)=XC z6d}4R5L+sI50Q4P3upXQ3Z!~1ZXLlh!^UNcK6#QpYt-YC=^H=EPg3)z*wXo*024Q4b2sBCG4I# zlTFFY=kQ>xvR+LsuDUAk)q%5pEcqr(O_|^spjhtpb1#aC& zghXzGkGDC_XDa%t(X`E+kvKQ4zrQ*uuQoj>7@@ykWvF332)RO?%AA&Fsn&MNzmFa$ zWk&&^=NNjxLjrli_8ESU)}U|N{%j&TQmvY~lk!~Jh}*=^INA~&QB9em!in_X%Rl1&Kd~Z(u z9mra#<@vZQlOY+JYUwCrgoea4C8^(xv4ceCXcejq84TQ#sF~IU2V}LKc~Xlr_P=ry zl&Hh0exdCbVd^NPCqNNlxM3vA13EI8XvZ1H9#bT7y*U8Y{H8nwGpOR!e!!}*g;mJ#}T{ekSb}5zIPmye*If(}}_=PcuAW#yidAa^9-`<8Gr0 z)Fz=NiZ{)HAvw{Pl5uu)?)&i&Us$Cx4gE}cIJ}B4Xz~-q7)R_%owbP!z_V2=Aq%Rj z{V;7#kV1dNT9-6R+H}}(ED*_!F=~uz>&nR3gb^Ce%+0s#u|vWl<~JD3MvS0T9thdF zioIG3c#Sdsv;LdtRv3ml7%o$6LTVL>(H`^@TNg`2KPIk*8-IB}X!MT0`hN9Ddf7yN z?J=GxPL!uJ7lqwowsl?iRrh@#5C$%E&h~Z>XQcvFC*5%0RN-Opq|=IwX(dq(*sjs+ zqy99+v~m|6T#zR*e1AVxZ8djd5>eIeCi(b8sUk)OGjAsKSOg^-ugwl2WSL@d#?mdl zib0v*{u-?cq}dDGyZ%$XRY=UkQwt2oGu`zQneZh$=^! zj;!pCBWQNtvAcwcWIBM2y9!*W|8LmQy$H~5BEx)78J`4Z0(FJO2P^!YyQU{*Al+fs z){!4JvT1iLrJ8aU3k0t|P}{RN)_^v%$$r;+p0DY7N8CXzmS*HB*=?qaaF9D@#_$SN zSz{moAK<*RH->%r7xX~9gVW$l7?b|_SYI)gcjf0VAUJ%FcQP(TpBs; zg$25D!Ry_`8xpS_OJdeo$qh#7U+cepZ??TII7_%AXsT$B z=e)Bx#v%J0j``00Zk5hsvv6%T^*xGNx%KN-=pocSoqE5_R)OK%-Pbu^1MNzfds)mL zxz^F4lDKV9D&lEY;I+A)ui{TznB*CE$=9(wgE{m}`^<--OzV-5V4X2w9j(_!+jpTr zJvD*y6;39&T+==$F&tsRKM_lqa1HC}aGL0o`%c9mO=fts?36@8MGm7Vi{Y z^<7m$(EtdSr#22<(rm_(l_(`j!*Pu~Y>>xc>I9M#DJYDJNHO&4=HM%YLIp?;iR&$m z#_$ZWYLfGLt5FJZhr3jpYb`*%9S!zCG6ivNHYzNHcI%khtgHBliM^Ou}ZVD7ehU9 zS+W@AV=?Ro!=%AJ>Kcy9aU3%VX3|XM_K0A+ZaknKDyIS3S-Hw1C7&BSW5)sqj5Ye_ z4OSW7Yu-;bCyYKHFUk}<*<(@TH?YZPHr~~Iy%9@GR2Yd}J2!N9K&CN7Eq{Ka!jdu; zQNB*Y;i(7)OxZK%IHGt#Rt?z`I|A{q_BmoF!f^G}XVeTbe1Wnzh%1g>j}>DqFf;Rp zz7>xIs12@Ke0gr+4-!pmFP84vCIaTjqFNg{V`5}Rdt~xE^I;Bxp4)|cs8=f)1YwHz zqI`G~s2~qqDV+h02b`PQpUE#^^Aq8l%y2|ByQeXSADg5*qMprEAE3WFg0Q39`O+i1 z!J@iV!`Y~C$wJ!5Z+j5$i<1`+@)tBG$JL=!*uk=2k;T<@{|s1$YL079FvK%mPhyHV zP8^KGZnp`(hVMZ;s=n~3r2y;LTwcJwoBW-(ndU-$03{RD zh+Qn$ja_Z^OuMf3Ub|JTY74s&Am*(n{J3~@#OJNYuEVVJd9*H%)oFoRBkySGm`hx! zT3tG|+aAkXcx-2Apy)h^BkOyFTWQVeZ%e2@;*0DtlG9I3Et=PKaPt&K zw?WI7S;P)TWED7aSH$3hL@Qde?H#tzo^<(o_sv_2ci<7M?F$|oCFWc?7@KBj-;N$P zB;q!8@bW-WJY9do&y|6~mEruZAVe$!?{)N9rZZxD-|oltkhW9~nR8bLBGXw<632!l z*TYQn^NnUy%Ds}$f^=yQ+BM-a5X4^GHF=%PDrRfm_uqC zh{sKwIu|O0&jWb27;wzg4w5uA@TO_j(1X?8E>5Zfma|Ly7Bklq|s z9)H`zoAGY3n-+&JPrT!>u^qg9Evx4y@GI4$n-Uk_5wttU1_t?6><>}cZ-U+&+~JE) zPlDbO_j;MoxdLzMd~Ew|1o^a5q_1R*JZ=#XXMzg?6Zy!^hop}qoLQlJ{(%!KYt`MK z8umEN@Z4w!2=q_oe=;QttPCQy3Nm4F@x>@v4sz_jo{4m*0r%J(w1cSo;D_hQtJs7W z><$QrmG^+<$4{d2bgGo&3-FV}avg9zI|Rr(k{wTyl3!M1q+a zD9W{pCd%il*j&Ft z5H$nENf>>k$;SONGW`qo6`&qKs*T z2^RS)pXk9b@(_Fw1bkb)-oqK|v}r$L!W&aXA>IpcdNZ_vWE#XO8X`#Yp1+?RshVcd zknG%rPd*4ECEI0wD#@d+3NbHKxl}n^Sgkx==Iu%}HvNliOqVBqG?P2va zQ;kRJ$J6j;+wP9cS za#m;#GUT!qAV%+rdWolk+)6kkz4@Yh5LXP+LSvo9_T+MmiaP-eq6_k;)i6_@WSJ zlT@wK$zqHu<83U2V*yJ|XJU4farT#pAA&@qu)(PO^8PxEmPD4;Txpio+2)#!9 z>&=i7*#tc0`?!==vk>s7V+PL#S1;PwSY?NIXN2=Gu89x(cToFm))7L;< z+bhAbVD*bD=}iU`+PU+SBobTQ%S!=VL!>q$rfWsaaV}Smz>lO9JXT#`CcH_mRCSf4%YQAw`$^yY z3Y*^Nzk_g$xn7a_NO(2Eb*I=^;4f!Ra#Oo~LLjlcjke*k*o$~U#0ZXOQ5@HQ&T46l z7504MUgZkz2gNP1QFN8Y?nSEnEai^Rgyvl}xZfMUV6QrJcXp;jKGqB=D*tj{8(_pV zqyB*DK$2lgYGejmJUW)*s_Cv65sFf&pb(Yz8oWgDtQ0~k^0-wdF|tj}MOXaN@ydF8 zNr={U?=;&Z?wr^VC+`)S2xl}QFagy;$mG=TUs7Vi2wws5zEke4hTa2)>O0U?$WYsZ z<8bN2bB_N4AWd%+kncgknZ&}bM~eDtj#C5uRkp21hWW5gxWvc6b*4+dn<{c?w9Rmf zIVZKsPl{W2vQAlYO3yh}-{Os=YBnL8?uN5(RqfQ=-1cOiUnJu>KcLA*tQK3FU`_bM zM^T28w;nAj5EdAXFi&Kk1Nnl2)D!M{@+D-}bIEe+Lc4{s;YJc-{F#``iS2uk;2!Zp zF9#myUmO!wCeJIoi^A+T^e~20c+c2C}XltaR!|U-HfDA=^xF97ev}$l6#oY z&-&T{egB)&aV$3_aVA51XGiU07$s9vubh_kQG?F$FycvS6|IO!6q zq^>9|3U^*!X_C~SxX&pqUkUjz%!j=VlXDo$!2VLH!rKj@61mDpSr~7B2yy{>X~_nc zRI+7g2V&k zd**H++P9dg!-AOs3;GM`(g<+GRV$+&DdMVpUxY9I1@uK28$az=6oaa+PutlO9?6#? zf-OsgT>^@8KK>ggkUQRPPgC7zjKFR5spqQb3ojCHzj^(UH~v+!y*`Smv)VpVoPwa6 zWG18WJaPKMi*F6Zdk*kU^`i~NNTfn3BkJniC`yN98L-Awd)Z&mY? zprBW$!qL-OL7h@O#kvYnLsfff@kDIegt~?{-*5A7JrA;#TmTe?jICJqhub-G@e??D zqiV#g{)M!kW1-4SDel7TO{;@*h2=_76g3NUD@|c*WO#>MfYq6_YVUP+&8e4|%4T`w zXzhmVNziAHazWO2qXcaOu@R1MrPP{t)`N)}-1&~mq=ZH=w=;-E$IOk=y$dOls{6sRR`I5>|X zpq~XYW4sd;J^6OwOf**J>a7u$S>WTFPRkjY;BfVgQst)u4aMLR1|6%)CB^18XCz+r ztkYQ}G43j~Q&1em(_EkMv0|WEiKu;z2zhb(L%$F&xWwzOmk;VLBYAZ8lOCziNoPw1 zv2BOyXA`A8z^WH!nXhKXM`t0;6D*-uGds3TYGrm8SPnJJOQ^fJU#}@aIy@MYWz**H zvkp?7I5PE{$$|~{-ZaFxr6ZolP^nL##mHOErB^AqJqn^hFA=)HWj!m3WDaHW$C)i^ z9@6G$SzB=>jbe>4kqr#sF7#K}W*Cg-5y6kun3u&0L7BpXF9=#7IN8FOjWrWwUBZiU zT_se3ih-GBKx+Uw0N|CwP3D@-C=5(9T#BH@M`F2!Goiqx+Js5xC92|Sy0%WWWp={$(am!#l~f^W_oz78HX<0X#7 zp)p1u~M*o9W@O8P{0Qkg@Wa# z2{Heb&oX^CQSZWSFBXKOfE|tsAm#^U-WkDnU;IowZ`Ok4!mwHwH=s|AqZ^YD4!5!@ zPxJj+Bd-q6w_YG`z_+r;S86zwXb+EO&qogOq8h-Ect5(M2+>(O7n7)^dP*ws_3U6v zVsh)sk^@*c>)3EML|0<-YROho{lz@Nd4;R9gL{9|64xVL`n!m$-Jjrx?-Bacp!=^5 z1^T^eB{_)Y<9)y{-4Rz@9_>;_7h;5D+@QcbF4Wv7hu)s0&==&6u)33 zHRj+&Woq-vDvjwJCYES@$C4{$?f$Ibi4G()UeN11rgjF+^;YE^5nYprYoJNoudNj= zm1pXSeG64dcWHObUetodRn1Fw|1nI$D9z}dVEYT0lQnsf_E1x2vBLql7NrHH!n&Sq z6lc*mvU=WS6=v9Lrl}&zRiu_6u;6g%_DU{9b+R z#YHqX7`m9eydf?KlKu6Sb%j$%_jmydig`B*TN`cZL-g!R)iE?+Q5oOqBFKhx z%MW>BC^(F_JuG(ayE(MT{S3eI{cKiwOtPwLc0XO*{*|(JOx;uQOfq@lp_^cZo=FZj z4#}@e@dJ>Bn%2`2_WPeSN7si^{U#H=7N4o%Dq3NdGybrZgEU$oSm$hC)uNDC_M9xc zGzwh5Sg?mpBIE8lT2XsqTt3j3?We8}3bzLBTQd639vyg^$0#1epq8snlDJP2(BF)K zSx30RM+{f+b$g{9usIL8H!hCO117Xgv}ttPJm9wVRjPk;ePH@zxv%j9k5`TzdXLeT zFgFX`V7cYIcBls5WN0Pf6SMBN+;CrQ(|EsFd*xtwr#$R{Z9FP`OWtyNsq#mCgZ7+P z^Yn$haBJ)r96{ZJd8vlMl?IBxrgh=fdq_NF!1{jARCVz>jNdC)H^wfy?R94#MPdUjcYX>#wEx+LB#P-#4S-%YH>t-j+w zOFTI8gX$ard6fAh&g=u&56%3^-6E2tpk*wx3HSCQ+t7+*iOs zPk5ysqE}i*cQocFvA68xHfL|iX(C4h*67@3|5Qwle(8wT&!&{8*{f%0(5gH+m>$tq zp;AqrP7?XTEooYG1Dzfxc>W%*CyL16q|fQ0_jp%%Bk^k!i#Nbi(N9&T>#M{gez_Ws zYK=l}adalV(nH}I_!hNeb;tQFk3BHX7N}}R8%pek^E`X}%ou=cx8InPU1EE0|Hen- zyw8MoJqB5=)Z%JXlrdTXAE)eqLAdVE-=>wGHrkRet}>3Yu^lt$Kzu%$3#(ioY}@Gu zjk3BZuQH&~7H+C*uX^4}F*|P89JX;Hg2U!pt>rDi(n(Qe-c}tzb0#6_ItoR0->LSt zR~UT<-|@TO%O`M+_e_J4wx7^)5_%%u+J=yF_S#2Xd?C;Ss3N7KY^#-vx+|;bJX&8r zD?|MetfhdC;^2WG`7MCgs>TKKN=^=!x&Q~BzmQio_^l~LboTNT=I zC5pme^P@ER``p$2md9>4!K#vV-Fc1an7pl>_|&>aqP}+zqR?+~Z;f2^`a+-!Te%V? z;H2SbF>jP^GE(R1@%C==XQ@J=G9lKX+Z<@5}PO(EYkJh=GCv#)Nj{DkWJM2}F&oAZ6xu8&g7pn1ps2U5srwQ7CAK zN&*~@t{`31lUf`O;2w^)M3B@o)_mbRu{-`PrfNpF!R^q>yTR&ETS7^-b2*{-tZAZz zw@q5x9B5V8Qd7dZ!Ai$9hk%Q!wqbE1F1c96&zwBBaRW}(^axoPpN^4Aw}&a5dMe+*Gomky_l^54*rzXro$ z>LL)U5Ry>~FJi=*{JDc)_**c)-&faPz`6v`YU3HQa}pLtb5K)u%K+BOqXP0)rj5Au$zB zW1?vr?mDv7Fsxtsr+S6ucp2l#(4dnr9sD*v+@*>g#M4b|U?~s93>Pg{{a5|rm2xfI z`>E}?9S@|IoUX{Q1zjm5YJT|3S>&09D}|2~BiMo=z4YEjXlWh)V&qs;*C{`UMxp$9 zX)QB?G$fPD6z5_pNs>Jeh{^&U^)Wbr?2D6-q?)`*1k@!UvwQgl8eG$r+)NnFoT)L6 zg7lEh+E6J17krfYJCSjWzm67hEth24pomhz71|Qodn#oAILN)*Vwu2qpJirG)4Wnv}9GWOFrQg%Je+gNrPl8mw7ykE8{ z=|B4+uwC&bpp%eFcRU6{mxRV32VeH8XxX>v$du<$(DfinaaWxP<+Y97Z#n#U~V zVEu-GoPD=9$}P;xv+S~Ob#mmi$JQmE;Iz4(){y*9pFyW-jjgdk#oG$fl4o9E8bo|L zWjo4l%n51@Kz-n%zeSCD`uB?T%FVk+KBI}=ve zvlcS#wt`U6wrJo}6I6Rwb=1GzZfwE=I&Ne@p7*pH84XShXYJRgvK)UjQL%R9Zbm(m zxzTQsLTON$WO7vM)*vl%Pc0JH7WhP;$z@j=y#avW4X8iqy6mEYr@-}PW?H)xfP6fQ z&tI$F{NNct4rRMSHhaelo<5kTYq+(?pY)Ieh8*sa83EQfMrFupMM@nfEV@EmdHUv9 z35uzIrIuo4#WnF^_jcpC@uNNaYTQ~uZWOE6P@LFT^1@$o&q+9Qr8YR+ObBkpP9=F+$s5+B!mX2~T zAuQ6RenX?O{IlLMl1%)OK{S7oL}X%;!XUxU~xJN8xk z`xywS*naF(J#?vOpB(K=o~lE;m$zhgPWDB@=p#dQIW>xe_p1OLoWInJRKbEuoncf; zmS1!u-ycc1qWnDg5Nk2D)BY%jmOwCLC+Ny>`f&UxFowIsHnOXfR^S;&F(KXd{ODlm z$6#1ccqt-HIH9)|@fHnrKudu!6B$_R{fbCIkSIb#aUN|3RM>zuO>dpMbROZ`^hvS@ z$FU-;e4W}!ubzKrU@R*dW*($tFZ>}dd*4_mv)#O>X{U@zSzQt*83l9mI zI$8O<5AIDx`wo0}f2fsPC_l>ONx_`E7kdXu{YIZbp1$(^oBAH({T~&oQ&1{X951QW zmhHUxd)t%GQ9#ak5fTjk-cahWC;>^Rg7(`TVlvy0W@Y!Jc%QL3Ozu# zDPIqBCy&T2PWBj+d-JA-pxZlM=9ja2ce|3B(^VCF+a*MMp`(rH>Rt6W1$;r{n1(VK zLs>UtkT43LR2G$AOYHVailiqk7naz2yZGLo*xQs!T9VN5Q>eE(w zw$4&)&6xIV$IO^>1N-jrEUg>O8G4^@y+-hQv6@OmF@gy^nL_n1P1-Rtyy$Bl;|VcV zF=p*&41-qI5gG9UhKmmnjs932!6hceXa#-qfK;3d*a{)BrwNFeKU|ge?N!;zk+kB! zMD_uHJR#%b54c2tr~uGPLTRLg$`fupo}cRJeTwK;~}A>(Acy4k-Xk&Aa1&eWYS1ULWUj@fhBiWY$pdfy+F z@G{OG{*v*mYtH3OdUjwEr6%_ZPZ3P{@rfbNPQG!BZ7lRyC^xlMpWH`@YRar`tr}d> z#wz87t?#2FsH-jM6m{U=gp6WPrZ%*w0bFm(T#7m#v^;f%Z!kCeB5oiF`W33W5Srdt zdU?YeOdPG@98H7NpI{(uN{FJdu14r(URPH^F6tOpXuhU7T9a{3G3_#Ldfx_nT(Hec zo<1dyhsVsTw;ZkVcJ_0-h-T3G1W@q)_Q30LNv)W?FbMH+XJ* zy=$@39Op|kZv`Rt>X`zg&at(?PO^I=X8d9&myFEx#S`dYTg1W+iE?vt#b47QwoHI9 zNP+|3WjtXo{u}VG(lLUaW0&@yD|O?4TS4dfJI`HC-^q;M(b3r2;7|FONXphw-%7~* z&;2!X17|05+kZOpQ3~3!Nb>O94b&ZSs%p)TK)n3m=4eiblVtSx@KNFgBY_xV6ts;NF;GcGxMP8OKV^h6LmSb2E#Qnw ze!6Mnz7>lE9u{AgQ~8u2zM8CYD5US8dMDX-5iMlgpE9m*s+Lh~A#P1er*rF}GHV3h z=`STo?kIXw8I<`W0^*@mB1$}pj60R{aJ7>C2m=oghKyxMbFNq#EVLgP0cH3q7H z%0?L93-z6|+jiN|@v>ix?tRBU(v-4RV`}cQH*fp|)vd3)8i9hJ3hkuh^8dz{F5-~_ zUUr1T3cP%cCaTooM8dj|4*M=e6flH0&8ve32Q)0dyisl))XkZ7Wg~N}6y`+Qi2l+e zUd#F!nJp{#KIjbQdI`%oZ`?h=5G^kZ_uN`<(`3;a!~EMsWV|j-o>c?x#;zR2ktiB! z);5rrHl?GPtr6-o!tYd|uK;Vbsp4P{v_4??=^a>>U4_aUXPWQ$FPLE4PK$T^3Gkf$ zHo&9$U&G`d(Os6xt1r?sg14n)G8HNyWa^q8#nf0lbr4A-Fi;q6t-`pAx1T*$eKM*$ z|CX|gDrk#&1}>5H+`EjV$9Bm)Njw&7-ZR{1!CJTaXuP!$Pcg69`{w5BRHysB$(tWUes@@6aM69kb|Lx$%BRY^-o6bjH#0!7b;5~{6J+jKxU!Kmi# zndh@+?}WKSRY2gZ?Q`{(Uj|kb1%VWmRryOH0T)f3cKtG4oIF=F7RaRnH0Rc_&372={_3lRNsr95%ZO{IX{p@YJ^EI%+gvvKes5cY+PE@unghjdY5#9A!G z70u6}?zmd?v+{`vCu-53_v5@z)X{oPC@P)iA3jK$`r zSA2a7&!^zmUiZ82R2=1cumBQwOJUPz5Ay`RLfY(EiwKkrx%@YN^^XuET;tE zmr-6~I7j!R!KrHu5CWGSChO6deaLWa*9LLJbcAJsFd%Dy>a!>J`N)Z&oiU4OEP-!Ti^_!p}O?7`}i7Lsf$-gBkuY*`Zb z7=!nTT;5z$_5$=J=Ko+Cp|Q0J=%oFr>hBgnL3!tvFoLNhf#D0O=X^h+x08iB;@8pXdRHxX}6R4k@i6%vmsQwu^5z zk1ip`#^N)^#Lg#HOW3sPI33xqFB4#bOPVnY%d6prwxf;Y-w9{ky4{O6&94Ra8VN@K zb-lY;&`HtxW@sF!doT5T$2&lIvJpbKGMuDAFM#!QPXW87>}=Q4J3JeXlwHys?!1^#37q_k?N@+u&Ns20pEoBeZC*np;i;M{2C0Z4_br2gsh6eL z#8`#sn41+$iD?^GL%5?cbRcaa-Nx0vE(D=*WY%rXy3B%gNz0l?#noGJGP728RMY#q z=2&aJf@DcR?QbMmN)ItUe+VM_U!ryqA@1VVt$^*xYt~-qvW!J4Tp<-3>jT=7Zow5M z8mSKp0v4b%a8bxFr>3MwZHSWD73D@+$5?nZAqGM#>H@`)mIeC#->B)P8T$zh-Pxnc z8)~Zx?TWF4(YfKuF3WN_ckpCe5;x4V4AA3(i$pm|78{%!q?|~*eH0f=?j6i)n~Hso zmTo>vqEtB)`%hP55INf7HM@taH)v`Fw40Ayc*R!T?O{ziUpYmP)AH`euTK!zg9*6Z z!>M=$3pd0!&TzU=hc_@@^Yd3eUQpX4-33}b{?~5t5lgW=ldJ@dUAH%`l5US1y_`40 zs(X`Qk}vvMDYYq+@Rm+~IyCX;iD~pMgq^KY)T*aBz@DYEB={PxA>)mI6tM*sx-DmGQHEaHwRrAmNjO!ZLHO4b;;5mf@zzlPhkP($JeZGE7 z?^XN}Gf_feGoG~BjUgVa*)O`>lX=$BSR2)uD<9 z>o^|nb1^oVDhQbfW>>!;8-7<}nL6L^V*4pB=>wwW+RXAeRvKED(n1;R`A6v$6gy0I(;Vf?!4;&sgn7F%LpM}6PQ?0%2Z@b{It<(G1CZ|>913E0nR2r^Pa*Bp z@tFGi*CQ~@Yc-?{cwu1 zsilf=k^+Qs>&WZG(3WDixisHpR>`+ihiRwkL(3T|=xsoNP*@XX3BU8hr57l3k;pni zI``=3Nl4xh4oDj<%>Q1zYXHr%Xg_xrK3Nq?vKX3|^Hb(Bj+lONTz>4yhU-UdXt2>j z<>S4NB&!iE+ao{0Tx^N*^|EZU;0kJkx@zh}S^P{ieQjGl468CbC`SWnwLRYYiStXm zOxt~Rb3D{dz=nHMcY)#r^kF8|q8KZHVb9FCX2m^X*(|L9FZg!5a7((!J8%MjT$#Fs)M1Pb zq6hBGp%O1A+&%2>l0mpaIzbo&jc^!oN^3zxap3V2dNj3x<=TwZ&0eKX5PIso9j1;e zwUg+C&}FJ`k(M|%%}p=6RPUq4sT3-Y;k-<68ciZ~_j|bt>&9ZLHNVrp#+pk}XvM{8 z`?k}o-!if>hVlCP9j%&WI2V`5SW)BCeR5>MQhF)po=p~AYN%cNa_BbV6EEh_kk^@a zD>4&>uCGCUmyA-c)%DIcF4R6!>?6T~Mj_m{Hpq`*(wj>foHL;;%;?(((YOxGt)Bhx zuS+K{{CUsaC++%}S6~CJ=|vr(iIs-je)e9uJEU8ZJAz)w166q)R^2XI?@E2vUQ!R% zn@dxS!JcOimXkWJBz8Y?2JKQr>`~SmE2F2SL38$SyR1^yqj8_mkBp)o$@+3BQ~Mid z9U$XVqxX3P=XCKj0*W>}L0~Em`(vG<>srF8+*kPrw z20{z(=^w+ybdGe~Oo_i|hYJ@kZl*(9sHw#Chi&OIc?w`nBODp?ia$uF%Hs(X>xm?j zqZQ`Ybf@g#wli`!-al~3GWiE$K+LCe=Ndi!#CVjzUZ z!sD2O*;d28zkl))m)YN7HDi^z5IuNo3^w(zy8 zszJG#mp#Cj)Q@E@r-=NP2FVxxEAeOI2e=|KshybNB6HgE^(r>HD{*}S}mO>LuRGJT{*tfTzw_#+er-0${}%YPe@CMJ1Ng#j#)i)SnY@ss3gL;g zg2D~#Kpdfu#G;q1qz_TwSz1VJT(b3zby$Vk&;Y#1(A)|xj`_?i5YQ;TR%jice5E;0 zYHg;`zS5{S*9xI6o^j>rE8Ua*XhIw{_-*&@(R|C(am8__>+Ws&Q^ymy*X4~hR2b5r zm^p3sw}yv=tdyncy_Ui7{BQS732et~Z_@{-IhHDXAV`(Wlay<#hb>%H%WDi+K$862nA@BDtM#UCKMu+kM`!JHyWSi?&)A7_ z3{cyNG%a~nnH_!+;g&JxEMAmh-Z}rC!o7>OVzW&PoMyTA_g{hqXG)SLraA^OP**<7 zjWbr7z!o2n3hnx7A=2O=WL;`@9N{vQIM@&|G-ljrPvIuJHYtss0Er0fT5cMXNUf1B z7FAwBDixt0X7C3S)mPe5g`YtME23wAnbU)+AtV}z+e8G;0BP=bI;?(#|Ep!vVfDbK zvx+|CKF>yt0hWQ3drchU#XBU+HiuG*V^snFAPUp-5<#R&BUAzoB!aZ+e*KIxa26V}s6?nBK(U-7REa573wg-jqCg>H8~>O{ z*C0JL-?X-k_y%hpUFL?I>0WV{oV`Nb)nZbJG01R~AG>flIJf)3O*oB2i8~;!P?Wo_ z0|QEB*fifiL6E6%>tlAYHm2cjTFE@*<);#>689Z6S#BySQ@VTMhf9vYQyLeDg1*F} zjq>i1*x>5|CGKN{l9br3kB0EHY|k4{%^t7-uhjd#NVipUZa=EUuE5kS1_~qYX?>hJ z$}!jc9$O$>J&wnu0SgfYods^z?J4X;X7c77Me0kS-dO_VUQ39T(Kv(Y#s}Qqz-0AH z^?WRL(4RzpkD+T5FG_0NyPq-a-B7A5LHOCqwObRJi&oRi(<;OuIN7SV5PeHU$<@Zh zPozEV`dYmu0Z&Tqd>t>8JVde9#Pt+l95iHe$4Xwfy1AhI zDM4XJ;bBTTvRFtW>E+GzkN)9k!hA5z;xUOL2 zq4}zn-DP{qc^i|Y%rvi|^5k-*8;JZ~9a;>-+q_EOX+p1Wz;>i7c}M6Nv`^NY&{J-> z`(mzDJDM}QPu5i44**2Qbo(XzZ-ZDu%6vm8w@DUarqXj41VqP~ zs&4Y8F^Waik3y1fQo`bVUH;b=!^QrWb)3Gl=QVKr+6sxc=ygauUG|cm?|X=;Q)kQ8 zM(xrICifa2p``I7>g2R~?a{hmw@{!NS5`VhH8+;cV(F>B94M*S;5#O`YzZH1Z%yD? zZ61w(M`#aS-*~Fj;x|J!KM|^o;MI#Xkh0ULJcA?o4u~f%Z^16ViA27FxU5GM*rKq( z7cS~MrZ=f>_OWx8j#-Q3%!aEU2hVuTu(7`TQk-Bi6*!<}0WQi;_FpO;fhpL4`DcWp zGOw9vx0N~6#}lz(r+dxIGZM3ah-8qrqMmeRh%{z@dbUD2w15*_4P?I~UZr^anP}DB zU9CCrNiy9I3~d#&!$DX9e?A});BjBtQ7oGAyoI$8YQrkLBIH@2;lt4E^)|d6Jwj}z z&2_E}Y;H#6I4<10d_&P0{4|EUacwFHauvrjAnAm6yeR#}f}Rk27CN)vhgRqEyPMMS7zvunj2?`f;%?alsJ+-K+IzjJx>h8 zu~m_y$!J5RWAh|C<6+uiCNsOKu)E72M3xKK(a9Okw3e_*O&}7llNV!=P87VM2DkAk zci!YXS2&=P0}Hx|wwSc9JP%m8dMJA*q&VFB0yMI@5vWoAGraygwn){R+Cj6B1a2Px z5)u(K5{+;z2n*_XD!+Auv#LJEM)(~Hx{$Yb^ldQmcYF2zNH1V30*)CN_|1$v2|`LnFUT$%-tO0Eg|c5$BB~yDfzS zcOXJ$wpzVK0MfTjBJ0b$r#_OvAJ3WRt+YOLlJPYMx~qp>^$$$h#bc|`g0pF-Ao43? z>*A+8lx>}L{p(Tni2Vvk)dtzg$hUKjSjXRagj)$h#8=KV>5s)J4vGtRn5kP|AXIz! zPgbbVxW{2o4s-UM;c#We8P&mPN|DW7_uLF!a|^0S=wr6Esx9Z$2|c1?GaupU6$tb| zY_KU`(_29O_%k(;>^|6*pZURH3`@%EuKS;Ns z1lujmf;r{qAN&Q0&m{wJSZ8MeE7RM5+Sq;ul_ z`+ADrd_Um+G37js6tKsArNB}n{p*zTUxQr>3@wA;{EUbjNjlNd6$Mx zg0|MyU)v`sa~tEY5$en7^PkC=S<2@!nEdG6L=h(vT__0F=S8Y&eM=hal#7eM(o^Lu z2?^;05&|CNliYrq6gUv;|i!(W{0N)LWd*@{2q*u)}u*> z7MQgk6t9OqqXMln?zoMAJcc zMKaof_Up})q#DzdF?w^%tTI7STI^@8=Wk#enR*)&%8yje>+tKvUYbW8UAPg55xb70 zEn5&Ba~NmOJlgI#iS8W3-@N%>V!#z-ZRwfPO1)dQdQkaHsiqG|~we2ALqG7Ruup(DqSOft2RFg_X%3w?6VqvV1uzX_@F(diNVp z4{I|}35=11u$;?|JFBEE*gb;T`dy+8gWJ9~pNsecrO`t#V9jW-6mnfO@ff9od}b(3s4>p0i30gbGIv~1@a^F2kl7YO;DxmF3? zWi-RoXhzRJV0&XE@ACc?+@6?)LQ2XNm4KfalMtsc%4!Fn0rl zpHTrHwR>t>7W?t!Yc{*-^xN%9P0cs0kr=`?bQ5T*oOo&VRRu+1chM!qj%2I!@+1XF z4GWJ=7ix9;Wa@xoZ0RP`NCWw0*8247Y4jIZ>GEW7zuoCFXl6xIvz$ezsWgKdVMBH> z{o!A7f;R-@eK9Vj7R40xx)T<2$?F2E<>Jy3F;;=Yt}WE59J!1WN367 zA^6pu_zLoZIf*x031CcwotS{L8bJE(<_F%j_KJ2P_IusaZXwN$&^t716W{M6X2r_~ zaiMwdISX7Y&Qi&Uh0upS3TyEIXNDICQlT5fHXC`aji-c{U(J@qh-mWl-uMN|T&435 z5)a1dvB|oe%b2mefc=Vpm0C%IUYYh7HI*;3UdgNIz}R##(#{(_>82|zB0L*1i4B5j-xi9O4x10rs_J6*gdRBX=@VJ+==sWb&_Qc6tSOowM{BX@(zawtjl zdU!F4OYw2@Tk1L^%~JCwb|e#3CC>srRHQ*(N%!7$Mu_sKh@|*XtR>)BmWw!;8-mq7 zBBnbjwx8Kyv|hd*`5}84flTHR1Y@@uqjG`UG+jN_YK&RYTt7DVwfEDXDW4U+iO{>K zw1hr{_XE*S*K9TzzUlJH2rh^hUm2v7_XjwTuYap|>zeEDY$HOq3X4Tz^X}E9z)x4F zs+T?Ed+Hj<#jY-`Va~fT2C$=qFT-5q$@p9~0{G&eeL~tiIAHXA!f6C(rAlS^)&k<- zXU|ZVs}XQ>s5iONo~t!XXZgtaP$Iau;JT%h)>}v54yut~pykaNye4axEK#5@?TSsQ zE;Jvf9I$GVb|S`7$pG)4vgo9NXsKr?u=F!GnA%VS2z$@Z(!MR9?EPcAqi5ft)Iz6sNl`%kj+_H-X`R<>BFrBW=fSlD|{`D%@Rcbu2?%>t7i34k?Ujb)2@J-`j#4 zLK<69qcUuniIan-$A1+fR=?@+thwDIXtF1Tks@Br-xY zfB+zblrR(ke`U;6U~-;p1Kg8Lh6v~LjW@9l2P6s+?$2!ZRPX`(ZkRGe7~q(4&gEi<$ch`5kQ?*1=GSqkeV z{SA1EaW_A!t{@^UY2D^YO0(H@+kFVzZaAh0_`A`f(}G~EP~?B|%gtxu&g%^x{EYSz zk+T;_c@d;+n@$<>V%P=nk36?L!}?*=vK4>nJSm+1%a}9UlmTJTrfX4{Lb7smNQn@T zw9p2%(Zjl^bWGo1;DuMHN(djsEm)P8mEC2sL@KyPjwD@d%QnZ$ zMJ3cnn!_!iP{MzWk%PI&D?m?C(y2d|2VChluN^yHya(b`h>~GkI1y;}O_E57zOs!{ zt2C@M$^PR2U#(dZmA-sNreB@z-yb0Bf7j*yONhZG=onhx>t4)RB`r6&TP$n zgmN*)eCqvgriBO-abHQ8ECN0bw?z5Bxpx z=jF@?zFdVn?@gD5egM4o$m`}lV(CWrOKKq(sv*`mNcHcvw&Xryfw<{ch{O&qc#WCTXX6=#{MV@q#iHYba!OUY+MGeNTjP%Fj!WgM&`&RlI^=AWTOqy-o zHo9YFt!gQ*p7{Fl86>#-JLZo(b^O`LdFK~OsZBRR@6P?ad^Ujbqm_j^XycM4ZHFyg ziUbIFW#2tj`65~#2V!4z7DM8Z;fG0|APaQ{a2VNYpNotB7eZ5kp+tPDz&Lqs0j%Y4tA*URpcfi z_M(FD=fRGdqf430j}1z`O0I=;tLu81bwJXdYiN7_&a-?ly|-j*+=--XGvCq#32Gh(=|qj5F?kmihk{%M&$}udW5)DHK zF_>}5R8&&API}o0osZJRL3n~>76nUZ&L&iy^s>PMnNcYZ|9*1$v-bzbT3rpWsJ+y{ zPrg>5Zlery96Um?lc6L|)}&{992{_$J&=4%nRp9BAC6!IB=A&=tF>r8S*O-=!G(_( zwXbX_rGZgeiK*&n5E;f=k{ktyA1(;x_kiMEt0*gpp_4&(twlS2e5C?NoD{n>X2AT# zY@Zp?#!b1zNq96MQqeO*M1MMBin5v#RH52&Xd~DO6-BZLnA6xO1$sou(YJ1Dlc{WF zVa%2DyYm`V#81jP@70IJ;DX@y*iUt$MLm)ByAD$eUuji|5{ptFYq(q)mE(5bOpxjM z^Q`AHWq44SG3`_LxC9fwR)XRVIp=B%<(-lOC3jI#bb@dK(*vjom!=t|#<@dZql%>O z15y^{4tQoeW9Lu%G&V$90x6F)xN6y_oIn;!Q zs)8jT$;&;u%Y>=T3hg34A-+Y*na=|glcStr5D;&5*t5*DmD~x;zQAV5{}Ya`?RRGa zT*t9@$a~!co;pD^!J5bo?lDOWFx%)Y=-fJ+PDGc0>;=q=s?P4aHForSB+)v0WY2JH z?*`O;RHum6j%#LG)Vu#ciO#+jRC3!>T(9fr+XE7T2B7Z|0nR5jw@WG)kDDzTJ=o4~ zUpeyt7}_nd`t}j9BKqryOha{34erm)RmST)_9Aw)@ zHbiyg5n&E{_CQR@h<}34d7WM{s{%5wdty1l+KX8*?+-YkNK2Be*6&jc>@{Fd;Ps|| z26LqdI3#9le?;}risDq$K5G3yoqK}C^@-8z^wj%tdgw-6@F#Ju{Sg7+y)L?)U$ez> zoOaP$UFZ?y5BiFycir*pnaAaY+|%1%8&|(@VB)zweR%?IidwJyK5J!STzw&2RFx zZV@qeaCB01Hu#U9|1#=Msc8Pgz5P*4Lrp!Q+~(G!OiNR{qa7|r^H?FC6gVhkk3y7=uW#Sh;&>78bZ}aK*C#NH$9rX@M3f{nckYI+5QG?Aj1DM)@~z_ zw!UAD@gedTlePB*%4+55naJ8ak_;))#S;4ji!LOqY5VRI){GMwHR~}6t4g>5C_#U# ztYC!tjKjrKvRy=GAsJVK++~$|+s!w9z3H4G^mACv=EErXNSmH7qN}%PKcN|8%9=i)qS5+$L zu&ya~HW%RMVJi4T^pv?>mw*Gf<)-7gf#Qj|e#w2|v4#t!%Jk{&xlf;$_?jW*n!Pyx zkG$<18kiLOAUPuFfyu-EfWX%4jYnjBYc~~*9JEz6oa)_R|8wjZA|RNrAp%}14L7fW zi7A5Wym*K+V8pkqqO-X#3ft{0qs?KVt^)?kS>AicmeO&q+~J~ zp0YJ_P~_a8j= zsAs~G=8F=M{4GZL{|B__UorX@MRNQLn?*_gym4aW(~+i13knnk1P=khoC-ViMZk+x zLW(l}oAg1H`dU+Fv**;qw|ANDSRs>cGqL!Yw^`; zv;{E&8CNJcc)GHzTYM}f&NPw<6j{C3gaeelU#y!M)w-utYEHOCCJo|Vgp7K6C_$14 zqIrLUB0bsgz^D%V%fbo2f9#yb#CntTX?55Xy|Kps&Xek*4_r=KDZ z+`TQuv|$l}MWLzA5Ay6Cvsa^7xvwXpy?`w(6vx4XJ zWuf1bVSb#U8{xlY4+wlZ$9jjPk)X_;NFMqdgq>m&W=!KtP+6NL57`AMljW+es zzqjUjgz;V*kktJI?!NOg^s_)ph45>4UDA!Vo0hn>KZ+h-3=?Y3*R=#!fOX zP$Y~+14$f66ix?UWB_6r#fMcC^~X4R-<&OD1CSDNuX~y^YwJ>sW0j`T<2+3F9>cLo z#!j57$ll2K9(%$4>eA7(>FJX5e)pR5&EZK!IMQzOfik#FU*o*LGz~7u(8}XzIQRy- z!U7AlMTIe|DgQFmc%cHy_9^{o`eD%ja_L>ckU6$O4*U**o5uR7`FzqkU8k4gxtI=o z^P^oGFPm5jwZMI{;nH}$?p@uV8FT4r=|#GziKXK07bHJLtK}X%I0TON$uj(iJ`SY^ zc$b2CoxCQ>7LH@nxcdW&_C#fMYBtTxcg46dL{vf%EFCZ~eErMvZq&Z%Lhumnkn^4A zsx$ay(FnN7kYah}tZ@0?-0Niroa~13`?hVi6`ndno`G+E8;$<6^gsE-K3)TxyoJ4M zb6pj5=I8^FD5H@`^V#Qb2^0cx7wUz&cruA5g>6>qR5)O^t1(-qqP&1g=qvY#s&{bx zq8Hc%LsbK1*%n|Y=FfojpE;w~)G0-X4i*K3{o|J7`krhIOd*c*$y{WIKz2n2*EXEH zT{oml3Th5k*vkswuFXdGDlcLj15Nec5pFfZ*0?XHaF_lVuiB%Pv&p7z)%38}%$Gup zVTa~C8=cw%6BKn_|4E?bPNW4PT7}jZQLhDJhvf4z;~L)506IE0 zX!tWXX(QOQPRj-p80QG79t8T2^az4Zp2hOHziQlvT!|H)jv{Ixodabzv6lBj)6WRB z{)Kg@$~~(7$-az?lw$4@L%I&DI0Lo)PEJJziWP33a3azb?jyXt1v0N>2kxwA6b%l> zZqRpAo)Npi&loWbjFWtEV)783BbeIAhqyuc+~>i7aQ8shIXt)bjCWT6$~ro^>99G} z2XfmT0(|l!)XJb^E!#3z4oEGIsL(xd; zYX1`1I(cG|u#4R4T&C|m*9KB1`UzKvho5R@1eYtUL9B72{i(ir&ls8g!pD ztR|25xGaF!4z5M+U@@lQf(12?xGy`!|3E}7pI$k`jOIFjiDr{tqf0va&3pOn6Pu)% z@xtG2zjYuJXrV)DUrIF*y<1O1<$#54kZ#2;=X51J^F#0nZ0(;S$OZDt_U2bx{RZ=Q zMMdd$fH|!s{ zXq#l;{`xfV`gp&C>A`WrQU?d{!Ey5(1u*VLJt>i27aZ-^&2IIk=zP5p+{$q(K?2(b z8?9h)kvj9SF!Dr zoyF}?V|9;6abHxWk2cEvGs$-}Pg}D+ZzgkaN&$Snp%;5m%zh1E#?Wac-}x?BYlGN#U#Mek*}kek#I9XaHt?mz3*fDrRTQ#&#~xyeqJk1QJ~E$7qsw6 z?sV;|?*=-{M<1+hXoj?@-$y+(^BJ1H~wQ9G8C0#^aEAyhDduNX@haoa=PuPp zYsGv8UBfQaRHgBgLjmP^eh>fLMeh{8ic)?xz?#3kX-D#Z{;W#cd_`9OMFIaJg-=t`_3*!YDgtNQ2+QUEAJB9M{~AvT$H`E)IKmCR21H532+ata8_i_MR@ z2Xj<3w<`isF~Ah$W{|9;51ub*f4#9ziKrOR&jM{x7I_7()O@`F*5o$KtZ?fxU~g`t zUovNEVKYn$U~VX8eR)qb`7;D8pn*Pp$(otYTqL)5KH$lUS-jf}PGBjy$weoceAcPp z&5ZYB$r&P$MN{0H0AxCe4Qmd3T%M*5d4i%#!nmBCN-WU-4m4Tjxn-%j3HagwTxCZ9 z)j5vO-C7%s%D!&UfO>bi2oXiCw<-w{vVTK^rVbv#W=WjdADJy8$khnU!`ZWCIU`># zyjc^1W~pcu>@lDZ{zr6gv%)2X4n27~Ve+cQqcND%0?IFSP4sH#yIaXXYAq^z3|cg` z`I3$m%jra>e2W-=DiD@84T!cb%||k)nPmEE09NC%@PS_OLhkrX*U!cgD*;;&gIaA(DyVT4QD+q_xu z>r`tg{hiGY&DvD-)B*h+YEd+Zn)WylQl}<4>(_NlsKXCRV;a)Rcw!wtelM2_rWX`j zTh5A|i6=2BA(iMCnj_fob@*eA;V?oa4Z1kRBGaU07O70fb6-qmA$Hg$ps@^ka1=RO zTbE_2#)1bndC3VuK@e!Sftxq4=Uux}fDxXE#Q5_x=E1h>T5`DPHz zbH<_OjWx$wy7=%0!mo*qH*7N4tySm+R0~(rbus`7;+wGh;C0O%x~fEMkt!eV>U$`i z5>Q(o z=t$gPjgGh0&I7KY#k50V7DJRX<%^X z>6+ebc9efB3@eE2Tr){;?_w`vhgF>`-GDY(YkR{9RH(MiCnyRtd!LxXJ75z+?2 zGi@m^+2hKJ5sB1@Xi@s_@p_Kwbc<*LQ_`mr^Y%j}(sV_$`J(?_FWP)4NW*BIL~sR>t6 zM;qTJZ~GoY36&{h-Pf}L#y2UtR}>ZaI%A6VkU>vG4~}9^i$5WP2Tj?Cc}5oQxe2=q z8BeLa$hwCg_psjZyC2+?yX4*hJ58Wu^w9}}7X*+i5Rjqu5^@GzXiw#SUir1G1`jY% zOL=GE_ENYxhcyUrEt9XlMNP6kx6h&%6^u3@zB8KUCAa18T(R2J`%JjWZ z!{7cXaEW+Qu*iJPu+m>QqW}Lo$4Z+!I)0JNzZ&_M%=|B1yejFRM04bGAvu{=lNPd+ zJRI^DRQ(?FcVUD+bgEcAi@o(msqys9RTCG#)TjI!9~3-dc`>gW;HSJuQvH~d`MQs86R$|SKXHh zqS9Qy)u;T`>>a!$LuaE2keJV%;8g)tr&Nnc;EkvA-RanHXsy)D@XN0a>h}z2j81R; zsUNJf&g&rKpuD0WD@=dDrPHdBoK42WoBU|nMo17o(5^;M|dB4?|FsAGVrSyWcI`+FVw^vTVC`y}f(BwJl zrw3Sp151^9=}B})6@H*i4-dIN_o^br+BkcLa^H56|^2XsT0dESw2 zMX>(KqNl=x2K5=zIKg}2JpGAZu{I_IO}0$EQ5P{4zol**PCt3F4`GX}2@vr8#Y)~J zKb)gJeHcFnR@4SSh%b;c%J`l=W*40UPjF#q{<}ywv-=vHRFmDjv)NtmC zQx9qm)d%0zH&qG7AFa3VAU1S^(n8VFTC~Hb+HjYMjX8r#&_0MzlNR*mnLH5hi}`@{ zK$8qiDDvS_(L9_2vHgzEQ${DYSE;DqB!g*jhJghE&=LTnbgl&Xepo<*uRtV{2wDHN z)l;Kg$TA>Y|K8Lc&LjWGj<+bp4Hiye_@BfU(y#nF{fpR&|Ltbye?e^j0}8JC4#xi% zv29ZR%8%hk=3ZDvO-@1u8KmQ@6p%E|dlHuy#H1&MiC<*$YdLkHmR#F3ae;bKd;@*i z2_VfELG=B}JMLCO-6UQy^>RDE%K4b>c%9ki`f~Z2Qu8hO7C#t%Aeg8E%+}6P7Twtg z-)dj(w}_zFK&86KR@q9MHicUAucLVshUdmz_2@32(V`y3`&Kf8Q2I)+!n0mR=rrDU zXvv^$ho;yh*kNqJ#r1}b0|i|xRUF6;lhx$M*uG3SNLUTC@|htC z-=fsw^F%$qqz4%QdjBrS+ov}Qv!z00E+JWas>p?z@=t!WWU3K*?Z(0meTuTOC7OTx zU|kFLE0bLZ+WGcL$u4E}5dB0g`h|uwv3=H6f+{5z9oLv-=Q45+n~V4WwgO=CabjM% zBAN+RjM65(-}>Q2V#i1Na@a0`08g&y;W#@sBiX6Tpy8r}*+{RnyGUT`?XeHSqo#|J z^ww~c;ou|iyzpErDtlVU=`8N7JSu>4M z_pr9=tX0edVn9B}YFO2y(88j#S{w%E8vVOpAboK*27a7e4Ekjt0)hIX99*1oE;vex z7#%jhY=bPijA=Ce@9rRO(Vl_vnd00!^TAc<+wVvRM9{;hP*rqEL_(RzfK$er_^SN; z)1a8vo8~Dr5?;0X0J62Cusw$A*c^Sx1)dom`-)Pl7hsW4i(r*^Mw`z5K>!2ixB_mu z*Ddqjh}zceRFdmuX1akM1$3>G=#~|y?eYv(e-`Qy?bRHIq=fMaN~fB zUa6I8Rt=)jnplP>yuS+P&PxeWpJ#1$F`iqRl|jF$WL_aZFZl@kLo&d$VJtu&w?Q0O zzuXK>6gmygq(yXJy0C1SL}T8AplK|AGNUOhzlGeK_oo|haD@)5PxF}rV+5`-w{Aag zus45t=FU*{LguJ11Sr-28EZkq;!mJO7AQGih1L4rEyUmp>B!%X0YemsrV3QFvlgt* z5kwlPzaiJ+kZ^PMd-RRbl(Y?F*m`4*UIhIuf#8q>H_M=fM*L_Op-<_r zBZagV=4B|EW+KTja?srADTZXCd3Yv%^Chfpi)cg{ED${SI>InNpRj5!euKv?=Xn92 zsS&FH(*w`qLIy$doc>RE&A5R?u zzkl1sxX|{*fLpXvIW>9d<$ePROttn3oc6R!sN{&Y+>Jr@yeQN$sFR z;w6A<2-0%UA?c8Qf;sX7>>uKRBv3Ni)E9pI{uVzX|6Bb0U)`lhLE3hK58ivfRs1}d zNjlGK0hdq0qjV@q1qI%ZFMLgcpWSY~mB^LK)4GZ^h_@H+3?dAe_a~k*;9P_d7%NEFP6+ zgV(oGr*?W(ql?6SQ~`lUsjLb%MbfC4V$)1E0Y_b|OIYxz4?O|!kRb?BGrgiH5+(>s zoqM}v*;OBfg-D1l`M6T6{K`LG+0dJ1)!??G5g(2*vlNkm%Q(MPABT$r13q?|+kL4- zf)Mi5r$sn;u41aK(K#!m+goyd$c!KPl~-&-({j#D4^7hQkV3W|&>l_b!}!z?4($OA z5IrkfuT#F&S1(`?modY&I40%gtroig{YMvF{K{>5u^I51k8RriGd${z)=5k2tG zM|&Bp5kDTfb#vfuTTd?)a=>bX=lokw^y9+2LS?kwHQIWI~pYgy7 zb?A-RKVm_vM5!9?C%qYdfRAw& zAU7`up~%g=p@}pg#b7E)BFYx3g%(J36Nw(Dij!b>cMl@CSNbrW!DBDbTD4OXk!G4x zi}JBKc8HBYx$J~31PXH+4^x|UxK~(<@I;^3pWN$E=sYma@JP|8YL`L(zI6Y#c%Q{6 z*APf`DU$S4pr#_!60BH$FGViP14iJmbrzSrOkR;f3YZa{#E7Wpd@^4E-zH8EgPc-# zKWFPvh%WbqU_%ZEt`=Q?odKHc7@SUmY{GK`?40VuL~o)bS|is$Hn=<=KGHOsEC5tB zFb|q}gGlL97NUf$G$>^1b^3E18PZ~Pm9kX%*ftnolljiEt@2#F2R5ah$zbXd%V_Ev zyDd{1o_uuoBga$fB@Fw!V5F3jIr=a-ykqrK?WWZ#a(bglI_-8pq74RK*KfQ z0~Dzus7_l;pMJYf>Bk`)`S8gF!To-BdMnVw5M-pyu+aCiC5dwNH|6fgRsIKZcF&)g zr}1|?VOp}I3)IR@m1&HX1~#wsS!4iYqES zK}4J{Ei>;e3>LB#Oly>EZkW14^@YmpbgxCDi#0RgdM${&wxR+LiX}B+iRioOB0(pDKpVEI;ND?wNx>%e|m{RsqR_{(nmQ z3ZS}@t!p4a(BKx_-CYwrcyJ5u1TO9bcXti$8sy>xcLKqKCc#~UOZYD{llKTSFEjJ~ zyNWt>tLU}*>^`TvPxtP%F`ZJQw@W0^>x;!^@?k_)9#bF$j0)S3;mH-IR5y82l|%=F z2lR8zhP?XNP-ucZZ6A+o$xOyF!w;RaLHGh57GZ|TCXhJqY~GCh)aXEV$1O&$c}La1 zjuJxkY9SM4av^Hb;i7efiYaMwI%jGy`3NdY)+mcJhF(3XEiSlU3c|jMBi|;m-c?~T z+x0_@;SxcoY=(6xNgO$bBt~Pj8`-<1S|;Bsjrzw3@zSjt^JC3X3*$HI79i~!$RmTz zsblZsLYs7L$|=1CB$8qS!tXrWs!F@BVuh?kN(PvE5Av-*r^iYu+L^j^m9JG^#=m>@ z=1soa)H*w6KzoR$B8mBCXoU;f5^bVuwQ3~2LKg!yxomG1#XPmn(?YH@E~_ED+W6mxs%x{%Z<$pW`~ON1~2XjP5v(0{C{+6Dm$00tsd3w=f=ZENy zOgb-=f}|Hb*LQ$YdWg<(u7x3`PKF)B7ZfZ6;1FrNM63 z?O6tE%EiU@6%rVuwIQjvGtOofZBGZT1Sh(xLIYt9c4VI8`!=UJd2BfLjdRI#SbVAX ziT(f*RI^T!IL5Ac>ql7uduF#nuCRJ1)2bdvAyMxp-5^Ww5p#X{rb5)(X|fEhDHHW{ zw(Lfc$g;+Q`B0AiPGtmK%*aWfQQ$d!*U<|-@n2HZvCWSiw^I>#vh+LyC;aaVWGbmkENr z&kl*8o^_FW$T?rDYLO1Pyi%>@&kJKQoH2E0F`HjcN}Zlnx1ddoDA>G4Xu_jyp6vuT zPvC}pT&Owx+qB`zUeR|4G;OH(<<^_bzkjln0k40t`PQxc$7h(T8Ya~X+9gDc8Z9{Z z&y0RAU}#_kQGrM;__MK9vwIwK^aoqFhk~dK!ARf1zJqHMxF2?7-8|~yoO@_~Ed;_wvT%Vs{9RK$6uUQ|&@#6vyBsFK9eZW1Ft#D2)VpQRwpR(;x^ zdoTgMqfF9iBl%{`QDv7B0~8{8`8k`C4@cbZAXBu00v#kYl!#_Wug{)2PwD5cNp?K^ z9+|d-4z|gZ!L{57>!Ogfbzchm>J1)Y%?NThxIS8frAw@z>Zb9v%3_3~F@<=LG%r*U zaTov}{{^z~SeX!qgSYow`_5)ij*QtGp4lvF`aIGQ>@3ZTkDmsl#@^5*NGjOuu82}o zzLF~Q9SW+mP=>88%eSA1W4_W7-Q>rdq^?t=m6}^tDPaBRGFLg%ak93W!kOp#EO{6& zP%}Iff5HZQ9VW$~+9r=|Quj#z*=YwcnssS~9|ub2>v|u1JXP47vZ1&L1O%Z1DsOrDfSIMHU{VT>&>H=9}G3i@2rP+rx@eU@uE8rJNec zij~#FmuEBj03F1~ct@C@$>y)zB+tVyjV3*n`mtAhIM0$58vM9jOQC}JJOem|EpwqeMuYPxu3sv}oMS?S#o6GGK@8PN59)m&K4Dc&X% z(;XL_kKeYkafzS3Wn5DD>Yiw{LACy_#jY4op(>9q>>-*9@C0M+=b#bknAWZ37^(Ij zq>H%<@>o4a#6NydoF{_M4i4zB_KG)#PSye9bk0Ou8h%1Dtl7Q_y#7*n%g)?m>xF~( zjqvOwC;*qvN_3(*a+w2|ao0D?@okOvg8JskUw(l7n`0fncglavwKd?~l_ryKJ^Ky! zKCHkIC-o7%fFvPa$)YNh022lakMar^dgL=t#@XLyNHHw!b?%WlM)R@^!)I!smZL@k zBi=6wE5)2v&!UNV(&)oOYW(6Qa!nUjDKKBf-~Da=#^HE4(@mWk)LPvhyN3i4goB$3K8iV7uh zsv+a?#c4&NWeK(3AH;ETrMOIFgu{_@%XRwCZ;L=^8Ts)hix4Pf3yJRQ<8xb^CkdmC z?c_gB)XmRsk`9ch#tx4*hO=#qS7={~Vb4*tTf<5P%*-XMfUUYkI9T1cEF;ObfxxI-yNuA=I$dCtz3ey znVkctYD*`fUuZ(57+^B*R=Q}~{1z#2!ca?)+YsRQb+lt^LmEvZt_`=j^wqig+wz@n@ z`LIMQJT3bxMzuKg8EGBU+Q-6cs5(@5W?N>JpZL{$9VF)veF`L5%DSYTNQEypW%6$u zm_~}T{HeHj1bAlKl8ii92l9~$dm=UM21kLemA&b$;^!wB7#IKWGnF$TVq!!lBlG4 z{?Rjz?P(uvid+|i$VH?`-C&Gcb3{(~Vpg`w+O);Wk1|Mrjxrht0GfRUnZqz2MhrXa zqgVC9nemD5)H$to=~hp)c=l9?#~Z_7i~=U-`FZxb-|TR9@YCxx;Zjo-WpMNOn2)z) zFPGGVl%3N$f`gp$gPnWC+f4(rmts%fidpo^BJx72zAd7|*Xi{2VXmbOm)1`w^tm9% znM=0Fg4bDxH5PxPEm{P3#A(mxqlM7SIARP?|2&+c7qmU8kP&iApzL|F>Dz)Ixp_`O zP%xrP1M6@oYhgo$ZWwrAsYLa4 z|I;DAvJxno9HkQrhLPQk-8}=De{9U3U%)dJ$955?_AOms!9gia%)0E$Mp}$+0er@< zq7J&_SzvShM?e%V?_zUu{niL@gt5UFOjFJUJ}L?$f%eU%jUSoujr{^O=?=^{19`ON zlRIy8Uo_nqcPa6@yyz`CM?pMJ^^SN^Fqtt`GQ8Q#W4kE7`V9^LT}j#pMChl!j#g#J zr-=CCaV%xyFeQ9SK+mG(cTwW*)xa(eK;_Z(jy)woZp~> zA(4}-&VH+TEeLzPTqw&FOoK(ZjD~m{KW05fiGLe@E3Z2`rLukIDahE*`u!ubU)9`o zn^-lyht#E#-dt~S>}4y$-mSbR8{T@}22cn^refuQ08NjLOv?JiEWjyOnzk<^R5%gO zhUH_B{oz~u#IYwVnUg8?3P*#DqD8#X;%q%HY**=I>>-S|!X*-!x1{^l#OnR56O>iD zc;i;KS+t$koh)E3)w0OjWJl_aW2;xF=9D9Kr>)(5}4FqUbk# zI#$N8o0w;IChL49m9CJTzoC!|u{Ljd%ECgBOf$}&jA^$(V#P#~)`&g`H8E{uv52pp zwto`xUL-L&WTAVREEm$0g_gYPL(^vHq(*t1WCH_6alhkeW&GCZ3hL)|{O-jiFOBrF z!EW=Jej|dqQitT6!B-7&io2K)WIm~Q)v@yq%U|VpV+I?{y0@Yd%n8~-NuuM*pM~KA z85YB};IS~M(c<}4Hxx>qRK0cdl&e?t253N%vefkgds>Ubn8X}j6Vpgs>a#nFq$osY z1ZRwLqFv=+BTb=i%D2Wv>_yE0z}+niZ4?rE|*a3d7^kndWGwnFqt+iZ(7+aln<}jzbAQ(#Z2SS}3S$%Bd}^ zc9ghB%O)Z_mTZMRC&H#)I#fiLuIkGa^`4e~9oM5zKPx?zjkC&Xy0~r{;S?FS%c7w< zWbMpzc(xSw?9tGxG~_l}Acq}zjt5ClaB7-!vzqnlrX;}$#+PyQ9oU)_DfePh2E1<7 ztok6g6K^k^DuHR*iJ?jw?bs_whk|bx`dxu^nC6#e{1*m~z1eq7m}Cf$*^Eua(oi_I zAL+3opNhJteu&mWQ@kQWPucmiP)4|nFG`b2tpC;h{-PI@`+h?9v=9mn|0R-n8#t=+Z*FD(c5 zjj79Jxkgck*DV=wpFgRZuwr%}KTm+dx?RT@aUHJdaX-ODh~gByS?WGx&czAkvkg;x zrf92l8$Or_zOwJVwh>5rB`Q5_5}ef6DjS*$x30nZbuO3dijS*wvNEqTY5p1_A0gWr znH<(Qvb!os14|R)n2Ost>jS2;d1zyLHu`Svm|&dZD+PpP{Bh>U&`Md;gRl64q;>{8MJJM$?UNUd`aC>BiLe>*{ zJY15->yW+<3rLgYeTruFDtk1ovU<$(_y7#HgUq>)r0{^}Xbth}V#6?%5jeFYt;SG^ z3qF)=uWRU;Jj)Q}cpY8-H+l_n$2$6{ZR?&*IGr{>ek!69ZH0ZoJ*Ji+ezzlJ^%qL3 zO5a`6gwFw(moEzqxh=yJ9M1FTn!eo&qD#y5AZXErHs%22?A+JmS&GIolml!)rZTnUDM3YgzYfT#;OXn)`PWv3Ta z!-i|-Wojv*k&bC}_JJDjiAK(Ba|YZgUI{f}TdEOFT2+}nPmttytw7j%@bQZDV1vvj z^rp{gRkCDmYJHGrE1~e~AE!-&6B6`7UxVQuvRrfdFkGX8H~SNP_X4EodVd;lXd^>eV1jN+Tt4}Rsn)R0LxBz0c=NXU|pUe!MQQFkGBWbR3&(jLm z%RSLc#p}5_dO{GD=DEFr=Fc% z85CBF>*t!6ugI?soX(*JNxBp+-DdZ4X0LldiK}+WWGvXV(C(Ht|!3$psR=&c*HIM=BmX;pRIpz@Ale{9dhGe(U2|Giv;# zOc|;?p67J=Q(kamB*aus=|XP|m{jN^6@V*Bpm?ye56Njh#vyJqE=DweC;?Rv7faX~ zde03n^I~0B2vUmr;w^X37tVxUK?4}ifsSH5_kpKZIzpYu0;Kv}SBGfI2AKNp+VN#z`nI{UNDRbo-wqa4NEls zICRJpu)??cj^*WcZ^MAv+;bDbh~gpN$1Cor<{Y2oyIDws^JsfW^5AL$azE(T0p&pP z1Mv~6Q44R&RHoH95&OuGx2srIr<@zYJTOMKiVs;Bx3py89I87LOb@%mr`0)#;7_~Z zzcZj8?w=)>%5@HoCHE_&hnu(n_yQ-L(~VjpjjkbT7e)Dk5??fApg(d>vwLRJ-x{um z*Nt?DqTSxh_MIyogY!vf1mU1`Gld-&L)*43f6dilz`Q@HEz;+>MDDYv9u!s;WXeao zUq=TaL$P*IFgJzrGc>j1dDOd zed+=ZBo?w4mr$2)Ya}?vedDopomhW1`#P<%YOJ_j=WwClX0xJH-f@s?^tmzs_j7t!k zK@j^zS0Q|mM4tVP5Ram$VbS6|YDY&y?Q1r1joe9dj08#CM{RSMTU}(RCh`hp_Rkl- zGd|Cv~G@F{DLhCizAm9AN!^{rNs8hu!G@8RpnGx7e`-+K$ffN<0qjR zGq^$dj_Tv!n*?zOSyk5skI7JVKJ)3jysnjIu-@VSzQiP8r6MzudCU=~?v-U8yzo^7 zGf~SUTvEp+S*!X9uX!sq=o}lH;r{pzk~M*VA(uyQ`3C8!{C;)&6)95fv(cK!%Cuz$ z_Zal57H6kPN>25KNiI6z6F)jzEkh#%OqU#-__Xzy)KyH};81#N6OfX$$IXWzOn`Q& z4f$Z1t>)8&8PcYfEwY5UadU1yg+U*(1m2ZlHoC-!2?gB!!fLhmTl))D@dhvkx#+Yj z1O=LV{(T%{^IeCuFK>%QR!VZ4GnO5tK8a+thWE zg4VytZrwcS?7^ zuZfhYnB8dwd%VLO?DK7pV5Wi<(`~DYqOXn8#jUIL^)12*Dbhk4GmL_E2`WX&iT16o zk(t|hok(Y|v-wzn?4x34T)|+SfZP>fiq!><*%vnxGN~ypST-FtC+@TPv*vYv@iU!_ z@2gf|PrgQ?Ktf*9^CnJ(x*CtZVB8!OBfg0%!wL;Z8(tYYre0vcnPGlyCc$V(Ipl*P z_(J!a=o@vp^%Efme!K74(Ke7A>Y}|sxV+JL^aYa{~m%5#$$+R1? zGaQhZTTX!#s#=Xtpegqero$RNt&`4xn3g$)=y*;=N=Qai)}~`xtxI_N*#MMCIq#HFifT zz(-*m;pVH&+4bixL&Bbg)W5FN^bH87pAHp)zPkWNMfTFqS=l~AC$3FX3kQUSh_C?-ZftyClgM)o_D7cX$RGlEYblux0jv5 zTr|i-I3@ZPCGheCl~BGhImF)K4!9@?pC(gi3ozX=a!|r1)LFxy_8c&wY0<^{2cm|P zv6Y`QktY*;I)IUd5y3ne1CqpVanlY45z8hf4&$EUBnucDj16pDa4&GI&TArYhf*xh zdj>*%APH8(h~c>o@l#%T>R$e>rwVx_WUB|~V`p^JHsg*y12lzj&zF}w6W09HwB2yb z%Q~`es&(;7#*DUC_w-Dmt7|$*?TA_m;zB+-u{2;Bg{O}nV7G_@7~<)Bv8fH^G$XG8$(&{A zwXJK5LRK%M34(t$&NI~MHT{UQ9qN-V_yn|%PqC81EIiSzmMM=2zb`mIwiP_b)x+2M z7Gd`83h79j#SItpQ}luuf2uOU`my_rY5T{6P#BNlb%h%<#MZb=m@y5aW;#o1^2Z)SWo+b`y0gV^iRcZtz5!-05vF z7wNo=hc6h4hc&s@uL^jqRvD6thVYtbErDK9k!;+a0xoE0WL7zLixjn5;$fXvT=O3I zT6jI&^A7k6R{&5#lVjz#8%_RiAa2{di{`kx79K+j72$H(!ass|B%@l%KeeKchYLe_ z>!(JC2fxsv>XVen+Y42GeYPxMWqm`6F$(E<6^s|g(slNk!lL*6v^W2>f6hh^mE$s= z3D$)}{V5(Qm&A6bp%2Q}*GZ5Qrf}n7*Hr51?bJOyA-?B4vg6y_EX<*-e20h{=0Mxs zbuQGZ$fLyO5v$nQ&^kuH+mNq9O#MWSfThtH|0q1i!NrWj^S}_P;Q1OkYLW6U^?_7G zx2wg?CULj7))QU(n{$0JE%1t2dWrMi2g-Os{v|8^wK{@qlj%+1b^?NI z$}l2tjp0g>K3O+p%yK<9!XqmQ?E9>z&(|^Pi~aSRwI5x$jaA62GFz9%fmO3t3a>cq zK8Xbv=5Ps~4mKN5+Eqw12(!PEyedFXv~VLxMB~HwT1Vfo51pQ#D8e$e4pFZ{&RC2P z5gTIzl{3!&(tor^BwZfR8j4k{7Rq#`riKXP2O-Bh66#WWK2w=z;iD9GLl+3 zpHIaI4#lQ&S-xBK8PiQ%dwOh?%BO~DCo06pN7<^dnZCN@NzY{_Z1>rrB0U|nC&+!2 z2y!oBcTd2;@lzyk(B=TkyZ)zy0deK05*Q0zk+o$@nun`VI1Er7pjq>8V zNmlW{p7S^Btgb(TA}jL(uR>`0w8gHP^T~Sh5Tkip^spk4SBAhC{TZU}_Z)UJw-}zm zPq{KBm!k)?P{`-(9?LFt&YN4s%SIZ-9lJ!Ws~B%exHOeVFk3~}HewnnH(d)qkLQ_d z6h>O)pEE{vbOVw}E+jdYC^wM+AAhaI(YAibUc@B#_mDss0Ji&BK{WG`4 zOk>vSNq(Bq2IB@s>>Rxm6Wv?h;ZXkpb1l8u|+_qXWdC*jjcPCixq;!%BVPSp#hP zqo`%cNf&YoQXHC$D=D45RiT|5ngPlh?0T~?lUf*O)){K@*Kbh?3RW1j9-T?%lDk@y z4+~?wKI%Y!-=O|_IuKz|=)F;V7ps=5@g)RrE;;tvM$gUhG>jHcw2Hr@fS+k^Zr~>G z^JvPrZc}_&d_kEsqAEMTMJw!!CBw)u&ZVzmq+ZworuaE&TT>$pYsd9|g9O^0orAe8 z221?Va!l1|Y5X1Y?{G7rt1sX#qFA^?RLG^VjoxPf63;AS=_mVDfGJKg73L zsGdnTUD40y(>S##2l|W2Cy!H(@@5KBa(#gs`vlz}Y~$ot5VsqPQ{{YtjYFvIumZzt zA{CcxZLJR|4#{j7k~Tu*jkwz8QA|5G1$Cl895R`Zyp;irp1{KN){kB30O8P1W5;@bG znvX74roeMmQlUi=v9Y%(wl$ZC#9tKNFpvi3!C}f1m6Ct|l2g%psc{TJp)@yu)*e2> z((p0Fg*8gJ!|3WZke9;Z{8}&NRkv7iP=#_y-F}x^y?2m%-D_aj^)f04%mneyjo_;) z6qc_Zu$q37d~X``*eP~Q>I2gg%rrV8v=kDfpp$=%Vj}hF)^dsSWygoN(A$g*E=Do6FX?&(@F#7pbiJ`;c0c@Ul zDqW_90Wm#5f2L<(Lf3)3TeXtI7nhYwRm(F;*r_G6K@OPW4H(Y3O5SjUzBC}u3d|eQ8*8d@?;zUPE+i#QNMn=r(ap?2SH@vo*m z3HJ%XuG_S6;QbWy-l%qU;8x;>z>4pMW7>R}J%QLf%@1BY(4f_1iixd-6GlO7Vp*yU zp{VU^3?s?90i=!#>H`lxT!q8rk>W_$2~kbpz7eV{3wR|8E=8**5?qn8#n`*(bt1xRQrdGxyx2y%B$qmw#>ZV$c7%cO#%JM1lY$Y0q?Yuo> ze9KdJoiM)RH*SB%^;TAdX-zEjA7@%y=!0=Zg%iWK7jVI9b&Dk}0$Af&08KHo+ zOwDhFvA(E|ER%a^cdh@^wLUlmIv6?_3=BvX8jKk92L=Y}7Jf5OGMfh` zBdR1wFCi-i5@`9km{isRb0O%TX+f~)KNaEz{rXQa89`YIF;EN&gN)cigu6mNh>?Cm zAO&Im2flv6D{jwm+y<%WsPe4!89n~KN|7}Cb{Z;XweER73r}Qp2 zz}WP4j}U0&(uD&9yGy6`!+_v-S(yG*iytsTR#x_Rc>=6u^vnRDnf1gP{#2>`ffrAC% zTZ5WQ@hAK;P;>kX{D)mIXe4%a5p=LO1xXH@8T?mz7Q@d)$3pL{{B!2{-v70L*o1AO+|n5beiw~ zk@(>m?T3{2k2c;NWc^`4@P&Z?BjxXJ@;x1qhn)9Mn*IFdt_J-dIqx5#d`NfyfX~m( zIS~5)MfZ2Uy?_4W`47i}u0ZgPh<{D|w_d#;D}Q&U$Q-G}xM1A@1f{#%A$jh6Qp&0hQ<0bPOM z-{1Wm&p%%#eb_?x7i;bol EfAhh=DF6Tf literal 0 HcmV?d00001 diff --git a/spring-boot/.mvn/wrapper/maven-wrapper.properties b/spring-boot/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..abd303b6 --- /dev/null +++ b/spring-boot/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/spring-boot/mvnw b/spring-boot/mvnw new file mode 100644 index 00000000..a16b5431 --- /dev/null +++ b/spring-boot/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/spring-boot/mvnw.cmd b/spring-boot/mvnw.cmd new file mode 100644 index 00000000..c8d43372 --- /dev/null +++ b/spring-boot/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 745154b1..88a00b2c 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -8,6 +8,7 @@ ruoyi 3.4.0 + ruoyi http://www.ruoyi.vip 若依管理系统 @@ -193,7 +194,12 @@ ruoyi-common ${ruoyi.version} - + + + com.zaxxer + HikariCP + 3.2.0 + @@ -204,6 +210,7 @@ ruoyi-quartz ruoyi-generator ruoyi-common + xiaoyi-mpgb pom diff --git a/spring-boot/ruoyi-admin/pom.xml b/spring-boot/ruoyi-admin/pom.xml index ed8d8da6..bde32892 100644 --- a/spring-boot/ruoyi-admin/pom.xml +++ b/spring-boot/ruoyi-admin/pom.xml @@ -50,7 +50,7 @@ springfox-swagger-ui - + mysql mysql-connector-java @@ -73,6 +73,17 @@ com.ruoyi ruoyi-generator + + com.zaxxer + HikariCP + 4.0.3 + + + com.zaxxer + HikariCP + 4.0.3 + + @@ -93,15 +104,15 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 false ${project.artifactId} - - + + ${project.artifactId} diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 32eb6f1d..8498b9fa 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -6,14 +6,12 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; /** * 启动程序 - * + * * @author ruoyi */ -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -public class RuoYiApplication -{ - public static void main(String[] args) - { +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +public class RuoYiApplication { + public static void main(String[] args) { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java index 6de67dc7..70cb1b36 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java @@ -5,14 +5,12 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer /** * web容器中进行部署 - * + * * @author ruoyi */ -public class RuoYiServletInitializer extends SpringBootServletInitializer -{ +public class RuoYiServletInitializer extends SpringBootServletInitializer { @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) - { + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RuoYiApplication.class); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index 8cafcef1..c45e9daa 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.util.FastByteArrayOutputStream; @@ -20,12 +21,11 @@ import com.ruoyi.common.utils.uuid.IdUtils; /** * 验证码操作处理 - * + * * @author ruoyi */ @RestController -public class CaptchaController -{ +public class CaptchaController { @Resource(name = "captchaProducer") private Producer captchaProducer; @@ -34,7 +34,7 @@ public class CaptchaController @Autowired private RedisCache redisCache; - + // 验证码类型 @Value("${ruoyi.captchaType}") private String captchaType; @@ -43,8 +43,7 @@ public class CaptchaController * 生成验证码 */ @GetMapping("/captchaImage") - public AjaxResult getCode(HttpServletResponse response) throws IOException - { + public AjaxResult getCode(HttpServletResponse response) throws IOException { // 保存验证码信息 String uuid = IdUtils.simpleUUID(); String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; @@ -53,15 +52,12 @@ public class CaptchaController BufferedImage image = null; // 生成验证码 - if ("math".equals(captchaType)) - { + if ("math".equals(captchaType)) { String capText = captchaProducerMath.createText(); capStr = capText.substring(0, capText.lastIndexOf("@")); code = capText.substring(capText.lastIndexOf("@") + 1); image = captchaProducerMath.createImage(capStr); - } - else if ("char".equals(captchaType)) - { + } else if ("char".equals(captchaType)) { capStr = code = captchaProducer.createText(); image = captchaProducer.createImage(capStr); } @@ -69,12 +65,9 @@ public class CaptchaController redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); // 转换流信息写出 FastByteArrayOutputStream os = new FastByteArrayOutputStream(); - try - { + try { ImageIO.write(image, "jpg", os); - } - catch (IOException e) - { + } catch (IOException e) { return AjaxResult.error(e.getMessage()); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index e0c728fa..a6188d6b 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.common; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -20,12 +21,11 @@ import com.ruoyi.framework.config.ServerConfig; /** * 通用请求处理 - * + * * @author ruoyi */ @RestController -public class CommonController -{ +public class CommonController { private static final Logger log = LoggerFactory.getLogger(CommonController.class); @Autowired @@ -33,17 +33,14 @@ public class CommonController /** * 通用下载请求 - * + * * @param fileName 文件名称 - * @param delete 是否删除 + * @param delete 是否删除 */ @GetMapping("common/download") - public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) - { - try - { - if (!FileUtils.checkAllowDownload(fileName)) - { + public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) { + try { + if (!FileUtils.checkAllowDownload(fileName)) { throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); } String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); @@ -52,13 +49,10 @@ public class CommonController response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); FileUtils.setAttachmentResponseHeader(response, realFileName); FileUtils.writeBytes(filePath, response.getOutputStream()); - if (delete) - { + if (delete) { FileUtils.deleteFile(filePath); } - } - catch (Exception e) - { + } catch (Exception e) { log.error("下载文件失败", e); } } @@ -67,10 +61,8 @@ public class CommonController * 通用上传请求 */ @PostMapping("/common/upload") - public AjaxResult uploadFile(MultipartFile file) throws Exception - { - try - { + public AjaxResult uploadFile(MultipartFile file) throws Exception { + try { // 上传文件路径 String filePath = RuoYiConfig.getUploadPath(); // 上传并返回新文件名称 @@ -80,9 +72,7 @@ public class CommonController ajax.put("fileName", fileName); ajax.put("url", url); return ajax; - } - catch (Exception e) - { + } catch (Exception e) { return AjaxResult.error(e.getMessage()); } } @@ -92,12 +82,9 @@ public class CommonController */ @GetMapping("/common/download/resource") public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) - throws Exception - { - try - { - if (!FileUtils.checkAllowDownload(resource)) - { + throws Exception { + try { + if (!FileUtils.checkAllowDownload(resource)) { throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); } // 本地资源路径 @@ -109,9 +96,7 @@ public class CommonController response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); FileUtils.setAttachmentResponseHeader(response, downloadName); FileUtils.writeBytes(downloadPath, response.getOutputStream()); - } - catch (Exception e) - { + } catch (Exception e) { log.error("下载文件失败", e); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java index 7b97de24..6add5519 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisTemplate; @@ -17,20 +18,18 @@ import com.ruoyi.common.utils.StringUtils; /** * 缓存监控 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/cache") -public class CacheController -{ +public class CacheController { @Autowired private RedisTemplate redisTemplate; @PreAuthorize("@ss.hasPermi('monitor:cache:list')") @GetMapping() - public AjaxResult getInfo() throws Exception - { + public AjaxResult getInfo() throws Exception { Properties info = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info()); Properties commandStats = (Properties) redisTemplate.execute((RedisCallback) connection -> connection.info("commandstats")); Object dbSize = redisTemplate.execute((RedisCallback) connection -> connection.dbSize()); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java index cc805ad8..63da0b83 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java @@ -9,17 +9,15 @@ import com.ruoyi.framework.web.domain.Server; /** * 服务器监控 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/server") -public class ServerController -{ +public class ServerController { @PreAuthorize("@ss.hasPermi('monitor:server:list')") @GetMapping() - public AjaxResult getInfo() throws Exception - { + public AjaxResult getInfo() throws Exception { Server server = new Server(); server.copyTo(); return AjaxResult.success(server); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java index 339f2428..9db3e65c 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.monitor; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -19,20 +20,18 @@ import com.ruoyi.system.service.ISysLogininforService; /** * 系统访问记录 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/logininfor") -public class SysLogininforController extends BaseController -{ +public class SysLogininforController extends BaseController { @Autowired private ISysLogininforService logininforService; @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") @GetMapping("/list") - public TableDataInfo list(SysLogininfor logininfor) - { + public TableDataInfo list(SysLogininfor logininfor) { startPage(); List list = logininforService.selectLogininforList(logininfor); return getDataTable(list); @@ -41,8 +40,7 @@ public class SysLogininforController extends BaseController @Log(title = "登录日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") @GetMapping("/export") - public AjaxResult export(SysLogininfor logininfor) - { + public AjaxResult export(SysLogininfor logininfor) { List list = logininforService.selectLogininforList(logininfor); ExcelUtil util = new ExcelUtil(SysLogininfor.class); return util.exportExcel(list, "登录日志"); @@ -51,16 +49,14 @@ public class SysLogininforController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.DELETE) @DeleteMapping("/{infoIds}") - public AjaxResult remove(@PathVariable Long[] infoIds) - { + public AjaxResult remove(@PathVariable Long[] infoIds) { return toAjax(logininforService.deleteLogininforByIds(infoIds)); } @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") - public AjaxResult clean() - { + public AjaxResult clean() { logininforService.cleanLogininfor(); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java index 0332a14a..d9ed0d6b 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.monitor; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -19,20 +20,18 @@ import com.ruoyi.system.service.ISysOperLogService; /** * 操作日志记录 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/operlog") -public class SysOperlogController extends BaseController -{ +public class SysOperlogController extends BaseController { @Autowired private ISysOperLogService operLogService; @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") @GetMapping("/list") - public TableDataInfo list(SysOperLog operLog) - { + public TableDataInfo list(SysOperLog operLog) { startPage(); List list = operLogService.selectOperLogList(operLog); return getDataTable(list); @@ -41,8 +40,7 @@ public class SysOperlogController extends BaseController @Log(title = "操作日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") @GetMapping("/export") - public AjaxResult export(SysOperLog operLog) - { + public AjaxResult export(SysOperLog operLog) { List list = operLogService.selectOperLogList(operLog); ExcelUtil util = new ExcelUtil(SysOperLog.class); return util.exportExcel(list, "操作日志"); @@ -50,16 +48,14 @@ public class SysOperlogController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") @DeleteMapping("/{operIds}") - public AjaxResult remove(@PathVariable Long[] operIds) - { + public AjaxResult remove(@PathVariable Long[] operIds) { return toAjax(operLogService.deleteOperLogByIds(operIds)); } @Log(title = "操作日志", businessType = BusinessType.CLEAN) @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") @DeleteMapping("/clean") - public AjaxResult clean() - { + public AjaxResult clean() { operLogService.cleanOperLog(); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java index 9b157ea7..6bab7a1e 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -25,13 +26,12 @@ import com.ruoyi.system.service.ISysUserOnlineService; /** * 在线用户监控 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/online") -public class SysUserOnlineController extends BaseController -{ +public class SysUserOnlineController extends BaseController { @Autowired private ISysUserOnlineService userOnlineService; @@ -40,36 +40,24 @@ public class SysUserOnlineController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:online:list')") @GetMapping("/list") - public TableDataInfo list(String ipaddr, String userName) - { + public TableDataInfo list(String ipaddr, String userName) { Collection keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*"); List userOnlineList = new ArrayList(); - for (String key : keys) - { + for (String key : keys) { LoginUser user = redisCache.getCacheObject(key); - if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { + if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) { userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); } - } - else if (StringUtils.isNotEmpty(ipaddr)) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { + } else if (StringUtils.isNotEmpty(ipaddr)) { + if (StringUtils.equals(ipaddr, user.getIpaddr())) { userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); } - } - else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) - { - if (StringUtils.equals(userName, user.getUsername())) - { + } else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) { + if (StringUtils.equals(userName, user.getUsername())) { userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); } - } - else - { + } else { userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); } } @@ -84,8 +72,7 @@ public class SysUserOnlineController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") @Log(title = "在线用户", businessType = BusinessType.FORCE) @DeleteMapping("/{tokenId}") - public AjaxResult forceLogout(@PathVariable String tokenId) - { + public AjaxResult forceLogout(@PathVariable String tokenId) { redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index fb39a336..6b66d059 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -26,13 +27,12 @@ import com.ruoyi.system.service.ISysConfigService; /** * 参数配置 信息操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/config") -public class SysConfigController extends BaseController -{ +public class SysConfigController extends BaseController { @Autowired private ISysConfigService configService; @@ -41,8 +41,7 @@ public class SysConfigController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:config:list')") @GetMapping("/list") - public TableDataInfo list(SysConfig config) - { + public TableDataInfo list(SysConfig config) { startPage(); List list = configService.selectConfigList(config); return getDataTable(list); @@ -51,8 +50,7 @@ public class SysConfigController extends BaseController @Log(title = "参数管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:config:export')") @GetMapping("/export") - public AjaxResult export(SysConfig config) - { + public AjaxResult export(SysConfig config) { List list = configService.selectConfigList(config); ExcelUtil util = new ExcelUtil(SysConfig.class); return util.exportExcel(list, "参数数据"); @@ -63,8 +61,7 @@ public class SysConfigController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:config:query')") @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long configId) - { + public AjaxResult getInfo(@PathVariable Long configId) { return AjaxResult.success(configService.selectConfigById(configId)); } @@ -72,8 +69,7 @@ public class SysConfigController extends BaseController * 根据参数键名查询参数值 */ @GetMapping(value = "/configKey/{configKey}") - public AjaxResult getConfigKey(@PathVariable String configKey) - { + public AjaxResult getConfigKey(@PathVariable String configKey) { return AjaxResult.success(configService.selectConfigByKey(configKey)); } @@ -84,10 +80,8 @@ public class SysConfigController extends BaseController @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit - public AjaxResult add(@Validated @RequestBody SysConfig config) - { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) - { + public AjaxResult add(@Validated @RequestBody SysConfig config) { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setCreateBy(SecurityUtils.getUsername()); @@ -100,10 +94,8 @@ public class SysConfigController extends BaseController @PreAuthorize("@ss.hasPermi('system:config:edit')") @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysConfig config) - { - if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) - { + public AjaxResult edit(@Validated @RequestBody SysConfig config) { + if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); } config.setUpdateBy(SecurityUtils.getUsername()); @@ -116,8 +108,7 @@ public class SysConfigController extends BaseController @PreAuthorize("@ss.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.DELETE) @DeleteMapping("/{configIds}") - public AjaxResult remove(@PathVariable Long[] configIds) - { + public AjaxResult remove(@PathVariable Long[] configIds) { return toAjax(configService.deleteConfigByIds(configIds)); } @@ -127,8 +118,7 @@ public class SysConfigController extends BaseController @PreAuthorize("@ss.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.CLEAN) @DeleteMapping("/clearCache") - public AjaxResult clearCache() - { + public AjaxResult clearCache() { configService.clearCache(); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 480816ab..848da05a 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system; import java.util.Iterator; import java.util.List; + import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -26,13 +27,12 @@ import com.ruoyi.system.service.ISysDeptService; /** * 部门信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/dept") -public class SysDeptController extends BaseController -{ +public class SysDeptController extends BaseController { @Autowired private ISysDeptService deptService; @@ -41,8 +41,7 @@ public class SysDeptController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list") - public AjaxResult list(SysDept dept) - { + public AjaxResult list(SysDept dept) { List depts = deptService.selectDeptList(dept); return AjaxResult.success(depts); } @@ -52,16 +51,13 @@ public class SysDeptController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list/exclude/{deptId}") - public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) - { + public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { List depts = deptService.selectDeptList(new SysDept()); Iterator it = depts.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { SysDept d = (SysDept) it.next(); if (d.getDeptId().intValue() == deptId - || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) - { + || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")) { it.remove(); } } @@ -73,8 +69,7 @@ public class SysDeptController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:dept:query')") @GetMapping(value = "/{deptId}") - public AjaxResult getInfo(@PathVariable Long deptId) - { + public AjaxResult getInfo(@PathVariable Long deptId) { return AjaxResult.success(deptService.selectDeptById(deptId)); } @@ -82,8 +77,7 @@ public class SysDeptController extends BaseController * 获取部门下拉树列表 */ @GetMapping("/treeselect") - public AjaxResult treeselect(SysDept dept) - { + public AjaxResult treeselect(SysDept dept) { List depts = deptService.selectDeptList(dept); return AjaxResult.success(deptService.buildDeptTreeSelect(depts)); } @@ -92,8 +86,7 @@ public class SysDeptController extends BaseController * 加载对应角色部门列表树 */ @GetMapping(value = "/roleDeptTreeselect/{roleId}") - public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) - { + public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) { List depts = deptService.selectDeptList(new SysDept()); AjaxResult ajax = AjaxResult.success(); ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); @@ -107,10 +100,8 @@ public class SysDeptController extends BaseController @PreAuthorize("@ss.hasPermi('system:dept:add')") @Log(title = "部门管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDept dept) - { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) - { + public AjaxResult add(@Validated @RequestBody SysDept dept) { + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } dept.setCreateBy(SecurityUtils.getUsername()); @@ -123,19 +114,13 @@ public class SysDeptController extends BaseController @PreAuthorize("@ss.hasPermi('system:dept:edit')") @Log(title = "部门管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDept dept) - { - if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) - { + public AjaxResult edit(@Validated @RequestBody SysDept dept) { + if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); - } - else if (dept.getParentId().equals(dept.getDeptId())) - { + } else if (dept.getParentId().equals(dept.getDeptId())) { return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); - } - else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) - && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) - { + } else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) + && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) { return AjaxResult.error("该部门包含未停用的子部门!"); } dept.setUpdateBy(SecurityUtils.getUsername()); @@ -148,14 +133,11 @@ public class SysDeptController extends BaseController @PreAuthorize("@ss.hasPermi('system:dept:remove')") @Log(title = "部门管理", businessType = BusinessType.DELETE) @DeleteMapping("/{deptId}") - public AjaxResult remove(@PathVariable Long deptId) - { - if (deptService.hasChildByDeptId(deptId)) - { + public AjaxResult remove(@PathVariable Long deptId) { + if (deptService.hasChildByDeptId(deptId)) { return AjaxResult.error("存在下级部门,不允许删除"); } - if (deptService.checkDeptExistUser(deptId)) - { + if (deptService.checkDeptExistUser(deptId)) { return AjaxResult.error("部门存在用户,不允许删除"); } return toAjax(deptService.deleteDeptById(deptId)); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java index 91bd67db..f367daec 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system; import java.util.ArrayList; import java.util.List; + +import com.alibaba.druid.pool.DruidDataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -27,13 +29,12 @@ import com.ruoyi.system.service.ISysDictTypeService; /** * 数据字典信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/dict/data") -public class SysDictDataController extends BaseController -{ +public class SysDictDataController extends BaseController { @Autowired private ISysDictDataService dictDataService; @@ -42,9 +43,10 @@ public class SysDictDataController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:list')") @GetMapping("/list") - public TableDataInfo list(SysDictData dictData) - { + public TableDataInfo list(SysDictData dictData) { + startPage(); + List list = dictDataService.selectDictDataList(dictData); return getDataTable(list); } @@ -52,8 +54,7 @@ public class SysDictDataController extends BaseController @Log(title = "字典数据", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:dict:export')") @GetMapping("/export") - public AjaxResult export(SysDictData dictData) - { + public AjaxResult export(SysDictData dictData) { List list = dictDataService.selectDictDataList(dictData); ExcelUtil util = new ExcelUtil(SysDictData.class); return util.exportExcel(list, "字典数据"); @@ -64,8 +65,7 @@ public class SysDictDataController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:dict:query')") @GetMapping(value = "/{dictCode}") - public AjaxResult getInfo(@PathVariable Long dictCode) - { + public AjaxResult getInfo(@PathVariable Long dictCode) { return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); } @@ -73,11 +73,9 @@ public class SysDictDataController extends BaseController * 根据字典类型查询字典数据信息 */ @GetMapping(value = "/type/{dictType}") - public AjaxResult dictType(@PathVariable String dictType) - { + public AjaxResult dictType(@PathVariable String dictType) { List data = dictTypeService.selectDictDataByType(dictType); - if (StringUtils.isNull(data)) - { + if (StringUtils.isNull(data)) { data = new ArrayList(); } return AjaxResult.success(data); @@ -89,8 +87,7 @@ public class SysDictDataController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:add')") @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictData dict) - { + public AjaxResult add(@Validated @RequestBody SysDictData dict) { dict.setCreateBy(SecurityUtils.getUsername()); return toAjax(dictDataService.insertDictData(dict)); } @@ -101,8 +98,7 @@ public class SysDictDataController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:edit')") @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictData dict) - { + public AjaxResult edit(@Validated @RequestBody SysDictData dict) { dict.setUpdateBy(SecurityUtils.getUsername()); return toAjax(dictDataService.updateDictData(dict)); } @@ -113,8 +109,7 @@ public class SysDictDataController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictCodes}") - public AjaxResult remove(@PathVariable Long[] dictCodes) - { + public AjaxResult remove(@PathVariable Long[] dictCodes) { return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index a4e0b2b1..ecf841cf 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -25,20 +26,18 @@ import com.ruoyi.system.service.ISysDictTypeService; /** * 数据字典信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/dict/type") -public class SysDictTypeController extends BaseController -{ +public class SysDictTypeController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; @PreAuthorize("@ss.hasPermi('system:dict:list')") @GetMapping("/list") - public TableDataInfo list(SysDictType dictType) - { + public TableDataInfo list(SysDictType dictType) { startPage(); List list = dictTypeService.selectDictTypeList(dictType); return getDataTable(list); @@ -47,8 +46,7 @@ public class SysDictTypeController extends BaseController @Log(title = "字典类型", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:dict:export')") @GetMapping("/export") - public AjaxResult export(SysDictType dictType) - { + public AjaxResult export(SysDictType dictType) { List list = dictTypeService.selectDictTypeList(dictType); ExcelUtil util = new ExcelUtil(SysDictType.class); return util.exportExcel(list, "字典类型"); @@ -59,8 +57,7 @@ public class SysDictTypeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:dict:query')") @GetMapping(value = "/{dictId}") - public AjaxResult getInfo(@PathVariable Long dictId) - { + public AjaxResult getInfo(@PathVariable Long dictId) { return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); } @@ -70,10 +67,8 @@ public class SysDictTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:add')") @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { + public AjaxResult add(@Validated @RequestBody SysDictType dict) { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setCreateBy(SecurityUtils.getUsername()); @@ -86,10 +81,8 @@ public class SysDictTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:edit')") @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { + public AjaxResult edit(@Validated @RequestBody SysDictType dict) { + if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); } dict.setUpdateBy(SecurityUtils.getUsername()); @@ -102,8 +95,7 @@ public class SysDictTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) - { + public AjaxResult remove(@PathVariable Long[] dictIds) { return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); } @@ -113,8 +105,7 @@ public class SysDictTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.CLEAN) @DeleteMapping("/clearCache") - public AjaxResult clearCache() - { + public AjaxResult clearCache() { dictTypeService.clearCache(); return AjaxResult.success(); } @@ -123,8 +114,7 @@ public class SysDictTypeController extends BaseController * 获取字典选择框列表 */ @GetMapping("/optionselect") - public AjaxResult optionselect() - { + public AjaxResult optionselect() { List dictTypes = dictTypeService.selectDictTypeAll(); return AjaxResult.success(dictTypes); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 997c5821..e6bfd0c2 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -1,7 +1,11 @@ package com.ruoyi.web.controller.system; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; + +import com.ruoyi.common.core.domain.model.MpLoginBody; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -21,12 +25,11 @@ import com.ruoyi.system.service.ISysMenuService; /** * 登录验证 - * + * * @author ruoyi */ @RestController -public class SysLoginController -{ +public class SysLoginController { @Autowired private SysLoginService loginService; @@ -41,13 +44,12 @@ public class SysLoginController /** * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @PostMapping("/login") - public AjaxResult login(@RequestBody LoginBody loginBody) - { + public AjaxResult login(@RequestBody LoginBody loginBody) { AjaxResult ajax = AjaxResult.success(); // 生成令牌 String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), @@ -56,14 +58,31 @@ public class SysLoginController return ajax; } + /** + * @return + * @Method 微信小程序用户登录 + * @Description TODO + * @Param null + * @date 2021-08-26,0026 11:47 + * @author admin + */ + @PostMapping("/wxLogin") + public AjaxResult wxLogin(@RequestBody MpLoginBody loginBody) { + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.mpLlogin(loginBody); + ajax.put(Constants.TOKEN, token); + + return ajax; + } + /** * 获取用户信息 - * + * * @return 用户信息 */ @GetMapping("getInfo") - public AjaxResult getInfo() - { + public AjaxResult getInfo() { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); SysUser user = loginUser.getUser(); // 角色集合 @@ -79,12 +98,11 @@ public class SysLoginController /** * 获取路由信息 - * + * * @return 路由信息 */ @GetMapping("getRouters") - public AjaxResult getRouters() - { + public AjaxResult getRouters() { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 用户信息 SysUser user = loginUser.getUser(); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index 2ee72383..ce646e13 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -28,13 +29,12 @@ import com.ruoyi.system.service.ISysMenuService; /** * 菜单信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/menu") -public class SysMenuController extends BaseController -{ +public class SysMenuController extends BaseController { @Autowired private ISysMenuService menuService; @@ -46,11 +46,11 @@ public class SysMenuController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:menu:list')") @GetMapping("/list") - public AjaxResult list(SysMenu menu) - { + public AjaxResult list(SysMenu menu) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); Long userId = loginUser.getUser().getUserId(); List menus = menuService.selectMenuList(menu, userId); + return AjaxResult.success(menus); } @@ -59,8 +59,7 @@ public class SysMenuController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:menu:query')") @GetMapping(value = "/{menuId}") - public AjaxResult getInfo(@PathVariable Long menuId) - { + public AjaxResult getInfo(@PathVariable Long menuId) { return AjaxResult.success(menuService.selectMenuById(menuId)); } @@ -68,8 +67,7 @@ public class SysMenuController extends BaseController * 获取菜单下拉树列表 */ @GetMapping("/treeselect") - public AjaxResult treeselect(SysMenu menu) - { + public AjaxResult treeselect(SysMenu menu) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); Long userId = loginUser.getUser().getUserId(); List menus = menuService.selectMenuList(menu, userId); @@ -80,8 +78,7 @@ public class SysMenuController extends BaseController * 加载对应角色菜单列表树 */ @GetMapping(value = "/roleMenuTreeselect/{roleId}") - public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) - { + public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); List menus = menuService.selectMenuList(loginUser.getUser().getUserId()); AjaxResult ajax = AjaxResult.success(); @@ -96,15 +93,11 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:add')") @Log(title = "菜单管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysMenu menu) - { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) - { + public AjaxResult add(@Validated @RequestBody SysMenu menu) { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) - && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) - { + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) + && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) { return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); } menu.setCreateBy(SecurityUtils.getUsername()); @@ -117,19 +110,13 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:edit')") @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysMenu menu) - { - if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) - { + public AjaxResult edit(@Validated @RequestBody SysMenu menu) { + if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) - && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) - { + } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) + && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS)) { return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); - } - else if (menu.getMenuId().equals(menu.getParentId())) - { + } else if (menu.getMenuId().equals(menu.getParentId())) { return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); } menu.setUpdateBy(SecurityUtils.getUsername()); @@ -142,14 +129,11 @@ public class SysMenuController extends BaseController @PreAuthorize("@ss.hasPermi('system:menu:remove')") @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/{menuId}") - public AjaxResult remove(@PathVariable("menuId") Long menuId) - { - if (menuService.hasChildByMenuId(menuId)) - { + public AjaxResult remove(@PathVariable("menuId") Long menuId) { + if (menuService.hasChildByMenuId(menuId)) { return AjaxResult.error("存在子菜单,不允许删除"); } - if (menuService.checkMenuExistRole(menuId)) - { + if (menuService.checkMenuExistRole(menuId)) { return AjaxResult.error("菜单已分配,不允许删除"); } return toAjax(menuService.deleteMenuById(menuId)); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java index 224e594d..d0ac4231 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -23,13 +24,12 @@ import com.ruoyi.system.service.ISysNoticeService; /** * 公告 信息操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/notice") -public class SysNoticeController extends BaseController -{ +public class SysNoticeController extends BaseController { @Autowired private ISysNoticeService noticeService; @@ -38,8 +38,7 @@ public class SysNoticeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:notice:list')") @GetMapping("/list") - public TableDataInfo list(SysNotice notice) - { + public TableDataInfo list(SysNotice notice) { startPage(); List list = noticeService.selectNoticeList(notice); return getDataTable(list); @@ -50,8 +49,7 @@ public class SysNoticeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:notice:query')") @GetMapping(value = "/{noticeId}") - public AjaxResult getInfo(@PathVariable Long noticeId) - { + public AjaxResult getInfo(@PathVariable Long noticeId) { return AjaxResult.success(noticeService.selectNoticeById(noticeId)); } @@ -61,8 +59,7 @@ public class SysNoticeController extends BaseController @PreAuthorize("@ss.hasPermi('system:notice:add')") @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysNotice notice) - { + public AjaxResult add(@Validated @RequestBody SysNotice notice) { notice.setCreateBy(SecurityUtils.getUsername()); return toAjax(noticeService.insertNotice(notice)); } @@ -73,8 +70,7 @@ public class SysNoticeController extends BaseController @PreAuthorize("@ss.hasPermi('system:notice:edit')") @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysNotice notice) - { + public AjaxResult edit(@Validated @RequestBody SysNotice notice) { notice.setUpdateBy(SecurityUtils.getUsername()); return toAjax(noticeService.updateNotice(notice)); } @@ -85,8 +81,7 @@ public class SysNoticeController extends BaseController @PreAuthorize("@ss.hasPermi('system:notice:remove')") @Log(title = "通知公告", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") - public AjaxResult remove(@PathVariable Long[] noticeIds) - { + public AjaxResult remove(@PathVariable Long[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java index 0c73ea8d..83149d46 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -25,13 +26,12 @@ import com.ruoyi.system.service.ISysPostService; /** * 岗位信息操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/post") -public class SysPostController extends BaseController -{ +public class SysPostController extends BaseController { @Autowired private ISysPostService postService; @@ -40,18 +40,16 @@ public class SysPostController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:post:list')") @GetMapping("/list") - public TableDataInfo list(SysPost post) - { + public TableDataInfo list(SysPost post) { startPage(); List list = postService.selectPostList(post); return getDataTable(list); } - + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:post:export')") @GetMapping("/export") - public AjaxResult export(SysPost post) - { + public AjaxResult export(SysPost post) { List list = postService.selectPostList(post); ExcelUtil util = new ExcelUtil(SysPost.class); return util.exportExcel(list, "岗位数据"); @@ -62,8 +60,7 @@ public class SysPostController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:post:query')") @GetMapping(value = "/{postId}") - public AjaxResult getInfo(@PathVariable Long postId) - { + public AjaxResult getInfo(@PathVariable Long postId) { return AjaxResult.success(postService.selectPostById(postId)); } @@ -73,14 +70,10 @@ public class SysPostController extends BaseController @PreAuthorize("@ss.hasPermi('system:post:add')") @Log(title = "岗位管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysPost post) - { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) - { + public AjaxResult add(@Validated @RequestBody SysPost post) { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) - { + } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } post.setCreateBy(SecurityUtils.getUsername()); @@ -93,14 +86,10 @@ public class SysPostController extends BaseController @PreAuthorize("@ss.hasPermi('system:post:edit')") @Log(title = "岗位管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysPost post) - { - if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) - { + public AjaxResult edit(@Validated @RequestBody SysPost post) { + if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) - { + } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); } post.setUpdateBy(SecurityUtils.getUsername()); @@ -113,8 +102,7 @@ public class SysPostController extends BaseController @PreAuthorize("@ss.hasPermi('system:post:remove')") @Log(title = "岗位管理", businessType = BusinessType.DELETE) @DeleteMapping("/{postIds}") - public AjaxResult remove(@PathVariable Long[] postIds) - { + public AjaxResult remove(@PathVariable Long[] postIds) { return toAjax(postService.deletePostByIds(postIds)); } @@ -122,8 +110,7 @@ public class SysPostController extends BaseController * 获取岗位选择框列表 */ @GetMapping("/optionselect") - public AjaxResult optionselect() - { + public AjaxResult optionselect() { List posts = postService.selectPostAll(); return AjaxResult.success(posts); } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index c2f3f227..caa25394 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.io.IOException; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -25,13 +26,12 @@ import com.ruoyi.system.service.ISysUserService; /** * 个人信息 业务处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/user/profile") -public class SysProfileController extends BaseController -{ +public class SysProfileController extends BaseController { @Autowired private ISysUserService userService; @@ -42,8 +42,7 @@ public class SysProfileController extends BaseController * 个人信息 */ @GetMapping - public AjaxResult profile() - { + public AjaxResult profile() { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); SysUser user = loginUser.getUser(); AjaxResult ajax = AjaxResult.success(user); @@ -57,10 +56,8 @@ public class SysProfileController extends BaseController */ @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult updateProfile(@RequestBody SysUser user) - { - if (userService.updateUserProfile(user) > 0) - { + public AjaxResult updateProfile(@RequestBody SysUser user) { + if (userService.updateUserProfile(user) > 0) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 更新缓存用户信息 loginUser.getUser().setNickName(user.getNickName()); @@ -78,21 +75,17 @@ public class SysProfileController extends BaseController */ @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PutMapping("/updatePwd") - public AjaxResult updatePwd(String oldPassword, String newPassword) - { + public AjaxResult updatePwd(String oldPassword, String newPassword) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); String userName = loginUser.getUsername(); String password = loginUser.getPassword(); - if (!SecurityUtils.matchesPassword(oldPassword, password)) - { + if (!SecurityUtils.matchesPassword(oldPassword, password)) { return AjaxResult.error("修改密码失败,旧密码错误"); } - if (SecurityUtils.matchesPassword(newPassword, password)) - { + if (SecurityUtils.matchesPassword(newPassword, password)) { return AjaxResult.error("新密码不能与旧密码相同"); } - if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) - { + if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) { // 更新缓存用户密码 loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); tokenService.setLoginUser(loginUser); @@ -106,14 +99,11 @@ public class SysProfileController extends BaseController */ @Log(title = "用户头像", businessType = BusinessType.UPDATE) @PostMapping("/avatar") - public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException - { - if (!file.isEmpty()) - { + public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException { + if (!file.isEmpty()) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); - if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) - { + if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) { AjaxResult ajax = AjaxResult.success(); ajax.put("imgUrl", avatar); // 更新缓存用户头像 diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java index ca581e7c..7b4d50f4 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.system; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -31,29 +32,27 @@ import com.ruoyi.system.service.ISysUserService; /** * 角色信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/role") -public class SysRoleController extends BaseController -{ +public class SysRoleController extends BaseController { @Autowired private ISysRoleService roleService; @Autowired private TokenService tokenService; - + @Autowired private SysPermissionService permissionService; - + @Autowired private ISysUserService userService; @PreAuthorize("@ss.hasPermi('system:role:list')") @GetMapping("/list") - public TableDataInfo list(SysRole role) - { + public TableDataInfo list(SysRole role) { startPage(); List list = roleService.selectRoleList(role); return getDataTable(list); @@ -62,8 +61,7 @@ public class SysRoleController extends BaseController @Log(title = "角色管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:role:export')") @GetMapping("/export") - public AjaxResult export(SysRole role) - { + public AjaxResult export(SysRole role) { List list = roleService.selectRoleList(role); ExcelUtil util = new ExcelUtil(SysRole.class); return util.exportExcel(list, "角色数据"); @@ -74,8 +72,7 @@ public class SysRoleController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:role:query')") @GetMapping(value = "/{roleId}") - public AjaxResult getInfo(@PathVariable Long roleId) - { + public AjaxResult getInfo(@PathVariable Long roleId) { return AjaxResult.success(roleService.selectRoleById(roleId)); } @@ -85,14 +82,10 @@ public class SysRoleController extends BaseController @PreAuthorize("@ss.hasPermi('system:role:add')") @Log(title = "角色管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysRole role) - { - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) - { + public AjaxResult add(@Validated @RequestBody SysRole role) { + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) - { + } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); } role.setCreateBy(SecurityUtils.getUsername()); @@ -106,25 +99,19 @@ public class SysRoleController extends BaseController @PreAuthorize("@ss.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysRole role) - { + public AjaxResult edit(@Validated @RequestBody SysRole role) { roleService.checkRoleAllowed(role); - if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) - { + if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) - { + } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); } role.setUpdateBy(SecurityUtils.getUsername()); - - if (roleService.updateRole(role) > 0) - { + + if (roleService.updateRole(role) > 0) { // 更新缓存用户权限 LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) - { + if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) { loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); tokenService.setLoginUser(loginUser); @@ -140,8 +127,7 @@ public class SysRoleController extends BaseController @PreAuthorize("@ss.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping("/dataScope") - public AjaxResult dataScope(@RequestBody SysRole role) - { + public AjaxResult dataScope(@RequestBody SysRole role) { roleService.checkRoleAllowed(role); return toAjax(roleService.authDataScope(role)); } @@ -152,8 +138,7 @@ public class SysRoleController extends BaseController @PreAuthorize("@ss.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysRole role) - { + public AjaxResult changeStatus(@RequestBody SysRole role) { roleService.checkRoleAllowed(role); role.setUpdateBy(SecurityUtils.getUsername()); return toAjax(roleService.updateRoleStatus(role)); @@ -165,8 +150,7 @@ public class SysRoleController extends BaseController @PreAuthorize("@ss.hasPermi('system:role:remove')") @Log(title = "角色管理", businessType = BusinessType.DELETE) @DeleteMapping("/{roleIds}") - public AjaxResult remove(@PathVariable Long[] roleIds) - { + public AjaxResult remove(@PathVariable Long[] roleIds) { return toAjax(roleService.deleteRoleByIds(roleIds)); } @@ -175,8 +159,7 @@ public class SysRoleController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:role:query')") @GetMapping("/optionselect") - public AjaxResult optionselect() - { + public AjaxResult optionselect() { return AjaxResult.success(roleService.selectRoleAll()); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 51f9d2a0..21b29f87 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -37,14 +37,13 @@ import com.ruoyi.system.service.ISysUserService; /** * 用户信息 - * + * * @author ruoyi */ -@Api(value="用户管理",tags="用户管理") +@Api(value = "用户管理", tags = "用户管理") @RestController @RequestMapping("/system/user") -public class SysUserController extends BaseController -{ +public class SysUserController extends BaseController { @Autowired private ISysUserService userService; @@ -63,8 +62,7 @@ public class SysUserController extends BaseController @ApiOperation(value = "获取用户列表", notes = "获取用户列表") @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/list") - public TableDataInfo list(SysUser user) - { + public TableDataInfo list(SysUser user) { startPage(); List list = userService.selectUserList(user); return getDataTable(list); @@ -73,8 +71,7 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") @GetMapping("/export") - public AjaxResult export(SysUser user) - { + public AjaxResult export(SysUser user) { List list = userService.selectUserList(user); ExcelUtil util = new ExcelUtil(SysUser.class); return util.exportExcel(list, "用户数据"); @@ -83,8 +80,7 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.IMPORT) @PreAuthorize("@ss.hasPermi('system:user:import')") @PostMapping("/importData") - public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception - { + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { ExcelUtil util = new ExcelUtil(SysUser.class); List userList = util.importExcel(file.getInputStream()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); @@ -94,8 +90,7 @@ public class SysUserController extends BaseController } @GetMapping("/importTemplate") - public AjaxResult importTemplate() - { + public AjaxResult importTemplate() { ExcelUtil util = new ExcelUtil(SysUser.class); return util.importTemplateExcel("用户数据"); } @@ -105,15 +100,13 @@ public class SysUserController extends BaseController */ @ApiOperation(value = "根据用户编号获取详细信息", notes = "根据用户编号获取详细信息") @PreAuthorize("@ss.hasPermi('system:user:query')") - @GetMapping(value = { "/", "/{userId}" }) - public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) - { + @GetMapping(value = {"/", "/{userId}"}) + public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) { AjaxResult ajax = AjaxResult.success(); List roles = roleService.selectRoleAll(); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostAll()); - if (StringUtils.isNotNull(userId)) - { + if (StringUtils.isNotNull(userId)) { ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); ajax.put("postIds", postService.selectPostListByUserId(userId)); ajax.put("roleIds", roleService.selectRoleListByUserId(userId)); @@ -128,20 +121,14 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping @ApiOperation(value = "新增用户", notes = "新增用户") - public AjaxResult add(@Validated @RequestBody SysUser user) - { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) - { + public AjaxResult add(@Validated @RequestBody SysUser user) { + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { + } else if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setCreateBy(SecurityUtils.getUsername()); @@ -155,20 +142,14 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping("/register") @ApiOperation(value = "用户注册", notes = "用户注册") - public AjaxResult register(@Validated @RequestBody SysUser user) - { - if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) - { + public AjaxResult register(@Validated @RequestBody SysUser user) { + if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { + } else if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setDelFlag("0"); @@ -183,17 +164,13 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysUser user) - { + public AjaxResult edit(@Validated @RequestBody SysUser user) { userService.checkUserAllowed(user); if (StringUtils.isNotEmpty(user.getPhonenumber()) - && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) - { + && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) { return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) - && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) - { + } else if (StringUtils.isNotEmpty(user.getEmail()) + && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) { return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setUpdateBy(SecurityUtils.getUsername()); @@ -207,8 +184,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:remove')") @Log(title = "用户管理", businessType = BusinessType.DELETE) @DeleteMapping("/{userIds}") - public AjaxResult remove(@PathVariable Long[] userIds) - { + public AjaxResult remove(@PathVariable Long[] userIds) { return toAjax(userService.deleteUserByIds(userIds)); } @@ -219,8 +195,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/resetPwd") - public AjaxResult resetPwd(@RequestBody SysUser user) - { + public AjaxResult resetPwd(@RequestBody SysUser user) { userService.checkUserAllowed(user); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setUpdateBy(SecurityUtils.getUsername()); @@ -234,8 +209,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysUser user) - { + public AjaxResult changeStatus(@RequestBody SysUser user) { userService.checkUserAllowed(user); user.setUpdateBy(SecurityUtils.getUsername()); return toAjax(userService.updateUserStatus(user)); diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java index f66ca24e..b79c15f4 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java @@ -8,17 +8,15 @@ import com.ruoyi.common.core.controller.BaseController; /** * swagger 接口 - * + * * @author ruoyi */ @Controller @RequestMapping("/tool/swagger") -public class SwaggerController extends BaseController -{ +public class SwaggerController extends BaseController { @PreAuthorize("@ss.hasPermi('tool:swagger:view')") @GetMapping() - public String index() - { + public String index() { return redirect("/swagger-ui.html"); } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java index 9c6e6b5e..9e94bda1 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; + import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -22,15 +23,15 @@ import io.swagger.annotations.ApiOperation; /** * swagger 用户测试方法 - * + * * @author ruoyi */ @Api("用户信息管理") @RestController @RequestMapping("/test/user") -public class TestController extends BaseController -{ +public class TestController extends BaseController { private final static Map users = new LinkedHashMap(); + { users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); @@ -38,8 +39,7 @@ public class TestController extends BaseController @ApiOperation("获取用户列表") @GetMapping("/list") - public AjaxResult userList() - { + public AjaxResult userList() { List userList = new ArrayList(users.values()); return AjaxResult.success(userList); } @@ -47,14 +47,10 @@ public class TestController extends BaseController @ApiOperation("获取用户详细") @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") @GetMapping("/{userId}") - public AjaxResult getUser(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { + public AjaxResult getUser(@PathVariable Integer userId) { + if (!users.isEmpty() && users.containsKey(userId)) { return AjaxResult.success(users.get(userId)); - } - else - { + } else { return AjaxResult.error("用户不存在"); } } @@ -62,10 +58,8 @@ public class TestController extends BaseController @ApiOperation("新增用户") @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") @PostMapping("/save") - public AjaxResult save(UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { + public AjaxResult save(UserEntity user) { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) { return AjaxResult.error("用户ID不能为空"); } return AjaxResult.success(users.put(user.getUserId(), user)); @@ -74,14 +68,11 @@ public class TestController extends BaseController @ApiOperation("更新用户") @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") @PutMapping("/update") - public AjaxResult update(UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { + public AjaxResult update(UserEntity user) { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) { return AjaxResult.error("用户ID不能为空"); } - if (users.isEmpty() || !users.containsKey(user.getUserId())) - { + if (users.isEmpty() || !users.containsKey(user.getUserId())) { return AjaxResult.error("用户不存在"); } users.remove(user.getUserId()); @@ -91,23 +82,18 @@ public class TestController extends BaseController @ApiOperation("删除用户信息") @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") @DeleteMapping("/{userId}") - public AjaxResult delete(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { + public AjaxResult delete(@PathVariable Integer userId) { + if (!users.isEmpty() && users.containsKey(userId)) { users.remove(userId); return AjaxResult.success(); - } - else - { + } else { return AjaxResult.error("用户不存在"); } } } @ApiModel("用户实体") -class UserEntity -{ +class UserEntity { @ApiModelProperty("用户ID") private Integer userId; @@ -120,56 +106,46 @@ class UserEntity @ApiModelProperty("用户手机") private String mobile; - public UserEntity() - { + public UserEntity() { } - public UserEntity(Integer userId, String username, String password, String mobile) - { + public UserEntity(Integer userId, String username, String password, String mobile) { this.userId = userId; this.username = username; this.password = password; this.mobile = mobile; } - public Integer getUserId() - { + public Integer getUserId() { return userId; } - public void setUserId(Integer userId) - { + public void setUserId(Integer userId) { this.userId = userId; } - public String getUsername() - { + public String getUsername() { return username; } - public void setUsername(String username) - { + public void setUsername(String username) { this.username = username; } - public String getPassword() - { + public String getPassword() { return password; } - public void setPassword(String password) - { + public void setPassword(String password) { this.password = password; } - public String getMobile() - { + public String getMobile() { return mobile; } - public void setMobile(String mobile) - { + public void setMobile(String mobile) { this.mobile = mobile; } } diff --git a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index bf997cf7..5ea47cd5 100644 --- a/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/spring-boot/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -2,6 +2,7 @@ package com.ruoyi.web.core.config; import java.util.ArrayList; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -23,22 +24,27 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * Swagger2的接口配置 - * + * * @author ruoyi */ @Configuration @EnableSwagger2 -public class SwaggerConfig -{ - /** 系统基础配置 */ +public class SwaggerConfig { + /** + * 系统基础配置 + */ @Autowired private RuoYiConfig ruoyiConfig; - /** 是否开启swagger */ + /** + * 是否开启swagger + */ @Value("${swagger.enabled}") private boolean enabled; - /** 设置请求的统一前缀 */ + /** + * 设置请求的统一前缀 + */ @Value("${swagger.pathMapping}") private String pathMapping; @@ -46,8 +52,7 @@ public class SwaggerConfig * 创建API */ @Bean - public Docket createRestApi() - { + public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) // 是否启用Swagger .enable(enabled) @@ -71,8 +76,7 @@ public class SwaggerConfig /** * 安全模式,这里指定token通过Authorization头请求头传递 */ - private List securitySchemes() - { + private List securitySchemes() { List apiKeyList = new ArrayList(); apiKeyList.add(new ApiKey("Authorization", "Authorization", "header")); return apiKeyList; @@ -81,8 +85,7 @@ public class SwaggerConfig /** * 安全上下文 */ - private List securityContexts() - { + private List securityContexts() { List securityContexts = new ArrayList<>(); securityContexts.add( SecurityContext.builder() @@ -95,8 +98,7 @@ public class SwaggerConfig /** * 默认的安全上引用 */ - private List defaultAuth() - { + private List defaultAuth() { AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; authorizationScopes[0] = authorizationScope; @@ -108,8 +110,7 @@ public class SwaggerConfig /** * 添加摘要信息 */ - private ApiInfo apiInfo() - { + private ApiInfo apiInfo() { // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 diff --git a/spring-boot/ruoyi-admin/src/main/resources/application-druid.yml b/spring-boot/ruoyi-admin/src/main/resources/application-druid.yml index 41297b37..15942599 100644 --- a/spring-boot/ruoyi-admin/src/main/resources/application-druid.yml +++ b/spring-boot/ruoyi-admin/src/main/resources/application-druid.yml @@ -1,57 +1,57 @@ # 数据源配置 spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - druid: - # 主库数据源 - master: - url: jdbc:mysql://localhost:3306/wumei-smart?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: root - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: - login-password: - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://host:3306/develop_xiaoyi_wumei?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: 123456 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: + login-password: + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/spring-boot/ruoyi-admin/src/main/resources/application.yml b/spring-boot/ruoyi-admin/src/main/resources/application.yml index 8a05437d..bf4491bd 100644 --- a/spring-boot/ruoyi-admin/src/main/resources/application.yml +++ b/spring-boot/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 9160 servlet: # 应用的访问路径 context-path: / @@ -42,15 +42,15 @@ spring: messages: # 国际化资源文件路径 basename: i18n/messages - profiles: + profiles: active: druid # 文件上传 servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB # 服务模块 devtools: restart: @@ -82,36 +82,36 @@ spring: mqtt: username: admin # 账号 password: admin # 密码 - host-url: tcp://localhost:1883 # mqtt连接tcp地址 - client-id: server-${random.value} # 客户端Id,每个启动的id要不同 随机:${random.value} + host-url: tcp://host:1883 # mqtt连接tcp地址 + client-id: server-xiaoyi-${random.value} # 客户端Id,每个启动的id要不同 随机:${random.value} default-topic: test # 默认主题 timeout: 100 # 超时时间 keepalive: 100 # 保持连接数 # token配置 token: - # 令牌自定义标识 - header: Authorization - # 令牌密钥 - secret: abcdefghijklmnopqrstuvwxyz - # 令牌有效期(默认30分钟,设置为1周过期) - expireTime: 10000 - + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟,设置为1周过期) + expireTime: 10000 + # MyBatis配置 mybatis: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 -pagehelper: +pagehelper: helperDialect: mysql reasonable: false supportMethodsArguments: true - params: count=countSql + params: count=countSql # Swagger配置 swagger: @@ -121,10 +121,26 @@ swagger: pathMapping: /dev-api # 防止XSS攻击 -xss: +xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice/* # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* + +# 公众号配置(必填) +wx: + miniapp: + appid: appid # # + appSecret: appSecret # # + config-storage: + type: Memory # 配置类型: Memory(默认), Jedis, RedisTemplate + key-prefix: wa # 相关redis前缀配置: wa(默认) + redis: + host: 127.0.0.1 + port: 6379 + passowrd: + # http客户端配置 + http-client-type: HttpClient # http客户端类型: HttpClient(默认), OkHttp, JoddHttp + diff --git a/spring-boot/ruoyi-admin/src/main/resources/i18n/messages.properties b/spring-boot/ruoyi-admin/src/main/resources/i18n/messages.properties index d63aa1f8..46f023be 100644 --- a/spring-boot/ruoyi-admin/src/main/resources/i18n/messages.properties +++ b/spring-boot/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -10,23 +10,18 @@ user.password.delete=对不起,您的账号已被删除 user.blocked=用户已封禁,请联系管理员 role.blocked=角色已封禁,请联系管理员 user.logout.success=退出成功 - length.not.valid=长度必须在{min}到{max}个字符之间 - user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 user.password.not.valid=* 5-50个字符 - user.email.not.valid=邮箱格式错误 user.mobile.phone.number.not.valid=手机号格式错误 user.login.success=登录成功 user.notfound=请重新登录 user.forcelogout=管理员强制退出,请重新登录 user.unknown.error=未知错误,请重新登录 - ##文件上传消息 upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! upload.filename.exceed.length=上传的文件名最长{0}个字符 - ##权限 no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] diff --git a/spring-boot/ruoyi-admin/src/main/resources/logback.xml b/spring-boot/ruoyi-admin/src/main/resources/logback.xml index a360583f..7793b8d8 100644 --- a/spring-boot/ruoyi-admin/src/main/resources/logback.xml +++ b/spring-boot/ruoyi-admin/src/main/resources/logback.xml @@ -1,31 +1,31 @@ - + - + - - - - ${log.pattern} - - - - - - ${log.path}/sys-info.log + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log - + - ${log.path}/sys-info.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + INFO @@ -33,16 +33,16 @@ DENY - - - - ${log.path}/sys-error.log + + + + ${log.path}/sys-error.log ${log.path}/sys-error.%d{yyyy-MM-dd}.log - - 60 + + 60 ${log.pattern} @@ -50,16 +50,16 @@ ERROR - + ACCEPT - + DENY - - + + - ${log.path}/sys-user.log + ${log.path}/sys-user.log ${log.path}/sys-user.%d{yyyy-MM-dd}.log @@ -70,23 +70,23 @@ ${log.pattern} - - - - - - - - - - + + + + + - - + - - + + + + + + + + diff --git a/spring-boot/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml b/spring-boot/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml index e8b52be8..55005995 100644 --- a/spring-boot/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml +++ b/spring-boot/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml @@ -1,15 +1,15 @@ + PUBLIC "-//mybatis.org//DTD Config 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-config.dtd"> - - - - - - - - - + + + + + + + + + diff --git a/spring-boot/ruoyi-common/pom.xml b/spring-boot/ruoyi-common/pom.xml index bc2327cb..e6d5e8e0 100644 --- a/spring-boot/ruoyi-common/pom.xml +++ b/spring-boot/ruoyi-common/pom.xml @@ -52,7 +52,7 @@ org.apache.commons commons-lang3 - + com.fasterxml.jackson.core @@ -118,6 +118,31 @@ javax.servlet javax.servlet-api + + org.projectlombok + lombok + + + org.projectlombok + lombok + 1.18.20 + + + com.github.binarywang + weixin-java-miniapp + 4.1.5.B + compile + + + com.github.binarywang + weixin-java-miniapp + 4.1.5.B + + + com.github.binarywang + weixin-java-mp + 4.1.5.B + diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java index 176878e9..b0d4b7ff 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java @@ -8,14 +8,13 @@ import java.lang.annotation.Target; /** * 数据权限过滤注解 - * + * * @author ruoyi */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented -public @interface DataScope -{ +public @interface DataScope { /** * 部门表的别名 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java index 79cd191f..48f6ffdb 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java @@ -6,21 +6,21 @@ import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; + import com.ruoyi.common.enums.DataSourceType; /** * 自定义多数据源切换注解 - * + *

* 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 * * @author ruoyi */ -@Target({ ElementType.METHOD, ElementType.TYPE }) +@Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited -public @interface DataSource -{ +public @interface DataSource { /** * 切换数据源名称 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java index b09f4cec..c21655e8 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java @@ -8,13 +8,12 @@ import java.math.BigDecimal; /** * 自定义导出Excel数据注解 - * + * * @author ruoyi */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) -public @interface Excel -{ +public @interface Excel { /** * 导出时在excel中排序 */ @@ -110,18 +109,15 @@ public @interface Excel */ Align align() default Align.AUTO; - public enum Align - { + public enum Align { AUTO(0), LEFT(1), CENTER(2), RIGHT(3); private final int value; - Align(int value) - { + Align(int value) { this.value = value; } - public int value() - { + public int value() { return this.value; } } @@ -131,34 +127,28 @@ public @interface Excel */ Type type() default Type.ALL; - public enum Type - { + public enum Type { ALL(0), EXPORT(1), IMPORT(2); private final int value; - Type(int value) - { + Type(int value) { this.value = value; } - public int value() - { + public int value() { return this.value; } } - public enum ColumnType - { + public enum ColumnType { NUMERIC(0), STRING(1), IMAGE(2); private final int value; - ColumnType(int value) - { + ColumnType(int value) { this.value = value; } - public int value() - { + public int value() { return this.value; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java index d33004f5..271210ef 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java @@ -7,12 +7,11 @@ import java.lang.annotation.Target; /** * Excel注解集 - * + * * @author ruoyi */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) -public @interface Excels -{ +public @interface Excels { Excel[] value(); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java index eb05dc7c..a8683c8a 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java @@ -5,22 +5,21 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; + import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.OperatorType; /** * 自定义操作日志记录注解 - * - * @author ruoyi * + * @author ruoyi */ -@Target({ ElementType.PARAMETER, ElementType.METHOD }) +@Target({ElementType.PARAMETER, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented -public @interface Log -{ +public @interface Log { /** - * 模块 + * 模块 */ public String title() default ""; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java index 9e350f17..29c667f8 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java @@ -9,15 +9,13 @@ import java.lang.annotation.Target; /** * 自定义注解防止表单重复提交 - * - * @author ruoyi * + * @author ruoyi */ @Inherited @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented -public @interface RepeatSubmit -{ +public @interface RepeatSubmit { } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java index d5d8723f..efc85bdb 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java @@ -5,112 +5,108 @@ import org.springframework.stereotype.Component; /** * 读取项目相关配置 - * + * * @author ruoyi */ @Component @ConfigurationProperties(prefix = "ruoyi") -public class RuoYiConfig -{ - /** 项目名称 */ +public class RuoYiConfig { + /** + * 项目名称 + */ private String name; - /** 版本 */ + /** + * 版本 + */ private String version; - /** 版权年份 */ + /** + * 版权年份 + */ private String copyrightYear; - /** 实例演示开关 */ + /** + * 实例演示开关 + */ private boolean demoEnabled; - /** 上传路径 */ + /** + * 上传路径 + */ private static String profile; - /** 获取地址开关 */ + /** + * 获取地址开关 + */ private static boolean addressEnabled; - public String getName() - { + public String getName() { return name; } - public void setName(String name) - { + public void setName(String name) { this.name = name; } - public String getVersion() - { + public String getVersion() { return version; } - public void setVersion(String version) - { + public void setVersion(String version) { this.version = version; } - public String getCopyrightYear() - { + public String getCopyrightYear() { return copyrightYear; } - public void setCopyrightYear(String copyrightYear) - { + public void setCopyrightYear(String copyrightYear) { this.copyrightYear = copyrightYear; } - public boolean isDemoEnabled() - { + public boolean isDemoEnabled() { return demoEnabled; } - public void setDemoEnabled(boolean demoEnabled) - { + public void setDemoEnabled(boolean demoEnabled) { this.demoEnabled = demoEnabled; } - public static String getProfile() - { + public static String getProfile() { return profile; } - public void setProfile(String profile) - { + public void setProfile(String profile) { RuoYiConfig.profile = profile; } - public static boolean isAddressEnabled() - { + public static boolean isAddressEnabled() { return addressEnabled; } - public void setAddressEnabled(boolean addressEnabled) - { + public void setAddressEnabled(boolean addressEnabled) { RuoYiConfig.addressEnabled = addressEnabled; } /** * 获取头像上传路径 */ - public static String getAvatarPath() - { + public static String getAvatarPath() { return getProfile() + "/avatar"; } /** * 获取下载路径 */ - public static String getDownloadPath() - { + public static String getDownloadPath() { return getProfile() + "/download/"; } /** * 获取上传路径 */ - public static String getUploadPath() - { + public static String getUploadPath() { return getProfile() + "/upload"; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxConfig.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxConfig.java new file mode 100644 index 00000000..b07732cc --- /dev/null +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxConfig.java @@ -0,0 +1,36 @@ +package com.ruoyi.common.config; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.config.WxMaConfig; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class WxConfig { + + @Autowired + private WxProperties properties; + + @Bean + public WxMaConfig wxMaConfig() { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + + config.setAppid(properties.getAppId()); + config.setSecret(properties.getAppSecret()); + return config; + } + + @Bean + public WxMaService wxMaService(WxMaConfig maConfig) { + WxMaService service = new WxMaServiceImpl(); + service.setWxMaConfig(maConfig); + return service; + } + +} + + + diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxMpConfig.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxMpConfig.java new file mode 100644 index 00000000..71531c32 --- /dev/null +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxMpConfig.java @@ -0,0 +1,50 @@ +package com.ruoyi.common.config; + +import com.ruoyi.common.constant.Constants; +import me.chanjar.weixin.mp.api.WxMpQrcodeService; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.api.impl.WxMpQrcodeServiceImpl; +import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; +import me.chanjar.weixin.mp.config.WxMpConfigStorage; +import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 类名: WxConfig + * 描述: TODO + * 时间: 2021/1/10 13:08 + * 开发人: admin + */ +@Configuration +public class WxMpConfig { + + @Bean + public WxMpConfigStorage wxMpConfigStorage() { + + WxMpDefaultConfigImpl wxMpInMemoryConfigStorage = new WxMpDefaultConfigImpl(); + //设置appid 这个在项目中肯定是通过配置来实现 + wxMpInMemoryConfigStorage.setAppId(Constants.wxAppId); + //设置密码 + wxMpInMemoryConfigStorage.setSecret(Constants.wxAppSecret); + return wxMpInMemoryConfigStorage; + + } + + @Bean//文档中需要用到这个对象 + public WxMpService wxMpService() { + WxMpServiceImpl wxMpService = new WxMpServiceImpl(); + //设置微信配置的存储 + wxMpService.setWxMpConfigStorage(wxMpConfigStorage()); + return wxMpService; + + } + + @Bean//文档中需要用到这个对象 + public WxMpQrcodeService wxMpQrcodeService() { + WxMpQrcodeService wxMpQrcodeService = new WxMpQrcodeServiceImpl(wxMpService()); + //设置微信配置的存储 + return wxMpQrcodeService; + + } +} diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxProperties.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxProperties.java new file mode 100644 index 00000000..05fb732c --- /dev/null +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/config/WxProperties.java @@ -0,0 +1,69 @@ +package com.ruoyi.common.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConfigurationProperties(prefix = "wx.miniapp") +public class WxProperties { + + private String appId; + + private String appSecret; + + private String mchId; + + private String mchKey; + + private String notifyUrl; + + private String keyPath; + + public String getNotifyUrl() { + return notifyUrl; + } + + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; + } + + public String getMchKey() { + return mchKey; + } + + public void setMchKey(String mchKey) { + this.mchKey = mchKey; + } + + public String getAppId() { + return this.appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getAppSecret() { + return appSecret; + } + + public void setAppSecret(String appSecret) { + this.appSecret = appSecret; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getKeyPath() { + return keyPath; + } + + public void setKeyPath(String keyPath) { + this.keyPath = keyPath; + } +} \ No newline at end of file diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 6e13ac15..9cb56056 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -2,11 +2,10 @@ package com.ruoyi.common.constant; /** * 通用常量信息 - * + * * @author ruoyi */ -public class Constants -{ +public class Constants { /** * UTF-8 字符集 */ @@ -61,7 +60,7 @@ public class Constants * 登录用户 redis key */ public static final String LOGIN_TOKEN_KEY = "login_tokens:"; - + /** * 防重提交 redis key */ @@ -126,4 +125,8 @@ public class Constants * 资源映射路径 前缀 */ public static final String RESOURCE_PREFIX = "/profile"; + public static final String DEFAULT_AVATAR = "https://c-ssl.duitang.com/uploads/item/201912/27/20191227145714_rtHRc.thumb.1000_0.jpeg"; + + public static String wxAppId = "wx00e680cbf69d159c"; + public static String wxAppSecret = "4902e0e4470663112f505f498b036c55"; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java index 1fa328e4..c831bd7f 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java @@ -2,113 +2,180 @@ package com.ruoyi.common.constant; /** * 代码生成通用常量 - * + * * @author ruoyi */ -public class GenConstants -{ - /** 单表(增删改查) */ +public class GenConstants { + /** + * 单表(增删改查) + */ public static final String TPL_CRUD = "crud"; - /** 树表(增删改查) */ + /** + * 树表(增删改查) + */ public static final String TPL_TREE = "tree"; - /** 主子表(增删改查) */ + /** + * 主子表(增删改查) + */ public static final String TPL_SUB = "sub"; - /** 树编码字段 */ + /** + * 树编码字段 + */ public static final String TREE_CODE = "treeCode"; - /** 树父编码字段 */ + /** + * 树父编码字段 + */ public static final String TREE_PARENT_CODE = "treeParentCode"; - /** 树名称字段 */ + /** + * 树名称字段 + */ public static final String TREE_NAME = "treeName"; - /** 上级菜单ID字段 */ + /** + * 上级菜单ID字段 + */ public static final String PARENT_MENU_ID = "parentMenuId"; - /** 上级菜单名称字段 */ + /** + * 上级菜单名称字段 + */ public static final String PARENT_MENU_NAME = "parentMenuName"; - /** 数据库字符串类型 */ - public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; + /** + * 数据库字符串类型 + */ + public static final String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"}; - /** 数据库文本类型 */ - public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; + /** + * 数据库文本类型 + */ + public static final String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"}; - /** 数据库时间类型 */ - public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; + /** + * 数据库时间类型 + */ + public static final String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"}; - /** 数据库数字类型 */ - public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", - "bit", "bigint", "float", "double", "decimal" }; + /** + * 数据库数字类型 + */ + public static final String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", + "bit", "bigint", "float", "double", "decimal"}; - /** 页面不需要编辑字段 */ - public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; + /** + * 页面不需要编辑字段 + */ + public static final String[] COLUMNNAME_NOT_EDIT = {"id", "create_by", "create_time", "del_flag"}; - /** 页面不需要显示的列表字段 */ - public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time" }; + /** + * 页面不需要显示的列表字段 + */ + public static final String[] COLUMNNAME_NOT_LIST = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time"}; - /** 页面不需要查询字段 */ - public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time", "remark" }; + /** + * 页面不需要查询字段 + */ + public static final String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by", + "update_time", "remark"}; - /** Entity基类字段 */ - public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; + /** + * Entity基类字段 + */ + public static final String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime", "remark"}; - /** Tree基类字段 */ - public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; + /** + * Tree基类字段 + */ + public static final String[] TREE_ENTITY = {"parentName", "parentId", "orderNum", "ancestors", "children"}; - /** 文本框 */ + /** + * 文本框 + */ public static final String HTML_INPUT = "input"; - /** 文本域 */ + /** + * 文本域 + */ public static final String HTML_TEXTAREA = "textarea"; - /** 下拉框 */ + /** + * 下拉框 + */ public static final String HTML_SELECT = "select"; - /** 单选框 */ + /** + * 单选框 + */ public static final String HTML_RADIO = "radio"; - /** 复选框 */ + /** + * 复选框 + */ public static final String HTML_CHECKBOX = "checkbox"; - /** 日期控件 */ + /** + * 日期控件 + */ public static final String HTML_DATETIME = "datetime"; - /** 图片上传控件 */ + /** + * 图片上传控件 + */ public static final String HTML_IMAGE_UPLOAD = "imageUpload"; - /** 文件上传控件 */ + /** + * 文件上传控件 + */ public static final String HTML_FILE_UPLOAD = "fileUpload"; - /** 富文本控件 */ + /** + * 富文本控件 + */ public static final String HTML_EDITOR = "editor"; - /** 字符串类型 */ + /** + * 字符串类型 + */ public static final String TYPE_STRING = "String"; - /** 整型 */ + /** + * 整型 + */ public static final String TYPE_INTEGER = "Integer"; - /** 长整型 */ + /** + * 长整型 + */ public static final String TYPE_LONG = "Long"; - /** 浮点型 */ + /** + * 浮点型 + */ public static final String TYPE_DOUBLE = "Double"; - /** 高精度计算类型 */ + /** + * 高精度计算类型 + */ public static final String TYPE_BIGDECIMAL = "BigDecimal"; - /** 时间类型 */ + /** + * 时间类型 + */ public static final String TYPE_DATE = "Date"; - /** 模糊查询 */ + /** + * 模糊查询 + */ public static final String QUERY_LIKE = "LIKE"; - /** 需要 */ + /** + * 需要 + */ public static final String REQUIRE = "1"; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java index d60afee2..4ce8f31a 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java @@ -2,11 +2,10 @@ package com.ruoyi.common.constant; /** * 返回状态码 - * + * * @author ruoyi */ -public class HttpStatus -{ +public class HttpStatus { /** * 操作成功 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java index 62ad8154..0af14ad2 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java @@ -2,30 +2,38 @@ package com.ruoyi.common.constant; /** * 任务调度通用常量 - * + * * @author ruoyi */ -public class ScheduleConstants -{ +public class ScheduleConstants { public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; - /** 执行目标key */ + /** + * 执行目标key + */ public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; - /** 默认 */ + /** + * 默认 + */ public static final String MISFIRE_DEFAULT = "0"; - /** 立即触发执行 */ + /** + * 立即触发执行 + */ public static final String MISFIRE_IGNORE_MISFIRES = "1"; - /** 触发一次执行 */ + /** + * 触发一次执行 + */ public static final String MISFIRE_FIRE_AND_PROCEED = "2"; - /** 不触发立即执行 */ + /** + * 不触发立即执行 + */ public static final String MISFIRE_DO_NOTHING = "3"; - public enum Status - { + public enum Status { /** * 正常 */ @@ -37,13 +45,11 @@ public class ScheduleConstants private String value; - private Status(String value) - { + private Status(String value) { this.value = value; } - public String getValue() - { + public String getValue() { return value; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java index 56b46ba8..67bc9baf 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java @@ -2,62 +2,93 @@ package com.ruoyi.common.constant; /** * 用户常量信息 - * + * * @author ruoyi */ -public class UserConstants -{ +public class UserConstants { /** * 平台内系统用户的唯一标志 */ public static final String SYS_USER = "SYS_USER"; - /** 正常状态 */ + /** + * 正常状态 + */ public static final String NORMAL = "0"; - /** 异常状态 */ + /** + * 异常状态 + */ public static final String EXCEPTION = "1"; - /** 用户封禁状态 */ + /** + * 用户封禁状态 + */ public static final String USER_DISABLE = "1"; - /** 角色封禁状态 */ + /** + * 角色封禁状态 + */ public static final String ROLE_DISABLE = "1"; - /** 部门正常状态 */ + /** + * 部门正常状态 + */ public static final String DEPT_NORMAL = "0"; - /** 部门停用状态 */ + /** + * 部门停用状态 + */ public static final String DEPT_DISABLE = "1"; - /** 字典正常状态 */ + /** + * 字典正常状态 + */ public static final String DICT_NORMAL = "0"; - /** 是否为系统默认(是) */ + /** + * 是否为系统默认(是) + */ public static final String YES = "Y"; - /** 是否菜单外链(是) */ + /** + * 是否菜单外链(是) + */ public static final String YES_FRAME = "0"; - /** 是否菜单外链(否) */ + /** + * 是否菜单外链(否) + */ public static final String NO_FRAME = "1"; - /** 菜单类型(目录) */ + /** + * 菜单类型(目录) + */ public static final String TYPE_DIR = "M"; - /** 菜单类型(菜单) */ + /** + * 菜单类型(菜单) + */ public static final String TYPE_MENU = "C"; - /** 菜单类型(按钮) */ + /** + * 菜单类型(按钮) + */ public static final String TYPE_BUTTON = "F"; - /** Layout组件标识 */ + /** + * Layout组件标识 + */ public final static String LAYOUT = "Layout"; - /** ParentView组件标识 */ + /** + * ParentView组件标识 + */ public final static String PARENT_VIEW = "ParentView"; - /** 校验返回结果码 */ + /** + * 校验返回结果码 + */ public final static String UNIQUE = "0"; public final static String NOT_UNIQUE = "1"; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index 2a31e70f..2eae5289 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -3,6 +3,7 @@ package com.ruoyi.common.core.controller; import java.beans.PropertyEditorSupport; import java.util.Date; import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.WebDataBinder; @@ -20,25 +21,21 @@ import com.ruoyi.common.utils.sql.SqlUtil; /** * web层通用数据处理 - * + * * @author ruoyi */ -public class BaseController -{ +public class BaseController { protected final Logger logger = LoggerFactory.getLogger(BaseController.class); /** * 将前台传递过来的日期格式的字符串,自动转化为Date类型 */ @InitBinder - public void initBinder(WebDataBinder binder) - { + public void initBinder(WebDataBinder binder) { // Date 类型转换 - binder.registerCustomEditor(Date.class, new PropertyEditorSupport() - { + binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { @Override - public void setAsText(String text) - { + public void setAsText(String text) { setValue(DateUtils.parseDate(text)); } }); @@ -47,13 +44,11 @@ public class BaseController /** * 设置请求分页数据 */ - protected void startPage() - { + protected void startPage() { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); - if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) - { + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) { String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); PageHelper.startPage(pageNum, pageSize, orderBy); } @@ -62,9 +57,8 @@ public class BaseController /** * 响应请求分页数据 */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - protected TableDataInfo getDataTable(List list) - { + @SuppressWarnings({"rawtypes", "unchecked"}) + protected TableDataInfo getDataTable(List list) { TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setMsg("查询成功"); @@ -75,20 +69,18 @@ public class BaseController /** * 响应返回结果 - * + * * @param rows 影响行数 * @return 操作结果 */ - protected AjaxResult toAjax(int rows) - { + protected AjaxResult toAjax(int rows) { return rows > 0 ? AjaxResult.success() : AjaxResult.error(); } /** * 页面跳转 */ - public String redirect(String url) - { + public String redirect(String url) { return StringUtils.format("redirect:{}", url); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java index 28e5a688..f6db15df 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java @@ -1,148 +1,142 @@ package com.ruoyi.common.core.domain; import java.util.HashMap; + import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.utils.StringUtils; /** * 操作消息提醒 - * + * * @author ruoyi */ -public class AjaxResult extends HashMap -{ +public class AjaxResult extends HashMap { private static final long serialVersionUID = 1L; - /** 状态码 */ + /** + * 状态码 + */ public static final String CODE_TAG = "code"; - /** 返回内容 */ + /** + * 返回内容 + */ public static final String MSG_TAG = "msg"; - /** 数据对象 */ + /** + * 数据对象 + */ public static final String DATA_TAG = "data"; /** * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 */ - public AjaxResult() - { + public AjaxResult() { } /** * 初始化一个新创建的 AjaxResult 对象 - * + * * @param code 状态码 - * @param msg 返回内容 + * @param msg 返回内容 */ - public AjaxResult(int code, String msg) - { + public AjaxResult(int code, String msg) { super.put(CODE_TAG, code); super.put(MSG_TAG, msg); } /** * 初始化一个新创建的 AjaxResult 对象 - * + * * @param code 状态码 - * @param msg 返回内容 + * @param msg 返回内容 * @param data 数据对象 */ - public AjaxResult(int code, String msg, Object data) - { + public AjaxResult(int code, String msg, Object data) { super.put(CODE_TAG, code); super.put(MSG_TAG, msg); - if (StringUtils.isNotNull(data)) - { + if (StringUtils.isNotNull(data)) { super.put(DATA_TAG, data); } } /** * 返回成功消息 - * + * * @return 成功消息 */ - public static AjaxResult success() - { + public static AjaxResult success() { return AjaxResult.success("操作成功"); } /** * 返回成功数据 - * + * * @return 成功消息 */ - public static AjaxResult success(Object data) - { + public static AjaxResult success(Object data) { return AjaxResult.success("操作成功", data); } /** * 返回成功消息 - * + * * @param msg 返回内容 * @return 成功消息 */ - public static AjaxResult success(String msg) - { + public static AjaxResult success(String msg) { return AjaxResult.success(msg, null); } /** * 返回成功消息 - * - * @param msg 返回内容 + * + * @param msg 返回内容 * @param data 数据对象 * @return 成功消息 */ - public static AjaxResult success(String msg, Object data) - { + public static AjaxResult success(String msg, Object data) { return new AjaxResult(HttpStatus.SUCCESS, msg, data); } /** * 返回错误消息 - * + * * @return */ - public static AjaxResult error() - { + public static AjaxResult error() { return AjaxResult.error("操作失败"); } /** * 返回错误消息 - * + * * @param msg 返回内容 * @return 警告消息 */ - public static AjaxResult error(String msg) - { + public static AjaxResult error(String msg) { return AjaxResult.error(msg, null); } /** * 返回错误消息 - * - * @param msg 返回内容 + * + * @param msg 返回内容 * @param data 数据对象 * @return 警告消息 */ - public static AjaxResult error(String msg, Object data) - { + public static AjaxResult error(String msg, Object data) { return new AjaxResult(HttpStatus.ERROR, msg, data); } /** * 返回错误消息 - * + * * @param code 状态码 - * @param msg 返回内容 + * @param msg 返回内容 * @return 警告消息 */ - public static AjaxResult error(int code, String msg) - { + public static AjaxResult error(int code, String msg) { return new AjaxResult(code, msg, null); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index f7d5bf46..093fee41 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -4,111 +4,110 @@ import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; + import com.fasterxml.jackson.annotation.JsonFormat; /** * Entity基类 - * + * * @author ruoyi */ -public class BaseEntity implements Serializable -{ +public class BaseEntity implements Serializable { private static final long serialVersionUID = 1L; - /** 搜索值 */ + /** + * 搜索值 + */ private String searchValue; - /** 创建者 */ + /** + * 创建者 + */ private String createBy; - /** 创建时间 */ + /** + * 创建时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; - /** 更新者 */ + /** + * 更新者 + */ private String updateBy; - /** 更新时间 */ + /** + * 更新时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; - /** 备注 */ + /** + * 备注 + */ private String remark; - /** 请求参数 */ + /** + * 请求参数 + */ private Map params; - public String getSearchValue() - { + public String getSearchValue() { return searchValue; } - public void setSearchValue(String searchValue) - { + public void setSearchValue(String searchValue) { this.searchValue = searchValue; } - public String getCreateBy() - { + public String getCreateBy() { return createBy; } - public void setCreateBy(String createBy) - { + public void setCreateBy(String createBy) { this.createBy = createBy; } - public Date getCreateTime() - { + public Date getCreateTime() { return createTime; } - public void setCreateTime(Date createTime) - { + public void setCreateTime(Date createTime) { this.createTime = createTime; } - public String getUpdateBy() - { + public String getUpdateBy() { return updateBy; } - public void setUpdateBy(String updateBy) - { + public void setUpdateBy(String updateBy) { this.updateBy = updateBy; } - public Date getUpdateTime() - { + public Date getUpdateTime() { return updateTime; } - public void setUpdateTime(Date updateTime) - { + public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } - public String getRemark() - { + public String getRemark() { return remark; } - public void setRemark(String remark) - { + public void setRemark(String remark) { this.remark = remark; } - public Map getParams() - { - if (params == null) - { + public Map getParams() { + if (params == null) { params = new HashMap<>(); } return params; } - public void setParams(Map params) - { + public void setParams(Map params) { this.params = params; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java index a180a18c..265c7385 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java @@ -5,75 +5,74 @@ import java.util.List; /** * Tree基类 - * + * * @author ruoyi */ -public class TreeEntity extends BaseEntity -{ +public class TreeEntity extends BaseEntity { private static final long serialVersionUID = 1L; - /** 父菜单名称 */ + /** + * 父菜单名称 + */ private String parentName; - /** 父菜单ID */ + /** + * 父菜单ID + */ private Long parentId; - /** 显示顺序 */ + /** + * 显示顺序 + */ private Integer orderNum; - /** 祖级列表 */ + /** + * 祖级列表 + */ private String ancestors; - /** 子部门 */ + /** + * 子部门 + */ private List children = new ArrayList<>(); - public String getParentName() - { + public String getParentName() { return parentName; } - public void setParentName(String parentName) - { + public void setParentName(String parentName) { this.parentName = parentName; } - public Long getParentId() - { + public Long getParentId() { return parentId; } - public void setParentId(Long parentId) - { + public void setParentId(Long parentId) { this.parentId = parentId; } - public Integer getOrderNum() - { + public Integer getOrderNum() { return orderNum; } - public void setOrderNum(Integer orderNum) - { + public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } - public String getAncestors() - { + public String getAncestors() { return ancestors; } - public void setAncestors(String ancestors) - { + public void setAncestors(String ancestors) { this.ancestors = ancestors; } - public List getChildren() - { + public List getChildren() { return children; } - public void setChildren(List children) - { + public void setChildren(List children) { this.children = children; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java index bd835db9..8649ccec 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java @@ -3,75 +3,72 @@ package com.ruoyi.common.core.domain; import java.io.Serializable; import java.util.List; import java.util.stream.Collectors; + import com.fasterxml.jackson.annotation.JsonInclude; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysMenu; /** * Treeselect树结构实体类 - * + * * @author ruoyi */ -public class TreeSelect implements Serializable -{ +public class TreeSelect implements Serializable { private static final long serialVersionUID = 1L; - /** 节点ID */ + /** + * 节点ID + */ private Long id; - /** 节点名称 */ + /** + * 节点名称 + */ private String label; - /** 子节点 */ + /** + * 子节点 + */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private List children; - public TreeSelect() - { + public TreeSelect() { } - public TreeSelect(SysDept dept) - { + public TreeSelect(SysDept dept) { this.id = dept.getDeptId(); this.label = dept.getDeptName(); this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } - public TreeSelect(SysMenu menu) - { + public TreeSelect(SysMenu menu) { this.id = menu.getMenuId(); this.label = menu.getMenuName(); this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } - public Long getId() - { + public Long getId() { return id; } - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public String getLabel() - { + public String getLabel() { return label; } - public void setLabel(String label) - { + public void setLabel(String label) { this.label = label; } - public List getChildren() - { + public List getChildren() { return children; } - public void setChildren(List children) - { + public void setChildren(List children) { this.children = children; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index c9238e23..df48444f 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -5,198 +5,198 @@ import java.util.List; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.domain.BaseEntity; /** * 部门表 sys_dept - * + * * @author ruoyi */ -public class SysDept extends BaseEntity -{ +public class SysDept extends BaseEntity { private static final long serialVersionUID = 1L; - /** 部门ID */ + /** + * 部门ID + */ private Long deptId; - /** 父部门ID */ + /** + * 父部门ID + */ private Long parentId; - /** 祖级列表 */ + /** + * 祖级列表 + */ private String ancestors; - /** 部门名称 */ + /** + * 部门名称 + */ private String deptName; - /** 显示顺序 */ + /** + * 显示顺序 + */ private String orderNum; - /** 负责人 */ + /** + * 负责人 + */ private String leader; - /** 联系电话 */ + /** + * 联系电话 + */ private String phone; - /** 邮箱 */ + /** + * 邮箱 + */ private String email; - /** 部门状态:0正常,1停用 */ + /** + * 部门状态:0正常,1停用 + */ private String status; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - /** 父部门名称 */ + /** + * 父部门名称 + */ private String parentName; - - /** 子部门 */ + + /** + * 子部门 + */ private List children = new ArrayList(); - public Long getDeptId() - { + public Long getDeptId() { return deptId; } - public void setDeptId(Long deptId) - { + public void setDeptId(Long deptId) { this.deptId = deptId; } - public Long getParentId() - { + public Long getParentId() { return parentId; } - public void setParentId(Long parentId) - { + public void setParentId(Long parentId) { this.parentId = parentId; } - public String getAncestors() - { + public String getAncestors() { return ancestors; } - public void setAncestors(String ancestors) - { + public void setAncestors(String ancestors) { this.ancestors = ancestors; } @NotBlank(message = "部门名称不能为空") @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") - public String getDeptName() - { + public String getDeptName() { return deptName; } - public void setDeptName(String deptName) - { + public void setDeptName(String deptName) { this.deptName = deptName; } @NotBlank(message = "显示顺序不能为空") - public String getOrderNum() - { + public String getOrderNum() { return orderNum; } - public void setOrderNum(String orderNum) - { + public void setOrderNum(String orderNum) { this.orderNum = orderNum; } - public String getLeader() - { + public String getLeader() { return leader; } - public void setLeader(String leader) - { + public void setLeader(String leader) { this.leader = leader; } @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") - public String getPhone() - { + public String getPhone() { return phone; } - public void setPhone(String phone) - { + public void setPhone(String phone) { this.phone = phone; } @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") - public String getEmail() - { + public String getEmail() { return email; } - public void setEmail(String email) - { + public void setEmail(String email) { this.email = email; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } - public void setDelFlag(String delFlag) - { + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getParentName() - { + public String getParentName() { return parentName; } - public void setParentName(String parentName) - { + public void setParentName(String parentName) { this.parentName = parentName; } - public List getChildren() - { + public List getChildren() { return children; } - public void setChildren(List children) - { + public void setChildren(List children) { this.children = children; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deptId", getDeptId()) - .append("parentId", getParentId()) - .append("ancestors", getAncestors()) - .append("deptName", getDeptName()) - .append("orderNum", getOrderNum()) - .append("leader", getLeader()) - .append("phone", getPhone()) - .append("email", getEmail()) - .append("status", getStatus()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deptId", getDeptId()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("deptName", getDeptName()) + .append("orderNum", getOrderNum()) + .append("leader", getLeader()) + .append("phone", getPhone()) + .append("email", getEmail()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java index 3f152b34..709c6c7a 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java @@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain.entity; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -11,166 +12,164 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 字典数据表 sys_dict_data - * + * * @author ruoyi */ -public class SysDictData extends BaseEntity -{ +public class SysDictData extends BaseEntity { private static final long serialVersionUID = 1L; - /** 字典编码 */ + /** + * 字典编码 + */ @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) private Long dictCode; - /** 字典排序 */ + /** + * 字典排序 + */ @Excel(name = "字典排序", cellType = ColumnType.NUMERIC) private Long dictSort; - /** 字典标签 */ + /** + * 字典标签 + */ @Excel(name = "字典标签") private String dictLabel; - /** 字典键值 */ + /** + * 字典键值 + */ @Excel(name = "字典键值") private String dictValue; - /** 字典类型 */ + /** + * 字典类型 + */ @Excel(name = "字典类型") private String dictType; - /** 样式属性(其他样式扩展) */ + /** + * 样式属性(其他样式扩展) + */ private String cssClass; - /** 表格字典样式 */ + /** + * 表格字典样式 + */ private String listClass; - /** 是否默认(Y是 N否) */ + /** + * 是否默认(Y是 N否) + */ @Excel(name = "是否默认", readConverterExp = "Y=是,N=否") private String isDefault; - /** 状态(0正常 1停用) */ + /** + * 状态(0正常 1停用) + */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; - public Long getDictCode() - { + public Long getDictCode() { return dictCode; } - public void setDictCode(Long dictCode) - { + public void setDictCode(Long dictCode) { this.dictCode = dictCode; } - public Long getDictSort() - { + public Long getDictSort() { return dictSort; } - public void setDictSort(Long dictSort) - { + public void setDictSort(Long dictSort) { this.dictSort = dictSort; } @NotBlank(message = "字典标签不能为空") @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") - public String getDictLabel() - { + public String getDictLabel() { return dictLabel; } - public void setDictLabel(String dictLabel) - { + public void setDictLabel(String dictLabel) { this.dictLabel = dictLabel; } @NotBlank(message = "字典键值不能为空") @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") - public String getDictValue() - { + public String getDictValue() { return dictValue; } - public void setDictValue(String dictValue) - { + public void setDictValue(String dictValue) { this.dictValue = dictValue; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") - public String getDictType() - { + public String getDictType() { return dictType; } - public void setDictType(String dictType) - { + public void setDictType(String dictType) { this.dictType = dictType; } @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") - public String getCssClass() - { + public String getCssClass() { return cssClass; } - public void setCssClass(String cssClass) - { + public void setCssClass(String cssClass) { this.cssClass = cssClass; } - public String getListClass() - { + public String getListClass() { return listClass; } - public void setListClass(String listClass) - { + public void setListClass(String listClass) { this.listClass = listClass; } - public boolean getDefault() - { + public boolean getDefault() { return UserConstants.YES.equals(this.isDefault) ? true : false; } - public String getIsDefault() - { + public String getIsDefault() { return isDefault; } - public void setIsDefault(String isDefault) - { + public void setIsDefault(String isDefault) { this.isDefault = isDefault; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("dictCode", getDictCode()) - .append("dictSort", getDictSort()) - .append("dictLabel", getDictLabel()) - .append("dictValue", getDictValue()) - .append("dictType", getDictType()) - .append("cssClass", getCssClass()) - .append("listClass", getListClass()) - .append("isDefault", getIsDefault()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("dictCode", getDictCode()) + .append("dictSort", getDictSort()) + .append("dictLabel", getDictLabel()) + .append("dictValue", getDictValue()) + .append("dictType", getDictType()) + .append("cssClass", getCssClass()) + .append("listClass", getListClass()) + .append("isDefault", getIsDefault()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java index d2c42498..8627553c 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java @@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain.entity; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -10,85 +11,84 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 字典类型表 sys_dict_type - * + * * @author ruoyi */ -public class SysDictType extends BaseEntity -{ +public class SysDictType extends BaseEntity { private static final long serialVersionUID = 1L; - /** 字典主键 */ + /** + * 字典主键 + */ @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) private Long dictId; - /** 字典名称 */ + /** + * 字典名称 + */ @Excel(name = "字典名称") private String dictName; - /** 字典类型 */ + /** + * 字典类型 + */ @Excel(name = "字典类型") private String dictType; - /** 状态(0正常 1停用) */ + /** + * 状态(0正常 1停用) + */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; - public Long getDictId() - { + public Long getDictId() { return dictId; } - public void setDictId(Long dictId) - { + public void setDictId(Long dictId) { this.dictId = dictId; } @NotBlank(message = "字典名称不能为空") @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") - public String getDictName() - { + public String getDictName() { return dictName; } - public void setDictName(String dictName) - { + public void setDictName(String dictName) { this.dictName = dictName; } @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") - public String getDictType() - { + public String getDictType() { return dictType; } - public void setDictType(String dictType) - { + public void setDictType(String dictType) { this.dictType = dictType; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("dictId", getDictId()) - .append("dictName", getDictName()) - .append("dictType", getDictType()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("dictId", getDictId()) + .append("dictName", getDictName()) + .append("dictType", getDictType()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java index 94d654ae..59f6ae96 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java @@ -4,242 +4,242 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.domain.BaseEntity; /** * 菜单权限表 sys_menu - * + * * @author ruoyi */ -public class SysMenu extends BaseEntity -{ +public class SysMenu extends BaseEntity { private static final long serialVersionUID = 1L; - /** 菜单ID */ + /** + * 菜单ID + */ private Long menuId; - /** 菜单名称 */ + /** + * 菜单名称 + */ private String menuName; - /** 父菜单名称 */ + /** + * 父菜单名称 + */ private String parentName; - /** 父菜单ID */ + /** + * 父菜单ID + */ private Long parentId; - /** 显示顺序 */ + /** + * 显示顺序 + */ private String orderNum; - /** 路由地址 */ + /** + * 路由地址 + */ private String path; - /** 组件路径 */ + /** + * 组件路径 + */ private String component; - /** 是否为外链(0是 1否) */ + /** + * 是否为外链(0是 1否) + */ private String isFrame; - /** 是否缓存(0缓存 1不缓存) */ + /** + * 是否缓存(0缓存 1不缓存) + */ private String isCache; - /** 类型(M目录 C菜单 F按钮) */ + /** + * 类型(M目录 C菜单 F按钮) + */ private String menuType; - /** 显示状态(0显示 1隐藏) */ + /** + * 显示状态(0显示 1隐藏) + */ private String visible; - - /** 菜单状态(0显示 1隐藏) */ + + /** + * 菜单状态(0显示 1隐藏) + */ private String status; - /** 权限字符串 */ + /** + * 权限字符串 + */ private String perms; - /** 菜单图标 */ + /** + * 菜单图标 + */ private String icon; - /** 子菜单 */ + /** + * 子菜单 + */ private List children = new ArrayList(); - public Long getMenuId() - { + public Long getMenuId() { return menuId; } - public void setMenuId(Long menuId) - { + public void setMenuId(Long menuId) { this.menuId = menuId; } @NotBlank(message = "菜单名称不能为空") @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") - public String getMenuName() - { + public String getMenuName() { return menuName; } - public void setMenuName(String menuName) - { + public void setMenuName(String menuName) { this.menuName = menuName; } - public String getParentName() - { + public String getParentName() { return parentName; } - public void setParentName(String parentName) - { + public void setParentName(String parentName) { this.parentName = parentName; } - public Long getParentId() - { + public Long getParentId() { return parentId; } - public void setParentId(Long parentId) - { + public void setParentId(Long parentId) { this.parentId = parentId; } @NotBlank(message = "显示顺序不能为空") - public String getOrderNum() - { + public String getOrderNum() { return orderNum; } - public void setOrderNum(String orderNum) - { + public void setOrderNum(String orderNum) { this.orderNum = orderNum; } @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") - public String getPath() - { + public String getPath() { return path; } - public void setPath(String path) - { + public void setPath(String path) { this.path = path; } @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") - public String getComponent() - { + public String getComponent() { return component; } - public void setComponent(String component) - { + public void setComponent(String component) { this.component = component; } - public String getIsFrame() - { + public String getIsFrame() { return isFrame; } - public void setIsFrame(String isFrame) - { + public void setIsFrame(String isFrame) { this.isFrame = isFrame; } - public String getIsCache() - { + public String getIsCache() { return isCache; } - public void setIsCache(String isCache) - { + public void setIsCache(String isCache) { this.isCache = isCache; } @NotBlank(message = "菜单类型不能为空") - public String getMenuType() - { + public String getMenuType() { return menuType; } - public void setMenuType(String menuType) - { + public void setMenuType(String menuType) { this.menuType = menuType; } - public String getVisible() - { + public String getVisible() { return visible; } - public void setVisible(String visible) - { + public void setVisible(String visible) { this.visible = visible; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") - public String getPerms() - { + public String getPerms() { return perms; } - public void setPerms(String perms) - { + public void setPerms(String perms) { this.perms = perms; } - public String getIcon() - { + public String getIcon() { return icon; } - public void setIcon(String icon) - { + public void setIcon(String icon) { this.icon = icon; } - public List getChildren() - { + public List getChildren() { return children; } - public void setChildren(List children) - { + public void setChildren(List children) { this.children = children; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("menuId", getMenuId()) - .append("menuName", getMenuName()) - .append("parentId", getParentId()) - .append("orderNum", getOrderNum()) - .append("path", getPath()) - .append("component", getComponent()) - .append("isFrame", getIsFrame()) - .append("IsCache", getIsCache()) - .append("menuType", getMenuType()) - .append("visible", getVisible()) - .append("status ", getStatus()) - .append("perms", getPerms()) - .append("icon", getIcon()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java index 2991595a..43b6b89f 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain.entity; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -10,217 +11,212 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 角色表 sys_role - * + * * @author ruoyi */ -public class SysRole extends BaseEntity -{ +public class SysRole extends BaseEntity { private static final long serialVersionUID = 1L; - /** 角色ID */ + /** + * 角色ID + */ @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) private Long roleId; - /** 角色名称 */ + /** + * 角色名称 + */ @Excel(name = "角色名称") private String roleName; - /** 角色权限 */ + /** + * 角色权限 + */ @Excel(name = "角色权限") private String roleKey; - /** 角色排序 */ + /** + * 角色排序 + */ @Excel(name = "角色排序") private String roleSort; - /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */ + /** + * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) + */ @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限") private String dataScope; - /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ + /** + * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) + */ private boolean menuCheckStrictly; - /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ + /** + * 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) + */ private boolean deptCheckStrictly; - /** 角色状态(0正常 1停用) */ + /** + * 角色状态(0正常 1停用) + */ @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") private String status; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - /** 用户是否存在此角色标识 默认不存在 */ + /** + * 用户是否存在此角色标识 默认不存在 + */ private boolean flag = false; - /** 菜单组 */ + /** + * 菜单组 + */ private Long[] menuIds; - /** 部门组(数据权限) */ + /** + * 部门组(数据权限) + */ private Long[] deptIds; - public SysRole() - { + public SysRole() { } - public SysRole(Long roleId) - { + public SysRole(Long roleId) { this.roleId = roleId; } - public Long getRoleId() - { + public Long getRoleId() { return roleId; } - public void setRoleId(Long roleId) - { + public void setRoleId(Long roleId) { this.roleId = roleId; } - public boolean isAdmin() - { + public boolean isAdmin() { return isAdmin(this.roleId); } - public static boolean isAdmin(Long roleId) - { + public static boolean isAdmin(Long roleId) { return roleId != null && 1L == roleId; } @NotBlank(message = "角色名称不能为空") @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") - public String getRoleName() - { + public String getRoleName() { return roleName; } - public void setRoleName(String roleName) - { + public void setRoleName(String roleName) { this.roleName = roleName; } @NotBlank(message = "权限字符不能为空") @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") - public String getRoleKey() - { + public String getRoleKey() { return roleKey; } - public void setRoleKey(String roleKey) - { + public void setRoleKey(String roleKey) { this.roleKey = roleKey; } @NotBlank(message = "显示顺序不能为空") - public String getRoleSort() - { + public String getRoleSort() { return roleSort; } - public void setRoleSort(String roleSort) - { + public void setRoleSort(String roleSort) { this.roleSort = roleSort; } - public String getDataScope() - { + public String getDataScope() { return dataScope; } - public void setDataScope(String dataScope) - { + public void setDataScope(String dataScope) { this.dataScope = dataScope; } - public boolean isMenuCheckStrictly() - { + public boolean isMenuCheckStrictly() { return menuCheckStrictly; } - public void setMenuCheckStrictly(boolean menuCheckStrictly) - { + public void setMenuCheckStrictly(boolean menuCheckStrictly) { this.menuCheckStrictly = menuCheckStrictly; } - public boolean isDeptCheckStrictly() - { + public boolean isDeptCheckStrictly() { return deptCheckStrictly; } - public void setDeptCheckStrictly(boolean deptCheckStrictly) - { + public void setDeptCheckStrictly(boolean deptCheckStrictly) { this.deptCheckStrictly = deptCheckStrictly; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } - public void setDelFlag(String delFlag) - { + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public boolean isFlag() - { + public boolean isFlag() { return flag; } - public void setFlag(boolean flag) - { + public void setFlag(boolean flag) { this.flag = flag; } - public Long[] getMenuIds() - { + public Long[] getMenuIds() { return menuIds; } - public void setMenuIds(Long[] menuIds) - { + public void setMenuIds(Long[] menuIds) { this.menuIds = menuIds; } - public Long[] getDeptIds() - { + public Long[] getDeptIds() { return deptIds; } - public void setDeptIds(Long[] deptIds) - { + public void setDeptIds(Long[] deptIds) { this.deptIds = deptIds; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("roleName", getRoleName()) - .append("roleKey", getRoleKey()) - .append("roleSort", getRoleSort()) - .append("dataScope", getDataScope()) - .append("menuCheckStrictly", isMenuCheckStrictly()) - .append("deptCheckStrictly", isDeptCheckStrictly()) - .append("status", getStatus()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("roleName", getRoleName()) + .append("roleKey", getRoleKey()) + .append("roleSort", getRoleSort()) + .append("dataScope", getDataScope()) + .append("menuCheckStrictly", isMenuCheckStrictly()) + .append("deptCheckStrictly", isDeptCheckStrictly()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index d08668ab..0c21b684 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -5,6 +5,7 @@ import java.util.List; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -17,312 +18,318 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 用户对象 sys_user - * + * * @author ruoyi */ -public class SysUser extends BaseEntity -{ +public class SysUser extends BaseEntity { private static final long serialVersionUID = 1L; - /** 用户ID */ + /** + * 用户ID + */ @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") private Long userId; - /** 部门ID */ + /** + * 部门ID + */ @Excel(name = "部门编号", type = Type.IMPORT) private Long deptId; - /** 用户账号 */ + /** + * 用户账号 + */ @Excel(name = "登录名称") private String userName; - /** 用户昵称 */ + /** + * 用户昵称 + */ @Excel(name = "用户名称") private String nickName; - /** 用户邮箱 */ + @Excel(name = "用户OpenId") + private String openId; + + /** + * 用户邮箱 + */ @Excel(name = "用户邮箱") private String email; - /** 手机号码 */ + /** + * 手机号码 + */ @Excel(name = "手机号码") private String phonenumber; - /** 用户性别 */ + /** + * 用户性别 + */ @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") private String sex; - /** 用户头像 */ + /** + * 用户头像 + */ private String avatar; - /** 密码 */ + /** + * 密码 + */ private String password; - /** 盐加密 */ + /** + * 盐加密 + */ private String salt; - /** 帐号状态(0正常 1停用) */ + /** + * 帐号状态(0正常 1停用) + */ @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") private String status; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - /** 最后登录IP */ + /** + * 最后登录IP + */ @Excel(name = "最后登录IP", type = Type.EXPORT) private String loginIp; - /** 最后登录时间 */ + /** + * 最后登录时间 + */ @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) private Date loginDate; - /** 部门对象 */ + /** + * 部门对象 + */ @Excels({ - @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), - @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) + @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) }) private SysDept dept; - /** 角色对象 */ + /** + * 角色对象 + */ private List roles; - /** 角色组 */ + /** + * 角色组 + */ private Long[] roleIds; - /** 岗位组 */ + /** + * 岗位组 + */ private Long[] postIds; - public SysUser() - { + public SysUser() { } - public SysUser(Long userId) - { + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public SysUser(Long userId) { this.userId = userId; } - public Long getUserId() - { + public Long getUserId() { return userId; } - public void setUserId(Long userId) - { + public void setUserId(Long userId) { this.userId = userId; } - public boolean isAdmin() - { + public boolean isAdmin() { return isAdmin(this.userId); } - public static boolean isAdmin(Long userId) - { + public static boolean isAdmin(Long userId) { return userId != null && 1L == userId; } - public Long getDeptId() - { + public Long getDeptId() { return deptId; } - public void setDeptId(Long deptId) - { + public void setDeptId(Long deptId) { this.deptId = deptId; } @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") - public String getNickName() - { + public String getNickName() { return nickName; } - public void setNickName(String nickName) - { + public void setNickName(String nickName) { this.nickName = nickName; } @NotBlank(message = "用户账号不能为空") @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") - public String getUserName() - { + public String getUserName() { return userName; } - public void setUserName(String userName) - { + public void setUserName(String userName) { this.userName = userName; } @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") - public String getEmail() - { + public String getEmail() { return email; } - public void setEmail(String email) - { + public void setEmail(String email) { this.email = email; } @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") - public String getPhonenumber() - { + public String getPhonenumber() { return phonenumber; } - public void setPhonenumber(String phonenumber) - { + public void setPhonenumber(String phonenumber) { this.phonenumber = phonenumber; } - public String getSex() - { + public String getSex() { return sex; } - public void setSex(String sex) - { + public void setSex(String sex) { this.sex = sex; } - public String getAvatar() - { + public String getAvatar() { return avatar; } - public void setAvatar(String avatar) - { + public void setAvatar(String avatar) { this.avatar = avatar; } - @JsonIgnore + @JsonIgnore @JsonProperty - public String getPassword() - { + public String getPassword() { return password; } - public void setPassword(String password) - { + public void setPassword(String password) { this.password = password; } - public String getSalt() - { + public String getSalt() { return salt; } - public void setSalt(String salt) - { + public void setSalt(String salt) { this.salt = salt; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } - public void setDelFlag(String delFlag) - { + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getLoginIp() - { + public String getLoginIp() { return loginIp; } - public void setLoginIp(String loginIp) - { + public void setLoginIp(String loginIp) { this.loginIp = loginIp; } - public Date getLoginDate() - { + public Date getLoginDate() { return loginDate; } - public void setLoginDate(Date loginDate) - { + public void setLoginDate(Date loginDate) { this.loginDate = loginDate; } - public SysDept getDept() - { + public SysDept getDept() { return dept; } - public void setDept(SysDept dept) - { + public void setDept(SysDept dept) { this.dept = dept; } - public List getRoles() - { + public List getRoles() { return roles; } - public void setRoles(List roles) - { + public void setRoles(List roles) { this.roles = roles; } - public Long[] getRoleIds() - { + public Long[] getRoleIds() { return roleIds; } - public void setRoleIds(Long[] roleIds) - { + public void setRoleIds(Long[] roleIds) { this.roleIds = roleIds; } - public Long[] getPostIds() - { + public Long[] getPostIds() { return postIds; } - public void setPostIds(Long[] postIds) - { + public void setPostIds(Long[] postIds) { this.postIds = postIds; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("deptId", getDeptId()) - .append("userName", getUserName()) - .append("nickName", getNickName()) - .append("email", getEmail()) - .append("phonenumber", getPhonenumber()) - .append("sex", getSex()) - .append("avatar", getAvatar()) - .append("password", getPassword()) - .append("salt", getSalt()) - .append("status", getStatus()) - .append("delFlag", getDelFlag()) - .append("loginIp", getLoginIp()) - .append("loginDate", getLoginDate()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .append("dept", getDept()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("deptId", getDeptId()) + .append("userName", getUserName()) + .append("nickName", getNickName()) + .append("email", getEmail()) + .append("phonenumber", getPhonenumber()) + .append("sex", getSex()) + .append("avatar", getAvatar()) + .append("password", getPassword()) + .append("salt", getSalt()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("loginIp", getLoginIp()) + .append("loginDate", getLoginDate()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("dept", getDept()) + .toString(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java index 03948b43..2d2fe112 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java @@ -2,11 +2,10 @@ package com.ruoyi.common.core.domain.model; /** * 用户登录对象 - * + * * @author ruoyi */ -public class LoginBody -{ +public class LoginBody { /** * 用户名 */ @@ -27,43 +26,35 @@ public class LoginBody */ private String uuid = ""; - public String getUsername() - { + public String getUsername() { return username; } - public void setUsername(String username) - { + public void setUsername(String username) { this.username = username; } - public String getPassword() - { + public String getPassword() { return password; } - public void setPassword(String password) - { + public void setPassword(String password) { this.password = password; } - public String getCode() - { + public String getCode() { return code; } - public void setCode(String code) - { + public void setCode(String code) { this.code = code; } - public String getUuid() - { + public String getUuid() { return uuid; } - public void setUuid(String uuid) - { + public void setUuid(String uuid) { this.uuid = uuid; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java index 6e3f1c6b..f9867ba9 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java @@ -1,7 +1,9 @@ package com.ruoyi.common.core.domain.model; import java.util.Collection; +import java.util.HashSet; import java.util.Set; + import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -9,11 +11,10 @@ import com.ruoyi.common.core.domain.entity.SysUser; /** * 登录用户身份权限 - * + * * @author ruoyi */ -public class LoginUser implements UserDetails -{ +public class LoginUser implements UserDetails { private static final long serialVersionUID = 1L; /** @@ -61,36 +62,32 @@ public class LoginUser implements UserDetails */ private SysUser user; - public String getToken() - { + public String getToken() { return token; } - public void setToken(String token) - { + public void setToken(String token) { this.token = token; } - public LoginUser() - { + public LoginUser() { } - public LoginUser(SysUser user, Set permissions) - { + public LoginUser(SysUser user, Set permissions) { this.user = user; this.permissions = permissions; } + + @JsonIgnore @Override - public String getPassword() - { + public String getPassword() { return user.getPassword(); } @Override - public String getUsername() - { + public String getUsername() { return user.getUserName(); } @@ -99,130 +96,110 @@ public class LoginUser implements UserDetails */ @JsonIgnore @Override - public boolean isAccountNonExpired() - { + public boolean isAccountNonExpired() { return true; } /** * 指定用户是否解锁,锁定的用户无法进行身份验证 - * + * * @return */ @JsonIgnore @Override - public boolean isAccountNonLocked() - { + public boolean isAccountNonLocked() { return true; } /** * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 - * + * * @return */ @JsonIgnore @Override - public boolean isCredentialsNonExpired() - { + public boolean isCredentialsNonExpired() { return true; } /** * 是否可用 ,禁用的用户不能身份验证 - * + * * @return */ @JsonIgnore @Override - public boolean isEnabled() - { + public boolean isEnabled() { return true; } - public Long getLoginTime() - { + public Long getLoginTime() { return loginTime; } - public void setLoginTime(Long loginTime) - { + public void setLoginTime(Long loginTime) { this.loginTime = loginTime; } - public String getIpaddr() - { + public String getIpaddr() { return ipaddr; } - public void setIpaddr(String ipaddr) - { + public void setIpaddr(String ipaddr) { this.ipaddr = ipaddr; } - public String getLoginLocation() - { + public String getLoginLocation() { return loginLocation; } - public void setLoginLocation(String loginLocation) - { + public void setLoginLocation(String loginLocation) { this.loginLocation = loginLocation; } - public String getBrowser() - { + public String getBrowser() { return browser; } - public void setBrowser(String browser) - { + public void setBrowser(String browser) { this.browser = browser; } - public String getOs() - { + public String getOs() { return os; } - public void setOs(String os) - { + public void setOs(String os) { this.os = os; } - public Long getExpireTime() - { + public Long getExpireTime() { return expireTime; } - public void setExpireTime(Long expireTime) - { + public void setExpireTime(Long expireTime) { this.expireTime = expireTime; } - public Set getPermissions() - { + public Set getPermissions() { + System.out.println("用户权限:"+permissions); return permissions; } - public void setPermissions(Set permissions) - { + public void setPermissions(Set permissions) { this.permissions = permissions; } - public SysUser getUser() - { + public SysUser getUser() { return user; } - public void setUser(SysUser user) - { + public void setUser(SysUser user) { this.user = user; } @Override - public Collection getAuthorities() - { + public Collection getAuthorities() { return null; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/MpLoginBody.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/MpLoginBody.java new file mode 100644 index 00000000..161fba39 --- /dev/null +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/MpLoginBody.java @@ -0,0 +1,17 @@ +package com.ruoyi.common.core.domain.model; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; + +/** + * 微信小程序用户登录对象 + * + * @author ruoyi + */ +@Data +public class MpLoginBody { + private String code; + + private JSONObject options; //{"path":"pages/mine/help/index","query":{},"scene":1001,"referrerInfo":{}} + +} diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java index 6fba8837..b63c3feb 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java @@ -4,69 +4,66 @@ import com.ruoyi.common.utils.StringUtils; /** * 分页数据 - * + * * @author ruoyi */ -public class PageDomain -{ - /** 当前记录起始索引 */ +public class PageDomain { + /** + * 当前记录起始索引 + */ private Integer pageNum; - /** 每页显示记录数 */ + /** + * 每页显示记录数 + */ private Integer pageSize; - /** 排序列 */ + /** + * 排序列 + */ private String orderByColumn; - /** 排序的方向desc或者asc */ + /** + * 排序的方向desc或者asc + */ private String isAsc = "asc"; - public String getOrderBy() - { - if (StringUtils.isEmpty(orderByColumn)) - { + public String getOrderBy() { + if (StringUtils.isEmpty(orderByColumn)) { return ""; } return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; } - public Integer getPageNum() - { + public Integer getPageNum() { return pageNum; } - public void setPageNum(Integer pageNum) - { + public void setPageNum(Integer pageNum) { this.pageNum = pageNum; } - public Integer getPageSize() - { + public Integer getPageSize() { return pageSize; } - public void setPageSize(Integer pageSize) - { + public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } - public String getOrderByColumn() - { + public String getOrderByColumn() { return orderByColumn; } - public void setOrderByColumn(String orderByColumn) - { + public void setOrderByColumn(String orderByColumn) { this.orderByColumn = orderByColumn; } - public String getIsAsc() - { + public String getIsAsc() { return isAsc; } - public void setIsAsc(String isAsc) - { + public void setIsAsc(String isAsc) { this.isAsc = isAsc; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java index 847685ba..d223e860 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java @@ -5,81 +5,78 @@ import java.util.List; /** * 表格分页数据对象 - * + * * @author ruoyi */ -public class TableDataInfo implements Serializable -{ +public class TableDataInfo implements Serializable { private static final long serialVersionUID = 1L; - /** 总记录数 */ + /** + * 总记录数 + */ private long total; - /** 列表数据 */ + /** + * 列表数据 + */ private List rows; - /** 消息状态码 */ + /** + * 消息状态码 + */ private int code; - /** 消息内容 */ + /** + * 消息内容 + */ private String msg; /** * 表格数据对象 */ - public TableDataInfo() - { + public TableDataInfo() { } /** * 分页 - * - * @param list 列表数据 + * + * @param list 列表数据 * @param total 总记录数 */ - public TableDataInfo(List list, int total) - { + public TableDataInfo(List list, int total) { this.rows = list; this.total = total; } - public long getTotal() - { + public long getTotal() { return total; } - public void setTotal(long total) - { + public void setTotal(long total) { this.total = total; } - public List getRows() - { + public List getRows() { return rows; } - public void setRows(List rows) - { + public void setRows(List rows) { this.rows = rows; } - public int getCode() - { + public int getCode() { return code; } - public void setCode(int code) - { + public void setCode(int code) { this.code = code; } - public String getMsg() - { + public String getMsg() { return msg; } - public void setMsg(String msg) - { + public void setMsg(String msg) { this.msg = msg; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java index 14eb1e11..812bee2b 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java @@ -4,11 +4,10 @@ import com.ruoyi.common.utils.ServletUtils; /** * 表格数据处理 - * + * * @author ruoyi */ -public class TableSupport -{ +public class TableSupport { /** * 当前记录起始索引 */ @@ -32,8 +31,7 @@ public class TableSupport /** * 封装分页对象 */ - public static PageDomain getPageDomain() - { + public static PageDomain getPageDomain() { PageDomain pageDomain = new PageDomain(); pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); @@ -42,8 +40,7 @@ public class TableSupport return pageDomain; } - public static PageDomain buildPageRequest() - { + public static PageDomain buildPageRequest() { return getPageDomain(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index 22a610db..d354cf4f 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundSetOperations; import org.springframework.data.redis.core.HashOperations; @@ -18,59 +19,54 @@ import org.springframework.stereotype.Component; * * @author ruoyi **/ -@SuppressWarnings(value = { "unchecked", "rawtypes" }) +@SuppressWarnings(value = {"unchecked", "rawtypes"}) @Component -public class RedisCache -{ +public class RedisCache { @Autowired public RedisTemplate redisTemplate; /** * 缓存基本的对象,Integer、String、实体类等 * - * @param key 缓存的键值 + * @param key 缓存的键值 * @param value 缓存的值 */ - public void setCacheObject(final String key, final T value) - { + public void setCacheObject(final String key, final T value) { redisTemplate.opsForValue().set(key, value); } /** * 缓存基本的对象,Integer、String、实体类等 * - * @param key 缓存的键值 - * @param value 缓存的值 - * @param timeout 时间 + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 * @param timeUnit 时间颗粒度 */ - public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) - { + public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) { redisTemplate.opsForValue().set(key, value, timeout, timeUnit); } /** * 设置有效时间 * - * @param key Redis键 + * @param key Redis键 * @param timeout 超时时间 * @return true=设置成功;false=设置失败 */ - public boolean expire(final String key, final long timeout) - { + public boolean expire(final String key, final long timeout) { return expire(key, timeout, TimeUnit.SECONDS); } /** * 设置有效时间 * - * @param key Redis键 + * @param key Redis键 * @param timeout 超时时间 - * @param unit 时间单位 + * @param unit 时间单位 * @return true=设置成功;false=设置失败 */ - public boolean expire(final String key, final long timeout, final TimeUnit unit) - { + public boolean expire(final String key, final long timeout, final TimeUnit unit) { return redisTemplate.expire(key, timeout, unit); } @@ -80,8 +76,7 @@ public class RedisCache * @param key 缓存键值 * @return 缓存键值对应的数据 */ - public T getCacheObject(final String key) - { + public T getCacheObject(final String key) { ValueOperations operation = redisTemplate.opsForValue(); return operation.get(key); } @@ -91,8 +86,7 @@ public class RedisCache * * @param key */ - public boolean deleteObject(final String key) - { + public boolean deleteObject(final String key) { return redisTemplate.delete(key); } @@ -102,20 +96,18 @@ public class RedisCache * @param collection 多个对象 * @return */ - public long deleteObject(final Collection collection) - { + public long deleteObject(final Collection collection) { return redisTemplate.delete(collection); } /** * 缓存List数据 * - * @param key 缓存的键值 + * @param key 缓存的键值 * @param dataList 待缓存的List数据 * @return 缓存的对象 */ - public long setCacheList(final String key, final List dataList) - { + public long setCacheList(final String key, final List dataList) { Long count = redisTemplate.opsForList().rightPushAll(key, dataList); return count == null ? 0 : count; } @@ -126,24 +118,21 @@ public class RedisCache * @param key 缓存的键值 * @return 缓存键值对应的数据 */ - public List getCacheList(final String key) - { + public List getCacheList(final String key) { return redisTemplate.opsForList().range(key, 0, -1); } /** * 缓存Set * - * @param key 缓存键值 + * @param key 缓存键值 * @param dataSet 缓存的数据 * @return 缓存数据的对象 */ - public BoundSetOperations setCacheSet(final String key, final Set dataSet) - { + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { BoundSetOperations setOperation = redisTemplate.boundSetOps(key); Iterator it = dataSet.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { setOperation.add(it.next()); } return setOperation; @@ -155,8 +144,7 @@ public class RedisCache * @param key * @return */ - public Set getCacheSet(final String key) - { + public Set getCacheSet(final String key) { return redisTemplate.opsForSet().members(key); } @@ -166,8 +154,7 @@ public class RedisCache * @param key * @param dataMap */ - public void setCacheMap(final String key, final Map dataMap) - { + public void setCacheMap(final String key, final Map dataMap) { if (dataMap != null) { redisTemplate.opsForHash().putAll(key, dataMap); } @@ -179,32 +166,29 @@ public class RedisCache * @param key * @return */ - public Map getCacheMap(final String key) - { + public Map getCacheMap(final String key) { return redisTemplate.opsForHash().entries(key); } /** * 往Hash中存入数据 * - * @param key Redis键 - * @param hKey Hash键 + * @param key Redis键 + * @param hKey Hash键 * @param value 值 */ - public void setCacheMapValue(final String key, final String hKey, final T value) - { + public void setCacheMapValue(final String key, final String hKey, final T value) { redisTemplate.opsForHash().put(key, hKey, value); } /** * 获取Hash中的数据 * - * @param key Redis键 + * @param key Redis键 * @param hKey Hash键 * @return Hash中的对象 */ - public T getCacheMapValue(final String key, final String hKey) - { + public T getCacheMapValue(final String key, final String hKey) { HashOperations opsForHash = redisTemplate.opsForHash(); return opsForHash.get(key, hKey); } @@ -212,12 +196,11 @@ public class RedisCache /** * 获取多个Hash中的数据 * - * @param key Redis键 + * @param key Redis键 * @param hKeys Hash键集合 * @return Hash对象集合 */ - public List getMultiCacheMapValue(final String key, final Collection hKeys) - { + public List getMultiCacheMapValue(final String key, final Collection hKeys) { return redisTemplate.opsForHash().multiGet(key, hKeys); } @@ -227,8 +210,7 @@ public class RedisCache * @param pattern 字符串前缀 * @return 对象列表 */ - public Collection keys(final String pattern) - { + public Collection keys(final String pattern) { return redisTemplate.keys(pattern); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java index 84124aac..71f33353 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java @@ -2,75 +2,81 @@ package com.ruoyi.common.core.text; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; + import com.ruoyi.common.utils.StringUtils; /** * 字符集工具类 - * + * * @author ruoyi */ -public class CharsetKit -{ - /** ISO-8859-1 */ +public class CharsetKit { + /** + * ISO-8859-1 + */ public static final String ISO_8859_1 = "ISO-8859-1"; - /** UTF-8 */ + /** + * UTF-8 + */ public static final String UTF_8 = "UTF-8"; - /** GBK */ + /** + * GBK + */ public static final String GBK = "GBK"; - /** ISO-8859-1 */ + /** + * ISO-8859-1 + */ public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); - /** UTF-8 */ + /** + * UTF-8 + */ public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); - /** GBK */ + /** + * GBK + */ public static final Charset CHARSET_GBK = Charset.forName(GBK); /** * 转换为Charset对象 - * + * * @param charset 字符集,为空则返回默认字符集 * @return Charset */ - public static Charset charset(String charset) - { + public static Charset charset(String charset) { return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); } /** * 转换字符串的字符集编码 - * - * @param source 字符串 - * @param srcCharset 源字符集,默认ISO-8859-1 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 * @param destCharset 目标字符集,默认UTF-8 * @return 转换后的字符集 */ - public static String convert(String source, String srcCharset, String destCharset) - { + public static String convert(String source, String srcCharset, String destCharset) { return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); } /** * 转换字符串的字符集编码 - * - * @param source 字符串 - * @param srcCharset 源字符集,默认ISO-8859-1 + * + * @param source 字符串 + * @param srcCharset 源字符集,默认ISO-8859-1 * @param destCharset 目标字符集,默认UTF-8 * @return 转换后的字符集 */ - public static String convert(String source, Charset srcCharset, Charset destCharset) - { - if (null == srcCharset) - { + public static String convert(String source, Charset srcCharset, Charset destCharset) { + if (null == srcCharset) { srcCharset = StandardCharsets.ISO_8859_1; } - if (null == destCharset) - { + if (null == destCharset) { destCharset = StandardCharsets.UTF_8; } - if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) - { + if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) { return source; } return new String(source.getBytes(srcCharset), destCharset); @@ -79,8 +85,7 @@ public class CharsetKit /** * @return 系统字符集编码 */ - public static String systemCharset() - { + public static String systemCharset() { return Charset.defaultCharset().name(); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java index b17dfdda..f9dce907 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -6,32 +6,29 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.text.NumberFormat; import java.util.Set; + import com.ruoyi.common.utils.StringUtils; /** * 类型转换器 - * + * * @author ruoyi */ -public class Convert -{ +public class Convert { /** * 转换为字符串
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static String toStr(Object value, String defaultValue) - { - if (null == value) - { + public static String toStr(Object value, String defaultValue) { + if (null == value) { return defaultValue; } - if (value instanceof String) - { + if (value instanceof String) { return (String) value; } return value.toString(); @@ -41,12 +38,11 @@ public class Convert * 转换为字符串
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static String toStr(Object value) - { + public static String toStr(Object value) { return toStr(value, null); } @@ -54,19 +50,16 @@ public class Convert * 转换为字符
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Character toChar(Object value, Character defaultValue) - { - if (null == value) - { + public static Character toChar(Object value, Character defaultValue) { + if (null == value) { return defaultValue; } - if (value instanceof Character) - { + if (value instanceof Character) { return (Character) value; } @@ -78,12 +71,11 @@ public class Convert * 转换为字符
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Character toChar(Object value) - { + public static Character toChar(Object value) { return toChar(value, null); } @@ -91,36 +83,28 @@ public class Convert * 转换为byte
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Byte toByte(Object value, Byte defaultValue) - { - if (value == null) - { + public static Byte toByte(Object value, Byte defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Byte) - { + if (value instanceof Byte) { return (Byte) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).byteValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return Byte.parseByte(valueStr); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -129,12 +113,11 @@ public class Convert * 转换为byte
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Byte toByte(Object value) - { + public static Byte toByte(Object value) { return toByte(value, null); } @@ -142,36 +125,28 @@ public class Convert * 转换为Short
* 如果给定的值为null,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Short toShort(Object value, Short defaultValue) - { - if (value == null) - { + public static Short toShort(Object value, Short defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Short) - { + if (value instanceof Short) { return (Short) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).shortValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return Short.parseShort(valueStr.trim()); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -180,12 +155,11 @@ public class Convert * 转换为Short
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Short toShort(Object value) - { + public static Short toShort(Object value) { return toShort(value, null); } @@ -193,32 +167,25 @@ public class Convert * 转换为Number
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Number toNumber(Object value, Number defaultValue) - { - if (value == null) - { + public static Number toNumber(Object value, Number defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Number) - { + if (value instanceof Number) { return (Number) value; } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return NumberFormat.getInstance().parse(valueStr); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -227,12 +194,11 @@ public class Convert * 转换为Number
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Number toNumber(Object value) - { + public static Number toNumber(Object value) { return toNumber(value, null); } @@ -240,36 +206,28 @@ public class Convert * 转换为int
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Integer toInt(Object value, Integer defaultValue) - { - if (value == null) - { + public static Integer toInt(Object value, Integer defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Integer) - { + if (value instanceof Integer) { return (Integer) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).intValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return Integer.parseInt(valueStr.trim()); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -278,54 +236,48 @@ public class Convert * 转换为int
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Integer toInt(Object value) - { + public static Integer toInt(Object value) { return toInt(value, null); } /** * 转换为Integer数组
- * + * * @param str 被转换的值 * @return 结果 */ - public static Integer[] toIntArray(String str) - { + public static Integer[] toIntArray(String str) { return toIntArray(",", str); } /** * 转换为Long数组
- * + * * @param str 被转换的值 * @return 结果 */ - public static Long[] toLongArray(String str) - { + public static Long[] toLongArray(String str) { return toLongArray(",", str); } /** * 转换为Integer数组
- * + * * @param split 分隔符 * @param split 被转换的值 * @return 结果 */ - public static Integer[] toIntArray(String split, String str) - { - if (StringUtils.isEmpty(str)) - { - return new Integer[] {}; + public static Integer[] toIntArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Integer[]{}; } String[] arr = str.split(split); final Integer[] ints = new Integer[arr.length]; - for (int i = 0; i < arr.length; i++) - { + for (int i = 0; i < arr.length; i++) { final Integer v = toInt(arr[i], 0); ints[i] = v; } @@ -334,21 +286,18 @@ public class Convert /** * 转换为Long数组
- * + * * @param split 分隔符 - * @param str 被转换的值 + * @param str 被转换的值 * @return 结果 */ - public static Long[] toLongArray(String split, String str) - { - if (StringUtils.isEmpty(str)) - { - return new Long[] {}; + public static Long[] toLongArray(String split, String str) { + if (StringUtils.isEmpty(str)) { + return new Long[]{}; } String[] arr = str.split(split); final Long[] longs = new Long[arr.length]; - for (int i = 0; i < arr.length; i++) - { + for (int i = 0; i < arr.length; i++) { final Long v = toLong(arr[i], null); longs[i] = v; } @@ -357,24 +306,22 @@ public class Convert /** * 转换为String数组
- * + * * @param str 被转换的值 * @return 结果 */ - public static String[] toStrArray(String str) - { + public static String[] toStrArray(String str) { return toStrArray(",", str); } /** * 转换为String数组
- * + * * @param split 分隔符 * @param split 被转换的值 * @return 结果 */ - public static String[] toStrArray(String split, String str) - { + public static String[] toStrArray(String split, String str) { return str.split(split); } @@ -382,37 +329,29 @@ public class Convert * 转换为long
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Long toLong(Object value, Long defaultValue) - { - if (value == null) - { + public static Long toLong(Object value, Long defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Long) - { + if (value instanceof Long) { return (Long) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).longValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { // 支持科学计数法 return new BigDecimal(valueStr.trim()).longValue(); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -421,12 +360,11 @@ public class Convert * 转换为long
* 如果给定的值为null,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Long toLong(Object value) - { + public static Long toLong(Object value) { return toLong(value, null); } @@ -434,37 +372,29 @@ public class Convert * 转换为double
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Double toDouble(Object value, Double defaultValue) - { - if (value == null) - { + public static Double toDouble(Object value, Double defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Double) - { + if (value instanceof Double) { return (Double) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).doubleValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { // 支持科学计数法 return new BigDecimal(valueStr.trim()).doubleValue(); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -473,12 +403,11 @@ public class Convert * 转换为double
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Double toDouble(Object value) - { + public static Double toDouble(Object value) { return toDouble(value, null); } @@ -486,36 +415,28 @@ public class Convert * 转换为Float
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Float toFloat(Object value, Float defaultValue) - { - if (value == null) - { + public static Float toFloat(Object value, Float defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Float) - { + if (value instanceof Float) { return (Float) value; } - if (value instanceof Number) - { + if (value instanceof Number) { return ((Number) value).floatValue(); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return Float.parseFloat(valueStr.trim()); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -524,12 +445,11 @@ public class Convert * 转换为Float
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Float toFloat(Object value) - { + public static Float toFloat(Object value) { return toFloat(value, null); } @@ -537,29 +457,24 @@ public class Convert * 转换为boolean
* String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static Boolean toBool(Object value, Boolean defaultValue) - { - if (value == null) - { + public static Boolean toBool(Object value, Boolean defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof Boolean) - { + if (value instanceof Boolean) { return (Boolean) value; } String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } valueStr = valueStr.trim().toLowerCase(); - switch (valueStr) - { + switch (valueStr) { case "true": return true; case "false": @@ -583,47 +498,39 @@ public class Convert * 转换为boolean
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static Boolean toBool(Object value) - { + public static Boolean toBool(Object value) { return toBool(value, null); } /** * 转换为Enum对象
* 如果给定的值为空,或者转换失败,返回默认值
- * - * @param clazz Enum的Class - * @param value 值 + * + * @param clazz Enum的Class + * @param value 值 * @param defaultValue 默认值 * @return Enum */ - public static > E toEnum(Class clazz, Object value, E defaultValue) - { - if (value == null) - { + public static > E toEnum(Class clazz, Object value, E defaultValue) { + if (value == null) { return defaultValue; } - if (clazz.isAssignableFrom(value.getClass())) - { + if (clazz.isAssignableFrom(value.getClass())) { @SuppressWarnings("unchecked") E myE = (E) value; return myE; } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return Enum.valueOf(clazz, valueStr); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -631,13 +538,12 @@ public class Convert /** * 转换为Enum对象
* 如果给定的值为空,或者转换失败,返回默认值null
- * + * * @param clazz Enum的Class * @param value 值 * @return Enum */ - public static > E toEnum(Class clazz, Object value) - { + public static > E toEnum(Class clazz, Object value) { return toEnum(clazz, value, null); } @@ -645,36 +551,28 @@ public class Convert * 转换为BigInteger
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static BigInteger toBigInteger(Object value, BigInteger defaultValue) - { - if (value == null) - { + public static BigInteger toBigInteger(Object value, BigInteger defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof BigInteger) - { + if (value instanceof BigInteger) { return (BigInteger) value; } - if (value instanceof Long) - { + if (value instanceof Long) { return BigInteger.valueOf((Long) value); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return new BigInteger(valueStr); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -683,12 +581,11 @@ public class Convert * 转换为BigInteger
* 如果给定的值为空,或者转换失败,返回默认值null
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static BigInteger toBigInteger(Object value) - { + public static BigInteger toBigInteger(Object value) { return toBigInteger(value, null); } @@ -696,44 +593,34 @@ public class Convert * 转换为BigDecimal
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * - * @param value 被转换的值 + * + * @param value 被转换的值 * @param defaultValue 转换错误时的默认值 * @return 结果 */ - public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) - { - if (value == null) - { + public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) { + if (value == null) { return defaultValue; } - if (value instanceof BigDecimal) - { + if (value instanceof BigDecimal) { return (BigDecimal) value; } - if (value instanceof Long) - { + if (value instanceof Long) { return new BigDecimal((Long) value); } - if (value instanceof Double) - { + if (value instanceof Double) { return new BigDecimal((Double) value); } - if (value instanceof Integer) - { + if (value instanceof Integer) { return new BigDecimal((Integer) value); } final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) - { + if (StringUtils.isEmpty(valueStr)) { return defaultValue; } - try - { + try { return new BigDecimal(valueStr); - } - catch (Exception e) - { + } catch (Exception e) { return defaultValue; } } @@ -742,65 +629,55 @@ public class Convert * 转换为BigDecimal
* 如果给定的值为空,或者转换失败,返回默认值
* 转换失败不会报错 - * + * * @param value 被转换的值 * @return 结果 */ - public static BigDecimal toBigDecimal(Object value) - { + public static BigDecimal toBigDecimal(Object value) { return toBigDecimal(value, null); } /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * + * * @param obj 对象 * @return 字符串 */ - public static String utf8Str(Object obj) - { + public static String utf8Str(Object obj) { return str(obj, CharsetKit.CHARSET_UTF_8); } /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * - * @param obj 对象 + * + * @param obj 对象 * @param charsetName 字符集 * @return 字符串 */ - public static String str(Object obj, String charsetName) - { + public static String str(Object obj, String charsetName) { return str(obj, Charset.forName(charsetName)); } /** * 将对象转为字符串
* 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * - * @param obj 对象 + * + * @param obj 对象 * @param charset 字符集 * @return 字符串 */ - public static String str(Object obj, Charset charset) - { - if (null == obj) - { + public static String str(Object obj, Charset charset) { + if (null == obj) { return null; } - if (obj instanceof String) - { + if (obj instanceof String) { return (String) obj; - } - else if (obj instanceof byte[] || obj instanceof Byte[]) - { + } else if (obj instanceof byte[] || obj instanceof Byte[]) { return str((Byte[]) obj, charset); - } - else if (obj instanceof ByteBuffer) - { + } else if (obj instanceof ByteBuffer) { return str((ByteBuffer) obj, charset); } return obj.toString(); @@ -808,32 +685,28 @@ public class Convert /** * 将byte数组转为字符串 - * - * @param bytes byte数组 + * + * @param bytes byte数组 * @param charset 字符集 * @return 字符串 */ - public static String str(byte[] bytes, String charset) - { + public static String str(byte[] bytes, String charset) { return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); } /** * 解码字节码 - * - * @param data 字符串 + * + * @param data 字符串 * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 * @return 解码后的字符串 */ - public static String str(byte[] data, Charset charset) - { - if (data == null) - { + public static String str(byte[] data, Charset charset) { + if (data == null) { return null; } - if (null == charset) - { + if (null == charset) { return new String(data); } return new String(data, charset); @@ -841,15 +714,13 @@ public class Convert /** * 将编码的byteBuffer数据转换为字符串 - * - * @param data 数据 + * + * @param data 数据 * @param charset 字符集,如果为空使用当前系统字符集 * @return 字符串 */ - public static String str(ByteBuffer data, String charset) - { - if (data == null) - { + public static String str(ByteBuffer data, String charset) { + if (data == null) { return null; } @@ -858,56 +729,48 @@ public class Convert /** * 将编码的byteBuffer数据转换为字符串 - * - * @param data 数据 + * + * @param data 数据 * @param charset 字符集,如果为空使用当前系统字符集 * @return 字符串 */ - public static String str(ByteBuffer data, Charset charset) - { - if (null == charset) - { + public static String str(ByteBuffer data, Charset charset) { + if (null == charset) { charset = Charset.defaultCharset(); } return charset.decode(data).toString(); } // ----------------------------------------------------------------------- 全角半角转换 + /** * 半角转全角 - * + * * @param input String. * @return 全角字符串. */ - public static String toSBC(String input) - { + public static String toSBC(String input) { return toSBC(input, null); } /** * 半角转全角 - * - * @param input String + * + * @param input String * @param notConvertSet 不替换的字符集合 * @return 全角字符串. */ - public static String toSBC(String input, Set notConvertSet) - { + public static String toSBC(String input, Set notConvertSet) { char c[] = input.toCharArray(); - for (int i = 0; i < c.length; i++) - { - if (null != notConvertSet && notConvertSet.contains(c[i])) - { + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { // 跳过不替换的字符 continue; } - if (c[i] == ' ') - { + if (c[i] == ' ') { c[i] = '\u3000'; - } - else if (c[i] < '\177') - { + } else if (c[i] < '\177') { c[i] = (char) (c[i] + 65248); } @@ -917,39 +780,32 @@ public class Convert /** * 全角转半角 - * + * * @param input String. * @return 半角字符串 */ - public static String toDBC(String input) - { + public static String toDBC(String input) { return toDBC(input, null); } /** * 替换全角为半角 - * - * @param text 文本 + * + * @param text 文本 * @param notConvertSet 不替换的字符集合 * @return 替换后的字符 */ - public static String toDBC(String text, Set notConvertSet) - { + public static String toDBC(String text, Set notConvertSet) { char c[] = text.toCharArray(); - for (int i = 0; i < c.length; i++) - { - if (null != notConvertSet && notConvertSet.contains(c[i])) - { + for (int i = 0; i < c.length; i++) { + if (null != notConvertSet && notConvertSet.contains(c[i])) { // 跳过不替换的字符 continue; } - if (c[i] == '\u3000') - { + if (c[i] == '\u3000') { c[i] = ' '; - } - else if (c[i] > '\uFF00' && c[i] < '\uFF5F') - { + } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') { c[i] = (char) (c[i] - 65248); } } @@ -960,35 +816,30 @@ public class Convert /** * 数字金额大写转换 先写个完整的然后将如零拾替换成零 - * + * * @param n 数字 * @return 中文大写数字 */ - public static String digitUppercase(double n) - { - String[] fraction = { "角", "分" }; - String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; - String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; + public static String digitUppercase(double n) { + String[] fraction = {"角", "分"}; + String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; + String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}}; String head = n < 0 ? "负" : ""; n = Math.abs(n); String s = ""; - for (int i = 0; i < fraction.length; i++) - { + for (int i = 0; i < fraction.length; i++) { s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); } - if (s.length() < 1) - { + if (s.length() < 1) { s = "整"; } int integerPart = (int) Math.floor(n); - for (int i = 0; i < unit[0].length && integerPart > 0; i++) - { + for (int i = 0; i < unit[0].length && integerPart > 0; i++) { String p = ""; - for (int j = 0; j < unit[1].length && n > 0; j++) - { + for (int j = 0; j < unit[1].length && n > 0; j++) { p = digit[integerPart % 10] + unit[1][j] + p; integerPart = integerPart / 10; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java index c78ac776..eec64f99 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java @@ -4,11 +4,10 @@ import com.ruoyi.common.utils.StringUtils; /** * 字符串格式化 - * + * * @author ruoyi */ -public class StrFormatter -{ +public class StrFormatter { public static final String EMPTY_JSON = "{}"; public static final char C_BACKSLASH = '\\'; public static final char C_DELIM_START = '{'; @@ -22,15 +21,13 @@ public class StrFormatter * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- * + * * @param strPattern 字符串模板 - * @param argArray 参数列表 + * @param argArray 参数列表 * @return 结果 */ - public static String format(final String strPattern, final Object... argArray) - { - if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) - { + public static String format(final String strPattern, final Object... argArray) { + if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) { return strPattern; } final int strPatternLength = strPattern.length(); @@ -40,43 +37,30 @@ public class StrFormatter int handledPosition = 0; int delimIndex;// 占位符所在位置 - for (int argIndex = 0; argIndex < argArray.length; argIndex++) - { + for (int argIndex = 0; argIndex < argArray.length; argIndex++) { delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); - if (delimIndex == -1) - { - if (handledPosition == 0) - { + if (delimIndex == -1) { + if (handledPosition == 0) { return strPattern; - } - else - { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 + } else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 sbuf.append(strPattern, handledPosition, strPatternLength); return sbuf.toString(); } - } - else - { - if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) - { - if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) - { + } else { + if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) { + if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) { // 转义符之前还有一个转义符,占位符依旧有效 sbuf.append(strPattern, handledPosition, delimIndex - 1); sbuf.append(Convert.utf8Str(argArray[argIndex])); handledPosition = delimIndex + 2; - } - else - { + } else { // 占位符被转义 argIndex--; sbuf.append(strPattern, handledPosition, delimIndex - 1); sbuf.append(C_DELIM_START); handledPosition = delimIndex + 1; } - } - else - { + } else { // 正常占位符 sbuf.append(strPattern, handledPosition, delimIndex); sbuf.append(Convert.utf8Str(argArray[argIndex])); diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java index 10b7306f..ce32cb41 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java @@ -2,12 +2,10 @@ package com.ruoyi.common.enums; /** * 操作状态 - * - * @author ruoyi * + * @author ruoyi */ -public enum BusinessStatus -{ +public enum BusinessStatus { /** * 成功 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java index 2e17c4a5..2d2f2e46 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java @@ -2,11 +2,10 @@ package com.ruoyi.common.enums; /** * 业务操作类型 - * + * * @author ruoyi */ -public enum BusinessType -{ +public enum BusinessType { /** * 其它 */ @@ -51,7 +50,7 @@ public enum BusinessType * 生成代码 */ GENCODE, - + /** * 清空数据 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java index 0d945be5..e9ed99af 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java @@ -2,11 +2,10 @@ package com.ruoyi.common.enums; /** * 数据源 - * + * * @author ruoyi */ -public enum DataSourceType -{ +public enum DataSourceType { /** * 主库 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java index be6f7392..a0cf8e5e 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java @@ -2,6 +2,7 @@ package com.ruoyi.common.enums; import java.util.HashMap; import java.util.Map; + import org.springframework.lang.Nullable; /** @@ -9,28 +10,23 @@ import org.springframework.lang.Nullable; * * @author ruoyi */ -public enum HttpMethod -{ +public enum HttpMethod { GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; private static final Map mappings = new HashMap<>(16); - static - { - for (HttpMethod httpMethod : values()) - { + static { + for (HttpMethod httpMethod : values()) { mappings.put(httpMethod.name(), httpMethod); } } @Nullable - public static HttpMethod resolve(@Nullable String method) - { + public static HttpMethod resolve(@Nullable String method) { return (method != null ? mappings.get(method) : null); } - public boolean matches(String method) - { + public boolean matches(String method) { return (this == resolve(method)); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java index bdd143c1..3c4127d9 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java @@ -2,11 +2,10 @@ package com.ruoyi.common.enums; /** * 操作人类别 - * + * * @author ruoyi */ -public enum OperatorType -{ +public enum OperatorType { /** * 其它 */ diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java index d7ff44a9..673ddebd 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java @@ -2,29 +2,25 @@ package com.ruoyi.common.enums; /** * 用户状态 - * + * * @author ruoyi */ -public enum UserStatus -{ +public enum UserStatus { OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); private final String code; private final String info; - UserStatus(String code, String info) - { + UserStatus(String code, String info) { this.code = code; this.info = info; } - public String getCode() - { + public String getCode() { return code; } - public String getInfo() - { + public String getInfo() { return info; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java index 92d6ae2d..21ff9fae 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java @@ -5,11 +5,10 @@ import com.ruoyi.common.utils.StringUtils; /** * 基础异常 - * + * * @author ruoyi */ -public class BaseException extends RuntimeException -{ +public class BaseException extends RuntimeException { private static final long serialVersionUID = 1L; /** @@ -32,66 +31,54 @@ public class BaseException extends RuntimeException */ private String defaultMessage; - public BaseException(String module, String code, Object[] args, String defaultMessage) - { + public BaseException(String module, String code, Object[] args, String defaultMessage) { this.module = module; this.code = code; this.args = args; this.defaultMessage = defaultMessage; } - public BaseException(String module, String code, Object[] args) - { + public BaseException(String module, String code, Object[] args) { this(module, code, args, null); } - public BaseException(String module, String defaultMessage) - { + public BaseException(String module, String defaultMessage) { this(module, null, null, defaultMessage); } - public BaseException(String code, Object[] args) - { + public BaseException(String code, Object[] args) { this(null, code, args, null); } - public BaseException(String defaultMessage) - { + public BaseException(String defaultMessage) { this(null, null, null, defaultMessage); } @Override - public String getMessage() - { + public String getMessage() { String message = null; - if (!StringUtils.isEmpty(code)) - { + if (!StringUtils.isEmpty(code)) { message = MessageUtils.message(code, args); } - if (message == null) - { + if (message == null) { message = defaultMessage; } return message; } - public String getModule() - { + public String getModule() { return module; } - public String getCode() - { + public String getCode() { return code; } - public Object[] getArgs() - { + public Object[] getArgs() { return args; } - public String getDefaultMessage() - { + public String getDefaultMessage() { return defaultMessage; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java index d96c7ba7..b9ee3afb 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java @@ -2,42 +2,36 @@ package com.ruoyi.common.exception; /** * 自定义异常 - * + * * @author ruoyi */ -public class CustomException extends RuntimeException -{ +public class CustomException extends RuntimeException { private static final long serialVersionUID = 1L; private Integer code; private String message; - public CustomException(String message) - { + public CustomException(String message) { this.message = message; } - public CustomException(String message, Integer code) - { + public CustomException(String message, Integer code) { this.message = message; this.code = code; } - public CustomException(String message, Throwable e) - { + public CustomException(String message, Throwable e) { super(message, e); this.message = message; } @Override - public String getMessage() - { + public String getMessage() { return message; } - public Integer getCode() - { + public Integer getCode() { return code; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java index f6ad2ab4..9178131d 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java @@ -2,14 +2,12 @@ package com.ruoyi.common.exception; /** * 演示模式异常 - * + * * @author ruoyi */ -public class DemoModeException extends RuntimeException -{ +public class DemoModeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DemoModeException() - { + public DemoModeException() { } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java index 980fa465..01cc8782 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java @@ -2,25 +2,21 @@ package com.ruoyi.common.exception; /** * 工具类异常 - * + * * @author ruoyi */ -public class UtilException extends RuntimeException -{ +public class UtilException extends RuntimeException { private static final long serialVersionUID = 8247610319171014183L; - public UtilException(Throwable e) - { + public UtilException(Throwable e) { super(e.getMessage(), e); } - public UtilException(String message) - { + public UtilException(String message) { super(message); } - public UtilException(String message, Throwable throwable) - { + public UtilException(String message, Throwable throwable) { super(message, throwable); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java index 75d6dbf1..95f59be5 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java @@ -4,15 +4,13 @@ import com.ruoyi.common.exception.BaseException; /** * 文件信息异常类 - * + * * @author ruoyi */ -public class FileException extends BaseException -{ +public class FileException extends BaseException { private static final long serialVersionUID = 1L; - public FileException(String code, Object[] args) - { + public FileException(String code, Object[] args) { super("file", code, args, null); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java index 70e0ec9b..64a5020d 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java @@ -2,15 +2,13 @@ package com.ruoyi.common.exception.file; /** * 文件名称超长限制异常类 - * + * * @author ruoyi */ -public class FileNameLengthLimitExceededException extends FileException -{ +public class FileNameLengthLimitExceededException extends FileException { private static final long serialVersionUID = 1L; - public FileNameLengthLimitExceededException(int defaultFileNameLength) - { - super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); + public FileNameLengthLimitExceededException(int defaultFileNameLength) { + super("upload.filename.exceed.length", new Object[]{defaultFileNameLength}); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java index ec6ab054..93e9e1c6 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java @@ -2,15 +2,13 @@ package com.ruoyi.common.exception.file; /** * 文件名大小限制异常类 - * + * * @author ruoyi */ -public class FileSizeLimitExceededException extends FileException -{ +public class FileSizeLimitExceededException extends FileException { private static final long serialVersionUID = 1L; - public FileSizeLimitExceededException(long defaultMaxSize) - { - super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); + public FileSizeLimitExceededException(long defaultMaxSize) { + super("upload.exceed.maxSize", new Object[]{defaultMaxSize}); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java index 8f63a799..ce5c7fda 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java @@ -1,70 +1,60 @@ package com.ruoyi.common.exception.file; import java.util.Arrays; + import org.apache.commons.fileupload.FileUploadException; /** * 文件上传 误异常类 - * + * * @author ruoyi */ -public class InvalidExtensionException extends FileUploadException -{ +public class InvalidExtensionException extends FileUploadException { private static final long serialVersionUID = 1L; private String[] allowedExtension; private String extension; private String filename; - public InvalidExtensionException(String[] allowedExtension, String extension, String filename) - { + public InvalidExtensionException(String[] allowedExtension, String extension, String filename) { super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]"); this.allowedExtension = allowedExtension; this.extension = extension; this.filename = filename; } - public String[] getAllowedExtension() - { + public String[] getAllowedExtension() { return allowedExtension; } - public String getExtension() - { + public String getExtension() { return extension; } - public String getFilename() - { + public String getFilename() { return filename; } - public static class InvalidImageExtensionException extends InvalidExtensionException - { + public static class InvalidImageExtensionException extends InvalidExtensionException { private static final long serialVersionUID = 1L; - public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) - { + public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) { super(allowedExtension, extension, filename); } } - public static class InvalidFlashExtensionException extends InvalidExtensionException - { + public static class InvalidFlashExtensionException extends InvalidExtensionException { private static final long serialVersionUID = 1L; - public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) - { + public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) { super(allowedExtension, extension, filename); } } - public static class InvalidMediaExtensionException extends InvalidExtensionException - { + public static class InvalidMediaExtensionException extends InvalidExtensionException { private static final long serialVersionUID = 1L; - public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) - { + public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) { super(allowedExtension, extension, filename); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java index a567b408..c9ac31f1 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java @@ -2,33 +2,28 @@ package com.ruoyi.common.exception.job; /** * 计划策略异常 - * + * * @author ruoyi */ -public class TaskException extends Exception -{ +public class TaskException extends Exception { private static final long serialVersionUID = 1L; private Code code; - public TaskException(String msg, Code code) - { + public TaskException(String msg, Code code) { this(msg, code, null); } - public TaskException(String msg, Code code, Exception nestedEx) - { + public TaskException(String msg, Code code, Exception nestedEx) { super(msg, nestedEx); this.code = code; } - public Code getCode() - { + public Code getCode() { return code; } - public enum Code - { + public enum Code { TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE } } \ No newline at end of file diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java index 389dbc75..90404854 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java @@ -2,15 +2,13 @@ package com.ruoyi.common.exception.user; /** * 验证码错误异常类 - * + * * @author ruoyi */ -public class CaptchaException extends UserException -{ +public class CaptchaException extends UserException { private static final long serialVersionUID = 1L; - public CaptchaException() - { + public CaptchaException() { super("user.jcaptcha.error", null); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java index 85f94861..ae5f759f 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java @@ -2,15 +2,13 @@ package com.ruoyi.common.exception.user; /** * 验证码失效异常类 - * + * * @author ruoyi */ -public class CaptchaExpireException extends UserException -{ +public class CaptchaExpireException extends UserException { private static final long serialVersionUID = 1L; - public CaptchaExpireException() - { + public CaptchaExpireException() { super("user.jcaptcha.expire", null); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java index aa015f88..886ffb5a 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java @@ -4,15 +4,13 @@ import com.ruoyi.common.exception.BaseException; /** * 用户信息异常类 - * + * * @author ruoyi */ -public class UserException extends BaseException -{ +public class UserException extends BaseException { private static final long serialVersionUID = 1L; - public UserException(String code, Object[] args) - { + public UserException(String code, Object[] args) { super("user", code, args, null); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java index a7f3e5ff..0fab1167 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java @@ -2,15 +2,13 @@ package com.ruoyi.common.exception.user; /** * 用户密码不正确或不符合规范异常类 - * + * * @author ruoyi */ -public class UserPasswordNotMatchException extends UserException -{ +public class UserPasswordNotMatchException extends UserException { private static final long serialVersionUID = 1L; - public UserPasswordNotMatchException() - { + public UserPasswordNotMatchException() { super("user.password.not.match", null); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java index ac45bfc3..e1fc3a61 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java @@ -8,45 +8,38 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; + import org.springframework.http.MediaType; import com.ruoyi.common.utils.StringUtils; /** * Repeatable 过滤器 - * + * * @author ruoyi */ -public class RepeatableFilter implements Filter -{ +public class RepeatableFilter implements Filter { @Override - public void init(FilterConfig filterConfig) throws ServletException - { + public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException - { + throws IOException, ServletException { ServletRequest requestWrapper = null; if (request instanceof HttpServletRequest - && StringUtils.equalsAnyIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) - { + && StringUtils.equalsAnyIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) { requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); } - if (null == requestWrapper) - { + if (null == requestWrapper) { chain.doFilter(request, response); - } - else - { + } else { chain.doFilter(requestWrapper, response); } } @Override - public void destroy() - { + public void destroy() { } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java index bd7097f5..f72291ce 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java @@ -9,19 +9,18 @@ import javax.servlet.ServletInputStream; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; + import com.ruoyi.common.utils.http.HttpHelper; /** * 构建可重复读取inputStream的request - * + * * @author ruoyi */ -public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper -{ +public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper { private final byte[] body; - public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException - { + public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException { super(request); request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); @@ -30,41 +29,34 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper } @Override - public BufferedReader getReader() throws IOException - { + public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader(getInputStream())); } @Override - public ServletInputStream getInputStream() throws IOException - { + public ServletInputStream getInputStream() throws IOException { final ByteArrayInputStream bais = new ByteArrayInputStream(body); - return new ServletInputStream() - { + return new ServletInputStream() { @Override - public int read() throws IOException - { + public int read() throws IOException { return bais.read(); } @Override - public boolean isFinished() - { + public boolean isFinished() { return false; } @Override - public boolean isReady() - { + public boolean isReady() { return false; } @Override - public void setReadListener(ReadListener readListener) - { + public void setReadListener(ReadListener readListener) { } }; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java index b3df122e..729aa2d2 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java @@ -13,15 +13,15 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import com.ruoyi.common.utils.StringUtils; /** * 防止XSS攻击的过滤器 - * + * * @author ruoyi */ -public class XssFilter implements Filter -{ +public class XssFilter implements Filter { /** * 排除链接 */ @@ -33,32 +33,26 @@ public class XssFilter implements Filter public boolean enabled = false; @Override - public void init(FilterConfig filterConfig) throws ServletException - { + public void init(FilterConfig filterConfig) throws ServletException { String tempExcludes = filterConfig.getInitParameter("excludes"); String tempEnabled = filterConfig.getInitParameter("enabled"); - if (StringUtils.isNotEmpty(tempExcludes)) - { + if (StringUtils.isNotEmpty(tempExcludes)) { String[] url = tempExcludes.split(","); - for (int i = 0; url != null && i < url.length; i++) - { + for (int i = 0; url != null && i < url.length; i++) { excludes.add(url[i]); } } - if (StringUtils.isNotEmpty(tempEnabled)) - { + if (StringUtils.isNotEmpty(tempEnabled)) { enabled = Boolean.valueOf(tempEnabled); } } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException - { + throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; - if (handleExcludeURL(req, resp)) - { + if (handleExcludeURL(req, resp)) { chain.doFilter(request, response); return; } @@ -66,23 +60,18 @@ public class XssFilter implements Filter chain.doFilter(xssRequest, response); } - private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) - { - if (!enabled) - { + private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) { + if (!enabled) { return true; } - if (excludes == null || excludes.isEmpty()) - { + if (excludes == null || excludes.isEmpty()) { return false; } String url = request.getServletPath(); - for (String pattern : excludes) - { + for (String pattern : excludes) { Pattern p = Pattern.compile("^" + pattern); Matcher m = p.matcher(url); - if (m.find()) - { + if (m.find()) { return true; } } @@ -90,8 +79,7 @@ public class XssFilter implements Filter } @Override - public void destroy() - { + public void destroy() { } } \ No newline at end of file diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java index 3c9efb29..7152f4d3 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java @@ -6,6 +6,7 @@ import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; + import org.apache.commons.io.IOUtils; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -14,29 +15,24 @@ import com.ruoyi.common.utils.html.EscapeUtil; /** * XSS过滤处理 - * + * * @author ruoyi */ -public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper -{ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { /** * @param request */ - public XssHttpServletRequestWrapper(HttpServletRequest request) - { + public XssHttpServletRequestWrapper(HttpServletRequest request) { super(request); } @Override - public String[] getParameterValues(String name) - { + public String[] getParameterValues(String name) { String[] values = super.getParameterValues(name); - if (values != null) - { + if (values != null) { int length = values.length; String[] escapseValues = new String[length]; - for (int i = 0; i < length; i++) - { + for (int i = 0; i < length; i++) { // 防xss攻击和过滤前后空格 escapseValues[i] = EscapeUtil.clean(values[i]).trim(); } @@ -46,46 +42,38 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper } @Override - public ServletInputStream getInputStream() throws IOException - { + public ServletInputStream getInputStream() throws IOException { // 非json类型,直接返回 - if (!isJsonRequest()) - { + if (!isJsonRequest()) { return super.getInputStream(); } // 为空,直接返回 String json = IOUtils.toString(super.getInputStream(), "utf-8"); - if (StringUtils.isEmpty(json)) - { + if (StringUtils.isEmpty(json)) { return super.getInputStream(); } // xss过滤 json = EscapeUtil.clean(json).trim(); final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); - return new ServletInputStream() - { + return new ServletInputStream() { @Override - public boolean isFinished() - { + public boolean isFinished() { return true; } @Override - public boolean isReady() - { + public boolean isReady() { return true; } @Override - public void setReadListener(ReadListener readListener) - { + public void setReadListener(ReadListener readListener) { } @Override - public int read() throws IOException - { + public int read() throws IOException { return bis.read(); } }; @@ -93,11 +81,10 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper /** * 是否是Json请求 - * + * * @param request */ - public boolean isJsonRequest() - { + public boolean isJsonRequest() { String header = super.getHeader(HttpHeaders.CONTENT_TYPE); return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java index 48a650e8..e8abc25e 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java @@ -5,28 +5,30 @@ import java.math.RoundingMode; /** * 精确的浮点数运算 - * + * * @author ruoyi */ -public class Arith -{ +public class Arith { - /** 默认除法运算精度 */ + /** + * 默认除法运算精度 + */ private static final int DEF_DIV_SCALE = 10; - /** 这个类不能实例化 */ - private Arith() - { + /** + * 这个类不能实例化 + */ + private Arith() { } /** * 提供精确的加法运算。 + * * @param v1 被加数 * @param v2 加数 * @return 两个参数的和 */ - public static double add(double v1, double v2) - { + public static double add(double v1, double v2) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); @@ -34,12 +36,12 @@ public class Arith /** * 提供精确的减法运算。 + * * @param v1 被减数 * @param v2 减数 * @return 两个参数的差 */ - public static double sub(double v1, double v2) - { + public static double sub(double v1, double v2) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.subtract(b2).doubleValue(); @@ -47,12 +49,12 @@ public class Arith /** * 提供精确的乘法运算。 + * * @param v1 被乘数 * @param v2 乘数 * @return 两个参数的积 */ - public static double mul(double v1, double v2) - { + public static double mul(double v1, double v2) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.multiply(b2).doubleValue(); @@ -61,34 +63,32 @@ public class Arith /** * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 * 小数点以后10位,以后的数字四舍五入。 + * * @param v1 被除数 * @param v2 除数 * @return 两个参数的商 */ - public static double div(double v1, double v2) - { + public static double div(double v1, double v2) { return div(v1, v2, DEF_DIV_SCALE); } /** * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 * 定精度,以后的数字四舍五入。 - * @param v1 被除数 - * @param v2 除数 + * + * @param v1 被除数 + * @param v2 除数 * @param scale 表示表示需要精确到小数点以后几位。 * @return 两个参数的商 */ - public static double div(double v1, double v2, int scale) - { - if (scale < 0) - { + public static double div(double v1, double v2, int scale) { + if (scale < 0) { throw new IllegalArgumentException( "The scale must be a positive integer or zero"); } BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); - if (b1.compareTo(BigDecimal.ZERO) == 0) - { + if (b1.compareTo(BigDecimal.ZERO) == 0) { return BigDecimal.ZERO.doubleValue(); } return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); @@ -96,14 +96,13 @@ public class Arith /** * 提供精确的小数位四舍五入处理。 - * @param v 需要四舍五入的数字 + * + * @param v 需要四舍五入的数字 * @param scale 小数点后保留几位 * @return 四舍五入后的结果 */ - public static double round(double v, int scale) - { - if (scale < 0) - { + public static double round(double v, int scale) { + if (scale < 0) { throw new IllegalArgumentException( "The scale must be a positive integer or zero"); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java index 536cb3cf..0ecacf32 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java @@ -4,15 +4,15 @@ import java.lang.management.ManagementFactory; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; + import org.apache.commons.lang3.time.DateFormatUtils; /** * 时间工具类 - * + * * @author ruoyi */ -public class DateUtils extends org.apache.commons.lang3.time.DateUtils -{ +public class DateUtils extends org.apache.commons.lang3.time.DateUtils { public static String YYYY = "yyyy"; public static String YYYY_MM = "yyyy-MM"; @@ -22,65 +22,54 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; - + private static String[] parsePatterns = { - "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", + "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; /** * 获取当前Date型日期 - * + * * @return Date() 当前日期 */ - public static Date getNowDate() - { + public static Date getNowDate() { return new Date(); } /** * 获取当前日期, 默认格式为yyyy-MM-dd - * + * * @return String */ - public static String getDate() - { + public static String getDate() { return dateTimeNow(YYYY_MM_DD); } - public static final String getTime() - { + public static final String getTime() { return dateTimeNow(YYYY_MM_DD_HH_MM_SS); } - public static final String dateTimeNow() - { + public static final String dateTimeNow() { return dateTimeNow(YYYYMMDDHHMMSS); } - public static final String dateTimeNow(final String format) - { + public static final String dateTimeNow(final String format) { return parseDateToStr(format, new Date()); } - public static final String dateTime(final Date date) - { + public static final String dateTime(final Date date) { return parseDateToStr(YYYY_MM_DD, date); } - public static final String parseDateToStr(final String format, final Date date) - { + public static final String parseDateToStr(final String format, final Date date) { return new SimpleDateFormat(format).format(date); } - public static final Date dateTime(final String format, final String ts) - { - try - { + public static final Date dateTime(final String format, final String ts) { + try { return new SimpleDateFormat(format).parse(ts); - } - catch (ParseException e) - { + } catch (ParseException e) { throw new RuntimeException(e); } } @@ -88,8 +77,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils /** * 日期路径 即年/月/日 如2018/08/08 */ - public static final String datePath() - { + public static final String datePath() { Date now = new Date(); return DateFormatUtils.format(now, "yyyy/MM/dd"); } @@ -97,8 +85,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils /** * 日期路径 即年/月/日 如20180808 */ - public static final String dateTime() - { + public static final String dateTime() { Date now = new Date(); return DateFormatUtils.format(now, "yyyyMMdd"); } @@ -106,27 +93,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils /** * 日期型字符串转化为日期 格式 */ - public static Date parseDate(Object str) - { - if (str == null) - { + public static Date parseDate(Object str) { + if (str == null) { return null; } - try - { + try { return parseDate(str.toString(), parsePatterns); - } - catch (ParseException e) - { + } catch (ParseException e) { return null; } } - + /** * 获取服务器启动时间 */ - public static Date getServerStartDate() - { + public static Date getServerStartDate() { long time = ManagementFactory.getRuntimeMXBean().getStartTime(); return new Date(time); } @@ -134,8 +115,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils /** * 计算两个时间差 */ - public static String getDatePoor(Date endDate, Date nowDate) - { + public static String getDatePoor(Date endDate, Date nowDate) { long nd = 1000 * 24 * 60 * 60; long nh = 1000 * 60 * 60; long nm = 1000 * 60; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java index 0a2ef1fb..5d7e838c 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -2,6 +2,7 @@ package com.ruoyi.common.utils; import java.util.Collection; import java.util.List; + import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; @@ -9,11 +10,10 @@ import com.ruoyi.common.utils.spring.SpringUtils; /** * 字典工具类 - * + * * @author ruoyi */ -public class DictUtils -{ +public class DictUtils { /** * 分隔符 */ @@ -21,26 +21,23 @@ public class DictUtils /** * 设置字典缓存 - * - * @param key 参数键 + * + * @param key 参数键 * @param dictDatas 字典数据列表 */ - public static void setDictCache(String key, List dictDatas) - { + public static void setDictCache(String key, List dictDatas) { SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas); } /** * 获取字典缓存 - * + * * @param key 参数键 * @return dictDatas 字典数据列表 */ - public static List getDictCache(String key) - { + public static List getDictCache(String key) { Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); - if (StringUtils.isNotNull(cacheObj)) - { + if (StringUtils.isNotNull(cacheObj)) { List dictDatas = StringUtils.cast(cacheObj); return dictDatas; } @@ -49,61 +46,50 @@ public class DictUtils /** * 根据字典类型和字典值获取字典标签 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典值 * @return 字典标签 */ - public static String getDictLabel(String dictType, String dictValue) - { + public static String getDictLabel(String dictType, String dictValue) { return getDictLabel(dictType, dictValue, SEPARATOR); } /** * 根据字典类型和字典标签获取字典值 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictLabel 字典标签 * @return 字典值 */ - public static String getDictValue(String dictType, String dictLabel) - { + public static String getDictValue(String dictType, String dictLabel) { return getDictValue(dictType, dictLabel, SEPARATOR); } /** * 根据字典类型和字典值获取字典标签 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典值 * @param separator 分隔符 * @return 字典标签 */ - public static String getDictLabel(String dictType, String dictValue, String separator) - { + public static String getDictLabel(String dictType, String dictValue, String separator) { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) - { - for (SysDictData dict : datas) - { - for (String value : dictValue.split(separator)) - { - if (value.equals(dict.getDictValue())) - { + if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) { + for (SysDictData dict : datas) { + for (String value : dictValue.split(separator)) { + if (value.equals(dict.getDictValue())) { propertyString.append(dict.getDictLabel() + separator); break; } } } - } - else - { - for (SysDictData dict : datas) - { - if (dictValue.equals(dict.getDictValue())) - { + } else { + for (SysDictData dict : datas) { + if (dictValue.equals(dict.getDictValue())) { return dict.getDictLabel(); } } @@ -113,37 +99,28 @@ public class DictUtils /** * 根据字典类型和字典标签获取字典值 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictLabel 字典标签 * @param separator 分隔符 * @return 字典值 */ - public static String getDictValue(String dictType, String dictLabel, String separator) - { + public static String getDictValue(String dictType, String dictLabel, String separator) { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) - { - for (SysDictData dict : datas) - { - for (String label : dictLabel.split(separator)) - { - if (label.equals(dict.getDictLabel())) - { + if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) { + for (SysDictData dict : datas) { + for (String label : dictLabel.split(separator)) { + if (label.equals(dict.getDictLabel())) { propertyString.append(dict.getDictValue() + separator); break; } } } - } - else - { - for (SysDictData dict : datas) - { - if (dictLabel.equals(dict.getDictLabel())) - { + } else { + for (SysDictData dict : datas) { + if (dictLabel.equals(dict.getDictLabel())) { return dict.getDictValue(); } } @@ -154,20 +131,18 @@ public class DictUtils /** * 清空字典缓存 */ - public static void clearDictCache() - { + public static void clearDictCache() { Collection keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*"); SpringUtils.getBean(RedisCache.class).deleteObject(keys); } /** * 设置cache key - * + * * @param configKey 参数键 * @return 缓存键key */ - public static String getCacheKey(String configKey) - { + public static String getCacheKey(String configKey) { return Constants.SYS_DICT_KEY + configKey; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java index ad57439b..56406fdf 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java @@ -2,6 +2,7 @@ package com.ruoyi.common.utils; import java.io.PrintWriter; import java.io.StringWriter; + import org.apache.commons.lang3.exception.ExceptionUtils; /** @@ -9,30 +10,25 @@ import org.apache.commons.lang3.exception.ExceptionUtils; * * @author ruoyi */ -public class ExceptionUtil -{ +public class ExceptionUtil { /** * 获取exception的详细错误信息。 */ - public static String getExceptionMessage(Throwable e) - { + public static String getExceptionMessage(Throwable e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw, true)); String str = sw.toString(); return str; } - public static String getRootErrorMseeage(Exception e) - { + public static String getRootErrorMseeage(Exception e) { Throwable root = ExceptionUtils.getRootCause(e); root = (root == null ? e : root); - if (root == null) - { + if (root == null) { return ""; } String msg = root.getMessage(); - if (msg == null) - { + if (msg == null) { return "null"; } return StringUtils.defaultString(msg); diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java index 0de30c6b..a0d5c9f6 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java @@ -2,15 +2,12 @@ package com.ruoyi.common.utils; /** * 处理并记录日志文件 - * + * * @author ruoyi */ -public class LogUtils -{ - public static String getBlock(Object msg) - { - if (msg == null) - { +public class LogUtils { + public static String getBlock(Object msg) { + if (msg == null) { msg = ""; } return "[" + msg.toString() + "]"; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java index 7dac75a3..d9eb4b97 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java @@ -6,11 +6,10 @@ import com.ruoyi.common.utils.spring.SpringUtils; /** * 获取i18n资源文件 - * + * * @author ruoyi */ -public class MessageUtils -{ +public class MessageUtils { /** * 根据消息键和参数 获取消息 委托给spring messageSource * @@ -18,8 +17,7 @@ public class MessageUtils * @param args 参数 * @return 获取国际化翻译值 */ - public static String message(String code, Object... args) - { + public static String message(String code, Object... args) { MessageSource messageSource = SpringUtils.getBean(MessageSource.class); return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java index aec57768..bef342f2 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java @@ -9,22 +9,18 @@ import com.ruoyi.common.exception.CustomException; /** * 安全服务工具类 - * + * * @author ruoyi */ -public class SecurityUtils -{ +public class SecurityUtils { /** * 获取用户账户 **/ - public static String getUsername() - { - try - { + public static String getUsername() { + try { return getLoginUser().getUsername(); - } - catch (Exception e) - { + } catch (Exception e) { + e.printStackTrace(); throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED); } } @@ -32,14 +28,10 @@ public class SecurityUtils /** * 获取用户 **/ - public static LoginUser getLoginUser() - { - try - { + public static LoginUser getLoginUser() { + try { return (LoginUser) getAuthentication().getPrincipal(); - } - catch (Exception e) - { + } catch (Exception e) { throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED); } } @@ -47,8 +39,7 @@ public class SecurityUtils /** * 获取Authentication */ - public static Authentication getAuthentication() - { + public static Authentication getAuthentication() { return SecurityContextHolder.getContext().getAuthentication(); } @@ -58,8 +49,7 @@ public class SecurityUtils * @param password 密码 * @return 加密字符串 */ - public static String encryptPassword(String password) - { + public static String encryptPassword(String password) { BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); return passwordEncoder.encode(password); } @@ -67,24 +57,22 @@ public class SecurityUtils /** * 判断密码是否相同 * - * @param rawPassword 真实密码 + * @param rawPassword 真实密码 * @param encodedPassword 加密后字符 * @return 结果 */ - public static boolean matchesPassword(String rawPassword, String encodedPassword) - { + public static boolean matchesPassword(String rawPassword, String encodedPassword) { BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); return passwordEncoder.matches(rawPassword, encodedPassword); } /** * 是否为管理员 - * + * * @param userId 用户ID * @return 结果 */ - public static boolean isAdmin(Long userId) - { + public static boolean isAdmin(Long userId) { return userId != null && 1L == userId; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java index ab9ebcfc..cc245797 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -4,6 +4,7 @@ import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; + import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -11,91 +12,78 @@ import com.ruoyi.common.core.text.Convert; /** * 客户端工具类 - * + * * @author ruoyi */ -public class ServletUtils -{ +public class ServletUtils { /** * 获取String参数 */ - public static String getParameter(String name) - { + public static String getParameter(String name) { return getRequest().getParameter(name); } /** * 获取String参数 */ - public static String getParameter(String name, String defaultValue) - { + public static String getParameter(String name, String defaultValue) { return Convert.toStr(getRequest().getParameter(name), defaultValue); } /** * 获取Integer参数 */ - public static Integer getParameterToInt(String name) - { + public static Integer getParameterToInt(String name) { return Convert.toInt(getRequest().getParameter(name)); } /** * 获取Integer参数 */ - public static Integer getParameterToInt(String name, Integer defaultValue) - { + public static Integer getParameterToInt(String name, Integer defaultValue) { return Convert.toInt(getRequest().getParameter(name), defaultValue); } /** * 获取request */ - public static HttpServletRequest getRequest() - { + public static HttpServletRequest getRequest() { return getRequestAttributes().getRequest(); } /** * 获取response */ - public static HttpServletResponse getResponse() - { + public static HttpServletResponse getResponse() { return getRequestAttributes().getResponse(); } /** * 获取session */ - public static HttpSession getSession() - { + public static HttpSession getSession() { return getRequest().getSession(); } - public static ServletRequestAttributes getRequestAttributes() - { + public static ServletRequestAttributes getRequestAttributes() { RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); return (ServletRequestAttributes) attributes; } /** * 将字符串渲染到客户端 - * + * * @param response 渲染对象 - * @param string 待渲染的字符串 + * @param string 待渲染的字符串 * @return null */ - public static String renderString(HttpServletResponse response, String string) - { - try - { + public static String renderString(HttpServletResponse response, String string) { + try { response.setStatus(200); response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.getWriter().print(string); - } - catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); } return null; @@ -103,32 +91,27 @@ public class ServletUtils /** * 是否是Ajax异步请求 - * + * * @param request */ - public static boolean isAjaxRequest(HttpServletRequest request) - { + public static boolean isAjaxRequest(HttpServletRequest request) { String accept = request.getHeader("accept"); - if (accept != null && accept.indexOf("application/json") != -1) - { + if (accept != null && accept.indexOf("application/json") != -1) { return true; } String xRequestedWith = request.getHeader("X-Requested-With"); - if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) - { + if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) { return true; } String uri = request.getRequestURI(); - if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) - { + if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { return true; } String ajax = request.getParameter("__ajax"); - if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) - { + if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) { return true; } return false; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java index 7e3969f1..4802bc94 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -6,186 +6,172 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; + import com.ruoyi.common.core.text.StrFormatter; /** * 字符串工具类 - * + * * @author ruoyi */ -public class StringUtils extends org.apache.commons.lang3.StringUtils -{ - /** 空字符串 */ +public class StringUtils extends org.apache.commons.lang3.StringUtils { + /** + * 空字符串 + */ private static final String NULLSTR = ""; - /** 下划线 */ + /** + * 下划线 + */ private static final char SEPARATOR = '_'; /** * 获取参数不为空值 - * + * * @param value defaultValue 要判断的value * @return value 返回值 */ - public static T nvl(T value, T defaultValue) - { + public static T nvl(T value, T defaultValue) { return value != null ? value : defaultValue; } /** * * 判断一个Collection是否为空, 包含List,Set,Queue - * + * * @param coll 要判断的Collection * @return true:为空 false:非空 */ - public static boolean isEmpty(Collection coll) - { + public static boolean isEmpty(Collection coll) { return isNull(coll) || coll.isEmpty(); } /** * * 判断一个Collection是否非空,包含List,Set,Queue - * + * * @param coll 要判断的Collection * @return true:非空 false:空 */ - public static boolean isNotEmpty(Collection coll) - { + public static boolean isNotEmpty(Collection coll) { return !isEmpty(coll); } /** * * 判断一个对象数组是否为空 - * + * * @param objects 要判断的对象数组 - ** @return true:为空 false:非空 + * * @return true:为空 false:非空 */ - public static boolean isEmpty(Object[] objects) - { + public static boolean isEmpty(Object[] objects) { return isNull(objects) || (objects.length == 0); } /** * * 判断一个对象数组是否非空 - * + * * @param objects 要判断的对象数组 * @return true:非空 false:空 */ - public static boolean isNotEmpty(Object[] objects) - { + public static boolean isNotEmpty(Object[] objects) { return !isEmpty(objects); } /** * * 判断一个Map是否为空 - * + * * @param map 要判断的Map * @return true:为空 false:非空 */ - public static boolean isEmpty(Map map) - { + public static boolean isEmpty(Map map) { return isNull(map) || map.isEmpty(); } /** * * 判断一个Map是否为空 - * + * * @param map 要判断的Map * @return true:非空 false:空 */ - public static boolean isNotEmpty(Map map) - { + public static boolean isNotEmpty(Map map) { return !isEmpty(map); } /** * * 判断一个字符串是否为空串 - * + * * @param str String * @return true:为空 false:非空 */ - public static boolean isEmpty(String str) - { + public static boolean isEmpty(String str) { return isNull(str) || NULLSTR.equals(str.trim()); } /** * * 判断一个字符串是否为非空串 - * + * * @param str String * @return true:非空串 false:空串 */ - public static boolean isNotEmpty(String str) - { + public static boolean isNotEmpty(String str) { return !isEmpty(str); } /** * * 判断一个对象是否为空 - * + * * @param object Object * @return true:为空 false:非空 */ - public static boolean isNull(Object object) - { + public static boolean isNull(Object object) { return object == null; } /** * * 判断一个对象是否非空 - * + * * @param object Object * @return true:非空 false:空 */ - public static boolean isNotNull(Object object) - { + public static boolean isNotNull(Object object) { return !isNull(object); } /** * * 判断一个对象是否是数组类型(Java基本型别的数组) - * + * * @param object 对象 * @return true:是数组 false:不是数组 */ - public static boolean isArray(Object object) - { + public static boolean isArray(Object object) { return isNotNull(object) && object.getClass().isArray(); } /** * 去空格 */ - public static String trim(String str) - { + public static String trim(String str) { return (str == null ? "" : str.trim()); } /** * 截取字符串 - * - * @param str 字符串 + * + * @param str 字符串 * @param start 开始 * @return 结果 */ - public static String substring(final String str, int start) - { - if (str == null) - { + public static String substring(final String str, int start) { + if (str == null) { return NULLSTR; } - if (start < 0) - { + if (start < 0) { start = str.length() + start; } - if (start < 0) - { + if (start < 0) { start = 0; } - if (start > str.length()) - { + if (start > str.length()) { return NULLSTR; } @@ -194,44 +180,36 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 截取字符串 - * - * @param str 字符串 + * + * @param str 字符串 * @param start 开始 - * @param end 结束 + * @param end 结束 * @return 结果 */ - public static String substring(final String str, int start, int end) - { - if (str == null) - { + public static String substring(final String str, int start, int end) { + if (str == null) { return NULLSTR; } - if (end < 0) - { + if (end < 0) { end = str.length() + end; } - if (start < 0) - { + if (start < 0) { start = str.length() + start; } - if (end > str.length()) - { + if (end > str.length()) { end = str.length(); } - if (start > end) - { + if (start > end) { return NULLSTR; } - if (start < 0) - { + if (start < 0) { start = 0; } - if (end < 0) - { + if (end < 0) { end = 0; } @@ -246,15 +224,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- * + * * @param template 文本模板,被替换的部分用 {} 表示 - * @param params 参数值 + * @param params 参数值 * @return 格式化后的文本 */ - public static String format(String template, Object... params) - { - if (isEmpty(params) || isEmpty(template)) - { + public static String format(String template, Object... params) { + if (isEmpty(params) || isEmpty(template)) { return template; } return StrFormatter.format(template, params); @@ -262,47 +238,40 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 字符串转set - * + * * @param str 字符串 * @param sep 分隔符 * @return set集合 */ - public static final Set str2Set(String str, String sep) - { + public static final Set str2Set(String str, String sep) { return new HashSet(str2List(str, sep, true, false)); } /** * 字符串转list - * - * @param str 字符串 - * @param sep 分隔符 + * + * @param str 字符串 + * @param sep 分隔符 * @param filterBlank 过滤纯空白 - * @param trim 去掉首尾空白 + * @param trim 去掉首尾空白 * @return list集合 */ - public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) - { + public static final List str2List(String str, String sep, boolean filterBlank, boolean trim) { List list = new ArrayList(); - if (StringUtils.isEmpty(str)) - { + if (StringUtils.isEmpty(str)) { return list; } // 过滤空白字符串 - if (filterBlank && StringUtils.isBlank(str)) - { + if (filterBlank && StringUtils.isBlank(str)) { return list; } String[] split = str.split(sep); - for (String string : split) - { - if (filterBlank && StringUtils.isBlank(string)) - { + for (String string : split) { + if (filterBlank && StringUtils.isBlank(string)) { continue; } - if (trim) - { + if (trim) { string = string.trim(); } list.add(string); @@ -314,10 +283,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 下划线转驼峰命名 */ - public static String toUnderScoreCase(String str) - { - if (str == null) - { + public static String toUnderScoreCase(String str) { + if (str == null) { return null; } StringBuilder sb = new StringBuilder(); @@ -327,31 +294,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils boolean curreCharIsUpperCase = true; // 下一字符是否大写 boolean nexteCharIsUpperCase = true; - for (int i = 0; i < str.length(); i++) - { + for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); - if (i > 0) - { + if (i > 0) { preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); - } - else - { + } else { preCharIsUpperCase = false; } curreCharIsUpperCase = Character.isUpperCase(c); - if (i < (str.length() - 1)) - { + if (i < (str.length() - 1)) { nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); } - if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) - { + if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { sb.append(SEPARATOR); - } - else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) - { + } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { sb.append(SEPARATOR); } sb.append(Character.toLowerCase(c)); @@ -362,19 +321,15 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 是否包含字符串 - * - * @param str 验证字符串 + * + * @param str 验证字符串 * @param strs 字符串组 * @return 包含返回true */ - public static boolean inStringIgnoreCase(String str, String... strs) - { - if (str != null && strs != null) - { - for (String s : strs) - { - if (str.equalsIgnoreCase(trim(s))) - { + public static boolean inStringIgnoreCase(String str, String... strs) { + if (str != null && strs != null) { + for (String s : strs) { + if (str.equalsIgnoreCase(trim(s))) { return true; } } @@ -384,31 +339,25 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld - * + * * @param name 转换前的下划线大写方式命名的字符串 * @return 转换后的驼峰式命名的字符串 */ - public static String convertToCamelCase(String name) - { + public static String convertToCamelCase(String name) { StringBuilder result = new StringBuilder(); // 快速检查 - if (name == null || name.isEmpty()) - { + if (name == null || name.isEmpty()) { // 没必要转换 return ""; - } - else if (!name.contains("_")) - { + } else if (!name.contains("_")) { // 不含下划线,仅将首字母大写 return name.substring(0, 1).toUpperCase() + name.substring(1); } // 用下划线将原始字符串分割 String[] camels = name.split("_"); - for (String camel : camels) - { + for (String camel : camels) { // 跳过原始字符串中开头、结尾的下换线或双重下划线 - if (camel.isEmpty()) - { + if (camel.isEmpty()) { continue; } // 首字母大写 @@ -421,30 +370,22 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 驼峰式命名法 例如:user_name->userName */ - public static String toCamelCase(String s) - { - if (s == null) - { + public static String toCamelCase(String s) { + if (s == null) { return null; } s = s.toLowerCase(); StringBuilder sb = new StringBuilder(s.length()); boolean upperCase = false; - for (int i = 0; i < s.length(); i++) - { + for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); - if (c == SEPARATOR) - { + if (c == SEPARATOR) { upperCase = true; - } - else if (upperCase) - { + } else if (upperCase) { sb.append(Character.toUpperCase(c)); upperCase = false; - } - else - { + } else { sb.append(c); } } @@ -452,8 +393,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils } @SuppressWarnings("unchecked") - public static T cast(Object obj) - { + public static T cast(Object obj) { return (T) obj; } } \ No newline at end of file diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java index 19341950..f427c314 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java @@ -5,29 +5,25 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 线程相关工具类. - * + * * @author ruoyi */ -public class Threads -{ +public class Threads { private static final Logger logger = LoggerFactory.getLogger(Threads.class); /** * sleep等待,单位为毫秒 */ - public static void sleep(long milliseconds) - { - try - { + public static void sleep(long milliseconds) { + try { Thread.sleep(milliseconds); - } - catch (InterruptedException e) - { + } catch (InterruptedException e) { return; } } @@ -39,24 +35,17 @@ public class Threads * 如果仍人超時,則強制退出. * 另对在shutdown时线程本身被调用中断做了处理. */ - public static void shutdownAndAwaitTermination(ExecutorService pool) - { - if (pool != null && !pool.isShutdown()) - { + public static void shutdownAndAwaitTermination(ExecutorService pool) { + if (pool != null && !pool.isShutdown()) { pool.shutdown(); - try - { - if (!pool.awaitTermination(120, TimeUnit.SECONDS)) - { + try { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { pool.shutdownNow(); - if (!pool.awaitTermination(120, TimeUnit.SECONDS)) - { + if (!pool.awaitTermination(120, TimeUnit.SECONDS)) { logger.info("Pool did not terminate"); } } - } - catch (InterruptedException ie) - { + } catch (InterruptedException ie) { pool.shutdownNow(); Thread.currentThread().interrupt(); } @@ -66,33 +55,22 @@ public class Threads /** * 打印线程异常信息 */ - public static void printException(Runnable r, Throwable t) - { - if (t == null && r instanceof Future) - { - try - { + public static void printException(Runnable r, Throwable t) { + if (t == null && r instanceof Future) { + try { Future future = (Future) r; - if (future.isDone()) - { + if (future.isDone()) { future.get(); } - } - catch (CancellationException ce) - { + } catch (CancellationException ce) { t = ce; - } - catch (ExecutionException ee) - { + } catch (ExecutionException ee) { t = ee.getCause(); - } - catch (InterruptedException ie) - { + } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } } - if (t != null) - { + if (t != null) { logger.error(t.getMessage(), t); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java index 5fdf3a9d..12e2d465 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java @@ -16,11 +16,10 @@ import javax.imageio.ImageIO; /** * 验证码工具类 - * + * * @author ruoyi */ -public class VerifyCodeUtils -{ +public class VerifyCodeUtils { // 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"; @@ -28,33 +27,29 @@ public class VerifyCodeUtils /** * 使用系统默认字符源生成验证码 - * + * * @param verifySize 验证码长度 * @return */ - public static String generateVerifyCode(int verifySize) - { + public static String generateVerifyCode(int verifySize) { return generateVerifyCode(verifySize, VERIFY_CODES); } /** * 使用指定源生成验证码 - * + * * @param verifySize 验证码长度 - * @param sources 验证码字符源 + * @param sources 验证码字符源 * @return */ - public static String generateVerifyCode(int verifySize, String sources) - { - if (sources == null || sources.length() == 0) - { + public static String generateVerifyCode(int verifySize, String sources) { + if (sources == null || sources.length() == 0) { sources = VERIFY_CODES; } int codesLen = sources.length(); Random rand = new Random(System.currentTimeMillis()); StringBuilder verifyCode = new StringBuilder(verifySize); - for (int i = 0; i < verifySize; i++) - { + for (int i = 0; i < verifySize; i++) { verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1))); } return verifyCode.toString(); @@ -62,26 +57,24 @@ public class VerifyCodeUtils /** * 输出指定验证码图片流 - * + * * @param w * @param h * @param os * @param code * @throws IOException */ - public static void outputImage(int w, int h, OutputStream os, String code) throws IOException - { + public static void outputImage(int w, int h, OutputStream os, String code) throws IOException { int verifySize = code.length(); BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); Random rand = new Random(); Graphics2D g2 = image.createGraphics(); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Color[] colors = new Color[5]; - Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, - Color.ORANGE, Color.PINK, Color.YELLOW }; + Color[] colorSpaces = new Color[]{Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, + Color.ORANGE, Color.PINK, Color.YELLOW}; float[] fractions = new float[colors.length]; - for (int i = 0; i < colors.length; i++) - { + for (int i = 0; i < colors.length; i++) { colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; fractions[i] = rand.nextFloat(); } @@ -97,8 +90,7 @@ public class VerifyCodeUtils // 绘制干扰线 Random random = new Random(); g2.setColor(getRandColor(160, 200));// 设置线条的颜色 - for (int i = 0; i < 20; i++) - { + for (int i = 0; i < 20; i++) { int x = random.nextInt(w - 1); int y = random.nextInt(h - 1); int xl = random.nextInt(6) + 1; @@ -109,8 +101,7 @@ public class VerifyCodeUtils // 添加噪点 float yawpRate = 0.05f;// 噪声率 int area = (int) (yawpRate * w * h); - for (int i = 0; i < area; i++) - { + for (int i = 0; i < area; i++) { int x = random.nextInt(w); int y = random.nextInt(h); int rgb = getRandomIntColor(); @@ -124,8 +115,7 @@ public class VerifyCodeUtils Font font = new Font("Algerian", Font.ITALIC, fontSize); g2.setFont(font); char[] chars = code.toCharArray(); - for (int i = 0; i < verifySize; i++) - { + for (int i = 0; i < verifySize; i++) { AffineTransform affine = new AffineTransform(); affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize / 2, h / 2); @@ -137,8 +127,7 @@ public class VerifyCodeUtils ImageIO.write(image, "jpg", os); } - private static Color getRandColor(int fc, int bc) - { + private static Color getRandColor(int fc, int bc) { if (fc > 255) { fc = 255; } @@ -151,36 +140,30 @@ public class VerifyCodeUtils return new Color(r, g, b); } - private static int getRandomIntColor() - { + private static int getRandomIntColor() { int[] rgb = getRandomRgb(); int color = 0; - for (int c : rgb) - { + for (int c : rgb) { color = color << 8; color = color | c; } return color; } - private static int[] getRandomRgb() - { + private static int[] getRandomRgb() { int[] rgb = new int[3]; - for (int i = 0; i < 3; i++) - { + for (int i = 0; i < 3; i++) { rgb[i] = random.nextInt(255); } return rgb; } - private static void shear(Graphics g, int w1, int h1, Color color) - { + private static void shear(Graphics g, int w1, int h1, Color color) { shearX(g, w1, h1, color); shearY(g, w1, h1, color); } - private static void shearX(Graphics g, int w1, int h1, Color color) - { + private static void shearX(Graphics g, int w1, int h1, Color color) { int period = random.nextInt(2); @@ -188,13 +171,11 @@ public class VerifyCodeUtils int frames = 1; int phase = random.nextInt(2); - for (int i = 0; i < h1; i++) - { + for (int i = 0; i < h1; i++) { double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); g.copyArea(0, i, w1, 1, (int) d, 0); - if (borderGap) - { + if (borderGap) { g.setColor(color); g.drawLine((int) d, i, 0, i); g.drawLine((int) d + w1, i, w1, i); @@ -203,21 +184,18 @@ public class VerifyCodeUtils } - private static void shearY(Graphics g, int w1, int h1, Color color) - { + private static void shearY(Graphics g, int w1, int h1, Color color) { int period = random.nextInt(40) + 10; // 50; boolean borderGap = true; int frames = 20; int phase = 7; - for (int i = 0; i < w1; i++) - { + for (int i = 0; i < w1; i++) { double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); g.copyArea(i, 0, 1, h1, 0, (int) d); - if (borderGap) - { + if (borderGap) { g.setColor(color); g.drawLine(i, (int) d, i, 0); g.drawLine(i, (int) d + h1, i, h1); diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java index 4463662d..43114b30 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java @@ -8,46 +8,46 @@ import java.util.regex.Pattern; /** * Bean 工具类 - * + * * @author ruoyi */ -public class BeanUtils extends org.springframework.beans.BeanUtils -{ - /** Bean方法名中属性名开始的下标 */ +public class BeanUtils extends org.springframework.beans.BeanUtils { + /** + * Bean方法名中属性名开始的下标 + */ private static final int BEAN_METHOD_PROP_INDEX = 3; - /** * 匹配getter方法的正则表达式 */ + /** + * 匹配getter方法的正则表达式 + */ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); - /** * 匹配setter方法的正则表达式 */ + /** + * 匹配setter方法的正则表达式 + */ private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); /** * Bean属性复制工具方法。 - * + * * @param dest 目标对象 - * @param src 源对象 + * @param src 源对象 */ - public static void copyBeanProp(Object dest, Object src) - { - try - { + public static void copyBeanProp(Object dest, Object src) { + try { copyProperties(src, dest); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); } } /** * 获取对象的setter方法。 - * + * * @param obj 对象 * @return 对象的setter方法列表 */ - public static List getSetterMethods(Object obj) - { + public static List getSetterMethods(Object obj) { // setter方法列表 List setterMethods = new ArrayList(); @@ -56,11 +56,9 @@ public class BeanUtils extends org.springframework.beans.BeanUtils // 查找setter方法 - for (Method method : methods) - { + for (Method method : methods) { Matcher m = SET_PATTERN.matcher(method.getName()); - if (m.matches() && (method.getParameterTypes().length == 1)) - { + if (m.matches() && (method.getParameterTypes().length == 1)) { setterMethods.add(method); } } @@ -70,23 +68,20 @@ public class BeanUtils extends org.springframework.beans.BeanUtils /** * 获取对象的getter方法。 - * + * * @param obj 对象 * @return 对象的getter方法列表 */ - public static List getGetterMethods(Object obj) - { + public static List getGetterMethods(Object obj) { // getter方法列表 List getterMethods = new ArrayList(); // 获取所有方法 Method[] methods = obj.getClass().getMethods(); // 查找getter方法 - for (Method method : methods) - { + for (Method method : methods) { Matcher m = GET_PATTERN.matcher(method.getName()); - if (m.matches() && (method.getParameterTypes().length == 0)) - { + if (m.matches() && (method.getParameterTypes().length == 0)) { getterMethods.add(method); } } @@ -97,14 +92,13 @@ public class BeanUtils extends org.springframework.beans.BeanUtils /** * 检查Bean方法名中的属性名是否相等。
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 - * + * * @param m1 方法名1 * @param m2 方法名2 * @return 属性名一样返回true,否则返回false */ - public static boolean isMethodPropEquals(String m1, String m2) - { + public static boolean isMethodPropEquals(String m1, String m2) { return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java index 68130b9c..23155448 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java @@ -1,6 +1,7 @@ package com.ruoyi.common.utils.file; import java.io.File; + import org.apache.commons.lang3.StringUtils; /** @@ -8,20 +9,17 @@ import org.apache.commons.lang3.StringUtils; * * @author ruoyi */ -public class FileTypeUtils -{ +public class FileTypeUtils { /** * 获取文件类型 *

* 例如: ruoyi.txt, 返回: txt - * + * * @param file 文件名 * @return 后缀(不含".") */ - public static String getFileType(File file) - { - if (null == file) - { + public static String getFileType(File file) { + if (null == file) { return StringUtils.EMPTY; } return getFileType(file.getName()); @@ -35,11 +33,9 @@ public class FileTypeUtils * @param fileName 文件名 * @return 后缀(不含".") */ - public static String getFileType(String fileName) - { + public static String getFileType(String fileName) { int separatorIndex = fileName.lastIndexOf("."); - if (separatorIndex < 0) - { + if (separatorIndex < 0) { return ""; } return fileName.substring(separatorIndex + 1).toLowerCase(); @@ -47,28 +43,20 @@ public class FileTypeUtils /** * 获取文件类型 - * + * * @param photoByte 文件字节码 * @return 后缀(不含".") */ - public static String getFileExtendName(byte[] photoByte) - { + public static String getFileExtendName(byte[] photoByte) { String strFileExtendName = "JPG"; if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) - && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) - { + && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) { strFileExtendName = "GIF"; - } - else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) - { + } else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) { strFileExtendName = "JPG"; - } - else if ((photoByte[0] == 66) && (photoByte[1] == 77)) - { + } else if ((photoByte[0] == 66) && (photoByte[1] == 77)) { strFileExtendName = "BMP"; - } - else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) - { + } else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) { strFileExtendName = "PNG"; } return strFileExtendName; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index 3ccbcb5a..bd0b0160 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -2,6 +2,7 @@ package com.ruoyi.common.utils.file; import java.io.File; import java.io.IOException; + import org.apache.commons.io.FilenameUtils; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; @@ -18,8 +19,7 @@ import com.ruoyi.common.utils.uuid.IdUtils; * * @author ruoyi */ -public class FileUploadUtils -{ +public class FileUploadUtils { /** * 默认大小 50M */ @@ -35,13 +35,11 @@ public class FileUploadUtils */ private static String defaultBaseDir = RuoYiConfig.getProfile(); - public static void setDefaultBaseDir(String defaultBaseDir) - { + public static void setDefaultBaseDir(String defaultBaseDir) { FileUploadUtils.defaultBaseDir = defaultBaseDir; } - public static String getDefaultBaseDir() - { + public static String getDefaultBaseDir() { return defaultBaseDir; } @@ -52,14 +50,10 @@ public class FileUploadUtils * @return 文件名称 * @throws Exception */ - public static final String upload(MultipartFile file) throws IOException - { - try - { + public static final String upload(MultipartFile file) throws IOException { + try { return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); - } - catch (Exception e) - { + } catch (Exception e) { throw new IOException(e.getMessage(), e); } } @@ -68,18 +62,14 @@ public class FileUploadUtils * 根据文件路径上传 * * @param baseDir 相对应用的基目录 - * @param file 上传的文件 + * @param file 上传的文件 * @return 文件名称 * @throws IOException */ - public static final String upload(String baseDir, MultipartFile file) throws IOException - { - try - { + public static final String upload(String baseDir, MultipartFile file) throws IOException { + try { return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); - } - catch (Exception e) - { + } catch (Exception e) { throw new IOException(e.getMessage(), e); } } @@ -87,22 +77,20 @@ public class FileUploadUtils /** * 文件上传 * - * @param baseDir 相对应用的基目录 - * @param file 上传的文件 + * @param baseDir 相对应用的基目录 + * @param file 上传的文件 * @param allowedExtension 上传文件类型 * @return 返回上传成功的文件名 - * @throws FileSizeLimitExceededException 如果超出最大大小 + * @throws FileSizeLimitExceededException 如果超出最大大小 * @throws FileNameLengthLimitExceededException 文件名太长 - * @throws IOException 比如读写文件出错时 - * @throws InvalidExtensionException 文件校验异常 + * @throws IOException 比如读写文件出错时 + * @throws InvalidExtensionException 文件校验异常 */ public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, - InvalidExtensionException - { + InvalidExtensionException { int fileNamelength = file.getOriginalFilename().length(); - if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) - { + if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); } @@ -119,31 +107,26 @@ public class FileUploadUtils /** * 编码文件名 */ - public static final String extractFilename(MultipartFile file) - { + public static final String extractFilename(MultipartFile file) { String fileName = file.getOriginalFilename(); String extension = getExtension(file); fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension; return fileName; } - private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException - { + private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException { File desc = new File(uploadDir + File.separator + fileName); - if (!desc.getParentFile().exists()) - { + if (!desc.getParentFile().exists()) { desc.getParentFile().mkdirs(); } - if (!desc.exists()) - { + if (!desc.exists()) { desc.createNewFile(); } return desc; } - private static final String getPathFileName(String uploadDir, String fileName) throws IOException - { + private static final String getPathFileName(String uploadDir, String fileName) throws IOException { int dirLastIndex = RuoYiConfig.getProfile().length() + 1; String currentDir = StringUtils.substring(uploadDir, dirLastIndex); String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; @@ -159,35 +142,25 @@ public class FileUploadUtils * @throws InvalidExtensionException */ public static final void assertAllowed(MultipartFile file, String[] allowedExtension) - throws FileSizeLimitExceededException, InvalidExtensionException - { + throws FileSizeLimitExceededException, InvalidExtensionException { long size = file.getSize(); - if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) - { + if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) { throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); } String fileName = file.getOriginalFilename(); String extension = getExtension(file); - if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) - { - if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) - { + if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) { + if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) { throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, fileName); - } - else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) - { + } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) { throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, fileName); - } - else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) - { + } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) { throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, fileName); - } - else - { + } else { throw new InvalidExtensionException(allowedExtension, extension, fileName); } } @@ -201,12 +174,9 @@ public class FileUploadUtils * @param allowedExtension * @return */ - public static final boolean isAllowedExtension(String extension, String[] allowedExtension) - { - for (String str : allowedExtension) - { - if (str.equalsIgnoreCase(extension)) - { + public static final boolean isAllowedExtension(String extension, String[] allowedExtension) { + for (String str : allowedExtension) { + if (str.equalsIgnoreCase(extension)) { return true; } } @@ -219,11 +189,9 @@ public class FileUploadUtils * @param file 表单文件 * @return 后缀名 */ - public static final String getExtension(MultipartFile file) - { + public static final String getExtension(MultipartFile file) { String extension = FilenameUtils.getExtension(file.getOriginalFilename()); - if (StringUtils.isEmpty(extension)) - { + if (StringUtils.isEmpty(extension)) { extension = MimeTypeUtils.getExtension(file.getContentType()); } return extension; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index f6aa1afc..adabd6f4 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -10,68 +10,52 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.commons.lang3.ArrayUtils; import com.ruoyi.common.utils.StringUtils; /** * 文件处理工具类 - * + * * @author ruoyi */ -public class FileUtils extends org.apache.commons.io.FileUtils -{ +public class FileUtils extends org.apache.commons.io.FileUtils { public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; /** * 输出指定文件的byte数组 - * + * * @param filePath 文件路径 - * @param os 输出流 + * @param os 输出流 * @return */ - public static void writeBytes(String filePath, OutputStream os) throws IOException - { + public static void writeBytes(String filePath, OutputStream os) throws IOException { FileInputStream fis = null; - try - { + try { File file = new File(filePath); - if (!file.exists()) - { + if (!file.exists()) { throw new FileNotFoundException(filePath); } fis = new FileInputStream(file); byte[] b = new byte[1024]; int length; - while ((length = fis.read(b)) > 0) - { + while ((length = fis.read(b)) > 0) { os.write(b, 0, length); } - } - catch (IOException e) - { + } catch (IOException e) { throw e; - } - finally - { - if (os != null) - { - try - { + } finally { + if (os != null) { + try { os.close(); - } - catch (IOException e1) - { + } catch (IOException e1) { e1.printStackTrace(); } } - if (fis != null) - { - try - { + if (fis != null) { + try { fis.close(); - } - catch (IOException e1) - { + } catch (IOException e1) { e1.printStackTrace(); } } @@ -80,17 +64,15 @@ public class FileUtils extends org.apache.commons.io.FileUtils /** * 删除文件 - * + * * @param filePath 文件 * @return */ - public static boolean deleteFile(String filePath) - { + public static boolean deleteFile(String filePath) { boolean flag = false; File file = new File(filePath); // 路径为文件且不为空则进行删除 - if (file.isFile() && file.exists()) - { + if (file.isFile() && file.exists()) { file.delete(); flag = true; } @@ -99,32 +81,28 @@ public class FileUtils extends org.apache.commons.io.FileUtils /** * 文件名称验证 - * + * * @param filename 文件名称 * @return true 正常 false 非法 */ - public static boolean isValidFilename(String filename) - { + public static boolean isValidFilename(String filename) { return filename.matches(FILENAME_PATTERN); } /** * 检查文件是否可下载 - * + * * @param resource 需要下载的文件 * @return true 正常 false 非法 */ - public static boolean checkAllowDownload(String resource) - { + public static boolean checkAllowDownload(String resource) { // 禁止目录上跳级别 - if (StringUtils.contains(resource, "..")) - { + if (StringUtils.contains(resource, "..")) { return false; } // 检查允许下载的文件规则 - if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource))) - { + if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getFileType(resource))) { return true; } @@ -134,33 +112,25 @@ public class FileUtils extends org.apache.commons.io.FileUtils /** * 下载文件名重新编码 - * - * @param request 请求对象 + * + * @param request 请求对象 * @param fileName 文件名 * @return 编码后的文件名 */ - public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException - { + public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException { final String agent = request.getHeader("USER-AGENT"); String filename = fileName; - if (agent.contains("MSIE")) - { + if (agent.contains("MSIE")) { // IE浏览器 filename = URLEncoder.encode(filename, "utf-8"); filename = filename.replace("+", " "); - } - else if (agent.contains("Firefox")) - { + } else if (agent.contains("Firefox")) { // 火狐浏览器 filename = new String(fileName.getBytes(), "ISO8859-1"); - } - else if (agent.contains("Chrome")) - { + } else if (agent.contains("Chrome")) { // google浏览器 filename = URLEncoder.encode(filename, "utf-8"); - } - else - { + } else { // 其它浏览器 filename = URLEncoder.encode(filename, "utf-8"); } @@ -170,12 +140,11 @@ public class FileUtils extends org.apache.commons.io.FileUtils /** * 下载文件名重新编码 * - * @param response 响应对象 + * @param response 响应对象 * @param realFileName 真实文件名 * @return */ - public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException - { + public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException { String percentEncodedFileName = percentEncode(realFileName); StringBuilder contentDispositionValue = new StringBuilder(); @@ -195,8 +164,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils * @param s 需要百分号编码的字符串 * @return 百分号编码后的字符串 */ - public static String percentEncode(String s) throws UnsupportedEncodingException - { + public static String percentEncode(String s) throws UnsupportedEncodingException { String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); return encode.replaceAll("\\+", "%20"); } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java index 07fd5389..4744eaff 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java @@ -7,6 +7,7 @@ import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import java.util.Arrays; + import org.apache.poi.util.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,38 +20,27 @@ import com.ruoyi.common.utils.StringUtils; * * @author ruoyi */ -public class ImageUtils -{ +public class ImageUtils { private static final Logger log = LoggerFactory.getLogger(ImageUtils.class); - public static byte[] getImage(String imagePath) - { + public static byte[] getImage(String imagePath) { InputStream is = getFile(imagePath); - try - { + try { return IOUtils.toByteArray(is); - } - catch (Exception e) - { + } catch (Exception e) { log.error("图片加载异常 {}", e); return null; - } - finally - { + } finally { IOUtils.closeQuietly(is); } } - public static InputStream getFile(String imagePath) - { - try - { + public static InputStream getFile(String imagePath) { + try { byte[] result = readFile(imagePath); result = Arrays.copyOf(result, result.length); return new ByteArrayInputStream(result); - } - catch (Exception e) - { + } catch (Exception e) { log.error("获取图片异常 {}", e); } return null; @@ -58,18 +48,15 @@ public class ImageUtils /** * 读取文件为字节数据 - * + * * @param key 地址 * @return 字节数据 */ - public static byte[] readFile(String url) - { + public static byte[] readFile(String url) { InputStream in = null; ByteArrayOutputStream baos = null; - try - { - if (url.startsWith("http")) - { + try { + if (url.startsWith("http")) { // 网络地址 URL urlObj = new URL(url); URLConnection urlConnection = urlObj.openConnection(); @@ -77,23 +64,17 @@ public class ImageUtils urlConnection.setReadTimeout(60 * 1000); urlConnection.setDoInput(true); in = urlConnection.getInputStream(); - } - else - { + } else { // 本机地址 String localPath = RuoYiConfig.getProfile(); String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX); in = new FileInputStream(downloadPath); } return IOUtils.toByteArray(in); - } - catch (Exception e) - { + } catch (Exception e) { log.error("获取文件路径异常 {}", e); return null; - } - finally - { + } finally { IOUtils.closeQuietly(baos); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java index 69846412..4369fc65 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java @@ -2,11 +2,10 @@ package com.ruoyi.common.utils.file; /** * 媒体类型工具类 - * + * * @author ruoyi */ -public class MimeTypeUtils -{ +public class MimeTypeUtils { public static final String IMAGE_PNG = "image/png"; public static final String IMAGE_JPG = "image/jpg"; @@ -16,13 +15,13 @@ public class MimeTypeUtils public static final String IMAGE_BMP = "image/bmp"; public static final String IMAGE_GIF = "image/gif"; - - public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" }; - public static final String[] FLASH_EXTENSION = { "swf", "flv" }; + public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"}; - public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", - "asf", "rm", "rmvb" }; + public static final String[] FLASH_EXTENSION = {"swf", "flv"}; + + public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb"}; public static final String[] DEFAULT_ALLOWED_EXTENSION = { // 图片 @@ -32,12 +31,10 @@ public class MimeTypeUtils // 压缩文件 "rar", "zip", "gz", "bz2", // pdf - "pdf" }; + "pdf"}; - public static String getExtension(String prefix) - { - switch (prefix) - { + public static String getExtension(String prefix) { + switch (prefix) { case IMAGE_PNG: return "png"; case IMAGE_JPG: diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java index bf9980a3..f2e81f2c 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java @@ -4,20 +4,17 @@ import com.ruoyi.common.utils.StringUtils; /** * 转义和反转义工具类 - * + * * @author ruoyi */ -public class EscapeUtil -{ +public class EscapeUtil { public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)"; private static final char[][] TEXT = new char[64][]; - static - { - for (int i = 0; i < 64; i++) - { - TEXT[i] = new char[] { (char) i }; + static { + for (int i = 0; i < 64; i++) { + TEXT[i] = new char[]{(char) i}; } // special HTML characters @@ -30,61 +27,52 @@ public class EscapeUtil /** * 转义文本中的HTML字符为安全的字符 - * + * * @param text 被转义的文本 * @return 转义后的文本 */ - public static String escape(String text) - { + public static String escape(String text) { return encode(text); } /** * 还原被转义的HTML特殊字符 - * + * * @param content 包含转义符的HTML内容 * @return 转换后的字符串 */ - public static String unescape(String content) - { + public static String unescape(String content) { return decode(content); } /** * 清除所有HTML标签,但是不删除标签内的内容 - * + * * @param content 文本 * @return 清除标签后的文本 */ - public static String clean(String content) - { + public static String clean(String content) { return new HTMLFilter().filter(content); } /** * Escape编码 - * + * * @param text 被编码的文本 * @return 编码后的字符 */ - private static String encode(String text) - { + private static String encode(String text) { int len; - if ((text == null) || ((len = text.length()) == 0)) - { + if ((text == null) || ((len = text.length()) == 0)) { return StringUtils.EMPTY; } StringBuilder buffer = new StringBuilder(len + (len >> 2)); char c; - for (int i = 0; i < len; i++) - { + for (int i = 0; i < len; i++) { c = text.charAt(i); - if (c < 64) - { + if (c < 64) { buffer.append(TEXT[c]); - } - else - { + } else { buffer.append(c); } } @@ -93,47 +81,35 @@ public class EscapeUtil /** * Escape解码 - * + * * @param content 被转义的内容 * @return 解码后的字符串 */ - public static String decode(String content) - { - if (StringUtils.isEmpty(content)) - { + public static String decode(String content) { + if (StringUtils.isEmpty(content)) { return content; } StringBuilder tmp = new StringBuilder(content.length()); int lastPos = 0, pos = 0; char ch; - while (lastPos < content.length()) - { + while (lastPos < content.length()) { pos = content.indexOf("%", lastPos); - if (pos == lastPos) - { - if (content.charAt(pos + 1) == 'u') - { + if (pos == lastPos) { + if (content.charAt(pos + 1) == 'u') { ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16); tmp.append(ch); lastPos = pos + 6; - } - else - { + } else { ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16); tmp.append(ch); lastPos = pos + 3; } - } - else - { - if (pos == -1) - { + } else { + if (pos == -1) { tmp.append(content.substring(lastPos)); lastPos = content.length(); - } - else - { + } else { tmp.append(content.substring(lastPos, pos)); lastPos = pos; } @@ -142,8 +118,7 @@ public class EscapeUtil return tmp.toString(); } - public static void main(String[] args) - { + public static void main(String[] args) { String html = ""; // String html = "ipt>alert(\"XSS\")ipt>"; // String html = "<123"; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java index cd8cd4ff..12375b1b 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java @@ -15,8 +15,7 @@ import java.util.regex.Pattern; * * @author ruoyi */ -public final class HTMLFilter -{ +public final class HTMLFilter { /** * regex flag union representing /si modifiers in php **/ @@ -100,8 +99,7 @@ public final class HTMLFilter /** * Default constructor. */ - public HTMLFilter() - { + public HTMLFilter() { vAllowed = new HashMap<>(); final ArrayList a_atts = new ArrayList<>(); @@ -122,13 +120,13 @@ public final class HTMLFilter vAllowed.put("i", no_atts); vAllowed.put("em", no_atts); - vSelfClosingTags = new String[] { "img" }; - vNeedClosingTags = new String[] { "a", "b", "strong", "i", "em" }; - vDisallowed = new String[] {}; - vAllowedProtocols = new String[] { "http", "mailto", "https" }; // no ftp. - vProtocolAtts = new String[] { "src", "href" }; - vRemoveBlanks = new String[] { "a", "b", "strong", "i", "em" }; - vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" }; + vSelfClosingTags = new String[]{"img"}; + vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"}; + vDisallowed = new String[]{}; + vAllowedProtocols = new String[]{"http", "mailto", "https"}; // no ftp. + vProtocolAtts = new String[]{"src", "href"}; + vRemoveBlanks = new String[]{"a", "b", "strong", "i", "em"}; + vAllowedEntities = new String[]{"amp", "gt", "lt", "quot"}; stripComment = true; encodeQuotes = true; alwaysMakeTags = false; @@ -140,8 +138,7 @@ public final class HTMLFilter * @param conf map containing configuration. keys match field names. */ @SuppressWarnings("unchecked") - public HTMLFilter(final Map conf) - { + public HTMLFilter(final Map conf) { assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; @@ -165,20 +162,17 @@ public final class HTMLFilter alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; } - private void reset() - { + private void reset() { vTagCounts.clear(); } // --------------------------------------------------------------- // my versions of some PHP library functions - public static String chr(final int decimal) - { + public static String chr(final int decimal) { return String.valueOf((char) decimal); } - public static String htmlSpecialChars(final String s) - { + public static String htmlSpecialChars(final String s) { String result = s; result = regexReplace(P_AMP, "&", result); result = regexReplace(P_QUOTE, """, result); @@ -195,8 +189,7 @@ public final class HTMLFilter * @param input text (i.e. submitted by a user) than may contain html * @return "clean" version of input, with only valid, whitelisted html elements allowed */ - public String filter(final String input) - { + public String filter(final String input) { reset(); String s = input; @@ -213,22 +206,18 @@ public final class HTMLFilter return s; } - public boolean isAlwaysMakeTags() - { + public boolean isAlwaysMakeTags() { return alwaysMakeTags; } - public boolean isStripComments() - { + public boolean isStripComments() { return stripComment; } - private String escapeComments(final String s) - { + private String escapeComments(final String s) { final Matcher m = P_COMMENTS.matcher(s); final StringBuffer buf = new StringBuffer(); - if (m.find()) - { + if (m.find()) { final String match = m.group(1); // (.*?) m.appendReplacement(buf, Matcher.quoteReplacement("")); } @@ -237,10 +226,8 @@ public final class HTMLFilter return buf.toString(); } - private String balanceHTML(String s) - { - if (alwaysMakeTags) - { + private String balanceHTML(String s) { + if (alwaysMakeTags) { // // try and form html // @@ -249,9 +236,7 @@ public final class HTMLFilter s = regexReplace(P_BODY_TO_END, "<$1>", s); s = regexReplace(P_XML_CONTENT, "$1<$2", s); - } - else - { + } else { // // escape stray brackets // @@ -269,13 +254,11 @@ public final class HTMLFilter return s; } - private String checkTags(String s) - { + private String checkTags(String s) { Matcher m = P_TAGS.matcher(s); final StringBuffer buf = new StringBuffer(); - while (m.find()) - { + while (m.find()) { String replaceStr = m.group(1); replaceStr = processTag(replaceStr); m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); @@ -285,10 +268,8 @@ public final class HTMLFilter // these get tallied in processTag // (remember to reset before subsequent calls to filter method) final StringBuilder sBuilder = new StringBuilder(buf.toString()); - for (String key : vTagCounts.keySet()) - { - for (int ii = 0; ii < vTagCounts.get(key); ii++) - { + for (String key : vTagCounts.keySet()) { + for (int ii = 0; ii < vTagCounts.get(key); ii++) { sBuilder.append(""); } } @@ -297,18 +278,14 @@ public final class HTMLFilter return s; } - private String processRemoveBlanks(final String s) - { + private String processRemoveBlanks(final String s) { String result = s; - for (String tag : vRemoveBlanks) - { - if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) - { + for (String tag : vRemoveBlanks) { + if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) { P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>")); } result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); - if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) - { + if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) { P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); } result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); @@ -317,25 +294,19 @@ public final class HTMLFilter return result; } - private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) - { + private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) { Matcher m = regex_pattern.matcher(s); return m.replaceAll(replacement); } - private String processTag(final String s) - { + private String processTag(final String s) { // ending tags Matcher m = P_END_TAG.matcher(s); - if (m.find()) - { + if (m.find()) { final String name = m.group(1).toLowerCase(); - if (allowed(name)) - { - if (false == inArray(name, vSelfClosingTags)) - { - if (vTagCounts.containsKey(name)) - { + if (allowed(name)) { + if (false == inArray(name, vSelfClosingTags)) { + if (vTagCounts.containsKey(name)) { vTagCounts.put(name, vTagCounts.get(name) - 1); return ""; } @@ -345,35 +316,30 @@ public final class HTMLFilter // starting tags m = P_START_TAG.matcher(s); - if (m.find()) - { + if (m.find()) { final String name = m.group(1).toLowerCase(); final String body = m.group(2); String ending = m.group(3); // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); - if (allowed(name)) - { + if (allowed(name)) { final StringBuilder params = new StringBuilder(); final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); final List paramNames = new ArrayList<>(); final List paramValues = new ArrayList<>(); - while (m2.find()) - { + while (m2.find()) { paramNames.add(m2.group(1)); // ([a-z0-9]+) paramValues.add(m2.group(3)); // (.*?) } - while (m3.find()) - { + while (m3.find()) { paramNames.add(m3.group(1)); // ([a-z0-9]+) paramValues.add(m3.group(3)); // ([^\"\\s']+) } String paramName, paramValue; - for (int ii = 0; ii < paramNames.size(); ii++) - { + for (int ii = 0; ii < paramNames.size(); ii++) { paramName = paramNames.get(ii).toLowerCase(); paramValue = paramValues.get(ii); @@ -381,72 +347,55 @@ public final class HTMLFilter // debug( "paramValue='" + paramValue + "'" ); // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); - if (allowedAttribute(name, paramName)) - { - if (inArray(paramName, vProtocolAtts)) - { + if (allowedAttribute(name, paramName)) { + if (inArray(paramName, vProtocolAtts)) { paramValue = processParamProtocol(paramValue); } params.append(' ').append(paramName).append("=\"").append(paramValue).append("\""); } } - if (inArray(name, vSelfClosingTags)) - { + if (inArray(name, vSelfClosingTags)) { ending = " /"; } - if (inArray(name, vNeedClosingTags)) - { + if (inArray(name, vNeedClosingTags)) { ending = ""; } - if (ending == null || ending.length() < 1) - { - if (vTagCounts.containsKey(name)) - { + if (ending == null || ending.length() < 1) { + if (vTagCounts.containsKey(name)) { vTagCounts.put(name, vTagCounts.get(name) + 1); - } - else - { + } else { vTagCounts.put(name, 1); } - } - else - { + } else { ending = " /"; } return "<" + name + params + ending + ">"; - } - else - { + } else { return ""; } } // comments m = P_COMMENT.matcher(s); - if (!stripComment && m.find()) - { + if (!stripComment && m.find()) { return "<" + m.group() + ">"; } return ""; } - private String processParamProtocol(String s) - { + private String processParamProtocol(String s) { s = decodeEntities(s); final Matcher m = P_PROTOCOL.matcher(s); - if (m.find()) - { + if (m.find()) { final String protocol = m.group(1); - if (!inArray(protocol, vAllowedProtocols)) - { + if (!inArray(protocol, vAllowedProtocols)) { // bad protocol, turn into local anchor link instead s = "#" + s.substring(protocol.length() + 1); - if (s.startsWith("#//")) - { + if (s.startsWith("#//")) { s = "#" + s.substring(3); } } @@ -455,13 +404,11 @@ public final class HTMLFilter return s; } - private String decodeEntities(String s) - { + private String decodeEntities(String s) { StringBuffer buf = new StringBuffer(); Matcher m = P_ENTITY.matcher(s); - while (m.find()) - { + while (m.find()) { final String match = m.group(1); final int decimal = Integer.decode(match).intValue(); m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); @@ -471,8 +418,7 @@ public final class HTMLFilter buf = new StringBuffer(); m = P_ENTITY_UNICODE.matcher(s); - while (m.find()) - { + while (m.find()) { final String match = m.group(1); final int decimal = Integer.valueOf(match, 16).intValue(); m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); @@ -482,8 +428,7 @@ public final class HTMLFilter buf = new StringBuffer(); m = P_ENCODE.matcher(s); - while (m.find()) - { + while (m.find()) { final String match = m.group(1); final int decimal = Integer.valueOf(match, 16).intValue(); m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); @@ -495,14 +440,12 @@ public final class HTMLFilter return s; } - private String validateEntities(final String s) - { + private String validateEntities(final String s) { StringBuffer buf = new StringBuffer(); // validate entities throughout the string Matcher m = P_VALID_ENTITIES.matcher(s); - while (m.find()) - { + while (m.find()) { final String one = m.group(1); // ([^&;]*) final String two = m.group(2); // (?=(;|&|$)) m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); @@ -512,14 +455,11 @@ public final class HTMLFilter return encodeQuotes(buf.toString()); } - private String encodeQuotes(final String s) - { - if (encodeQuotes) - { + private String encodeQuotes(final String s) { + if (encodeQuotes) { StringBuffer buf = new StringBuffer(); Matcher m = P_VALID_QUOTES.matcher(s); - while (m.find()) - { + while (m.find()) { final String one = m.group(1); // (>|^) final String two = m.group(2); // ([^<]+?) final String three = m.group(3); // (<|$) @@ -528,43 +468,34 @@ public final class HTMLFilter } m.appendTail(buf); return buf.toString(); - } - else - { + } else { return s; } } - private String checkEntity(final String preamble, final String term) - { + private String checkEntity(final String preamble, final String term) { return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble; } - private boolean isValidEntity(final String entity) - { + private boolean isValidEntity(final String entity) { return inArray(entity, vAllowedEntities); } - private static boolean inArray(final String s, final String[] array) - { - for (String item : array) - { - if (item != null && item.equals(s)) - { + private static boolean inArray(final String s, final String[] array) { + for (String item : array) { + if (item != null && item.equals(s)) { return true; } } return false; } - private boolean allowed(final String name) - { + private boolean allowed(final String name) { return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); } - private boolean allowedAttribute(final String name, final String paramName) - { + private boolean allowedAttribute(final String name, final String paramName) { return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); } } \ No newline at end of file diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java index dac60ad0..dcb8e4ce 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java @@ -6,46 +6,35 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import javax.servlet.ServletRequest; + import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 通用http工具封装 - * + * * @author ruoyi */ -public class HttpHelper -{ +public class HttpHelper { private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); - public static String getBodyString(ServletRequest request) - { + public static String getBodyString(ServletRequest request) { StringBuilder sb = new StringBuilder(); BufferedReader reader = null; - try (InputStream inputStream = request.getInputStream()) - { + try (InputStream inputStream = request.getInputStream()) { reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); String line = ""; - while ((line = reader.readLine()) != null) - { + while ((line = reader.readLine()) != null) { sb.append(line); } - } - catch (IOException e) - { + } catch (IOException e) { LOGGER.warn("getBodyString出现问题!"); - } - finally - { - if (reader != null) - { - try - { + } finally { + if (reader != null) { + try { reader.close(); - } - catch (IOException e) - { + } catch (IOException e) { LOGGER.error(ExceptionUtils.getMessage(e)); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 9aee92ef..8213c6f3 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -16,45 +16,42 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.constant.Constants; /** * 通用http发送方法 - * + * * @author ruoyi */ -public class HttpUtils -{ +public class HttpUtils { private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); /** * 向指定 URL 发送GET方法的请求 * - * @param url 发送请求的 URL + * @param url 发送请求的 URL * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 * @return 所代表远程资源的响应结果 */ - public static String sendGet(String url, String param) - { + public static String sendGet(String url, String param) { return sendGet(url, param, Constants.UTF8); } /** * 向指定 URL 发送GET方法的请求 * - * @param url 发送请求的 URL - * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 + * @param url 发送请求的 URL + * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 * @param contentType 编码类型 * @return 所代表远程资源的响应结果 */ - public static String sendGet(String url, String param, String contentType) - { + public static String sendGet(String url, String param, String contentType) { StringBuilder result = new StringBuilder(); BufferedReader in = null; - try - { + try { String urlNameString = url + "?" + param; log.info("sendGet - {}", urlNameString); URL realUrl = new URL(urlNameString); @@ -65,39 +62,24 @@ public class HttpUtils connection.connect(); in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); String line; - while ((line = in.readLine()) != null) - { + while ((line = in.readLine()) != null) { result.append(line); } log.info("recv - {}", result); - } - catch (ConnectException e) - { + } catch (ConnectException e) { log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); - } - catch (SocketTimeoutException e) - { + } catch (SocketTimeoutException e) { log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); - } - catch (IOException e) - { + } catch (IOException e) { log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); - } - catch (Exception e) - { + } catch (Exception e) { log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); - } - finally - { - try - { - if (in != null) - { + } finally { + try { + if (in != null) { in.close(); } - } - catch (Exception ex) - { + } catch (Exception ex) { log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); } } @@ -107,17 +89,15 @@ public class HttpUtils /** * 向指定 URL 发送POST方法的请求 * - * @param url 发送请求的 URL + * @param url 发送请求的 URL * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 * @return 所代表远程资源的响应结果 */ - public static String sendPost(String url, String param) - { + public static String sendPost(String url, String param) { PrintWriter out = null; BufferedReader in = null; StringBuilder result = new StringBuilder(); - try - { + try { String urlNameString = url; log.info("sendPost - {}", urlNameString); URL realUrl = new URL(urlNameString); @@ -134,58 +114,40 @@ public class HttpUtils out.flush(); in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); String line; - while ((line = in.readLine()) != null) - { + while ((line = in.readLine()) != null) { result.append(line); } log.info("recv - {}", result); - } - catch (ConnectException e) - { + } catch (ConnectException e) { log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); - } - catch (SocketTimeoutException e) - { + } catch (SocketTimeoutException e) { log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); - } - catch (IOException e) - { + } catch (IOException e) { log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); - } - catch (Exception e) - { + } catch (Exception e) { log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); - } - finally - { - try - { - if (out != null) - { + } finally { + try { + if (out != null) { out.close(); } - if (in != null) - { + if (in != null) { in.close(); } - } - catch (IOException ex) - { + } catch (IOException ex) { log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); } } return result.toString(); } - public static String sendSSLPost(String url, String param) - { + public static String sendSSLPost(String url, String param) { StringBuilder result = new StringBuilder(); String urlNameString = url + "?" + param; - try - { + try { log.info("sendSSLPost - {}", urlNameString); SSLContext sc = SSLContext.getInstance("SSL"); - sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom()); + sc.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom()); URL console = new URL(urlNameString); HttpsURLConnection conn = (HttpsURLConnection) console.openConnection(); conn.setRequestProperty("accept", "*/*"); @@ -202,60 +164,44 @@ public class HttpUtils InputStream is = conn.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String ret = ""; - while ((ret = br.readLine()) != null) - { - if (ret != null && !"".equals(ret.trim())) - { + while ((ret = br.readLine()) != null) { + if (ret != null && !"".equals(ret.trim())) { result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8")); } } log.info("recv - {}", result); conn.disconnect(); br.close(); - } - catch (ConnectException e) - { + } catch (ConnectException e) { log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e); - } - catch (SocketTimeoutException e) - { + } catch (SocketTimeoutException e) { log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e); - } - catch (IOException e) - { + } catch (IOException e) { log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e); - } - catch (Exception e) - { + } catch (Exception e) { log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e); } return result.toString(); } - private static class TrustAnyTrustManager implements X509TrustManager - { + private static class TrustAnyTrustManager implements X509TrustManager { @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) - { + public void checkClientTrusted(X509Certificate[] chain, String authType) { } @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) - { + public void checkServerTrusted(X509Certificate[] chain, String authType) { } @Override - public X509Certificate[] getAcceptedIssuers() - { - return new X509Certificate[] {}; + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[]{}; } } - private static class TrustAnyHostnameVerifier implements HostnameVerifier - { + private static class TrustAnyHostnameVerifier implements HostnameVerifier { @Override - public boolean verify(String hostname, SSLSession session) - { + public boolean verify(String hostname, SSLSession session) { return true; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java index 01c24fc7..ce391a88 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java @@ -10,11 +10,10 @@ import com.ruoyi.common.utils.http.HttpUtils; /** * 获取地址类 - * + * * @author ruoyi */ -public class AddressUtils -{ +public class AddressUtils { private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); // IP地址查询 @@ -23,21 +22,16 @@ public class AddressUtils // 未知地址 public static final String UNKNOWN = "XX XX"; - public static String getRealAddressByIP(String ip) - { + public static String getRealAddressByIP(String ip) { String address = UNKNOWN; // 内网不查询 - if (IpUtils.internalIp(ip)) - { + if (IpUtils.internalIp(ip)) { return "内网IP"; } - if (RuoYiConfig.isAddressEnabled()) - { - try - { + if (RuoYiConfig.isAddressEnabled()) { + try { String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); - if (StringUtils.isEmpty(rspStr)) - { + if (StringUtils.isEmpty(rspStr)) { log.error("获取地理位置异常 {}", ip); return UNKNOWN; } @@ -45,9 +39,7 @@ public class AddressUtils String region = obj.getString("pro"); String city = obj.getString("city"); return String.format("%s %s", region, city); - } - catch (Exception e) - { + } catch (Exception e) { log.error("获取地理位置异常 {}", ip); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java index 1b3f42ba..4fa9eb89 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java @@ -3,57 +3,47 @@ package com.ruoyi.common.utils.ip; import java.net.InetAddress; import java.net.UnknownHostException; import javax.servlet.http.HttpServletRequest; + import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.html.EscapeUtil; /** * 获取IP方法 - * + * * @author ruoyi */ -public class IpUtils -{ - public static String getIpAddr(HttpServletRequest request) - { - if (request == null) - { +public class IpUtils { + public static String getIpAddr(HttpServletRequest request) { + if (request == null) { return "unknown"; } String ip = request.getHeader("x-forwarded-for"); - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("X-Forwarded-For"); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("X-Real-IP"); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : EscapeUtil.clean(ip); } - public static boolean internalIp(String ip) - { + public static boolean internalIp(String ip) { byte[] addr = textToNumericFormatV4(ip); return internalIp(addr) || "127.0.0.1".equals(ip); } - private static boolean internalIp(byte[] addr) - { - if (StringUtils.isNull(addr) || addr.length < 2) - { + private static boolean internalIp(byte[] addr) { + if (StringUtils.isNull(addr) || addr.length < 2) { return true; } final byte b0 = addr[0]; @@ -67,18 +57,15 @@ public class IpUtils // 192.168.x.x/16 final byte SECTION_5 = (byte) 0xC0; final byte SECTION_6 = (byte) 0xA8; - switch (b0) - { + switch (b0) { case SECTION_1: return true; case SECTION_2: - if (b1 >= SECTION_3 && b1 <= SECTION_4) - { + if (b1 >= SECTION_3 && b1 <= SECTION_4) { return true; } case SECTION_5: - switch (b1) - { + switch (b1) { case SECTION_6: return true; } @@ -89,25 +76,21 @@ public class IpUtils /** * 将IPv4地址转换成字节 - * + * * @param text IPv4地址 * @return byte 字节 */ - public static byte[] textToNumericFormatV4(String text) - { - if (text.length() == 0) - { + public static byte[] textToNumericFormatV4(String text) { + if (text.length() == 0) { return null; } byte[] bytes = new byte[4]; String[] elements = text.split("\\.", -1); - try - { + try { long l; int i; - switch (elements.length) - { + switch (elements.length) { case 1: l = Long.parseLong(elements[0]); if ((l < 0L) || (l > 4294967295L)) { @@ -133,8 +116,7 @@ public class IpUtils bytes[3] = (byte) (int) (l & 0xFF); break; case 3: - for (i = 0; i < 2; ++i) - { + for (i = 0; i < 2; ++i) { l = Integer.parseInt(elements[i]); if ((l < 0L) || (l > 255L)) { return null; @@ -149,8 +131,7 @@ public class IpUtils bytes[3] = (byte) (int) (l & 0xFF); break; case 4: - for (i = 0; i < 4; ++i) - { + for (i = 0; i < 4; ++i) { l = Integer.parseInt(elements[i]); if ((l < 0L) || (l > 255L)) { return null; @@ -161,34 +142,24 @@ public class IpUtils default: return null; } - } - catch (NumberFormatException e) - { + } catch (NumberFormatException e) { return null; } return bytes; } - public static String getHostIp() - { - try - { + public static String getHostIp() { + try { return InetAddress.getLocalHost().getHostAddress(); - } - catch (UnknownHostException e) - { + } catch (UnknownHostException e) { } return "127.0.0.1"; } - public static String getHostName() - { - try - { + public static String getHostName() { + try { return InetAddress.getLocalHost().getHostName(); - } - catch (UnknownHostException e) - { + } catch (UnknownHostException e) { } return "未知"; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 495370b3..9bb72174 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; + import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; @@ -60,11 +61,10 @@ import com.ruoyi.common.utils.reflect.ReflectUtils; /** * Excel相关处理 - * + * * @author ruoyi */ -public class ExcelUtil -{ +public class ExcelUtil { private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); /** @@ -116,26 +116,23 @@ public class ExcelUtil * 统计列表 */ private Map statistics = new HashMap(); - + /** * 数字格式 */ private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00"); - + /** * 实体对象 */ public Class clazz; - public ExcelUtil(Class clazz) - { + public ExcelUtil(Class clazz) { this.clazz = clazz; } - public void init(List list, String sheetName, Type type) - { - if (list == null) - { + public void init(List list, String sheetName, Type type) { + if (list == null) { list = new ArrayList(); } this.list = list; @@ -147,62 +144,51 @@ public class ExcelUtil /** * 对excel表单默认第一个索引名转换成list - * + * * @param is 输入流 * @return 转换后集合 */ - public List importExcel(InputStream is) throws Exception - { + public List importExcel(InputStream is) throws Exception { return importExcel(StringUtils.EMPTY, is); } /** * 对excel表单指定表格索引名转换成list - * + * * @param sheetName 表格索引名 - * @param is 输入流 + * @param is 输入流 * @return 转换后集合 */ - public List importExcel(String sheetName, InputStream is) throws Exception - { + public List importExcel(String sheetName, InputStream is) throws Exception { this.type = Type.IMPORT; this.wb = WorkbookFactory.create(is); List list = new ArrayList(); Sheet sheet = null; - if (StringUtils.isNotEmpty(sheetName)) - { + if (StringUtils.isNotEmpty(sheetName)) { // 如果指定sheet名,则取指定sheet中的内容. sheet = wb.getSheet(sheetName); - } - else - { + } else { // 如果传入的sheet名不存在则默认指向第1个sheet. sheet = wb.getSheetAt(0); } - if (sheet == null) - { + if (sheet == null) { throw new IOException("文件sheet不存在"); } int rows = sheet.getPhysicalNumberOfRows(); - if (rows > 0) - { + if (rows > 0) { // 定义一个map用于存放excel列的序号和field. Map cellMap = new HashMap(); // 获取表头 Row heard = sheet.getRow(0); - for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) - { + for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) { Cell cell = heard.getCell(i); - if (StringUtils.isNotNull(cell)) - { + if (StringUtils.isNotNull(cell)) { String value = this.getCellValue(heard, i).toString(); cellMap.put(value, i); - } - else - { + } else { cellMap.put(null, i); } } @@ -210,28 +196,23 @@ public class ExcelUtil Field[] allFields = clazz.getDeclaredFields(); // 定义一个map用于存放列的序号和field. Map fieldsMap = new HashMap(); - for (int col = 0; col < allFields.length; col++) - { + for (int col = 0; col < allFields.length; col++) { Field field = allFields[col]; Excel attr = field.getAnnotation(Excel.class); - if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) - { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) { // 设置类的私有字段属性可访问. field.setAccessible(true); Integer column = cellMap.get(attr.name()); - if (column != null) - { + if (column != null) { fieldsMap.put(column, field); } } } - for (int i = 1; i < rows; i++) - { + for (int i = 1; i < rows; i++) { // 从第2行开始取数据,默认第一行是表头. Row row = sheet.getRow(i); T entity = null; - for (Map.Entry entry : fieldsMap.entrySet()) - { + for (Map.Entry entry : fieldsMap.entrySet()) { Object val = this.getCellValue(row, entry.getKey()); // 如果不存在实例则新建. @@ -240,75 +221,45 @@ public class ExcelUtil Field field = fieldsMap.get(entry.getKey()); // 取得类型,并根据对象类型设置值. Class fieldType = field.getType(); - if (String.class == fieldType) - { + if (String.class == fieldType) { String s = Convert.toStr(val); - if (StringUtils.endsWith(s, ".0")) - { + if (StringUtils.endsWith(s, ".0")) { val = StringUtils.substringBefore(s, ".0"); - } - else - { + } else { String dateFormat = field.getAnnotation(Excel.class).dateFormat(); - if (StringUtils.isNotEmpty(dateFormat)) - { + if (StringUtils.isNotEmpty(dateFormat)) { val = DateUtils.parseDateToStr(dateFormat, (Date) val); - } - else - { + } else { val = Convert.toStr(val); } } - } - else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) - { + } else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) { val = Convert.toInt(val); - } - else if (Long.TYPE == fieldType || Long.class == fieldType) - { + } else if (Long.TYPE == fieldType || Long.class == fieldType) { val = Convert.toLong(val); - } - else if (Double.TYPE == fieldType || Double.class == fieldType) - { + } else if (Double.TYPE == fieldType || Double.class == fieldType) { val = Convert.toDouble(val); - } - else if (Float.TYPE == fieldType || Float.class == fieldType) - { + } else if (Float.TYPE == fieldType || Float.class == fieldType) { val = Convert.toFloat(val); - } - else if (BigDecimal.class == fieldType) - { + } else if (BigDecimal.class == fieldType) { val = Convert.toBigDecimal(val); - } - else if (Date.class == fieldType) - { - if (val instanceof String) - { + } else if (Date.class == fieldType) { + if (val instanceof String) { val = DateUtils.parseDate(val); - } - else if (val instanceof Double) - { + } else if (val instanceof Double) { val = DateUtil.getJavaDate((Double) val); } - } - else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) - { + } else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) { val = Convert.toBool(val, false); } - if (StringUtils.isNotNull(fieldType)) - { + if (StringUtils.isNotNull(fieldType)) { Excel attr = field.getAnnotation(Excel.class); String propertyName = field.getName(); - if (StringUtils.isNotEmpty(attr.targetAttr())) - { + if (StringUtils.isNotEmpty(attr.targetAttr())) { propertyName = field.getName() + "." + attr.targetAttr(); - } - else if (StringUtils.isNotEmpty(attr.readConverterExp())) - { + } else if (StringUtils.isNotEmpty(attr.readConverterExp())) { val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator()); - } - else if (StringUtils.isNotEmpty(attr.dictType())) - { + } else if (StringUtils.isNotEmpty(attr.dictType())) { val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator()); } ReflectUtils.invokeSetter(entity, propertyName, val); @@ -322,56 +273,49 @@ public class ExcelUtil /** * 对list数据源将其里面的数据导入到excel表单 - * - * @param list 导出数据集合 + * + * @param list 导出数据集合 * @param sheetName 工作表的名称 * @return 结果 */ - public AjaxResult exportExcel(List list, String sheetName) - { + public AjaxResult exportExcel(List list, String sheetName) { this.init(list, sheetName, Type.EXPORT); return exportExcel(); } /** * 对list数据源将其里面的数据导入到excel表单 - * + * * @param sheetName 工作表的名称 * @return 结果 */ - public AjaxResult importTemplateExcel(String sheetName) - { + public AjaxResult importTemplateExcel(String sheetName) { this.init(null, sheetName, Type.IMPORT); return exportExcel(); } /** * 对list数据源将其里面的数据导入到excel表单 - * + * * @return 结果 */ - public AjaxResult exportExcel() - { + public AjaxResult exportExcel() { OutputStream out = null; - try - { + try { // 取出一共有多少个sheet. double sheetNo = Math.ceil(list.size() / sheetSize); - for (int index = 0; index <= sheetNo; index++) - { + for (int index = 0; index <= sheetNo; index++) { createSheet(sheetNo, index); // 产生一行 Row row = sheet.createRow(0); int column = 0; // 写入各个字段的列头名称 - for (Object[] os : fields) - { + for (Object[] os : fields) { Excel excel = (Excel) os[1]; this.createCell(excel, row, column++); } - if (Type.EXPORT.equals(type)) - { + if (Type.EXPORT.equals(type)) { fillExcelData(index, row); addStatisticsRow(); } @@ -380,33 +324,21 @@ public class ExcelUtil out = new FileOutputStream(getAbsoluteFile(filename)); wb.write(out); return AjaxResult.success(filename); - } - catch (Exception e) - { + } catch (Exception e) { log.error("导出Excel异常{}", e.getMessage()); throw new CustomException("导出Excel失败,请联系网站管理员!"); - } - finally - { - if (wb != null) - { - try - { + } finally { + if (wb != null) { + try { wb.close(); - } - catch (IOException e1) - { + } catch (IOException e1) { e1.printStackTrace(); } } - if (out != null) - { - try - { + if (out != null) { + try { out.close(); - } - catch (IOException e1) - { + } catch (IOException e1) { e1.printStackTrace(); } } @@ -415,22 +347,19 @@ public class ExcelUtil /** * 填充excel数据 - * + * * @param index 序号 - * @param row 单元格行 + * @param row 单元格行 */ - public void fillExcelData(int index, Row row) - { + public void fillExcelData(int index, Row row) { int startNo = index * sheetSize; int endNo = Math.min(startNo + sheetSize, list.size()); - for (int i = startNo; i < endNo; i++) - { + for (int i = startNo; i < endNo; i++) { row = sheet.createRow(i + 1 - startNo); // 得到导出对象. T vo = (T) list.get(i); int column = 0; - for (Object[] os : fields) - { + for (Object[] os : fields) { Field field = (Field) os[0]; Excel excel = (Excel) os[1]; // 设置实体类私有属性可访问 @@ -442,12 +371,11 @@ public class ExcelUtil /** * 创建表格样式 - * + * * @param wb 工作薄对象 * @return 样式列表 */ - private Map createStyles(Workbook wb) - { + private Map createStyles(Workbook wb) { // 写入各条记录,每条记录对应excel表中的一行 Map styles = new HashMap(); CellStyle style = wb.createCellStyle(); @@ -480,7 +408,7 @@ public class ExcelUtil headerFont.setColor(IndexedColors.WHITE.getIndex()); style.setFont(headerFont); styles.put("header", style); - + style = wb.createCellStyle(); style.setAlignment(HorizontalAlignment.CENTER); style.setVerticalAlignment(VerticalAlignment.CENTER); @@ -511,8 +439,7 @@ public class ExcelUtil /** * 创建单元格 */ - public Cell createCell(Excel attr, Row row, int column) - { + public Cell createCell(Excel attr, Row row, int column) { // 创建列 Cell cell = row.createCell(column); // 写入列信息 @@ -524,42 +451,33 @@ public class ExcelUtil /** * 设置单元格信息 - * + * * @param value 单元格值 - * @param attr 注解相关 - * @param cell 单元格信息 + * @param attr 注解相关 + * @param cell 单元格信息 */ - public void setCellVo(Object value, Excel attr, Cell cell) - { - if (ColumnType.STRING == attr.cellType()) - { + public void setCellVo(Object value, Excel attr, Cell cell) { + if (ColumnType.STRING == attr.cellType()) { cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); - } - else if (ColumnType.NUMERIC == attr.cellType()) - { + } else if (ColumnType.NUMERIC == attr.cellType()) { cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); - } - else if (ColumnType.IMAGE == attr.cellType()) - { + } else if (ColumnType.IMAGE == attr.cellType()) { ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1); String imagePath = Convert.toStr(value); - if (StringUtils.isNotEmpty(imagePath)) - { + if (StringUtils.isNotEmpty(imagePath)) { byte[] data = ImageUtils.getImage(imagePath); getDrawingPatriarch(cell.getSheet()).createPicture(anchor, cell.getSheet().getWorkbook().addPicture(data, getImageType(data))); } } } - + /** * 获取画布 */ - public static Drawing getDrawingPatriarch(Sheet sheet) - { - if (sheet.getDrawingPatriarch() == null) - { + public static Drawing getDrawingPatriarch(Sheet sheet) { + if (sheet.getDrawingPatriarch() == null) { sheet.createDrawingPatriarch(); } return sheet.getDrawingPatriarch(); @@ -568,15 +486,11 @@ public class ExcelUtil /** * 获取图片类型,设置图片插入类型 */ - public int getImageType(byte[] value) - { + public int getImageType(byte[] value) { String type = FileTypeUtils.getFileExtendName(value); - if ("JPG".equalsIgnoreCase(type)) - { + if ("JPG".equalsIgnoreCase(type)) { return Workbook.PICTURE_TYPE_JPEG; - } - else if ("PNG".equalsIgnoreCase(type)) - { + } else if ("PNG".equalsIgnoreCase(type)) { return Workbook.PICTURE_TYPE_PNG; } return Workbook.PICTURE_TYPE_JPEG; @@ -585,26 +499,20 @@ public class ExcelUtil /** * 创建表格样式 */ - public void setDataValidation(Excel attr, Row row, int column) - { - if (attr.name().indexOf("注:") >= 0) - { + public void setDataValidation(Excel attr, Row row, int column) { + if (attr.name().indexOf("注:") >= 0) { sheet.setColumnWidth(column, 6000); - } - else - { + } else { // 设置列宽 sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); } // 如果设置了提示信息则鼠标放上去提示. - if (StringUtils.isNotEmpty(attr.prompt())) - { + if (StringUtils.isNotEmpty(attr.prompt())) { // 这里默认设了2-101列提示. setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); } // 如果设置了combo属性则本列只能选择不能输入 - if (attr.combo().length > 0) - { + if (attr.combo().length > 0) { // 这里默认设了2-101列只能选择不能输入. setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); } @@ -613,16 +521,13 @@ public class ExcelUtil /** * 添加单元格 */ - public Cell addCell(Excel attr, Row row, T vo, Field field, int column) - { + public Cell addCell(Excel attr, Row row, T vo, Field field, int column) { Cell cell = null; - try - { + try { // 设置行高 row.setHeight(maxHeight); // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列. - if (attr.isExport()) - { + if (attr.isExport()) { // 创建cell cell = row.createCell(column); int align = attr.align().value(); @@ -634,32 +539,21 @@ public class ExcelUtil String readConverterExp = attr.readConverterExp(); String separator = attr.separator(); String dictType = attr.dictType(); - if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) - { + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) { cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); - } - else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) - { + } else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) { cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator)); - } - else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value)) - { + } else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value)) { cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator)); - } - else if (value instanceof BigDecimal && -1 != attr.scale()) - { + } else if (value instanceof BigDecimal && -1 != attr.scale()) { cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString()); - } - else - { + } else { // 设置列类型 setCellVo(value, attr, cell); } addStatisticsData(column, Convert.toStr(value), attr); } - } - catch (Exception e) - { + } catch (Exception e) { log.error("导出Excel失败{}", e); } return cell; @@ -667,18 +561,17 @@ public class ExcelUtil /** * 设置 POI XSSFSheet 单元格提示 - * - * @param sheet 表单 - * @param promptTitle 提示标题 + * + * @param sheet 表单 + * @param promptTitle 提示标题 * @param promptContent 提示内容 - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 + * @param firstRow 开始行 + * @param endRow 结束行 + * @param firstCol 开始列 + * @param endCol 结束列 */ public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, - int firstCol, int endCol) - { + int firstCol, int endCol) { DataValidationHelper helper = sheet.getDataValidationHelper(); DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); @@ -690,17 +583,16 @@ public class ExcelUtil /** * 设置某些列的值只能输入预制的数据,显示下拉框. - * - * @param sheet 要设置的sheet. + * + * @param sheet 要设置的sheet. * @param textlist 下拉框显示的内容 * @param firstRow 开始行 - * @param endRow 结束行 + * @param endRow 结束行 * @param firstCol 开始列 - * @param endCol 结束列 + * @param endCol 结束列 * @return 设置好的sheet. */ - public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) - { + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) { DataValidationHelper helper = sheet.getDataValidationHelper(); // 加载下拉列表内容 DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); @@ -709,13 +601,10 @@ public class ExcelUtil // 数据有效性对象 DataValidation dataValidation = helper.createValidation(constraint, regions); // 处理Excel兼容性问题 - if (dataValidation instanceof XSSFDataValidation) - { + if (dataValidation instanceof XSSFDataValidation) { dataValidation.setSuppressDropDownArrow(true); dataValidation.setShowErrorBox(true); - } - else - { + } else { dataValidation.setSuppressDropDownArrow(false); } @@ -724,34 +613,26 @@ public class ExcelUtil /** * 解析导出值 0=男,1=女,2=未知 - * + * * @param propertyValue 参数值 - * @param converterExp 翻译注解 - * @param separator 分隔符 + * @param converterExp 翻译注解 + * @param separator 分隔符 * @return 解析后值 */ - public static String convertByExp(String propertyValue, String converterExp, String separator) - { + public static String convertByExp(String propertyValue, String converterExp, String separator) { StringBuilder propertyString = new StringBuilder(); String[] convertSource = converterExp.split(","); - for (String item : convertSource) - { + for (String item : convertSource) { String[] itemArray = item.split("="); - if (StringUtils.containsAny(separator, propertyValue)) - { - for (String value : propertyValue.split(separator)) - { - if (itemArray[0].equals(value)) - { + if (StringUtils.containsAny(separator, propertyValue)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[0].equals(value)) { propertyString.append(itemArray[1] + separator); break; } } - } - else - { - if (itemArray[0].equals(propertyValue)) - { + } else { + if (itemArray[0].equals(propertyValue)) { return itemArray[1]; } } @@ -761,85 +642,69 @@ public class ExcelUtil /** * 反向解析值 男=0,女=1,未知=2 - * + * * @param propertyValue 参数值 - * @param converterExp 翻译注解 - * @param separator 分隔符 + * @param converterExp 翻译注解 + * @param separator 分隔符 * @return 解析后值 */ - public static String reverseByExp(String propertyValue, String converterExp, String separator) - { + public static String reverseByExp(String propertyValue, String converterExp, String separator) { StringBuilder propertyString = new StringBuilder(); String[] convertSource = converterExp.split(","); - for (String item : convertSource) - { + for (String item : convertSource) { String[] itemArray = item.split("="); - if (StringUtils.containsAny(separator, propertyValue)) - { - for (String value : propertyValue.split(separator)) - { - if (itemArray[1].equals(value)) - { + if (StringUtils.containsAny(separator, propertyValue)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[1].equals(value)) { propertyString.append(itemArray[0] + separator); break; } } - } - else - { - if (itemArray[1].equals(propertyValue)) - { + } else { + if (itemArray[1].equals(propertyValue)) { return itemArray[0]; } } } return StringUtils.stripEnd(propertyString.toString(), separator); } - + /** * 解析字典值 - * + * * @param dictValue 字典值 - * @param dictType 字典类型 + * @param dictType 字典类型 * @param separator 分隔符 * @return 字典标签 */ - public static String convertDictByExp(String dictValue, String dictType, String separator) - { + public static String convertDictByExp(String dictValue, String dictType, String separator) { return DictUtils.getDictLabel(dictType, dictValue, separator); } /** * 反向解析值字典值 - * + * * @param dictLabel 字典标签 - * @param dictType 字典类型 + * @param dictType 字典类型 * @param separator 分隔符 * @return 字典值 */ - public static String reverseDictByExp(String dictLabel, String dictType, String separator) - { + public static String reverseDictByExp(String dictLabel, String dictType, String separator) { return DictUtils.getDictValue(dictType, dictLabel, separator); } - + /** * 合计统计信息 */ - private void addStatisticsData(Integer index, String text, Excel entity) - { - if (entity != null && entity.isStatistics()) - { + private void addStatisticsData(Integer index, String text, Excel entity) { + if (entity != null && entity.isStatistics()) { Double temp = 0D; - if (!statistics.containsKey(index)) - { + if (!statistics.containsKey(index)) { statistics.put(index, temp); } - try - { + try { temp = Double.valueOf(text); - } - catch (NumberFormatException e) - { + } catch (NumberFormatException e) { } statistics.put(index, statistics.get(index) + temp); } @@ -848,19 +713,16 @@ public class ExcelUtil /** * 创建统计行 */ - public void addStatisticsRow() - { - if (statistics.size() > 0) - { + public void addStatisticsRow() { + if (statistics.size() > 0) { Cell cell = null; Row row = sheet.createRow(sheet.getLastRowNum() + 1); Set keys = statistics.keySet(); cell = row.createCell(0); cell.setCellStyle(styles.get("total")); cell.setCellValue("合计"); - - for (Integer key : keys) - { + + for (Integer key : keys) { cell = row.createCell(key); cell.setCellStyle(styles.get("total")); cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key))); @@ -872,23 +734,20 @@ public class ExcelUtil /** * 编码文件名 */ - public String encodingFilename(String filename) - { + public String encodingFilename(String filename) { filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; return filename; } /** * 获取下载路径 - * + * * @param filename 文件名称 */ - public String getAbsoluteFile(String filename) - { + public String getAbsoluteFile(String filename) { String downloadPath = RuoYiConfig.getDownloadPath() + filename; File desc = new File(downloadPath); - if (!desc.getParentFile().exists()) - { + if (!desc.getParentFile().exists()) { desc.getParentFile().mkdirs(); } return downloadPath; @@ -896,29 +755,23 @@ public class ExcelUtil /** * 获取bean中的属性值 - * - * @param vo 实体对象 + * + * @param vo 实体对象 * @param field 字段 * @param excel 注解 * @return 最终的属性值 * @throws Exception */ - private Object getTargetValue(T vo, Field field, Excel excel) throws Exception - { + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception { Object o = field.get(vo); - if (StringUtils.isNotEmpty(excel.targetAttr())) - { + if (StringUtils.isNotEmpty(excel.targetAttr())) { String target = excel.targetAttr(); - if (target.indexOf(".") > -1) - { + if (target.indexOf(".") > -1) { String[] targets = target.split("[.]"); - for (String name : targets) - { + for (String name : targets) { o = getValue(o, name); } - } - else - { + } else { o = getValue(o, target); } } @@ -927,16 +780,14 @@ public class ExcelUtil /** * 以类的属性的get方法方法形式获取值 - * + * * @param o * @param name * @return value * @throws Exception */ - private Object getValue(Object o, String name) throws Exception - { - if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name)) - { + private Object getValue(Object o, String name) throws Exception { + if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name)) { Class clazz = o.getClass(); Field field = clazz.getDeclaredField(name); field.setAccessible(true); @@ -948,27 +799,22 @@ public class ExcelUtil /** * 得到所有定义字段 */ - private void createExcelField() - { + private void createExcelField() { this.fields = new ArrayList(); List tempFields = new ArrayList<>(); tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); - for (Field field : tempFields) - { + for (Field field : tempFields) { // 单注解 - if (field.isAnnotationPresent(Excel.class)) - { + if (field.isAnnotationPresent(Excel.class)) { putToField(field, field.getAnnotation(Excel.class)); } // 多注解 - if (field.isAnnotationPresent(Excels.class)) - { + if (field.isAnnotationPresent(Excels.class)) { Excels attrs = field.getAnnotation(Excels.class); Excel[] excels = attrs.value(); - for (Excel excel : excels) - { + for (Excel excel : excels) { putToField(field, excel); } } @@ -976,15 +822,13 @@ public class ExcelUtil this.fields = this.fields.stream().sorted(Comparator.comparing(objects -> ((Excel) objects[1]).sort())).collect(Collectors.toList()); this.maxHeight = getRowHeight(); } - + /** * 根据注解获取最大行高 */ - public short getRowHeight() - { + public short getRowHeight() { double maxHeight = 0; - for (Object[] os : this.fields) - { + for (Object[] os : this.fields) { Excel excel = (Excel) os[1]; maxHeight = maxHeight > excel.height() ? maxHeight : excel.height(); } @@ -994,98 +838,72 @@ public class ExcelUtil /** * 放到字段集合中 */ - private void putToField(Field field, Excel attr) - { - if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) - { - this.fields.add(new Object[] { field, attr }); + private void putToField(Field field, Excel attr) { + if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) { + this.fields.add(new Object[]{field, attr}); } } /** * 创建一个工作簿 */ - public void createWorkbook() - { + public void createWorkbook() { this.wb = new SXSSFWorkbook(500); } /** * 创建工作表 - * + * * @param sheetNo sheet数量 - * @param index 序号 + * @param index 序号 */ - public void createSheet(double sheetNo, int index) - { + public void createSheet(double sheetNo, int index) { this.sheet = wb.createSheet(); this.styles = createStyles(wb); // 设置工作表的名称. - if (sheetNo == 0) - { + if (sheetNo == 0) { wb.setSheetName(index, sheetName); - } - else - { + } else { wb.setSheetName(index, sheetName + index); } } /** * 获取单元格值 - * - * @param row 获取的行 + * + * @param row 获取的行 * @param column 获取单元格列号 * @return 单元格值 */ - public Object getCellValue(Row row, int column) - { - if (row == null) - { + public Object getCellValue(Row row, int column) { + if (row == null) { return row; } Object val = ""; - try - { + try { Cell cell = row.getCell(column); - if (StringUtils.isNotNull(cell)) - { - if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA) - { + if (StringUtils.isNotNull(cell)) { + if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA) { val = cell.getNumericCellValue(); - if (DateUtil.isCellDateFormatted(cell)) - { + if (DateUtil.isCellDateFormatted(cell)) { val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换 - } - else - { - if ((Double) val % 1 != 0) - { + } else { + if ((Double) val % 1 != 0) { val = new BigDecimal(val.toString()); - } - else - { + } else { val = new DecimalFormat("0").format(val); } } - } - else if (cell.getCellType() == CellType.STRING) - { + } else if (cell.getCellType() == CellType.STRING) { val = cell.getStringCellValue(); - } - else if (cell.getCellType() == CellType.BOOLEAN) - { + } else if (cell.getCellType() == CellType.BOOLEAN) { val = cell.getBooleanCellValue(); - } - else if (cell.getCellType() == CellType.ERROR) - { + } else if (cell.getCellType() == CellType.ERROR) { val = cell.getErrorCellValue(); } } - } - catch (Exception e) - { + } catch (Exception e) { return val; } return val; diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java index b19953e0..da362e3b 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java @@ -7,6 +7,7 @@ import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Date; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.poi.ss.usermodel.DateUtil; @@ -17,12 +18,11 @@ import com.ruoyi.common.utils.DateUtils; /** * 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数. - * + * * @author ruoyi */ @SuppressWarnings("rawtypes") -public class ReflectUtils -{ +public class ReflectUtils { private static final String SETTER_PREFIX = "set"; private static final String GETTER_PREFIX = "get"; @@ -36,13 +36,11 @@ public class ReflectUtils * 支持多级,如:对象名.对象名.方法 */ @SuppressWarnings("unchecked") - public static E invokeGetter(Object obj, String propertyName) - { + public static E invokeGetter(Object obj, String propertyName) { Object object = obj; - for (String name : StringUtils.split(propertyName, ".")) - { + for (String name : StringUtils.split(propertyName, ".")) { String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); - object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); + object = invokeMethod(object, getterMethodName, new Class[]{}, new Object[]{}); } return (E) object; } @@ -51,21 +49,16 @@ public class ReflectUtils * 调用Setter方法, 仅匹配方法名。 * 支持多级,如:对象名.对象名.方法 */ - public static void invokeSetter(Object obj, String propertyName, E value) - { + public static void invokeSetter(Object obj, String propertyName, E value) { Object object = obj; String[] names = StringUtils.split(propertyName, "."); - for (int i = 0; i < names.length; i++) - { - if (i < names.length - 1) - { + for (int i = 0; i < names.length; i++) { + if (i < names.length - 1) { String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); - object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); - } - else - { + object = invokeMethod(object, getterMethodName, new Class[]{}, new Object[]{}); + } else { String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); - invokeMethodByName(object, setterMethodName, new Object[] { value }); + invokeMethodByName(object, setterMethodName, new Object[]{value}); } } } @@ -74,21 +67,16 @@ public class ReflectUtils * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数. */ @SuppressWarnings("unchecked") - public static E getFieldValue(final Object obj, final String fieldName) - { + public static E getFieldValue(final Object obj, final String fieldName) { Field field = getAccessibleField(obj, fieldName); - if (field == null) - { + if (field == null) { logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); return null; } E result = null; - try - { + try { result = (E) field.get(obj); - } - catch (IllegalAccessException e) - { + } catch (IllegalAccessException e) { logger.error("不可能抛出的异常{}", e.getMessage()); } return result; @@ -97,21 +85,16 @@ public class ReflectUtils /** * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数. */ - public static void setFieldValue(final Object obj, final String fieldName, final E value) - { + public static void setFieldValue(final Object obj, final String fieldName, final E value) { Field field = getAccessibleField(obj, fieldName); - if (field == null) - { + if (field == null) { // throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); return; } - try - { + try { field.set(obj, value); - } - catch (IllegalAccessException e) - { + } catch (IllegalAccessException e) { logger.error("不可能抛出的异常: {}", e.getMessage()); } } @@ -123,24 +106,18 @@ public class ReflectUtils */ @SuppressWarnings("unchecked") public static E invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, - final Object[] args) - { - if (obj == null || methodName == null) - { + final Object[] args) { + if (obj == null || methodName == null) { return null; } Method method = getAccessibleMethod(obj, methodName, parameterTypes); - if (method == null) - { + if (method == null) { logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); return null; } - try - { + try { return (E) method.invoke(obj, args); - } - catch (Exception e) - { + } catch (Exception e) { String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; throw convertReflectionExceptionToUnchecked(msg, e); } @@ -152,68 +129,44 @@ public class ReflectUtils * 只匹配函数名,如果有多个同名函数调用第一个。 */ @SuppressWarnings("unchecked") - public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) - { + public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) { Method method = getAccessibleMethodByName(obj, methodName, args.length); - if (method == null) - { + if (method == null) { // 如果为空不报错,直接返回空。 logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); return null; } - try - { + try { // 类型转换(将参数数据类型转换为目标方法参数类型) Class[] cs = method.getParameterTypes(); - for (int i = 0; i < cs.length; i++) - { - if (args[i] != null && !args[i].getClass().equals(cs[i])) - { - if (cs[i] == String.class) - { + for (int i = 0; i < cs.length; i++) { + if (args[i] != null && !args[i].getClass().equals(cs[i])) { + if (cs[i] == String.class) { args[i] = Convert.toStr(args[i]); - if (StringUtils.endsWith((String) args[i], ".0")) - { + if (StringUtils.endsWith((String) args[i], ".0")) { args[i] = StringUtils.substringBefore((String) args[i], ".0"); } - } - else if (cs[i] == Integer.class) - { + } else if (cs[i] == Integer.class) { args[i] = Convert.toInt(args[i]); - } - else if (cs[i] == Long.class) - { + } else if (cs[i] == Long.class) { args[i] = Convert.toLong(args[i]); - } - else if (cs[i] == Double.class) - { + } else if (cs[i] == Double.class) { args[i] = Convert.toDouble(args[i]); - } - else if (cs[i] == Float.class) - { + } else if (cs[i] == Float.class) { args[i] = Convert.toFloat(args[i]); - } - else if (cs[i] == Date.class) - { - if (args[i] instanceof String) - { + } else if (cs[i] == Date.class) { + if (args[i] instanceof String) { args[i] = DateUtils.parseDate(args[i]); - } - else - { + } else { args[i] = DateUtil.getJavaDate((Double) args[i]); } - } - else if (cs[i] == boolean.class || cs[i] == Boolean.class) - { + } else if (cs[i] == boolean.class || cs[i] == Boolean.class) { args[i] = Convert.toBool(args[i]); } } } return (E) method.invoke(obj, args); - } - catch (Exception e) - { + } catch (Exception e) { String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; throw convertReflectionExceptionToUnchecked(msg, e); } @@ -223,24 +176,18 @@ public class ReflectUtils * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问. * 如向上转型到Object仍无法找到, 返回null. */ - public static Field getAccessibleField(final Object obj, final String fieldName) - { + public static Field getAccessibleField(final Object obj, final String fieldName) { // 为空不报错。直接返回 null - if (obj == null) - { + if (obj == null) { return null; } Validate.notBlank(fieldName, "fieldName can't be blank"); - for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) - { - try - { + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { + try { Field field = superClass.getDeclaredField(fieldName); makeAccessible(field); return field; - } - catch (NoSuchFieldException e) - { + } catch (NoSuchFieldException e) { continue; } } @@ -254,24 +201,18 @@ public class ReflectUtils * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) */ public static Method getAccessibleMethod(final Object obj, final String methodName, - final Class... parameterTypes) - { + final Class... parameterTypes) { // 为空不报错。直接返回 null - if (obj == null) - { + if (obj == null) { return null; } Validate.notBlank(methodName, "methodName can't be blank"); - for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) - { - try - { + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { + try { Method method = searchType.getDeclaredMethod(methodName, parameterTypes); makeAccessible(method); return method; - } - catch (NoSuchMethodException e) - { + } catch (NoSuchMethodException e) { continue; } } @@ -284,21 +225,16 @@ public class ReflectUtils * 只匹配函数名。 * 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args) */ - public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) - { + public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) { // 为空不报错。直接返回 null - if (obj == null) - { + if (obj == null) { return null; } Validate.notBlank(methodName, "methodName can't be blank"); - for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) - { + for (Class searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] methods = searchType.getDeclaredMethods(); - for (Method method : methods) - { - if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) - { + for (Method method : methods) { + if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) { makeAccessible(method); return method; } @@ -310,11 +246,9 @@ public class ReflectUtils /** * 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 */ - public static void makeAccessible(Method method) - { + public static void makeAccessible(Method method) { if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) - && !method.isAccessible()) - { + && !method.isAccessible()) { method.setAccessible(true); } } @@ -322,11 +256,9 @@ public class ReflectUtils /** * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 */ - public static void makeAccessible(Field field) - { + public static void makeAccessible(Field field) { if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) - || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) - { + || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) { field.setAccessible(true); } } @@ -336,8 +268,7 @@ public class ReflectUtils * 如无法找到, 返回Object.class. */ @SuppressWarnings("unchecked") - public static Class getClassGenricType(final Class clazz) - { + public static Class getClassGenricType(final Class clazz) { return getClassGenricType(clazz, 0); } @@ -345,26 +276,22 @@ public class ReflectUtils * 通过反射, 获得Class定义中声明的父类的泛型参数的类型. * 如无法找到, 返回Object.class. */ - public static Class getClassGenricType(final Class clazz, final int index) - { + public static Class getClassGenricType(final Class clazz, final int index) { Type genType = clazz.getGenericSuperclass(); - if (!(genType instanceof ParameterizedType)) - { + if (!(genType instanceof ParameterizedType)) { logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); return Object.class; } Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); - if (index >= params.length || index < 0) - { + if (index >= params.length || index < 0) { logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + params.length); return Object.class; } - if (!(params[index] instanceof Class)) - { + if (!(params[index] instanceof Class)) { logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); return Object.class; } @@ -372,18 +299,14 @@ public class ReflectUtils return (Class) params[index]; } - public static Class getUserClass(Object instance) - { - if (instance == null) - { + public static Class getUserClass(Object instance) { + if (instance == null) { throw new RuntimeException("Instance must not be null"); } Class clazz = instance.getClass(); - if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) - { + if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) { Class superClass = clazz.getSuperclass(); - if (superClass != null && !Object.class.equals(superClass)) - { + if (superClass != null && !Object.class.equals(superClass)) { return superClass; } } @@ -394,15 +317,11 @@ public class ReflectUtils /** * 将反射时的checked exception转换为unchecked exception. */ - public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) - { + public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) { if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException - || e instanceof NoSuchMethodException) - { + || e instanceof NoSuchMethodException) { return new IllegalArgumentException(msg, e); - } - else if (e instanceof InvocationTargetException) - { + } else if (e instanceof InvocationTargetException) { return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException()); } return new RuntimeException(msg, e); diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java index ca1cd924..55659bcf 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java @@ -2,75 +2,63 @@ package com.ruoyi.common.utils.sign; /** * Base64工具类 - * + * * @author ruoyi */ -public final class Base64 -{ - static private final int BASELENGTH = 128; - static private final int LOOKUPLENGTH = 64; - static private final int TWENTYFOURBITGROUP = 24; - static private final int EIGHTBIT = 8; - static private final int SIXTEENBIT = 16; - static private final int FOURBYTE = 4; - static private final int SIGN = -128; - static private final char PAD = '='; - static final private byte[] base64Alphabet = new byte[BASELENGTH]; - static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; +public final class Base64 { + static private final int BASELENGTH = 128; + static private final int LOOKUPLENGTH = 64; + static private final int TWENTYFOURBITGROUP = 24; + static private final int EIGHTBIT = 8; + static private final int SIXTEENBIT = 16; + static private final int FOURBYTE = 4; + static private final int SIGN = -128; + static private final char PAD = '='; + static final private byte[] base64Alphabet = new byte[BASELENGTH]; + static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH]; - static - { - for (int i = 0; i < BASELENGTH; ++i) - { + static { + for (int i = 0; i < BASELENGTH; ++i) { base64Alphabet[i] = -1; } - for (int i = 'Z'; i >= 'A'; i--) - { + for (int i = 'Z'; i >= 'A'; i--) { base64Alphabet[i] = (byte) (i - 'A'); } - for (int i = 'z'; i >= 'a'; i--) - { + for (int i = 'z'; i >= 'a'; i--) { base64Alphabet[i] = (byte) (i - 'a' + 26); } - for (int i = '9'; i >= '0'; i--) - { + for (int i = '9'; i >= '0'; i--) { base64Alphabet[i] = (byte) (i - '0' + 52); } base64Alphabet['+'] = 62; base64Alphabet['/'] = 63; - for (int i = 0; i <= 25; i++) - { + for (int i = 0; i <= 25; i++) { lookUpBase64Alphabet[i] = (char) ('A' + i); } - for (int i = 26, j = 0; i <= 51; i++, j++) - { + for (int i = 26, j = 0; i <= 51; i++, j++) { lookUpBase64Alphabet[i] = (char) ('a' + j); } - for (int i = 52, j = 0; i <= 61; i++, j++) - { + for (int i = 52, j = 0; i <= 61; i++, j++) { lookUpBase64Alphabet[i] = (char) ('0' + j); } lookUpBase64Alphabet[62] = (char) '+'; lookUpBase64Alphabet[63] = (char) '/'; } - private static boolean isWhiteSpace(char octect) - { + private static boolean isWhiteSpace(char octect) { return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9); } - private static boolean isPad(char octect) - { + private static boolean isPad(char octect) { return (octect == PAD); } - private static boolean isData(char octect) - { + private static boolean isData(char octect) { return (octect < BASELENGTH && base64Alphabet[octect] != -1); } @@ -80,16 +68,13 @@ public final class Base64 * @param binaryData Array containing binaryData * @return Encoded Base64 array */ - public static String encode(byte[] binaryData) - { - if (binaryData == null) - { + public static String encode(byte[] binaryData) { + if (binaryData == null) { return null; } int lengthDataBits = binaryData.length * EIGHTBIT; - if (lengthDataBits == 0) - { + if (lengthDataBits == 0) { return ""; } @@ -105,8 +90,7 @@ public final class Base64 int encodedIndex = 0; int dataIndex = 0; - for (int i = 0; i < numberTriplets; i++) - { + for (int i = 0; i < numberTriplets; i++) { b1 = binaryData[dataIndex++]; b2 = binaryData[dataIndex++]; b3 = binaryData[dataIndex++]; @@ -125,8 +109,7 @@ public final class Base64 } // form integral number of 6-bit groups - if (fewerThan24bits == EIGHTBIT) - { + if (fewerThan24bits == EIGHTBIT) { b1 = binaryData[dataIndex]; k = (byte) (b1 & 0x03); byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0); @@ -134,9 +117,7 @@ public final class Base64 encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4]; encodedData[encodedIndex++] = PAD; encodedData[encodedIndex++] = PAD; - } - else if (fewerThan24bits == SIXTEENBIT) - { + } else if (fewerThan24bits == SIXTEENBIT) { b1 = binaryData[dataIndex]; b2 = binaryData[dataIndex + 1]; l = (byte) (b2 & 0x0f); @@ -159,10 +140,8 @@ public final class Base64 * @param encoded string containing Base64 data * @return Array containind decoded data. */ - public static byte[] decode(String encoded) - { - if (encoded == null) - { + public static byte[] decode(String encoded) { + if (encoded == null) { return null; } @@ -170,15 +149,13 @@ public final class Base64 // remove white spaces int len = removeWhiteSpace(base64Data); - if (len % FOURBYTE != 0) - { + if (len % FOURBYTE != 0) { return null;// should be divisible by four } int numberQuadruple = (len / FOURBYTE); - if (numberQuadruple == 0) - { + if (numberQuadruple == 0) { return new byte[0]; } @@ -191,12 +168,10 @@ public final class Base64 int dataIndex = 0; decodedData = new byte[(numberQuadruple) * 3]; - for (; i < numberQuadruple - 1; i++) - { + for (; i < numberQuadruple - 1; i++) { if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])) - || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) - { + || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) { return null; } // if found "no data" just return null @@ -210,8 +185,7 @@ public final class Base64 decodedData[encodedIndex++] = (byte) (b3 << 6 | b4); } - if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) - { + if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) { return null;// if found "no data" just return null } @@ -220,10 +194,8 @@ public final class Base64 d3 = base64Data[dataIndex++]; d4 = base64Data[dataIndex++]; - if (!isData((d3)) || !isData((d4))) - {// Check if they are PAD characters - if (isPad(d3) && isPad(d4)) - { + if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters + if (isPad(d3) && isPad(d4)) { if ((b2 & 0xf) != 0)// last 4 bits should be zero { return null; @@ -232,9 +204,7 @@ public final class Base64 System.arraycopy(decodedData, 0, tmp, 0, i * 3); tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4); return tmp; - } - else if (!isPad(d3) && isPad(d4)) - { + } else if (!isPad(d3) && isPad(d4)) { b3 = base64Alphabet[d3]; if ((b3 & 0x3) != 0)// last 2 bits should be zero { @@ -245,14 +215,10 @@ public final class Base64 tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)); return tmp; - } - else - { + } else { return null; } - } - else - { // No PAD e.g 3cQl + } else { // No PAD e.g 3cQl b3 = base64Alphabet[d3]; b4 = base64Alphabet[d4]; decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4); @@ -269,20 +235,16 @@ public final class Base64 * @param data the byte array of base64 data (with WS) * @return the new length */ - private static int removeWhiteSpace(char[] data) - { - if (data == null) - { + private static int removeWhiteSpace(char[] data) { + if (data == null) { return 0; } // count characters that's not whitespace int newSize = 0; int len = data.length; - for (int i = 0; i < len; i++) - { - if (!isWhiteSpace(data[i])) - { + for (int i = 0; i < len; i++) { + if (!isWhiteSpace(data[i])) { data[newSize++] = data[i]; } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java index de77ee82..70bdcb0d 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java @@ -1,49 +1,41 @@ package com.ruoyi.common.utils.sign; import java.security.MessageDigest; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Md5加密方法 - * + * * @author ruoyi */ -public class Md5Utils -{ +public class Md5Utils { private static final Logger log = LoggerFactory.getLogger(Md5Utils.class); - private static byte[] md5(String s) - { + private static byte[] md5(String s) { MessageDigest algorithm; - try - { + try { algorithm = MessageDigest.getInstance("MD5"); algorithm.reset(); algorithm.update(s.getBytes("UTF-8")); byte[] messageDigest = algorithm.digest(); return messageDigest; - } - catch (Exception e) - { + } catch (Exception e) { log.error("MD5 Error...", e); } return null; } - private static final String toHex(byte hash[]) - { - if (hash == null) - { + private static final String toHex(byte hash[]) { + if (hash == null) { return null; } StringBuffer buf = new StringBuffer(hash.length * 2); int i; - for (i = 0; i < hash.length; i++) - { - if ((hash[i] & 0xff) < 0x10) - { + for (i = 0; i < hash.length; i++) { + if ((hash[i] & 0xff) < 0x10) { buf.append("0"); } buf.append(Long.toString(hash[i] & 0xff, 16)); @@ -51,14 +43,10 @@ public class Md5Utils return buf.toString(); } - public static String hash(String s) - { - try - { + public static String hash(String s) { + try { return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); - } - catch (Exception e) - { + } catch (Exception e) { log.error("not supported charset...{}", e); return s; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java index 9993b98f..8fd4951b 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java @@ -12,26 +12,25 @@ import com.ruoyi.common.utils.StringUtils; /** * spring工具类 方便在非spring管理环境中获取bean - * + * * @author ruoyi */ @Component -public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware -{ - /** Spring应用上下文环境 */ +public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware { + /** + * Spring应用上下文环境 + */ private static ConfigurableListableBeanFactory beanFactory; private static ApplicationContext applicationContext; @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException - { + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringUtils.beanFactory = beanFactory; } @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException - { + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { SpringUtils.applicationContext = applicationContext; } @@ -41,11 +40,9 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param name * @return Object 一个以所给名字注册的bean的实例 * @throws org.springframework.beans.BeansException - * */ @SuppressWarnings("unchecked") - public static T getBean(String name) throws BeansException - { + public static T getBean(String name) throws BeansException { return (T) beanFactory.getBean(name); } @@ -55,10 +52,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param clz * @return * @throws org.springframework.beans.BeansException - * */ - public static T getBean(Class clz) throws BeansException - { + public static T getBean(Class clz) throws BeansException { T result = (T) beanFactory.getBean(clz); return result; } @@ -69,8 +64,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param name * @return boolean */ - public static boolean containsBean(String name) - { + public static boolean containsBean(String name) { return beanFactory.containsBean(name); } @@ -80,10 +74,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param name * @return boolean * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * */ - public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException - { + public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { return beanFactory.isSingleton(name); } @@ -91,10 +83,8 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param name * @return Class 注册对象的类型 * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * */ - public static Class getType(String name) throws NoSuchBeanDefinitionException - { + public static Class getType(String name) throws NoSuchBeanDefinitionException { return beanFactory.getType(name); } @@ -104,22 +94,19 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @param name * @return * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * */ - public static String[] getAliases(String name) throws NoSuchBeanDefinitionException - { + public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { return beanFactory.getAliases(name); } /** * 获取aop代理对象 - * + * * @param invoker * @return */ @SuppressWarnings("unchecked") - public static T getAopProxy(T invoker) - { + public static T getAopProxy(T invoker) { return (T) AopContext.currentProxy(); } @@ -128,8 +115,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * * @return 当前的环境配置 */ - public static String[] getActiveProfiles() - { + public static String[] getActiveProfiles() { return applicationContext.getEnvironment().getActiveProfiles(); } @@ -138,8 +124,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * * @return 当前的环境配置 */ - public static String getActiveProfile() - { + public static String getActiveProfile() { final String[] activeProfiles = getActiveProfiles(); return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java index 0b06dd96..2e6d36a5 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java @@ -5,11 +5,10 @@ import com.ruoyi.common.utils.StringUtils; /** * sql操作工具类 - * + * * @author ruoyi */ -public class SqlUtil -{ +public class SqlUtil { /** * 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序) */ @@ -18,10 +17,8 @@ public class SqlUtil /** * 检查字符,防止注入绕过 */ - public static String escapeOrderBySql(String value) - { - if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) - { + public static String escapeOrderBySql(String value) { + if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { throw new BaseException("参数不符合规范,不能进行查询"); } return value; @@ -30,8 +27,7 @@ public class SqlUtil /** * 验证 order by 语法是否符合规范 */ - public static boolean isValidOrderBySql(String value) - { + public static boolean isValidOrderBySql(String value) { return value.matches(SQL_PATTERN); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java index 0d14f57d..11ef56e4 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java @@ -4,48 +4,43 @@ import com.ruoyi.common.utils.uuid.UUID; /** * ID生成器工具类 - * + * * @author ruoyi */ -public class IdUtils -{ +public class IdUtils { /** * 获取随机UUID - * + * * @return 随机UUID */ - public static String randomUUID() - { + public static String randomUUID() { return UUID.randomUUID().toString(); } /** * 简化的UUID,去掉了横线 - * + * * @return 简化的UUID,去掉了横线 */ - public static String simpleUUID() - { + public static String simpleUUID() { return UUID.randomUUID().toString(true); } /** * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID - * + * * @return 随机UUID */ - public static String fastUUID() - { + public static String fastUUID() { return UUID.fastUUID().toString(); } /** * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID - * + * * @return 简化的UUID,去掉了横线 */ - public static String fastSimpleUUID() - { + public static String fastSimpleUUID() { return UUID.fastUUID().toString(true); } } diff --git a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java index 062d6336..d87e4988 100644 --- a/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java +++ b/spring-boot/ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java @@ -5,6 +5,7 @@ import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; + import com.ruoyi.common.exception.UtilException; /** @@ -12,41 +13,39 @@ import com.ruoyi.common.exception.UtilException; * * @author ruoyi */ -public final class UUID implements java.io.Serializable, Comparable -{ +public final class UUID implements java.io.Serializable, Comparable { private static final long serialVersionUID = -1185015143654744140L; /** * SecureRandom 的单例 - * */ - private static class Holder - { + private static class Holder { static final SecureRandom numberGenerator = getSecureRandom(); } - /** 此UUID的最高64有效位 */ + /** + * 此UUID的最高64有效位 + */ private final long mostSigBits; - /** 此UUID的最低64有效位 */ + /** + * 此UUID的最低64有效位 + */ private final long leastSigBits; /** * 私有构造 - * + * * @param data 数据 */ - private UUID(byte[] data) - { + private UUID(byte[] data) { long msb = 0; long lsb = 0; assert data.length == 16 : "data must be 16 bytes in length"; - for (int i = 0; i < 8; i++) - { + for (int i = 0; i < 8; i++) { msb = (msb << 8) | (data[i] & 0xff); } - for (int i = 8; i < 16; i++) - { + for (int i = 8; i < 16; i++) { lsb = (lsb << 8) | (data[i] & 0xff); } this.mostSigBits = msb; @@ -56,43 +55,39 @@ public final class UUID implements java.io.Serializable, Comparable /** * 使用指定的数据构造新的 UUID。 * - * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 + * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位 */ - public UUID(long mostSigBits, long leastSigBits) - { + public UUID(long mostSigBits, long leastSigBits) { this.mostSigBits = mostSigBits; this.leastSigBits = leastSigBits; } /** * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 - * + * * @return 随机生成的 {@code UUID} */ - public static UUID fastUUID() - { + public static UUID fastUUID() { return randomUUID(false); } /** * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 - * + * * @return 随机生成的 {@code UUID} */ - public static UUID randomUUID() - { + public static UUID randomUUID() { return randomUUID(true); } /** * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 - * + * * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能 * @return 随机生成的 {@code UUID} */ - public static UUID randomUUID(boolean isSecure) - { + public static UUID randomUUID(boolean isSecure) { final Random ng = isSecure ? Holder.numberGenerator : getRandom(); byte[] randomBytes = new byte[16]; @@ -108,18 +103,13 @@ public final class UUID implements java.io.Serializable, Comparable * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。 * * @param name 用于构造 UUID 的字节数组。 - * * @return 根据指定数组生成的 {@code UUID} */ - public static UUID nameUUIDFromBytes(byte[] name) - { + public static UUID nameUUIDFromBytes(byte[] name) { MessageDigest md; - try - { + try { md = MessageDigest.getInstance("MD5"); - } - catch (NoSuchAlgorithmException nsae) - { + } catch (NoSuchAlgorithmException nsae) { throw new InternalError("MD5 not supported"); } byte[] md5Bytes = md.digest(name); @@ -136,17 +126,13 @@ public final class UUID implements java.io.Serializable, Comparable * @param name 指定 {@code UUID} 字符串 * @return 具有指定值的 {@code UUID} * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常 - * */ - public static UUID fromString(String name) - { + public static UUID fromString(String name) { String[] components = name.split("-"); - if (components.length != 5) - { + if (components.length != 5) { throw new IllegalArgumentException("Invalid UUID string: " + name); } - for (int i = 0; i < 5; i++) - { + for (int i = 0; i < 5; i++) { components[i] = "0x" + components[i]; } @@ -168,8 +154,7 @@ public final class UUID implements java.io.Serializable, Comparable * * @return 此 UUID 的 128 位值中的最低有效 64 位。 */ - public long getLeastSignificantBits() - { + public long getLeastSignificantBits() { return leastSigBits; } @@ -178,8 +163,7 @@ public final class UUID implements java.io.Serializable, Comparable * * @return 此 UUID 的 128 位值中最高有效 64 位。 */ - public long getMostSignificantBits() - { + public long getMostSignificantBits() { return mostSigBits; } @@ -196,8 +180,7 @@ public final class UUID implements java.io.Serializable, Comparable * * @return 此 {@code UUID} 的版本号 */ - public int version() - { + public int version() { // Version is bits masked by 0x000000000000F000 in MS long return (int) ((mostSigBits >> 12) & 0x0f); } @@ -215,8 +198,7 @@ public final class UUID implements java.io.Serializable, Comparable * * @return 此 {@code UUID} 相关联的变体号 */ - public int variant() - { + public int variant() { // This field is composed of a varying number of bits. // 0 - - Reserved for NCS backward compatibility // 1 0 - The IETF aka Leach-Salz variant (used by this class) @@ -238,8 +220,7 @@ public final class UUID implements java.io.Serializable, Comparable * * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。 */ - public long timestamp() throws UnsupportedOperationException - { + public long timestamp() throws UnsupportedOperationException { checkTimeBase(); return (mostSigBits & 0x0FFFL) << 48// | ((mostSigBits >> 16) & 0x0FFFFL) << 32// @@ -256,11 +237,9 @@ public final class UUID implements java.io.Serializable, Comparable * UnsupportedOperationException。 * * @return 此 {@code UUID} 的时钟序列 - * * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 */ - public int clockSequence() throws UnsupportedOperationException - { + public int clockSequence() throws UnsupportedOperationException { checkTimeBase(); return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48); } @@ -275,11 +254,9 @@ public final class UUID implements java.io.Serializable, Comparable * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 * * @return 此 {@code UUID} 的节点值 - * * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 */ - public long node() throws UnsupportedOperationException - { + public long node() throws UnsupportedOperationException { checkTimeBase(); return leastSigBits & 0x0000FFFFFFFFFFFFL; } @@ -289,7 +266,7 @@ public final class UUID implements java.io.Serializable, Comparable * *

* UUID 的字符串表示形式由此 BNF 描述: - * + * *

      * {@code
      * UUID                   = ----
@@ -302,15 +279,14 @@ public final class UUID implements java.io.Serializable, Comparable
      * hexDigit               = [0-9a-fA-F]
      * }
      * 
- * + * * * * @return 此{@code UUID} 的字符串表现形式 * @see #toString(boolean) */ @Override - public String toString() - { + public String toString() { return toString(false); } @@ -319,7 +295,7 @@ public final class UUID implements java.io.Serializable, Comparable * *

* UUID 的字符串表示形式由此 BNF 描述: - * + * *

      * {@code
      * UUID                   = ----
@@ -332,37 +308,32 @@ public final class UUID implements java.io.Serializable, Comparable
      * hexDigit               = [0-9a-fA-F]
      * }
      * 
- * + * * * * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串 * @return 此{@code UUID} 的字符串表现形式 */ - public String toString(boolean isSimple) - { + public String toString(boolean isSimple) { final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); // time_low builder.append(digits(mostSigBits >> 32, 8)); - if (false == isSimple) - { + if (false == isSimple) { builder.append('-'); } // time_mid builder.append(digits(mostSigBits >> 16, 4)); - if (false == isSimple) - { + if (false == isSimple) { builder.append('-'); } // time_high_and_version builder.append(digits(mostSigBits, 4)); - if (false == isSimple) - { + if (false == isSimple) { builder.append('-'); } // variant_and_sequence builder.append(digits(leastSigBits >> 48, 4)); - if (false == isSimple) - { + if (false == isSimple) { builder.append('-'); } // node @@ -377,8 +348,7 @@ public final class UUID implements java.io.Serializable, Comparable * @return UUID 的哈希码值。 */ @Override - public int hashCode() - { + public int hashCode() { long hilo = mostSigBits ^ leastSigBits; return ((int) (hilo >> 32)) ^ (int) hilo; } @@ -389,14 +359,11 @@ public final class UUID implements java.io.Serializable, Comparable * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。 * * @param obj 要与之比较的对象 - * * @return 如果对象相同,则返回 {@code true};否则返回 {@code false} */ @Override - public boolean equals(Object obj) - { - if ((null == obj) || (obj.getClass() != UUID.class)) - { + public boolean equals(Object obj) { + if ((null == obj) || (obj.getClass() != UUID.class)) { return false; } UUID id = (UUID) obj; @@ -412,13 +379,10 @@ public final class UUID implements java.io.Serializable, Comparable * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。 * * @param val 与此 UUID 比较的 UUID - * * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。 - * */ @Override - public int compareTo(UUID val) - { + public int compareTo(UUID val) { // The ordering is intentionally set up so that the UUIDs // can simply be numerically compared as two numbers return (this.mostSigBits < val.mostSigBits ? -1 : // @@ -430,15 +394,15 @@ public final class UUID implements java.io.Serializable, Comparable // ------------------------------------------------------------------------------------------------------------------- // Private method start + /** * 返回指定数字对应的hex值 - * - * @param val 值 + * + * @param val 值 * @param digits 位 * @return 值 */ - private static String digits(long val, int digits) - { + private static String digits(long val, int digits) { long hi = 1L << (digits * 4); return Long.toHexString(hi | (val & (hi - 1))).substring(1); } @@ -446,27 +410,21 @@ public final class UUID implements java.io.Serializable, Comparable /** * 检查是否为time-based版本UUID */ - private void checkTimeBase() - { - if (version() != 1) - { + private void checkTimeBase() { + if (version() != 1) { throw new UnsupportedOperationException("Not a time-based UUID"); } } /** * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG) - * + * * @return {@link SecureRandom} */ - public static SecureRandom getSecureRandom() - { - try - { + public static SecureRandom getSecureRandom() { + try { return SecureRandom.getInstance("SHA1PRNG"); - } - catch (NoSuchAlgorithmException e) - { + } catch (NoSuchAlgorithmException e) { throw new UtilException(e); } } @@ -474,11 +432,10 @@ public final class UUID implements java.io.Serializable, Comparable /** * 获取随机数生成器对象
* ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。 - * + * * @return {@link ThreadLocalRandom} */ - public static ThreadLocalRandom getRandom() - { + public static ThreadLocalRandom getRandom() { return ThreadLocalRandom.current(); } } diff --git a/spring-boot/ruoyi-framework/pom.xml b/spring-boot/ruoyi-framework/pom.xml index 8e0a73fc..982c8993 100644 --- a/spring-boot/ruoyi-framework/pom.xml +++ b/spring-boot/ruoyi-framework/pom.xml @@ -18,7 +18,7 @@ - + org.springframework.boot spring-boot-starter-web @@ -58,6 +58,12 @@ com.ruoyi ruoyi-system + + com.github.binarywang + weixin-java-miniapp + 4.0.0 + + diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java index 45d939bb..cc01b942 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.aspectj; import java.lang.reflect.Method; + import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Aspect; @@ -25,8 +26,7 @@ import com.ruoyi.framework.web.service.TokenService; */ @Aspect @Component -public class DataScopeAspect -{ +public class DataScopeAspect { /** * 全部数据权限 */ @@ -59,32 +59,26 @@ public class DataScopeAspect // 配置织入点 @Pointcut("@annotation(com.ruoyi.common.annotation.DataScope)") - public void dataScopePointCut() - { + public void dataScopePointCut() { } @Before("dataScopePointCut()") - public void doBefore(JoinPoint point) throws Throwable - { + public void doBefore(JoinPoint point) throws Throwable { handleDataScope(point); } - protected void handleDataScope(final JoinPoint joinPoint) - { + protected void handleDataScope(final JoinPoint joinPoint) { // 获得注解 DataScope controllerDataScope = getAnnotationLog(joinPoint); - if (controllerDataScope == null) - { + if (controllerDataScope == null) { return; } // 获取当前的用户 LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNotNull(loginUser)) - { + if (StringUtils.isNotNull(loginUser)) { SysUser currentUser = loginUser.getUser(); // 如果是超级管理员,则不过滤数据 - if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) - { + if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) { dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias()); } @@ -95,56 +89,40 @@ public class DataScopeAspect * 数据范围过滤 * * @param joinPoint 切点 - * @param user 用户 + * @param user 用户 * @param userAlias 别名 */ - public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) - { + public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) { StringBuilder sqlString = new StringBuilder(); - for (SysRole role : user.getRoles()) - { + for (SysRole role : user.getRoles()) { String dataScope = role.getDataScope(); - if (DATA_SCOPE_ALL.equals(dataScope)) - { + if (DATA_SCOPE_ALL.equals(dataScope)) { sqlString = new StringBuilder(); break; - } - else if (DATA_SCOPE_CUSTOM.equals(dataScope)) - { + } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { sqlString.append(StringUtils.format( " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId())); - } - else if (DATA_SCOPE_DEPT.equals(dataScope)) - { + } else if (DATA_SCOPE_DEPT.equals(dataScope)) { sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); - } - else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) - { + } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { sqlString.append(StringUtils.format( " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId())); - } - else if (DATA_SCOPE_SELF.equals(dataScope)) - { - if (StringUtils.isNotBlank(userAlias)) - { + } else if (DATA_SCOPE_SELF.equals(dataScope)) { + if (StringUtils.isNotBlank(userAlias)) { sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); - } - else - { + } else { // 数据权限为仅本人且没有userAlias别名不查询任何数据 sqlString.append(" OR 1=0 "); } } } - if (StringUtils.isNotBlank(sqlString.toString())) - { + if (StringUtils.isNotBlank(sqlString.toString())) { Object params = joinPoint.getArgs()[0]; - if (StringUtils.isNotNull(params) && params instanceof BaseEntity) - { + if (StringUtils.isNotNull(params) && params instanceof BaseEntity) { BaseEntity baseEntity = (BaseEntity) params; baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")"); } @@ -154,14 +132,12 @@ public class DataScopeAspect /** * 是否存在注解,如果存在就获取 */ - private DataScope getAnnotationLog(JoinPoint joinPoint) - { + private DataScope getAnnotationLog(JoinPoint joinPoint) { Signature signature = joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature) signature; Method method = methodSignature.getMethod(); - if (method != null) - { + if (method != null) { return method.getAnnotation(DataScope.class); } return null; diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java index 8c2c9f43..020493d2 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.aspectj; import java.util.Objects; + import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -17,39 +18,32 @@ import com.ruoyi.framework.datasource.DynamicDataSourceContextHolder; /** * 多数据源处理 - * + * * @author ruoyi */ @Aspect @Order(1) @Component -public class DataSourceAspect -{ +public class DataSourceAspect { protected Logger logger = LoggerFactory.getLogger(getClass()); @Pointcut("@annotation(com.ruoyi.common.annotation.DataSource)" + "|| @within(com.ruoyi.common.annotation.DataSource)") - public void dsPointCut() - { + public void dsPointCut() { } @Around("dsPointCut()") - public Object around(ProceedingJoinPoint point) throws Throwable - { + public Object around(ProceedingJoinPoint point) throws Throwable { DataSource dataSource = getDataSource(point); - if (StringUtils.isNotNull(dataSource)) - { + if (StringUtils.isNotNull(dataSource)) { DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name()); } - try - { + try { return point.proceed(); - } - finally - { + } finally { // 销毁数据源 在执行方法之后 DynamicDataSourceContextHolder.clearDataSourceType(); } @@ -58,12 +52,10 @@ public class DataSourceAspect /** * 获取需要切换的数据源 */ - public DataSource getDataSource(ProceedingJoinPoint point) - { + public DataSource getDataSource(ProceedingJoinPoint point) { MethodSignature signature = (MethodSignature) point.getSignature(); DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class); - if (Objects.nonNull(dataSource)) - { + if (Objects.nonNull(dataSource)) { return dataSource; } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 7e180ab7..7c53fc23 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -6,6 +6,7 @@ import java.util.Iterator; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.AfterReturning; @@ -34,19 +35,17 @@ import com.ruoyi.system.domain.SysOperLog; /** * 操作日志记录处理 - * + * * @author ruoyi */ @Aspect @Component -public class LogAspect -{ +public class LogAspect { private static final Logger log = LoggerFactory.getLogger(LogAspect.class); // 配置织入点 @Pointcut("@annotation(com.ruoyi.common.annotation.Log)") - public void logPointCut() - { + public void logPointCut() { } /** @@ -55,31 +54,26 @@ public class LogAspect * @param joinPoint 切点 */ @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult") - public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) - { + public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) { handleLog(joinPoint, null, jsonResult); } /** * 拦截异常操作 - * + * * @param joinPoint 切点 - * @param e 异常 + * @param e 异常 */ @AfterThrowing(value = "logPointCut()", throwing = "e") - public void doAfterThrowing(JoinPoint joinPoint, Exception e) - { + public void doAfterThrowing(JoinPoint joinPoint, Exception e) { handleLog(joinPoint, e, null); } - protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) - { - try - { + protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) { + try { // 获得注解 Log controllerLog = getAnnotationLog(joinPoint); - if (controllerLog == null) - { + if (controllerLog == null) { return; } @@ -96,13 +90,11 @@ public class LogAspect operLog.setJsonResult(JSON.toJSONString(jsonResult)); operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); - if (loginUser != null) - { + if (loginUser != null) { operLog.setOperName(loginUser.getUsername()); } - if (e != null) - { + if (e != null) { operLog.setStatus(BusinessStatus.FAIL.ordinal()); operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); } @@ -116,9 +108,7 @@ public class LogAspect getControllerMethodDescription(joinPoint, controllerLog, operLog); // 保存数据库 AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); - } - catch (Exception exp) - { + } catch (Exception exp) { // 记录本地异常日志 log.error("==前置通知异常=="); log.error("异常信息:{}", exp.getMessage()); @@ -128,13 +118,12 @@ public class LogAspect /** * 获取注解中对方法的描述信息 用于Controller层注解 - * - * @param log 日志 + * + * @param log 日志 * @param operLog 操作日志 * @throws Exception */ - public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception - { + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception { // 设置action动作 operLog.setBusinessType(log.businessType().ordinal()); // 设置标题 @@ -142,8 +131,7 @@ public class LogAspect // 设置操作人类别 operLog.setOperatorType(log.operatorType().ordinal()); // 是否需要保存request,参数和值 - if (log.isSaveRequestData()) - { + if (log.isSaveRequestData()) { // 获取参数的信息,传入到数据库中。 setRequestValue(joinPoint, operLog); } @@ -151,20 +139,16 @@ public class LogAspect /** * 获取请求的参数,放到log中 - * + * * @param operLog 操作日志 * @throws Exception 异常 */ - private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception - { + private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception { String requestMethod = operLog.getRequestMethod(); - if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) - { + if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { String params = argsArrayToString(joinPoint.getArgs()); operLog.setOperParam(StringUtils.substring(params, 0, 2000)); - } - else - { + } else { Map paramsMap = (Map) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000)); } @@ -173,14 +157,12 @@ public class LogAspect /** * 是否存在注解,如果存在就获取 */ - private Log getAnnotationLog(JoinPoint joinPoint) throws Exception - { + private Log getAnnotationLog(JoinPoint joinPoint) throws Exception { Signature signature = joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature) signature; Method method = methodSignature.getMethod(); - if (method != null) - { + if (method != null) { return method.getAnnotation(Log.class); } return null; @@ -189,15 +171,11 @@ public class LogAspect /** * 参数拼装 */ - private String argsArrayToString(Object[] paramsArray) - { + private String argsArrayToString(Object[] paramsArray) { String params = ""; - if (paramsArray != null && paramsArray.length > 0) - { - for (int i = 0; i < paramsArray.length; i++) - { - if (!isFilterObject(paramsArray[i])) - { + if (paramsArray != null && paramsArray.length > 0) { + for (int i = 0; i < paramsArray.length; i++) { + if (!isFilterObject(paramsArray[i])) { Object jsonObj = JSON.toJSON(paramsArray[i]); params += jsonObj.toString() + " "; } @@ -208,31 +186,23 @@ public class LogAspect /** * 判断是否需要过滤的对象。 - * + * * @param o 对象信息。 * @return 如果是需要过滤的对象,则返回true;否则返回false。 */ @SuppressWarnings("rawtypes") - public boolean isFilterObject(final Object o) - { + public boolean isFilterObject(final Object o) { Class clazz = o.getClass(); - if (clazz.isArray()) - { + if (clazz.isArray()) { return clazz.getComponentType().isAssignableFrom(MultipartFile.class); - } - else if (Collection.class.isAssignableFrom(clazz)) - { + } else if (Collection.class.isAssignableFrom(clazz)) { Collection collection = (Collection) o; - for (Iterator iter = collection.iterator(); iter.hasNext();) - { + for (Iterator iter = collection.iterator(); iter.hasNext(); ) { return iter.next() instanceof MultipartFile; } - } - else if (Map.class.isAssignableFrom(clazz)) - { + } else if (Map.class.isAssignableFrom(clazz)) { Map map = (Map) o; - for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) - { + for (Iterator iter = map.entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); return entry.getValue() instanceof MultipartFile; } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java index 1d4dc1f7..dbc30d90 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.config; import java.util.TimeZone; + import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.context.annotation.Bean; @@ -17,14 +18,12 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; @EnableAspectJAutoProxy(exposeProxy = true) // 指定要扫描的Mapper类的包的路径 @MapperScan("com.ruoyi.**.mapper") -public class ApplicationConfig -{ +public class ApplicationConfig { /** * 时区配置 */ @Bean - public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() - { + public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() { return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java index 43e78aeb..be2a6e34 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java @@ -1,23 +1,23 @@ package com.ruoyi.framework.config; import java.util.Properties; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.google.code.kaptcha.impl.DefaultKaptcha; import com.google.code.kaptcha.util.Config; + import static com.google.code.kaptcha.Constants.*; /** * 验证码配置 - * + * * @author ruoyi */ @Configuration -public class CaptchaConfig -{ +public class CaptchaConfig { @Bean(name = "captchaProducer") - public DefaultKaptcha getKaptchaBean() - { + public DefaultKaptcha getKaptchaBean() { DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); Properties properties = new Properties(); // 是否有边框 默认为true 我们可以自己设置yes,no @@ -44,8 +44,7 @@ public class CaptchaConfig } @Bean(name = "captchaProducerMath") - public DefaultKaptcha getKaptchaBeanMath() - { + public DefaultKaptcha getKaptchaBeanMath() { DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); Properties properties = new Properties(); // 是否有边框 默认为true 我们可以自己设置yes,no diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java index f6abac13..7e9f4b03 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -9,6 +9,7 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.sql.DataSource; + import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; @@ -26,16 +27,14 @@ import com.ruoyi.framework.datasource.DynamicDataSource; /** * druid 配置多数据源 - * + * * @author ruoyi */ @Configuration -public class DruidConfig -{ +public class DruidConfig { @Bean @ConfigurationProperties("spring.datasource.druid.master") - public DataSource masterDataSource(DruidProperties druidProperties) - { + public DataSource masterDataSource(DruidProperties druidProperties) { DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); return druidProperties.dataSource(dataSource); } @@ -43,49 +42,42 @@ public class DruidConfig @Bean @ConfigurationProperties("spring.datasource.druid.slave") @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true") - public DataSource slaveDataSource(DruidProperties druidProperties) - { + public DataSource slaveDataSource(DruidProperties druidProperties) { DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); return druidProperties.dataSource(dataSource); } @Bean(name = "dynamicDataSource") @Primary - public DynamicDataSource dataSource(DataSource masterDataSource) - { + public DynamicDataSource dataSource(DataSource masterDataSource) { Map targetDataSources = new HashMap<>(); targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource"); return new DynamicDataSource(masterDataSource, targetDataSources); } - + /** * 设置数据源 - * + * * @param targetDataSources 备选数据源集合 - * @param sourceName 数据源名称 - * @param beanName bean名称 + * @param sourceName 数据源名称 + * @param beanName bean名称 */ - public void setDataSource(Map targetDataSources, String sourceName, String beanName) - { - try - { + public void setDataSource(Map targetDataSources, String sourceName, String beanName) { + try { DataSource dataSource = SpringUtils.getBean(beanName); targetDataSources.put(sourceName, dataSource); - } - catch (Exception e) - { + } catch (Exception e) { } } /** * 去除监控页面底部的广告 */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) @Bean @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true") - public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) - { + public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) { // 获取web监控页面的参数 DruidStatProperties.StatViewServlet config = properties.getStatViewServlet(); // 提取common.js的配置路径 @@ -93,16 +85,14 @@ public class DruidConfig String commonJsPattern = pattern.replaceAll("\\*", "js/common.js"); final String filePath = "support/http/resources/js/common.js"; // 创建filter进行过滤 - Filter filter = new Filter() - { + Filter filter = new Filter() { @Override - public void init(javax.servlet.FilterConfig filterConfig) throws ServletException - { + public void init(javax.servlet.FilterConfig filterConfig) throws ServletException { } + @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException - { + throws IOException, ServletException { chain.doFilter(request, response); // 重置缓冲区,响应头不会被重置 response.resetBuffer(); @@ -113,9 +103,9 @@ public class DruidConfig text = text.replaceAll("powered.*?shrek.wang", ""); response.getWriter().write(text); } + @Override - public void destroy() - { + public void destroy() { } }; FilterRegistrationBean registrationBean = new FilterRegistrationBean(); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java index 59812ea5..a7c29f3f 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java @@ -9,15 +9,15 @@ import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.SerializationException; import com.alibaba.fastjson.parser.ParserConfig; import org.springframework.util.Assert; + import java.nio.charset.Charset; /** * Redis使用FastJson序列化 - * + * * @author ruoyi */ -public class FastJson2JsonRedisSerializer implements RedisSerializer -{ +public class FastJson2JsonRedisSerializer implements RedisSerializer { @SuppressWarnings("unused") private ObjectMapper objectMapper = new ObjectMapper(); @@ -25,32 +25,26 @@ public class FastJson2JsonRedisSerializer implements RedisSerializer private Class clazz; - static - { + static { ParserConfig.getGlobalInstance().setAutoTypeSupport(true); } - public FastJson2JsonRedisSerializer(Class clazz) - { + public FastJson2JsonRedisSerializer(Class clazz) { super(); this.clazz = clazz; } @Override - public byte[] serialize(T t) throws SerializationException - { - if (t == null) - { + public byte[] serialize(T t) throws SerializationException { + if (t == null) { return new byte[0]; } return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET); } @Override - public T deserialize(byte[] bytes) throws SerializationException - { - if (bytes == null || bytes.length <= 0) - { + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes == null || bytes.length <= 0) { return null; } String str = new String(bytes, DEFAULT_CHARSET); @@ -58,14 +52,12 @@ public class FastJson2JsonRedisSerializer implements RedisSerializer return JSON.parseObject(str, clazz); } - public void setObjectMapper(ObjectMapper objectMapper) - { + public void setObjectMapper(ObjectMapper objectMapper) { Assert.notNull(objectMapper, "'objectMapper' must not be null"); this.objectMapper = objectMapper; } - protected JavaType getJavaType(Class clazz) - { + protected JavaType getJavaType(Class clazz) { return TypeFactory.defaultInstance().constructType(clazz); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java index b5f03ec8..4feef0d0 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java @@ -3,6 +3,7 @@ package com.ruoyi.framework.config; import java.util.HashMap; import java.util.Map; import javax.servlet.DispatcherType; + import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; @@ -17,8 +18,7 @@ import com.ruoyi.common.utils.StringUtils; * @author ruoyi */ @Configuration -public class FilterConfig -{ +public class FilterConfig { @Value("${xss.enabled}") private String enabled; @@ -28,10 +28,9 @@ public class FilterConfig @Value("${xss.urlPatterns}") private String urlPatterns; - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) @Bean - public FilterRegistrationBean xssFilterRegistration() - { + public FilterRegistrationBean xssFilterRegistration() { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setDispatcherTypes(DispatcherType.REQUEST); registration.setFilter(new XssFilter()); @@ -45,10 +44,9 @@ public class FilterConfig return registration; } - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({"rawtypes", "unchecked"}) @Bean - public FilterRegistrationBean someFilterRegistration() - { + public FilterRegistrationBean someFilterRegistration() { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setFilter(new RepeatableFilter()); registration.addUrlPatterns("/*"); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java index 3e745800..4f028959 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java @@ -1,69 +1,55 @@ package com.ruoyi.framework.config; import java.util.Random; + import com.google.code.kaptcha.text.impl.DefaultTextCreator; /** * 验证码文本生成器 - * + * * @author ruoyi */ -public class KaptchaTextCreator extends DefaultTextCreator -{ +public class KaptchaTextCreator extends DefaultTextCreator { private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(","); @Override - public String getText() - { + public String getText() { Integer result = 0; Random random = new Random(); int x = random.nextInt(10); int y = random.nextInt(10); StringBuilder suChinese = new StringBuilder(); int randomoperands = (int) Math.round(Math.random() * 2); - if (randomoperands == 0) - { + if (randomoperands == 0) { result = x * y; suChinese.append(CNUMBERS[x]); suChinese.append("*"); suChinese.append(CNUMBERS[y]); - } - else if (randomoperands == 1) - { - if (!(x == 0) && y % x == 0) - { + } else if (randomoperands == 1) { + if (!(x == 0) && y % x == 0) { result = y / x; suChinese.append(CNUMBERS[y]); suChinese.append("/"); suChinese.append(CNUMBERS[x]); - } - else - { + } else { result = x + y; suChinese.append(CNUMBERS[x]); suChinese.append("+"); suChinese.append(CNUMBERS[y]); } - } - else if (randomoperands == 2) - { - if (x >= y) - { + } else if (randomoperands == 2) { + if (x >= y) { result = x - y; suChinese.append(CNUMBERS[x]); suChinese.append("-"); suChinese.append(CNUMBERS[y]); - } - else - { + } else { result = y - x; suChinese.append(CNUMBERS[y]); suChinese.append("-"); suChinese.append(CNUMBERS[x]); } - } - else - { + } else { result = x + y; suChinese.append(CNUMBERS[x]); suChinese.append("+"); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java index 057c9419..31387ee6 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import javax.sql.DataSource; + import org.apache.ibatis.io.VFS; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; @@ -26,86 +27,64 @@ import com.ruoyi.common.utils.StringUtils; /** * Mybatis支持*匹配扫描包 - * + * * @author ruoyi */ @Configuration -public class MyBatisConfig -{ +public class MyBatisConfig { @Autowired private Environment env; static final String DEFAULT_RESOURCE_PATTERN = "**/*.class"; - public static String setTypeAliasesPackage(String typeAliasesPackage) - { + public static String setTypeAliasesPackage(String typeAliasesPackage) { ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver(); MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver); List allResult = new ArrayList(); - try - { - for (String aliasesPackage : typeAliasesPackage.split(",")) - { + try { + for (String aliasesPackage : typeAliasesPackage.split(",")) { List result = new ArrayList(); aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN; Resource[] resources = resolver.getResources(aliasesPackage); - if (resources != null && resources.length > 0) - { + if (resources != null && resources.length > 0) { MetadataReader metadataReader = null; - for (Resource resource : resources) - { - if (resource.isReadable()) - { + for (Resource resource : resources) { + if (resource.isReadable()) { metadataReader = metadataReaderFactory.getMetadataReader(resource); - try - { + try { result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName()); - } - catch (ClassNotFoundException e) - { + } catch (ClassNotFoundException e) { e.printStackTrace(); } } } } - if (result.size() > 0) - { + if (result.size() > 0) { HashSet hashResult = new HashSet(result); allResult.addAll(hashResult); } } - if (allResult.size() > 0) - { + if (allResult.size() > 0) { typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0])); - } - else - { + } else { throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); } - } - catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); } return typeAliasesPackage; } - public Resource[] resolveMapperLocations(String[] mapperLocations) - { + public Resource[] resolveMapperLocations(String[] mapperLocations) { ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); List resources = new ArrayList(); - if (mapperLocations != null) - { - for (String mapperLocation : mapperLocations) - { - try - { + if (mapperLocations != null) { + for (String mapperLocation : mapperLocations) { + try { Resource[] mappers = resourceResolver.getResources(mapperLocation); resources.addAll(Arrays.asList(mappers)); - } - catch (IOException e) - { + } catch (IOException e) { // ignore } } @@ -114,8 +93,7 @@ public class MyBatisConfig } @Bean - public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception - { + public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); String mapperLocations = env.getProperty("mybatis.mapperLocations"); String configLocation = env.getProperty("mybatis.configLocation"); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java index a65626aa..a55670e9 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java @@ -15,17 +15,15 @@ import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator /** * redis配置 - * + * * @author ruoyi */ @Configuration @EnableCaching -public class RedisConfig extends CachingConfigurerSupport -{ +public class RedisConfig extends CachingConfigurerSupport { @Bean - @SuppressWarnings(value = { "unchecked", "rawtypes" }) - public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) - { + @SuppressWarnings(value = {"unchecked", "rawtypes"}) + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { RedisTemplate template = new RedisTemplate<>(); template.setConnectionFactory(connectionFactory); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java index 7f0a629b..80b91dce 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -15,18 +15,16 @@ import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; /** * 通用配置 - * + * * @author ruoyi */ @Configuration -public class ResourcesConfig implements WebMvcConfigurer -{ +public class ResourcesConfig implements WebMvcConfigurer { @Autowired private RepeatSubmitInterceptor repeatSubmitInterceptor; @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) - { + public void addResourceHandlers(ResourceHandlerRegistry registry) { /** 本地文件上传路径 */ registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); @@ -39,8 +37,7 @@ public class ResourcesConfig implements WebMvcConfigurer * 自定义拦截规则 */ @Override - public void addInterceptors(InterceptorRegistry registry) - { + public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); } @@ -48,8 +45,7 @@ public class ResourcesConfig implements WebMvcConfigurer * 跨域配置 */ @Bean - public CorsFilter corsFilter() - { + public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index e71fccb2..64c1a5d8 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -20,18 +20,17 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; /** * spring security配置 - * + * * @author ruoyi */ @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter -{ +public class SecurityConfig extends WebSecurityConfigurerAdapter { /** * 自定义用户认证逻辑 */ @Autowired private UserDetailsService userDetailsService; - + /** * 认证失败处理类 */ @@ -55,7 +54,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter */ @Autowired private CorsFilter corsFilter; - + /** * 解决 无法直接注入 AuthenticationManager * @@ -64,8 +63,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter */ @Bean @Override - public AuthenticationManager authenticationManagerBean() throws Exception - { + public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } @@ -85,8 +83,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter * authenticated | 用户登录后可访问 */ @Override - protected void configure(HttpSecurity httpSecurity) throws Exception - { + protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity // CSRF禁用,因为不使用session .csrf().disable() @@ -97,7 +94,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/captchaImage","/system/user/register").anonymous() + .antMatchers("/wxLogin", "/login", "/captchaImage", "/system/user/register").anonymous() .antMatchers( HttpMethod.GET, "/*.html", @@ -125,13 +122,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); } - + /** * 强散列哈希加密实现 */ @Bean - public BCryptPasswordEncoder bCryptPasswordEncoder() - { + public BCryptPasswordEncoder bCryptPasswordEncoder() { return new BCryptPasswordEncoder(); } @@ -139,8 +135,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter * 身份认证接口 */ @Override - protected void configure(AuthenticationManagerBuilder auth) throws Exception - { + protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java index b5b7de31..d50be60a 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java @@ -1,30 +1,28 @@ package com.ruoyi.framework.config; import javax.servlet.http.HttpServletRequest; + import org.springframework.stereotype.Component; import com.ruoyi.common.utils.ServletUtils; /** * 服务相关配置 - * + * * @author ruoyi */ @Component -public class ServerConfig -{ +public class ServerConfig { /** * 获取完整的请求路径,包括:域名,端口,上下文访问路径 - * + * * @return 服务地址 */ - public String getUrl() - { + public String getUrl() { HttpServletRequest request = ServletUtils.getRequest(); return getDomain(request); } - public static String getDomain(HttpServletRequest request) - { + public static String getDomain(HttpServletRequest request) { StringBuffer url = request.getRequestURL(); String contextPath = request.getServletContext().getContextPath(); return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java index 0d67c224..dac6f6e8 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java @@ -3,6 +3,7 @@ package com.ruoyi.framework.config; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor; + import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -15,8 +16,7 @@ import com.ruoyi.common.utils.Threads; * @author ruoyi **/ @Configuration -public class ThreadPoolConfig -{ +public class ThreadPoolConfig { // 核心线程池大小 private int corePoolSize = 50; @@ -30,8 +30,7 @@ public class ThreadPoolConfig private int keepAliveSeconds = 300; @Bean(name = "threadPoolTaskExecutor") - public ThreadPoolTaskExecutor threadPoolTaskExecutor() - { + public ThreadPoolTaskExecutor threadPoolTaskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setMaxPoolSize(maxPoolSize); executor.setCorePoolSize(corePoolSize); @@ -46,14 +45,11 @@ public class ThreadPoolConfig * 执行周期性或定时任务 */ @Bean(name = "scheduledExecutorService") - protected ScheduledExecutorService scheduledExecutorService() - { + protected ScheduledExecutorService scheduledExecutorService() { return new ScheduledThreadPoolExecutor(corePoolSize, - new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) - { + new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) { @Override - protected void afterExecute(Runnable r, Throwable t) - { + protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); Threads.printException(r, t); } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java index 84f7e009..33983900 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java @@ -6,12 +6,11 @@ import com.alibaba.druid.pool.DruidDataSource; /** * druid 配置属性 - * + * * @author ruoyi */ @Configuration -public class DruidProperties -{ +public class DruidProperties { @Value("${spring.datasource.druid.initialSize}") private int initialSize; @@ -45,8 +44,7 @@ public class DruidProperties @Value("${spring.datasource.druid.testOnReturn}") private boolean testOnReturn; - public DruidDataSource dataSource(DruidDataSource datasource) - { + public DruidDataSource dataSource(DruidDataSource datasource) { /** 配置初始化大小、最小、最大 */ datasource.setInitialSize(initialSize); datasource.setMaxActive(maxActive); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java index e70b8cfa..8bd0f04a 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java @@ -2,25 +2,23 @@ package com.ruoyi.framework.datasource; import java.util.Map; import javax.sql.DataSource; + import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; /** * 动态数据源 - * + * * @author ruoyi */ -public class DynamicDataSource extends AbstractRoutingDataSource -{ - public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) - { +public class DynamicDataSource extends AbstractRoutingDataSource { + public DynamicDataSource(DataSource defaultTargetDataSource, Map targetDataSources) { super.setDefaultTargetDataSource(defaultTargetDataSource); super.setTargetDataSources(targetDataSources); super.afterPropertiesSet(); } @Override - protected Object determineCurrentLookupKey() - { + protected Object determineCurrentLookupKey() { return DynamicDataSourceContextHolder.getDataSourceType(); } } \ No newline at end of file diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java index 3572db91..37a5f8e5 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java @@ -5,24 +5,22 @@ import org.slf4j.LoggerFactory; /** * 数据源切换处理 - * + * * @author ruoyi */ -public class DynamicDataSourceContextHolder -{ +public class DynamicDataSourceContextHolder { public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); /** * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, - * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 + * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 */ private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); /** * 设置数据源的变量 */ - public static void setDataSourceType(String dsType) - { + public static void setDataSourceType(String dsType) { log.info("切换到{}数据源", dsType); CONTEXT_HOLDER.set(dsType); } @@ -30,16 +28,14 @@ public class DynamicDataSourceContextHolder /** * 获得数据源的变量 */ - public static String getDataSourceType() - { + public static String getDataSourceType() { return CONTEXT_HOLDER.get(); } /** * 清空数据源变量 */ - public static void clearDataSourceType() - { + public static void clearDataSourceType() { CONTEXT_HOLDER.remove(); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java index 17d607fd..e07e6de6 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java @@ -3,6 +3,7 @@ package com.ruoyi.framework.interceptor; import java.lang.reflect.Method; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; @@ -17,29 +18,22 @@ import com.ruoyi.common.utils.ServletUtils; * @author ruoyi */ @Component -public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter -{ +public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter { @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception - { - if (handler instanceof HandlerMethod) - { + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + if (handler instanceof HandlerMethod) { HandlerMethod handlerMethod = (HandlerMethod) handler; Method method = handlerMethod.getMethod(); RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class); - if (annotation != null) - { - if (this.isRepeatSubmit(request)) - { + if (annotation != null) { + if (this.isRepeatSubmit(request)) { AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试"); ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult)); return false; } } return true; - } - else - { + } else { return super.preHandle(request, response, handler); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java index a9d0a542..3386b411 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -18,12 +19,11 @@ import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; /** * 判断请求url和数据是否和上一次相同, * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。 - * + * * @author ruoyi */ @Component -public class SameUrlDataInterceptor extends RepeatSubmitInterceptor -{ +public class SameUrlDataInterceptor extends RepeatSubmitInterceptor { public final String REPEAT_PARAMS = "repeatParams"; public final String REPEAT_TIME = "repeatTime"; @@ -37,30 +37,26 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor /** * 间隔时间,单位:秒 默认10秒 - * + *

* 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据 */ private int intervalTime = 10; - public void setIntervalTime(int intervalTime) - { + public void setIntervalTime(int intervalTime) { this.intervalTime = intervalTime; } @SuppressWarnings("unchecked") @Override - public boolean isRepeatSubmit(HttpServletRequest request) - { + public boolean isRepeatSubmit(HttpServletRequest request) { String nowParams = ""; - if (request instanceof RepeatedlyRequestWrapper) - { + if (request instanceof RepeatedlyRequestWrapper) { RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request; nowParams = HttpHelper.getBodyString(repeatedlyRequest); } // body参数为空,获取Parameter的数据 - if (StringUtils.isEmpty(nowParams)) - { + if (StringUtils.isEmpty(nowParams)) { nowParams = JSONObject.toJSONString(request.getParameterMap()); } Map nowDataMap = new HashMap(); @@ -72,8 +68,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor // 唯一值(没有消息头则使用请求地址) String submitKey = request.getHeader(header); - if (StringUtils.isEmpty(submitKey)) - { + if (StringUtils.isEmpty(submitKey)) { submitKey = url; } @@ -81,14 +76,11 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor String cache_repeat_key = Constants.REPEAT_SUBMIT_KEY + submitKey; Object sessionObj = redisCache.getCacheObject(cache_repeat_key); - if (sessionObj != null) - { + if (sessionObj != null) { Map sessionMap = (Map) sessionObj; - if (sessionMap.containsKey(url)) - { + if (sessionMap.containsKey(url)) { Map preDataMap = (Map) sessionMap.get(url); - if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap)) - { + if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap)) { return true; } } @@ -102,8 +94,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor /** * 判断参数是否相同 */ - private boolean compareParams(Map nowMap, Map preMap) - { + private boolean compareParams(Map nowMap, Map preMap) { String nowParams = (String) nowMap.get(REPEAT_PARAMS); String preParams = (String) preMap.get(REPEAT_PARAMS); return nowParams.equals(preParams); @@ -112,12 +103,10 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor /** * 判断两次间隔时间 */ - private boolean compareTime(Map nowMap, Map preMap) - { + private boolean compareTime(Map nowMap, Map preMap) { long time1 = (Long) nowMap.get(REPEAT_TIME); long time2 = (Long) preMap.get(REPEAT_TIME); - if ((time1 - time2) < (this.intervalTime * 1000)) - { + if ((time1 - time2) < (this.intervalTime * 1000)) { return true; } return false; diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java index 7387a02c..e8a8e84c 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java @@ -3,16 +3,16 @@ package com.ruoyi.framework.manager; import java.util.TimerTask; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; + import com.ruoyi.common.utils.Threads; import com.ruoyi.common.utils.spring.SpringUtils; /** * 异步任务管理器 - * + * * @author ruoyi */ -public class AsyncManager -{ +public class AsyncManager { /** * 操作延迟10毫秒 */ @@ -26,30 +26,28 @@ public class AsyncManager /** * 单例模式 */ - private AsyncManager(){} + private AsyncManager() { + } private static AsyncManager me = new AsyncManager(); - public static AsyncManager me() - { + public static AsyncManager me() { return me; } /** * 执行任务 - * + * * @param task 任务 */ - public void execute(TimerTask task) - { + public void execute(TimerTask task) { executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); } /** * 停止任务线程池 */ - public void shutdown() - { + public void shutdown() { Threads.shutdownAndAwaitTermination(executor); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java index e36ca3c5..0d6a67b1 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java @@ -3,6 +3,7 @@ package com.ruoyi.framework.manager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; + import javax.annotation.PreDestroy; /** @@ -11,28 +12,22 @@ import javax.annotation.PreDestroy; * @author ruoyi */ @Component -public class ShutdownManager -{ +public class ShutdownManager { private static final Logger logger = LoggerFactory.getLogger("sys-user"); @PreDestroy - public void destroy() - { + public void destroy() { shutdownAsyncManager(); } /** * 停止异步执行任务 */ - private void shutdownAsyncManager() - { - try - { + private void shutdownAsyncManager() { + try { logger.info("====关闭后台任务任务线程池===="); AsyncManager.me().shutdown(); - } - catch (Exception e) - { + } catch (Exception e) { logger.error(e.getMessage(), e); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java index 17a8f40f..a94953b9 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.manager.factory; import java.util.TimerTask; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.constant.Constants; @@ -17,32 +18,28 @@ import eu.bitwalker.useragentutils.UserAgent; /** * 异步工厂(产生任务用) - * + * * @author ruoyi */ -public class AsyncFactory -{ +public class AsyncFactory { private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); /** * 记录登录信息 - * + * * @param username 用户名 - * @param status 状态 - * @param message 消息 - * @param args 列表 + * @param status 状态 + * @param message 消息 + * @param args 列表 * @return 任务task */ public static TimerTask recordLogininfor(final String username, final String status, final String message, - final Object... args) - { + final Object... args) { final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); final String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); - return new TimerTask() - { + return new TimerTask() { @Override - public void run() - { + public void run() { String address = AddressUtils.getRealAddressByIP(ip); StringBuilder s = new StringBuilder(); s.append(LogUtils.getBlock(ip)); @@ -65,12 +62,9 @@ public class AsyncFactory logininfor.setOs(os); logininfor.setMsg(message); // 日志状态 - if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status)) - { + if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status)) { logininfor.setStatus(Constants.SUCCESS); - } - else if (Constants.LOGIN_FAIL.equals(status)) - { + } else if (Constants.LOGIN_FAIL.equals(status)) { logininfor.setStatus(Constants.FAIL); } // 插入数据 @@ -81,17 +75,14 @@ public class AsyncFactory /** * 操作日志记录 - * + * * @param operLog 操作日志信息 * @return 任务task */ - public static TimerTask recordOper(final SysOperLog operLog) - { - return new TimerTask() - { + public static TimerTask recordOper(final SysOperLog operLog) { + return new TimerTask() { @Override - public void run() - { + public void run() { // 远程查询操作地点 operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); SpringUtils.getBean(ISysOperLogService.class).insertOperlog(operLog); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java index 3eb24954..58f480b2 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java @@ -5,6 +5,7 @@ import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; @@ -18,22 +19,19 @@ import com.ruoyi.framework.web.service.TokenService; /** * token过滤器 验证token有效性 - * + * * @author ruoyi */ @Component -public class JwtAuthenticationTokenFilter extends OncePerRequestFilter -{ +public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { @Autowired private TokenService tokenService; @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws ServletException, IOException - { + throws ServletException, IOException { LoginUser loginUser = tokenService.getLoginUser(request); - if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) - { + if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) { tokenService.verifyToken(loginUser); UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java index c22dd324..a506100c 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.io.Serializable; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.stereotype.Component; @@ -15,18 +16,16 @@ import com.ruoyi.common.utils.StringUtils; /** * 认证失败处理类 返回未授权 - * + * * @author ruoyi */ @Component -public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable -{ +public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable { private static final long serialVersionUID = -8970718410437077606L; @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) - throws IOException - { + throws IOException { int code = HttpStatus.UNAUTHORIZED; String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI()); ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg))); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java index e5fc11d0..6df16a6b 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java @@ -4,6 +4,7 @@ import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.core.Authentication; @@ -21,27 +22,24 @@ import com.ruoyi.framework.web.service.TokenService; /** * 自定义退出处理类 返回成功 - * + * * @author ruoyi */ @Configuration -public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler -{ +public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler { @Autowired private TokenService tokenService; /** * 退出处理 - * + * * @return */ @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) - throws IOException, ServletException - { + throws IOException, ServletException { LoginUser loginUser = tokenService.getLoginUser(request); - if (StringUtils.isNotNull(loginUser)) - { + if (StringUtils.isNotNull(loginUser)) { String userName = loginUser.getUsername(); // 删除用户缓存记录 tokenService.delLoginUser(loginUser.getToken()); diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java index 63b03da7..b2fc3d95 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java @@ -4,6 +4,7 @@ import java.net.UnknownHostException; import java.util.LinkedList; import java.util.List; import java.util.Properties; + import com.ruoyi.common.utils.Arith; import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.framework.web.domain.server.Cpu; @@ -23,13 +24,12 @@ import oshi.util.Util; /** * 服务器相关信息 - * + * * @author ruoyi */ -public class Server -{ +public class Server { private static final int OSHI_WAIT_SECOND = 1000; - + /** * CPU相关信息 */ @@ -55,58 +55,47 @@ public class Server */ private List sysFiles = new LinkedList(); - public Cpu getCpu() - { + public Cpu getCpu() { return cpu; } - public void setCpu(Cpu cpu) - { + public void setCpu(Cpu cpu) { this.cpu = cpu; } - public Mem getMem() - { + public Mem getMem() { return mem; } - public void setMem(Mem mem) - { + public void setMem(Mem mem) { this.mem = mem; } - public Jvm getJvm() - { + public Jvm getJvm() { return jvm; } - public void setJvm(Jvm jvm) - { + public void setJvm(Jvm jvm) { this.jvm = jvm; } - public Sys getSys() - { + public Sys getSys() { return sys; } - public void setSys(Sys sys) - { + public void setSys(Sys sys) { this.sys = sys; } - public List getSysFiles() - { + public List getSysFiles() { return sysFiles; } - public void setSysFiles(List sysFiles) - { + public void setSysFiles(List sysFiles) { this.sysFiles = sysFiles; } - public void copyTo() throws Exception - { + public void copyTo() throws Exception { SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hal = si.getHardware(); @@ -124,8 +113,7 @@ public class Server /** * 设置CPU信息 */ - private void setCpuInfo(CentralProcessor processor) - { + private void setCpuInfo(CentralProcessor processor) { // CPU信息 long[] prevTicks = processor.getSystemCpuLoadTicks(); Util.sleep(OSHI_WAIT_SECOND); @@ -150,8 +138,7 @@ public class Server /** * 设置内存信息 */ - private void setMemInfo(GlobalMemory memory) - { + private void setMemInfo(GlobalMemory memory) { mem.setTotal(memory.getTotal()); mem.setUsed(memory.getTotal() - memory.getAvailable()); mem.setFree(memory.getAvailable()); @@ -160,8 +147,7 @@ public class Server /** * 设置服务器信息 */ - private void setSysInfo() - { + private void setSysInfo() { Properties props = System.getProperties(); sys.setComputerName(IpUtils.getHostName()); sys.setComputerIp(IpUtils.getHostIp()); @@ -173,8 +159,7 @@ public class Server /** * 设置Java虚拟机 */ - private void setJvmInfo() throws UnknownHostException - { + private void setJvmInfo() throws UnknownHostException { Properties props = System.getProperties(); jvm.setTotal(Runtime.getRuntime().totalMemory()); jvm.setMax(Runtime.getRuntime().maxMemory()); @@ -186,12 +171,10 @@ public class Server /** * 设置磁盘信息 */ - private void setSysFiles(OperatingSystem os) - { + private void setSysFiles(OperatingSystem os) { FileSystem fileSystem = os.getFileSystem(); List fsArray = fileSystem.getFileStores(); - for (OSFileStore fs : fsArray) - { + for (OSFileStore fs : fsArray) { long free = fs.getUsableSpace(); long total = fs.getTotalSpace(); long used = total - free; @@ -209,31 +192,23 @@ public class Server /** * 字节转换 - * + * * @param size 字节大小 * @return 转换后值 */ - public String convertFileSize(long size) - { + public String convertFileSize(long size) { long kb = 1024; long mb = kb * 1024; long gb = mb * 1024; - if (size >= gb) - { + if (size >= gb) { return String.format("%.1f GB", (float) size / gb); - } - else if (size >= mb) - { + } else if (size >= mb) { float f = (float) size / mb; return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f); - } - else if (size >= kb) - { + } else if (size >= kb) { float f = (float) size / kb; return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f); - } - else - { + } else { return String.format("%d B", size); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java index a13a66cf..4878bbd3 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -4,11 +4,10 @@ import com.ruoyi.common.utils.Arith; /** * CPU相关信息 - * + * * @author ruoyi */ -public class Cpu -{ +public class Cpu { /** * 核心数 */ @@ -39,63 +38,51 @@ public class Cpu */ private double free; - public int getCpuNum() - { + public int getCpuNum() { return cpuNum; } - public void setCpuNum(int cpuNum) - { + public void setCpuNum(int cpuNum) { this.cpuNum = cpuNum; } - public double getTotal() - { + public double getTotal() { return Arith.round(Arith.mul(total, 100), 2); } - public void setTotal(double total) - { + public void setTotal(double total) { this.total = total; } - public double getSys() - { + public double getSys() { return Arith.round(Arith.mul(sys / total, 100), 2); } - public void setSys(double sys) - { + public void setSys(double sys) { this.sys = sys; } - public double getUsed() - { + public double getUsed() { return Arith.round(Arith.mul(used / total, 100), 2); } - public void setUsed(double used) - { + public void setUsed(double used) { this.used = used; } - public double getWait() - { + public double getWait() { return Arith.round(Arith.mul(wait / total, 100), 2); } - public void setWait(double wait) - { + public void setWait(double wait) { this.wait = wait; } - public double getFree() - { + public double getFree() { return Arith.round(Arith.mul(free / total, 100), 2); } - public void setFree(double free) - { + public void setFree(double free) { this.free = free; } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java index 485d201d..62d043b1 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java @@ -1,16 +1,16 @@ package com.ruoyi.framework.web.domain.server; import java.lang.management.ManagementFactory; + import com.ruoyi.common.utils.Arith; import com.ruoyi.common.utils.DateUtils; /** * JVM相关信息 - * + * * @author ruoyi */ -public class Jvm -{ +public class Jvm { /** * 当前JVM占用的内存总数(M) */ @@ -36,87 +36,72 @@ public class Jvm */ private String home; - public double getTotal() - { + public double getTotal() { return Arith.div(total, (1024 * 1024), 2); } - public void setTotal(double total) - { + public void setTotal(double total) { this.total = total; } - public double getMax() - { + public double getMax() { return Arith.div(max, (1024 * 1024), 2); } - public void setMax(double max) - { + public void setMax(double max) { this.max = max; } - public double getFree() - { + public double getFree() { return Arith.div(free, (1024 * 1024), 2); } - public void setFree(double free) - { + public void setFree(double free) { this.free = free; } - public double getUsed() - { + public double getUsed() { return Arith.div(total - free, (1024 * 1024), 2); } - public double getUsage() - { + public double getUsage() { return Arith.mul(Arith.div(total - free, total, 4), 100); } /** * 获取JDK名称 */ - public String getName() - { + public String getName() { return ManagementFactory.getRuntimeMXBean().getVmName(); } - public String getVersion() - { + public String getVersion() { return version; } - public void setVersion(String version) - { + public void setVersion(String version) { this.version = version; } - public String getHome() - { + public String getHome() { return home; } - public void setHome(String home) - { + public void setHome(String home) { this.home = home; } /** * JDK启动时间 */ - public String getStartTime() - { + public String getStartTime() { return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); } /** * JDK运行时间 */ - public String getRunTime() - { + public String getRunTime() { return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java index 13eec521..f065d819 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java @@ -4,11 +4,10 @@ import com.ruoyi.common.utils.Arith; /** * 內存相关信息 - * + * * @author ruoyi */ -public class Mem -{ +public class Mem { /** * 内存总量 */ @@ -24,38 +23,31 @@ public class Mem */ private double free; - public double getTotal() - { + public double getTotal() { return Arith.div(total, (1024 * 1024 * 1024), 2); } - public void setTotal(long total) - { + public void setTotal(long total) { this.total = total; } - public double getUsed() - { + public double getUsed() { return Arith.div(used, (1024 * 1024 * 1024), 2); } - public void setUsed(long used) - { + public void setUsed(long used) { this.used = used; } - public double getFree() - { + public double getFree() { return Arith.div(free, (1024 * 1024 * 1024), 2); } - public void setFree(long free) - { + public void setFree(long free) { this.free = free; } - public double getUsage() - { + public double getUsage() { return Arith.mul(Arith.div(used, total, 4), 100); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java index 45d64d9c..7c3857ee 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java @@ -2,11 +2,10 @@ package com.ruoyi.framework.web.domain.server; /** * 系统相关信息 - * + * * @author ruoyi */ -public class Sys -{ +public class Sys { /** * 服务器名称 */ @@ -32,53 +31,43 @@ public class Sys */ private String osArch; - public String getComputerName() - { + public String getComputerName() { return computerName; } - public void setComputerName(String computerName) - { + public void setComputerName(String computerName) { this.computerName = computerName; } - public String getComputerIp() - { + public String getComputerIp() { return computerIp; } - public void setComputerIp(String computerIp) - { + public void setComputerIp(String computerIp) { this.computerIp = computerIp; } - public String getUserDir() - { + public String getUserDir() { return userDir; } - public void setUserDir(String userDir) - { + public void setUserDir(String userDir) { this.userDir = userDir; } - public String getOsName() - { + public String getOsName() { return osName; } - public void setOsName(String osName) - { + public void setOsName(String osName) { this.osName = osName; } - public String getOsArch() - { + public String getOsArch() { return osArch; } - public void setOsArch(String osArch) - { + public void setOsArch(String osArch) { this.osArch = osArch; } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java index 1320cde6..0c4710a6 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java @@ -2,11 +2,10 @@ package com.ruoyi.framework.web.domain.server; /** * 系统文件相关信息 - * + * * @author ruoyi */ -public class SysFile -{ +public class SysFile { /** * 盘符路径 */ @@ -42,73 +41,59 @@ public class SysFile */ private double usage; - public String getDirName() - { + public String getDirName() { return dirName; } - public void setDirName(String dirName) - { + public void setDirName(String dirName) { this.dirName = dirName; } - public String getSysTypeName() - { + public String getSysTypeName() { return sysTypeName; } - public void setSysTypeName(String sysTypeName) - { + public void setSysTypeName(String sysTypeName) { this.sysTypeName = sysTypeName; } - public String getTypeName() - { + public String getTypeName() { return typeName; } - public void setTypeName(String typeName) - { + public void setTypeName(String typeName) { this.typeName = typeName; } - public String getTotal() - { + public String getTotal() { return total; } - public void setTotal(String total) - { + public void setTotal(String total) { this.total = total; } - public String getFree() - { + public String getFree() { return free; } - public void setFree(String free) - { + public void setFree(String free) { this.free = free; } - public String getUsed() - { + public String getUsed() { return used; } - public void setUsed(String used) - { + public void setUsed(String used) { this.used = used; } - public double getUsage() - { + public double getUsage() { return usage; } - public void setUsage(double usage) - { + public void setUsage(double usage) { this.usage = usage; } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index 845c6f25..44d5222d 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -19,20 +19,18 @@ import com.ruoyi.common.utils.StringUtils; /** * 全局异常处理器 - * + * * @author ruoyi */ @RestControllerAdvice -public class GlobalExceptionHandler -{ +public class GlobalExceptionHandler { private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); /** * 基础异常 */ @ExceptionHandler(BaseException.class) - public AjaxResult baseException(BaseException e) - { + public AjaxResult baseException(BaseException e) { return AjaxResult.error(e.getMessage()); } @@ -40,46 +38,39 @@ public class GlobalExceptionHandler * 业务异常 */ @ExceptionHandler(CustomException.class) - public AjaxResult businessException(CustomException e) - { - if (StringUtils.isNull(e.getCode())) - { + public AjaxResult businessException(CustomException e) { + if (StringUtils.isNull(e.getCode())) { return AjaxResult.error(e.getMessage()); } return AjaxResult.error(e.getCode(), e.getMessage()); } @ExceptionHandler(NoHandlerFoundException.class) - public AjaxResult handlerNoFoundException(Exception e) - { + public AjaxResult handlerNoFoundException(Exception e) { log.error(e.getMessage(), e); return AjaxResult.error(HttpStatus.NOT_FOUND, "路径不存在,请检查路径是否正确"); } @ExceptionHandler(AccessDeniedException.class) - public AjaxResult handleAuthorizationException(AccessDeniedException e) - { + public AjaxResult handleAuthorizationException(AccessDeniedException e) { log.error(e.getMessage()); return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); } @ExceptionHandler(AccountExpiredException.class) - public AjaxResult handleAccountExpiredException(AccountExpiredException e) - { + public AjaxResult handleAccountExpiredException(AccountExpiredException e) { log.error(e.getMessage(), e); return AjaxResult.error(e.getMessage()); } @ExceptionHandler(UsernameNotFoundException.class) - public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) - { + public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) { log.error(e.getMessage(), e); return AjaxResult.error(e.getMessage()); } @ExceptionHandler(Exception.class) - public AjaxResult handleException(Exception e) - { + public AjaxResult handleException(Exception e) { log.error(e.getMessage(), e); return AjaxResult.error(e.getMessage()); } @@ -88,8 +79,7 @@ public class GlobalExceptionHandler * 自定义验证异常 */ @ExceptionHandler(BindException.class) - public AjaxResult validatedBindException(BindException e) - { + public AjaxResult validatedBindException(BindException e) { log.error(e.getMessage(), e); String message = e.getAllErrors().get(0).getDefaultMessage(); return AjaxResult.error(message); @@ -99,8 +89,7 @@ public class GlobalExceptionHandler * 自定义验证异常 */ @ExceptionHandler(MethodArgumentNotValidException.class) - public Object validExceptionHandler(MethodArgumentNotValidException e) - { + public Object validExceptionHandler(MethodArgumentNotValidException e) { log.error(e.getMessage(), e); String message = e.getBindingResult().getFieldError().getDefaultMessage(); return AjaxResult.error(message); @@ -110,8 +99,7 @@ public class GlobalExceptionHandler * 演示模式异常 */ @ExceptionHandler(DemoModeException.class) - public AjaxResult demoModeException(DemoModeException e) - { + public AjaxResult demoModeException(DemoModeException e) { return AjaxResult.error("演示模式,不允许操作"); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AuthService.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AuthService.java new file mode 100644 index 00000000..e90b554c --- /dev/null +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/AuthService.java @@ -0,0 +1,106 @@ +package com.ruoyi.framework.web.service; + + +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.sign.Md5Utils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.system.domain.TUserAccountInfo; +import com.ruoyi.system.domain.TUserLoginLog; +import com.ruoyi.system.mapper.TUserAccountInfoMapper; +import com.ruoyi.system.mapper.TUserLoginLogMapper; +import com.ruoyi.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 类名: AuthServiceImpl + * 描述: TODO + * 时间: 2021-08-11,0011 12:34 + * 开发人: admin + */ +@Service +public class AuthService { + + @Autowired + private TUserAccountInfoMapper userAccountInfoMapper; + + @Autowired + private TUserLoginLogMapper userLoginLogMapper; + + @Autowired + private TokenService tokenService; + + @Resource + private AuthenticationManager authenticationManager; + @Autowired + private ISysUserService sysUserService; + + + @Transactional + public String mpLogin(String code, String openId, String sessionKey, String accessToken) { + //查询用户是否存在,不存在创建 + SysUser sysUser = sysUserService.selectUserByOpenId(openId); + if(sysUser==null) + { + //创建用户 + sysUser=new SysUser(); + sysUser.setOpenId(openId); + sysUser.setNickName("微信注册用户"); + sysUser.setPassword("123456"); + sysUser.setUserName(Md5Utils.hash(openId).toUpperCase().substring(20)); + sysUser.setCreateBy("微信小程序"); + sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPassword())); + sysUserService.insertUser(sysUser); + } +// Authentication authentication = null; +// try { +// +// // 该方法会去调用 UserDetailsServiceImpl.loadUserByUsername +// authentication = authenticationManager +// .authenticate(new UsernamePasswordAuthenticationToken(openId, sysUser.getPassword())); +// }catch (Exception e){ +// e.printStackTrace(); +// } +// LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + Set permissions=new HashSet<>(); + permissions.add("*:*:*"); + LoginUser loginUser = new LoginUser(sysUser,permissions); + + // 生成token + String token= tokenService.createToken(loginUser); + return token; + + } + +// public UserDetails loadUserByOpenId(String openId) { +// TUserAccountInfoExample tUserAccountInfoExample = new TUserAccountInfoExample(); +// TUserAccountInfoExample.Criteria criteria = tUserAccountInfoExample.createCriteria(); +// criteria.andOpenIdEqualTo(openId); +// TUserAccountInfo tUserAccountInfo = userAccountInfoMapper.selectOneByExample(tUserAccountInfoExample); +// if (tUserAccountInfo == null) { +// return null; +// } else { +// UserInfoDetails userInfoDetails = new UserInfoDetails(tUserAccountInfo); +// return userInfoDetails; +// } +// } +} diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java index 277e4b99..d91532e5 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java @@ -1,6 +1,7 @@ package com.ruoyi.framework.web.service; import java.util.Set; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -11,16 +12,19 @@ import com.ruoyi.common.utils.StringUtils; /** * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 - * + * * @author ruoyi */ @Service("ss") -public class PermissionService -{ - /** 所有权限标识 */ +public class PermissionService { + /** + * 所有权限标识 + */ private static final String ALL_PERMISSION = "*:*:*"; - /** 管理员角色权限标识 */ + /** + * 管理员角色权限标识 + */ private static final String SUPER_ADMIN = "admin"; private static final String ROLE_DELIMETER = ","; @@ -32,19 +36,16 @@ public class PermissionService /** * 验证用户是否具备某权限 - * + * * @param permission 权限字符串 * @return 用户是否具备某权限 */ - public boolean hasPermi(String permission) - { - if (StringUtils.isEmpty(permission)) - { + public boolean hasPermi(String permission) { + if (StringUtils.isEmpty(permission)) { return false; } LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) - { + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) { return false; } return hasPermissions(loginUser.getPermissions(), permission); @@ -56,8 +57,7 @@ public class PermissionService * @param permission 权限字符串 * @return 用户是否不具备某权限 */ - public boolean lacksPermi(String permission) - { + public boolean lacksPermi(String permission) { return hasPermi(permission) != true; } @@ -67,22 +67,17 @@ public class PermissionService * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 * @return 用户是否具有以下任意一个权限 */ - public boolean hasAnyPermi(String permissions) - { - if (StringUtils.isEmpty(permissions)) - { + public boolean hasAnyPermi(String permissions) { + if (StringUtils.isEmpty(permissions)) { return false; } LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) - { + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) { return false; } Set authorities = loginUser.getPermissions(); - for (String permission : permissions.split(PERMISSION_DELIMETER)) - { - if (permission != null && hasPermissions(authorities, permission)) - { + for (String permission : permissions.split(PERMISSION_DELIMETER)) { + if (permission != null && hasPermissions(authorities, permission)) { return true; } } @@ -91,26 +86,21 @@ public class PermissionService /** * 判断用户是否拥有某个角色 - * + * * @param role 角色字符串 * @return 用户是否具备某角色 */ - public boolean hasRole(String role) - { - if (StringUtils.isEmpty(role)) - { + public boolean hasRole(String role) { + if (StringUtils.isEmpty(role)) { return false; } LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) - { + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) { return false; } - for (SysRole sysRole : loginUser.getUser().getRoles()) - { + for (SysRole sysRole : loginUser.getUser().getRoles()) { String roleKey = sysRole.getRoleKey(); - if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role))) - { + if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role))) { return true; } } @@ -123,8 +113,7 @@ public class PermissionService * @param role 角色名称 * @return 用户是否不具备某角色 */ - public boolean lacksRole(String role) - { + public boolean lacksRole(String role) { return hasRole(role) != true; } @@ -134,21 +123,16 @@ public class PermissionService * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 * @return 用户是否具有以下任意一个角色 */ - public boolean hasAnyRoles(String roles) - { - if (StringUtils.isEmpty(roles)) - { + public boolean hasAnyRoles(String roles) { + if (StringUtils.isEmpty(roles)) { return false; } LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); - if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) - { + if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) { return false; } - for (String role : roles.split(ROLE_DELIMETER)) - { - if (hasRole(role)) - { + for (String role : roles.split(ROLE_DELIMETER)) { + if (hasRole(role)) { return true; } } @@ -157,13 +141,12 @@ public class PermissionService /** * 判断是否包含权限 - * + * * @param permissions 权限列表 - * @param permission 权限字符串 + * @param permission 权限字符串 * @return 用户是否具备某权限 */ - private boolean hasPermissions(Set permissions, String permission) - { + private boolean hasPermissions(Set permissions, String permission) { return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index b56b4370..528461ca 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -1,6 +1,19 @@ package com.ruoyi.framework.web.service; import javax.annotation.Resource; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.config.WxMaConfig; +import com.google.gson.Gson; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.MpLoginBody; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.sign.Md5Utils; +import com.ruoyi.common.utils.uuid.UUID; +import com.ruoyi.system.service.ISysUserService; +import com.ruoyi.system.service.impl.SysUserServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.BadCredentialsException; @@ -17,15 +30,18 @@ import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.Map; /** * 登录校验方法 - * + * * @author ruoyi */ @Component -public class SysLoginService -{ +public class SysLoginService { @Autowired private TokenService tokenService; @@ -35,47 +51,47 @@ public class SysLoginService @Autowired private RedisCache redisCache; + @Autowired + private WxMaService wxMaService; + + @Autowired + private AuthService authService; + + @Autowired + private ISysUserService sysUserService; + /** * 登录验证 - * + * * @param username 用户名 * @param password 密码 - * @param code 验证码 - * @param uuid 唯一标识 + * @param code 验证码 + * @param uuid 唯一标识 * @return 结果 */ - public String login(String username, String password, String code, String uuid) - { + public String login(String username, String password, String code, String uuid) { String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; String captcha = redisCache.getCacheObject(verifyKey); redisCache.deleteObject(verifyKey); - if (captcha == null) - { + if (captcha == null) { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); throw new CaptchaExpireException(); } - if (!code.equalsIgnoreCase(captcha)) - { + if (!code.equalsIgnoreCase(captcha)) { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); throw new CaptchaException(); } // 用户验证 Authentication authentication = null; - try - { + try { // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername authentication = authenticationManager .authenticate(new UsernamePasswordAuthenticationToken(username, password)); - } - catch (Exception e) - { - if (e instanceof BadCredentialsException) - { + } catch (Exception e) { + if (e instanceof BadCredentialsException) { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); throw new UserPasswordNotMatchException(); - } - else - { + } else { AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); throw new CustomException(e.getMessage()); } @@ -85,4 +101,64 @@ public class SysLoginService // 生成token return tokenService.createToken(loginUser); } + + public String mpLlogin(MpLoginBody loginBody) { + + System.out.println(loginBody); + String code = loginBody.getCode(); + if (StringUtils.isEmpty(code)) { + throw new CustomException("无效的code"); + + } else { + //存在有效的 code + System.out.println("这里请求了一次code==========" + code); + WxMaJscode2SessionResult session = null; + try { + session = wxMaService.getUserService().getSessionInfo(code); + } catch (Exception e) { + e.printStackTrace(); + throw new CustomException(e.getMessage()); + } + WxMaConfig wxMaConfig = wxMaService.getWxMaConfig(); + System.out.println(wxMaConfig); + System.out.println(new Gson().toJson(wxMaConfig)); + String sessionKey = session.getSessionKey(); + String openid = session.getOpenid(); + String unionid = session.getUnionid(); + System.out.println("sessionKey= " + sessionKey); + System.out.println("openid= " + openid); + System.out.println("unionid= " + unionid); + //通过openId sessionKey 生成3rd session 返回给客户端小程序 + String accessToken = UUID.fastUUID().toString().replace("-", ""); + + String token = authService.mpLogin(code, openid, sessionKey, accessToken); + +// TUserAccountInfo userInfo = userAccoutInfoSevice.getUserInfo(openid); +// Integer userType = userInfo.getUserType(); + + Map data = new HashMap<>(); + data.put("token", token); +// data.put("userInfo", userInfo); +// data.put("userType", userType); + + +// if (userType.intValue() == 0)//新用户 +// { +//// HashMap supplierInfo = supplierInfoSevice.getSupplierInfo(userInfo.getId()); +//// data.put("userInfo", userInfo); +//// data.put("supplyInfo", supplierInfo); +// +// //已授权用户 +// } else if (userType.intValue() == 1)//注册老用户 +// { +//// data.put("userInfo", userInfo); +// } else if (userType.intValue() == 2) { //注册商家 +//// data.put("userInfo", userInfo); +//// data.put("userType", userType); +// } + + System.out.println("jwtToken : " + token); + return token; + } + } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java index feb80387..f1dfd2b6 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java @@ -2,6 +2,7 @@ package com.ruoyi.framework.web.service; import java.util.HashSet; import java.util.Set; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.ruoyi.common.core.domain.entity.SysUser; @@ -10,12 +11,11 @@ import com.ruoyi.system.service.ISysRoleService; /** * 用户权限处理 - * + * * @author ruoyi */ @Component -public class SysPermissionService -{ +public class SysPermissionService { @Autowired private ISysRoleService roleService; @@ -24,20 +24,16 @@ public class SysPermissionService /** * 获取角色数据权限 - * + * * @param user 用户信息 * @return 角色权限信息 */ - public Set getRolePermission(SysUser user) - { + public Set getRolePermission(SysUser user) { Set roles = new HashSet(); // 管理员拥有所有权限 - if (user.isAdmin()) - { + if (user.isAdmin()) { roles.add("admin"); - } - else - { + } else { roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); } return roles; @@ -45,20 +41,16 @@ public class SysPermissionService /** * 获取菜单数据权限 - * + * * @param user 用户信息 * @return 菜单权限信息 */ - public Set getMenuPermission(SysUser user) - { + public Set getMenuPermission(SysUser user) { Set perms = new HashSet(); // 管理员拥有所有权限 - if (user.isAdmin()) - { + if (user.isAdmin()) { perms.add("*:*:*"); - } - else - { + } else { perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); } return perms; diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java index 00238559..ff9ede00 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -26,8 +27,7 @@ import io.jsonwebtoken.SignatureAlgorithm; * @author ruoyi */ @Component -public class TokenService -{ +public class TokenService { // 令牌自定义标识 @Value("${token.header}") private String header; @@ -54,12 +54,16 @@ public class TokenService * * @return 用户信息 */ - public LoginUser getLoginUser(HttpServletRequest request) - { + public LoginUser getLoginUser(HttpServletRequest request) { // 获取请求携带的令牌 String token = getToken(request); - if (StringUtils.isNotEmpty(token)) + String requestURI = request.getRequestURI(); + StringBuffer requestURL = request.getRequestURL(); + if(requestURI.contains( "wxLogin")) { + return null; + } + if (StringUtils.isNotEmpty(token) ) { Claims claims = parseToken(token); // 解析对应的权限以及用户信息 String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); @@ -73,10 +77,8 @@ public class TokenService /** * 设置用户身份信息 */ - public void setLoginUser(LoginUser loginUser) - { - if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) - { + public void setLoginUser(LoginUser loginUser) { + if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) { refreshToken(loginUser); } } @@ -84,10 +86,8 @@ public class TokenService /** * 删除用户身份信息 */ - public void delLoginUser(String token) - { - if (StringUtils.isNotEmpty(token)) - { + public void delLoginUser(String token) { + if (StringUtils.isNotEmpty(token)) { String userKey = getTokenKey(token); redisCache.deleteObject(userKey); } @@ -99,8 +99,7 @@ public class TokenService * @param loginUser 用户信息 * @return 令牌 */ - public String createToken(LoginUser loginUser) - { + public String createToken(LoginUser loginUser) { String token = IdUtils.fastUUID(); loginUser.setToken(token); setUserAgent(loginUser); @@ -117,12 +116,10 @@ public class TokenService * @param loginUser * @return 令牌 */ - public void verifyToken(LoginUser loginUser) - { + public void verifyToken(LoginUser loginUser) { long expireTime = loginUser.getExpireTime(); long currentTime = System.currentTimeMillis(); - if (expireTime - currentTime <= MILLIS_MINUTE_TEN) - { + if (expireTime - currentTime <= MILLIS_MINUTE_TEN) { refreshToken(loginUser); } } @@ -132,8 +129,7 @@ public class TokenService * * @param loginUser 登录信息 */ - public void refreshToken(LoginUser loginUser) - { + public void refreshToken(LoginUser loginUser) { loginUser.setLoginTime(System.currentTimeMillis()); loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE); // 根据uuid将loginUser缓存 @@ -146,8 +142,7 @@ public class TokenService * * @param loginUser 登录信息 */ - public void setUserAgent(LoginUser loginUser) - { + public void setUserAgent(LoginUser loginUser) { UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); loginUser.setIpaddr(ip); @@ -162,8 +157,7 @@ public class TokenService * @param claims 数据声明 * @return 令牌 */ - private String createToken(Map claims) - { + private String createToken(Map claims) { String token = Jwts.builder() .setClaims(claims) .signWith(SignatureAlgorithm.HS512, secret).compact(); @@ -176,8 +170,7 @@ public class TokenService * @param token 令牌 * @return 数据声明 */ - private Claims parseToken(String token) - { + private Claims parseToken(String token) { return Jwts.parser() .setSigningKey(secret) .parseClaimsJws(token) @@ -190,8 +183,7 @@ public class TokenService * @param token 令牌 * @return 用户名 */ - public String getUsernameFromToken(String token) - { + public String getUsernameFromToken(String token) { Claims claims = parseToken(token); return claims.getSubject(); } @@ -202,18 +194,15 @@ public class TokenService * @param request * @return token */ - private String getToken(HttpServletRequest request) - { + private String getToken(HttpServletRequest request) { String token = request.getHeader(header); - if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) - { + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) { token = token.replace(Constants.TOKEN_PREFIX, ""); } return token; } - private String getTokenKey(String uuid) - { + private String getTokenKey(String uuid) { return Constants.LOGIN_TOKEN_KEY + uuid; } } diff --git a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java index 35fd05e2..9b60dedb 100644 --- a/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java +++ b/spring-boot/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.framework.web.service; +import com.ruoyi.system.domain.TUserAccountInfo; +import com.ruoyi.system.service.impl.TUserAccountInfoServiceImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -14,14 +16,16 @@ import com.ruoyi.common.exception.BaseException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.service.ISysUserService; +import java.util.HashSet; +import java.util.List; + /** * 用户验证处理 * * @author ruoyi */ @Service -public class UserDetailsServiceImpl implements UserDetailsService -{ +public class UserDetailsServiceImpl implements UserDetailsService { private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class); @Autowired @@ -30,22 +34,27 @@ public class UserDetailsServiceImpl implements UserDetailsService @Autowired private SysPermissionService permissionService; + @Autowired + private TUserAccountInfoServiceImpl userAccountInfoService; + @Override - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException - { + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { SysUser user = userService.selectUserByUserName(username); - if (StringUtils.isNull(user)) - { + if (user == null) { + //微信小程序登陆 + user = userService.selectUserByOpenId(username); + if (user == null ) { + log.info("新用户登录:{} ", username); + } + return createLoginUser(user); + } + if (StringUtils.isNull(user)) { log.info("登录用户:{} 不存在.", username); throw new UsernameNotFoundException("登录用户:" + username + " 不存在"); - } - else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) - { + } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { log.info("登录用户:{} 已被删除.", username); throw new BaseException("对不起,您的账号:" + username + " 已被删除"); - } - else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) - { + } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { log.info("登录用户:{} 已被停用.", username); throw new BaseException("对不起,您的账号:" + username + " 已停用"); } @@ -53,8 +62,13 @@ public class UserDetailsServiceImpl implements UserDetailsService return createLoginUser(user); } - public UserDetails createLoginUser(SysUser user) - { + public UserDetails createLoginUser(SysUser user) { return new LoginUser(user, permissionService.getMenuPermission(user)); } + + public UserDetails createWxLoginUser(SysUser user) { + HashSet permissions = new HashSet<>(); + permissions.add("*:*:*"); + return new LoginUser(user, permissions); + } } diff --git a/spring-boot/ruoyi-generator/pom.xml b/spring-boot/ruoyi-generator/pom.xml index 6e9802b9..62bd419b 100644 --- a/spring-boot/ruoyi-generator/pom.xml +++ b/spring-boot/ruoyi-generator/pom.xml @@ -28,6 +28,15 @@ com.ruoyi ruoyi-common + + com.baomidou + mybatis-plus-generator + 3.3.2 + + + mysql + mysql-connector-java + diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/SggCodeGenerator.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/SggCodeGenerator.java new file mode 100644 index 00000000..4cc8e9ae --- /dev/null +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/SggCodeGenerator.java @@ -0,0 +1,70 @@ +package com.ruoyi.generator; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import com.baomidou.mybatisplus.generator.config.GlobalConfig; +import com.baomidou.mybatisplus.generator.config.PackageConfig; +import com.baomidou.mybatisplus.generator.config.StrategyConfig; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; + +public class SggCodeGenerator { + + public static void main(String[] args) { + + // 1、创建代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 2、全局配置 + GlobalConfig gc = new GlobalConfig(); + String projectPath = System.getProperty("user.dir"); + gc.setOutputDir(projectPath + "/ruoyi-system/src/main/java"); + gc.setAuthor("wxy"); + gc.setOpen(false); //生成后是否打开资源管理器 + gc.setFileOverride(false); //重新生成时文件是否覆盖 + gc.setServiceName("%sService"); //去掉Service接口的首字母I + gc.setIdType(IdType.ID_WORKER_STR); //主键策略 + gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 + gc.setSwagger2(false);//开启Swagger2模式 + + mpg.setGlobalConfig(gc); + + // 3、数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl("jdbc:mysql://51xy.xyz:3316/develop_xiaoyi_wumei?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"); + dsc.setDriverName("com.mysql.cj.jdbc.Driver"); + dsc.setUsername("xiaoyi"); + dsc.setPassword("123456"); + dsc.setDbType(DbType.MYSQL); + mpg.setDataSource(dsc); + + // 4、包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(null); //模块名 + pc.setParent("com.ruoyi.common.core"); + pc.setController("controller"); + pc.setEntity("entity"); + pc.setService("service"); + pc.setMapper("mapper"); + mpg.setPackageInfo(pc); + + // 5、策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setTablePrefix("t_%");//对那一张表生成代码 + strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 + strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 + + strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 + strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 + + strategy.setRestControllerStyle(true); //restful api风格控制器 + strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 + + mpg.setStrategy(strategy); + + // 6、执行 + mpg.execute(); + } +} \ No newline at end of file diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java index cc4cd14c..7baa6cd5 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java @@ -7,67 +7,66 @@ import org.springframework.stereotype.Component; /** * 读取代码生成相关配置 - * + * * @author ruoyi */ @Component @ConfigurationProperties(prefix = "gen") -@PropertySource(value = { "classpath:generator.yml" }) -public class GenConfig -{ - /** 作者 */ +@PropertySource(value = {"classpath:generator.yml"}) +public class GenConfig { + /** + * 作者 + */ public static String author; - /** 生成包路径 */ + /** + * 生成包路径 + */ public static String packageName; - /** 自动去除表前缀,默认是false */ + /** + * 自动去除表前缀,默认是false + */ public static boolean autoRemovePre; - /** 表前缀(类名不会包含表前缀) */ + /** + * 表前缀(类名不会包含表前缀) + */ public static String tablePrefix; - public static String getAuthor() - { + public static String getAuthor() { return author; } @Value("${author}") - public void setAuthor(String author) - { + public void setAuthor(String author) { GenConfig.author = author; } - public static String getPackageName() - { + public static String getPackageName() { return packageName; } @Value("${packageName}") - public void setPackageName(String packageName) - { + public void setPackageName(String packageName) { GenConfig.packageName = packageName; } - public static boolean getAutoRemovePre() - { + public static boolean getAutoRemovePre() { return autoRemovePre; } @Value("${autoRemovePre}") - public void setAutoRemovePre(boolean autoRemovePre) - { + public void setAutoRemovePre(boolean autoRemovePre) { GenConfig.autoRemovePre = autoRemovePre; } - public static String getTablePrefix() - { + public static String getTablePrefix() { return tablePrefix; } @Value("${tablePrefix}") - public void setTablePrefix(String tablePrefix) - { + public void setTablePrefix(String tablePrefix) { GenConfig.tablePrefix = tablePrefix; } } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java index 8195206f..52759edf 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; + import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -30,13 +31,12 @@ import com.ruoyi.generator.service.IGenTableService; /** * 代码生成 操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/tool/gen") -public class GenController extends BaseController -{ +public class GenController extends BaseController { @Autowired private IGenTableService genTableService; @@ -48,8 +48,7 @@ public class GenController extends BaseController */ @PreAuthorize("@ss.hasPermi('tool:gen:list')") @GetMapping("/list") - public TableDataInfo genList(GenTable genTable) - { + public TableDataInfo genList(GenTable genTable) { startPage(); List list = genTableService.selectGenTableList(genTable); return getDataTable(list); @@ -60,8 +59,7 @@ public class GenController extends BaseController */ @PreAuthorize("@ss.hasPermi('tool:gen:query')") @GetMapping(value = "/{talbleId}") - public AjaxResult getInfo(@PathVariable Long talbleId) - { + public AjaxResult getInfo(@PathVariable Long talbleId) { GenTable table = genTableService.selectGenTableById(talbleId); List tables = genTableService.selectGenTableAll(); List list = genTableColumnService.selectGenTableColumnListByTableId(talbleId); @@ -77,8 +75,7 @@ public class GenController extends BaseController */ @PreAuthorize("@ss.hasPermi('tool:gen:list')") @GetMapping("/db/list") - public TableDataInfo dataList(GenTable genTable) - { + public TableDataInfo dataList(GenTable genTable) { startPage(); List list = genTableService.selectDbTableList(genTable); return getDataTable(list); @@ -89,8 +86,7 @@ public class GenController extends BaseController */ @PreAuthorize("@ss.hasPermi('tool:gen:list')") @GetMapping(value = "/column/{talbleId}") - public TableDataInfo columnList(Long tableId) - { + public TableDataInfo columnList(Long tableId) { TableDataInfo dataInfo = new TableDataInfo(); List list = genTableColumnService.selectGenTableColumnListByTableId(tableId); dataInfo.setRows(list); @@ -104,8 +100,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:list')") @Log(title = "代码生成", businessType = BusinessType.IMPORT) @PostMapping("/importTable") - public AjaxResult importTableSave(String tables) - { + public AjaxResult importTableSave(String tables) { String[] tableNames = Convert.toStrArray(tables); // 查询表信息 List tableList = genTableService.selectDbTableListByNames(tableNames); @@ -119,8 +114,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:edit')") @Log(title = "代码生成", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult editSave(@Validated @RequestBody GenTable genTable) - { + public AjaxResult editSave(@Validated @RequestBody GenTable genTable) { genTableService.validateEdit(genTable); genTableService.updateGenTable(genTable); return AjaxResult.success(); @@ -132,8 +126,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:remove')") @Log(title = "代码生成", businessType = BusinessType.DELETE) @DeleteMapping("/{tableIds}") - public AjaxResult remove(@PathVariable Long[] tableIds) - { + public AjaxResult remove(@PathVariable Long[] tableIds) { genTableService.deleteGenTableByIds(tableIds); return AjaxResult.success(); } @@ -143,8 +136,7 @@ public class GenController extends BaseController */ @PreAuthorize("@ss.hasPermi('tool:gen:preview')") @GetMapping("/preview/{tableId}") - public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException - { + public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException { Map dataMap = genTableService.previewCode(tableId); return AjaxResult.success(dataMap); } @@ -155,8 +147,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/download/{tableName}") - public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException - { + public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { byte[] data = genTableService.downloadCode(tableName); genCode(response, data); } @@ -167,8 +158,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/genCode/{tableName}") - public AjaxResult genCode(@PathVariable("tableName") String tableName) - { + public AjaxResult genCode(@PathVariable("tableName") String tableName) { genTableService.generatorCode(tableName); return AjaxResult.success(); } @@ -179,8 +169,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:edit')") @Log(title = "代码生成", businessType = BusinessType.UPDATE) @GetMapping("/synchDb/{tableName}") - public AjaxResult synchDb(@PathVariable("tableName") String tableName) - { + public AjaxResult synchDb(@PathVariable("tableName") String tableName) { genTableService.synchDb(tableName); return AjaxResult.success(); } @@ -191,8 +180,7 @@ public class GenController extends BaseController @PreAuthorize("@ss.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/batchGenCode") - public void batchGenCode(HttpServletResponse response, String tables) throws IOException - { + public void batchGenCode(HttpServletResponse response, String tables) throws IOException { String[] tableNames = Convert.toStrArray(tables); byte[] data = genTableService.downloadCode(tableNames); genCode(response, data); @@ -201,8 +189,7 @@ public class GenController extends BaseController /** * 生成zip文件 */ - private void genCode(HttpServletResponse response, byte[] data) throws IOException - { + private void genCode(HttpServletResponse response, byte[] data) throws IOException { response.reset(); response.addHeader("Access-Control-Allow-Origin", "*"); response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java index 269779cf..eaa01081 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java @@ -3,6 +3,7 @@ package com.ruoyi.generator.domain; import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotBlank; + import org.apache.commons.lang3.ArrayUtils; import com.ruoyi.common.constant.GenConstants; import com.ruoyi.common.core.domain.BaseEntity; @@ -10,360 +11,350 @@ import com.ruoyi.common.utils.StringUtils; /** * 业务表 gen_table - * + * * @author ruoyi */ -public class GenTable extends BaseEntity -{ +public class GenTable extends BaseEntity { private static final long serialVersionUID = 1L; - /** 编号 */ + /** + * 编号 + */ private Long tableId; - /** 表名称 */ + /** + * 表名称 + */ @NotBlank(message = "表名称不能为空") private String tableName; - /** 表描述 */ + /** + * 表描述 + */ @NotBlank(message = "表描述不能为空") private String tableComment; - /** 关联父表的表名 */ + /** + * 关联父表的表名 + */ private String subTableName; - /** 本表关联父表的外键名 */ + /** + * 本表关联父表的外键名 + */ private String subTableFkName; - /** 实体类名称(首字母大写) */ + /** + * 实体类名称(首字母大写) + */ @NotBlank(message = "实体类名称不能为空") private String className; - /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */ + /** + * 使用的模板(crud单表操作 tree树表操作 sub主子表操作) + */ private String tplCategory; - /** 生成包路径 */ + /** + * 生成包路径 + */ @NotBlank(message = "生成包路径不能为空") private String packageName; - /** 生成模块名 */ + /** + * 生成模块名 + */ @NotBlank(message = "生成模块名不能为空") private String moduleName; - /** 生成业务名 */ + /** + * 生成业务名 + */ @NotBlank(message = "生成业务名不能为空") private String businessName; - /** 生成功能名 */ + /** + * 生成功能名 + */ @NotBlank(message = "生成功能名不能为空") private String functionName; - /** 生成作者 */ + /** + * 生成作者 + */ @NotBlank(message = "作者不能为空") private String functionAuthor; - /** 生成代码方式(0zip压缩包 1自定义路径) */ + /** + * 生成代码方式(0zip压缩包 1自定义路径) + */ private String genType; - /** 生成路径(不填默认项目路径) */ + /** + * 生成路径(不填默认项目路径) + */ private String genPath; - /** 主键信息 */ + /** + * 主键信息 + */ private GenTableColumn pkColumn; - /** 子表信息 */ + /** + * 子表信息 + */ private GenTable subTable; - /** 表列信息 */ + /** + * 表列信息 + */ @Valid private List columns; - /** 其它生成选项 */ + /** + * 其它生成选项 + */ private String options; - /** 树编码字段 */ + /** + * 树编码字段 + */ private String treeCode; - /** 树父编码字段 */ + /** + * 树父编码字段 + */ private String treeParentCode; - /** 树名称字段 */ + /** + * 树名称字段 + */ private String treeName; - /** 上级菜单ID字段 */ + /** + * 上级菜单ID字段 + */ private String parentMenuId; - /** 上级菜单名称字段 */ + /** + * 上级菜单名称字段 + */ private String parentMenuName; - public Long getTableId() - { + public Long getTableId() { return tableId; } - public void setTableId(Long tableId) - { + public void setTableId(Long tableId) { this.tableId = tableId; } - public String getTableName() - { + public String getTableName() { return tableName; } - public void setTableName(String tableName) - { + public void setTableName(String tableName) { this.tableName = tableName; } - public String getTableComment() - { + public String getTableComment() { return tableComment; } - public void setTableComment(String tableComment) - { + public void setTableComment(String tableComment) { this.tableComment = tableComment; } - public String getSubTableName() - { + public String getSubTableName() { return subTableName; } - public void setSubTableName(String subTableName) - { + public void setSubTableName(String subTableName) { this.subTableName = subTableName; } - public String getSubTableFkName() - { + public String getSubTableFkName() { return subTableFkName; } - public void setSubTableFkName(String subTableFkName) - { + public void setSubTableFkName(String subTableFkName) { this.subTableFkName = subTableFkName; } - public String getClassName() - { + public String getClassName() { return className; } - public void setClassName(String className) - { + public void setClassName(String className) { this.className = className; } - public String getTplCategory() - { + public String getTplCategory() { return tplCategory; } - public void setTplCategory(String tplCategory) - { + public void setTplCategory(String tplCategory) { this.tplCategory = tplCategory; } - public String getPackageName() - { + public String getPackageName() { return packageName; } - public void setPackageName(String packageName) - { + public void setPackageName(String packageName) { this.packageName = packageName; } - public String getModuleName() - { + public String getModuleName() { return moduleName; } - public void setModuleName(String moduleName) - { + public void setModuleName(String moduleName) { this.moduleName = moduleName; } - public String getBusinessName() - { + public String getBusinessName() { return businessName; } - public void setBusinessName(String businessName) - { + public void setBusinessName(String businessName) { this.businessName = businessName; } - public String getFunctionName() - { + public String getFunctionName() { return functionName; } - public void setFunctionName(String functionName) - { + public void setFunctionName(String functionName) { this.functionName = functionName; } - public String getFunctionAuthor() - { + public String getFunctionAuthor() { return functionAuthor; } - public void setFunctionAuthor(String functionAuthor) - { + public void setFunctionAuthor(String functionAuthor) { this.functionAuthor = functionAuthor; } - public String getGenType() - { + public String getGenType() { return genType; } - public void setGenType(String genType) - { + public void setGenType(String genType) { this.genType = genType; } - public String getGenPath() - { + public String getGenPath() { return genPath; } - public void setGenPath(String genPath) - { + public void setGenPath(String genPath) { this.genPath = genPath; } - public GenTableColumn getPkColumn() - { + public GenTableColumn getPkColumn() { return pkColumn; } - public void setPkColumn(GenTableColumn pkColumn) - { + public void setPkColumn(GenTableColumn pkColumn) { this.pkColumn = pkColumn; } - public GenTable getSubTable() - { + public GenTable getSubTable() { return subTable; } - public void setSubTable(GenTable subTable) - { + public void setSubTable(GenTable subTable) { this.subTable = subTable; } - public List getColumns() - { + public List getColumns() { return columns; } - public void setColumns(List columns) - { + public void setColumns(List columns) { this.columns = columns; } - public String getOptions() - { + public String getOptions() { return options; } - public void setOptions(String options) - { + public void setOptions(String options) { this.options = options; } - public String getTreeCode() - { + public String getTreeCode() { return treeCode; } - public void setTreeCode(String treeCode) - { + public void setTreeCode(String treeCode) { this.treeCode = treeCode; } - public String getTreeParentCode() - { + public String getTreeParentCode() { return treeParentCode; } - public void setTreeParentCode(String treeParentCode) - { + public void setTreeParentCode(String treeParentCode) { this.treeParentCode = treeParentCode; } - public String getTreeName() - { + public String getTreeName() { return treeName; } - public void setTreeName(String treeName) - { + public void setTreeName(String treeName) { this.treeName = treeName; } - public String getParentMenuId() - { + public String getParentMenuId() { return parentMenuId; } - public void setParentMenuId(String parentMenuId) - { + public void setParentMenuId(String parentMenuId) { this.parentMenuId = parentMenuId; } - public String getParentMenuName() - { + public String getParentMenuName() { return parentMenuName; } - public void setParentMenuName(String parentMenuName) - { + public void setParentMenuName(String parentMenuName) { this.parentMenuName = parentMenuName; } - public boolean isSub() - { + public boolean isSub() { return isSub(this.tplCategory); } - public static boolean isSub(String tplCategory) - { + public static boolean isSub(String tplCategory) { return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory); } - public boolean isTree() - { + public boolean isTree() { return isTree(this.tplCategory); } - public static boolean isTree(String tplCategory) - { + public static boolean isTree(String tplCategory) { return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory); } - public boolean isCrud() - { + public boolean isCrud() { return isCrud(this.tplCategory); } - public static boolean isCrud(String tplCategory) - { + public static boolean isCrud(String tplCategory) { return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory); } - public boolean isSuperColumn(String javaField) - { + public boolean isSuperColumn(String javaField) { return isSuperColumn(this.tplCategory, javaField); } - public static boolean isSuperColumn(String tplCategory, String javaField) - { - if (isTree(tplCategory)) - { + public static boolean isSuperColumn(String tplCategory, String javaField) { + if (isTree(tplCategory)) { return StringUtils.equalsAnyIgnoreCase(javaField, ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY)); } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java index d1733b64..cb65d2a0 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java @@ -1,335 +1,318 @@ package com.ruoyi.generator.domain; import javax.validation.constraints.NotBlank; + import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.utils.StringUtils; /** * 代码生成业务字段表 gen_table_column - * + * * @author ruoyi */ -public class GenTableColumn extends BaseEntity -{ +public class GenTableColumn extends BaseEntity { private static final long serialVersionUID = 1L; - /** 编号 */ + /** + * 编号 + */ private Long columnId; - /** 归属表编号 */ + /** + * 归属表编号 + */ private Long tableId; - /** 列名称 */ + /** + * 列名称 + */ private String columnName; - /** 列描述 */ + /** + * 列描述 + */ private String columnComment; - /** 列类型 */ + /** + * 列类型 + */ private String columnType; - /** JAVA类型 */ + /** + * JAVA类型 + */ private String javaType; - /** JAVA字段名 */ + /** + * JAVA字段名 + */ @NotBlank(message = "Java属性不能为空") private String javaField; - /** 是否主键(1是) */ + /** + * 是否主键(1是) + */ private String isPk; - /** 是否自增(1是) */ + /** + * 是否自增(1是) + */ private String isIncrement; - /** 是否必填(1是) */ + /** + * 是否必填(1是) + */ private String isRequired; - /** 是否为插入字段(1是) */ + /** + * 是否为插入字段(1是) + */ private String isInsert; - /** 是否编辑字段(1是) */ + /** + * 是否编辑字段(1是) + */ private String isEdit; - /** 是否列表字段(1是) */ + /** + * 是否列表字段(1是) + */ private String isList; - /** 是否查询字段(1是) */ + /** + * 是否查询字段(1是) + */ private String isQuery; - /** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */ + /** + * 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) + */ private String queryType; - /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) */ + /** + * 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件) + */ private String htmlType; - /** 字典类型 */ + /** + * 字典类型 + */ private String dictType; - /** 排序 */ + /** + * 排序 + */ private Integer sort; - public void setColumnId(Long columnId) - { + public void setColumnId(Long columnId) { this.columnId = columnId; } - public Long getColumnId() - { + public Long getColumnId() { return columnId; } - public void setTableId(Long tableId) - { + public void setTableId(Long tableId) { this.tableId = tableId; } - public Long getTableId() - { + public Long getTableId() { return tableId; } - public void setColumnName(String columnName) - { + public void setColumnName(String columnName) { this.columnName = columnName; } - public String getColumnName() - { + public String getColumnName() { return columnName; } - public void setColumnComment(String columnComment) - { + public void setColumnComment(String columnComment) { this.columnComment = columnComment; } - public String getColumnComment() - { + public String getColumnComment() { return columnComment; } - public void setColumnType(String columnType) - { + public void setColumnType(String columnType) { this.columnType = columnType; } - public String getColumnType() - { + public String getColumnType() { return columnType; } - public void setJavaType(String javaType) - { + public void setJavaType(String javaType) { this.javaType = javaType; } - public String getJavaType() - { + public String getJavaType() { return javaType; } - public void setJavaField(String javaField) - { + public void setJavaField(String javaField) { this.javaField = javaField; } - public String getJavaField() - { + public String getJavaField() { return javaField; } - public String getCapJavaField() - { + public String getCapJavaField() { return StringUtils.capitalize(javaField); } - public void setIsPk(String isPk) - { + public void setIsPk(String isPk) { this.isPk = isPk; } - public String getIsPk() - { + public String getIsPk() { return isPk; } - public boolean isPk() - { + public boolean isPk() { return isPk(this.isPk); } - public boolean isPk(String isPk) - { + public boolean isPk(String isPk) { return isPk != null && StringUtils.equals("1", isPk); } - public String getIsIncrement() - { + public String getIsIncrement() { return isIncrement; } - public void setIsIncrement(String isIncrement) - { + public void setIsIncrement(String isIncrement) { this.isIncrement = isIncrement; } - public boolean isIncrement() - { + public boolean isIncrement() { return isIncrement(this.isIncrement); } - public boolean isIncrement(String isIncrement) - { + public boolean isIncrement(String isIncrement) { return isIncrement != null && StringUtils.equals("1", isIncrement); } - public void setIsRequired(String isRequired) - { + public void setIsRequired(String isRequired) { this.isRequired = isRequired; } - public String getIsRequired() - { + public String getIsRequired() { return isRequired; } - public boolean isRequired() - { + public boolean isRequired() { return isRequired(this.isRequired); } - public boolean isRequired(String isRequired) - { + public boolean isRequired(String isRequired) { return isRequired != null && StringUtils.equals("1", isRequired); } - public void setIsInsert(String isInsert) - { + public void setIsInsert(String isInsert) { this.isInsert = isInsert; } - public String getIsInsert() - { + public String getIsInsert() { return isInsert; } - public boolean isInsert() - { + public boolean isInsert() { return isInsert(this.isInsert); } - public boolean isInsert(String isInsert) - { + public boolean isInsert(String isInsert) { return isInsert != null && StringUtils.equals("1", isInsert); } - public void setIsEdit(String isEdit) - { + public void setIsEdit(String isEdit) { this.isEdit = isEdit; } - public String getIsEdit() - { + public String getIsEdit() { return isEdit; } - public boolean isEdit() - { + public boolean isEdit() { return isInsert(this.isEdit); } - public boolean isEdit(String isEdit) - { + public boolean isEdit(String isEdit) { return isEdit != null && StringUtils.equals("1", isEdit); } - public void setIsList(String isList) - { + public void setIsList(String isList) { this.isList = isList; } - public String getIsList() - { + public String getIsList() { return isList; } - public boolean isList() - { + public boolean isList() { return isList(this.isList); } - public boolean isList(String isList) - { + public boolean isList(String isList) { return isList != null && StringUtils.equals("1", isList); } - public void setIsQuery(String isQuery) - { + public void setIsQuery(String isQuery) { this.isQuery = isQuery; } - public String getIsQuery() - { + public String getIsQuery() { return isQuery; } - public boolean isQuery() - { + public boolean isQuery() { return isQuery(this.isQuery); } - public boolean isQuery(String isQuery) - { + public boolean isQuery(String isQuery) { return isQuery != null && StringUtils.equals("1", isQuery); } - public void setQueryType(String queryType) - { + public void setQueryType(String queryType) { this.queryType = queryType; } - public String getQueryType() - { + public String getQueryType() { return queryType; } - public String getHtmlType() - { + public String getHtmlType() { return htmlType; } - public void setHtmlType(String htmlType) - { + public void setHtmlType(String htmlType) { this.htmlType = htmlType; } - public void setDictType(String dictType) - { + public void setDictType(String dictType) { this.dictType = dictType; } - public String getDictType() - { + public String getDictType() { return dictType; } - public void setSort(Integer sort) - { + public void setSort(Integer sort) { this.sort = sort; } - public Integer getSort() - { + public Integer getSort() { return sort; } - public boolean isSuperColumn() - { + public boolean isSuperColumn() { return isSuperColumn(this.javaField); } - public static boolean isSuperColumn(String javaField) - { + public static boolean isSuperColumn(String javaField) { return StringUtils.equalsAnyIgnoreCase(javaField, // BaseEntity "createBy", "createTime", "updateBy", "updateTime", "remark", @@ -337,36 +320,28 @@ public class GenTableColumn extends BaseEntity "parentName", "parentId", "orderNum", "ancestors"); } - public boolean isUsableColumn() - { + public boolean isUsableColumn() { return isUsableColumn(javaField); } - public static boolean isUsableColumn(String javaField) - { + public static boolean isUsableColumn(String javaField) { // isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单 return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark"); } - public String readConverterExp() - { + public String readConverterExp() { String remarks = StringUtils.substringBetween(this.columnComment, "(", ")"); StringBuffer sb = new StringBuffer(); - if (StringUtils.isNotEmpty(remarks)) - { - for (String value : remarks.split(" ")) - { - if (StringUtils.isNotEmpty(value)) - { + if (StringUtils.isNotEmpty(remarks)) { + for (String value : remarks.split(" ")) { + if (StringUtils.isNotEmpty(value)) { Object startStr = value.subSequence(0, 1); String endStr = value.substring(1); sb.append("").append(startStr).append("=").append(endStr).append(","); } } return sb.deleteCharAt(sb.length() - 1).toString(); - } - else - { + } else { return this.columnComment; } } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java index 951e1667..ffbb6ca4 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.generator.mapper; import java.util.List; + import com.ruoyi.generator.domain.GenTableColumn; /** * 业务字段 数据层 - * + * * @author ruoyi */ -public interface GenTableColumnMapper -{ +public interface GenTableColumnMapper { /** * 根据表名称查询列信息 - * + * * @param tableName 表名称 * @return 列信息 */ @@ -20,7 +20,7 @@ public interface GenTableColumnMapper /** * 查询业务字段列表 - * + * * @param tableId 业务字段编号 * @return 业务字段集合 */ @@ -28,7 +28,7 @@ public interface GenTableColumnMapper /** * 新增业务字段 - * + * * @param genTableColumn 业务字段信息 * @return 结果 */ @@ -36,7 +36,7 @@ public interface GenTableColumnMapper /** * 修改业务字段 - * + * * @param genTableColumn 业务字段信息 * @return 结果 */ @@ -44,7 +44,7 @@ public interface GenTableColumnMapper /** * 删除业务字段 - * + * * @param genTableColumns 列数据 * @return 结果 */ @@ -52,7 +52,7 @@ public interface GenTableColumnMapper /** * 批量删除业务字段 - * + * * @param ids 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java index 9b330df8..7ea272e0 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.generator.mapper; import java.util.List; + import com.ruoyi.generator.domain.GenTable; /** * 业务 数据层 - * + * * @author ruoyi */ -public interface GenTableMapper -{ +public interface GenTableMapper { /** * 查询业务列表 - * + * * @param genTable 业务信息 * @return 业务集合 */ @@ -20,7 +20,7 @@ public interface GenTableMapper /** * 查询据库列表 - * + * * @param genTable 业务信息 * @return 数据库表集合 */ @@ -28,7 +28,7 @@ public interface GenTableMapper /** * 查询据库列表 - * + * * @param tableNames 表名称组 * @return 数据库表集合 */ @@ -36,14 +36,14 @@ public interface GenTableMapper /** * 查询所有表信息 - * + * * @return 表信息集合 */ public List selectGenTableAll(); /** * 查询表ID业务信息 - * + * * @param id 业务ID * @return 业务信息 */ @@ -51,7 +51,7 @@ public interface GenTableMapper /** * 查询表名称业务信息 - * + * * @param tableName 表名称 * @return 业务信息 */ @@ -59,7 +59,7 @@ public interface GenTableMapper /** * 新增业务 - * + * * @param genTable 业务信息 * @return 结果 */ @@ -67,7 +67,7 @@ public interface GenTableMapper /** * 修改业务 - * + * * @param genTable 业务信息 * @return 结果 */ @@ -75,7 +75,7 @@ public interface GenTableMapper /** * 批量删除业务 - * + * * @param ids 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java index 0679689d..9f57c46a 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.generator.service; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.core.text.Convert; @@ -9,60 +10,55 @@ import com.ruoyi.generator.mapper.GenTableColumnMapper; /** * 业务字段 服务层实现 - * + * * @author ruoyi */ @Service -public class GenTableColumnServiceImpl implements IGenTableColumnService -{ - @Autowired - private GenTableColumnMapper genTableColumnMapper; +public class GenTableColumnServiceImpl implements IGenTableColumnService { + @Autowired + private GenTableColumnMapper genTableColumnMapper; - /** + /** * 查询业务字段列表 - * + * * @param tableId 业务字段编号 * @return 业务字段集合 */ - @Override - public List selectGenTableColumnListByTableId(Long tableId) - { - return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); - } - + @Override + public List selectGenTableColumnListByTableId(Long tableId) { + return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); + } + /** * 新增业务字段 - * + * * @param genTableColumn 业务字段信息 * @return 结果 */ - @Override - public int insertGenTableColumn(GenTableColumn genTableColumn) - { - return genTableColumnMapper.insertGenTableColumn(genTableColumn); - } - - /** - * 修改业务字段 - * - * @param genTableColumn 业务字段信息 - * @return 结果 - */ - @Override - public int updateGenTableColumn(GenTableColumn genTableColumn) - { - return genTableColumnMapper.updateGenTableColumn(genTableColumn); - } + @Override + public int insertGenTableColumn(GenTableColumn genTableColumn) { + return genTableColumnMapper.insertGenTableColumn(genTableColumn); + } - /** + /** + * 修改业务字段 + * + * @param genTableColumn 业务字段信息 + * @return 结果 + */ + @Override + public int updateGenTableColumn(GenTableColumn genTableColumn) { + return genTableColumnMapper.updateGenTableColumn(genTableColumn); + } + + /** * 删除业务字段对象 - * + * * @param ids 需要删除的数据ID * @return 结果 */ - @Override - public int deleteGenTableColumnByIds(String ids) - { - return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); - } + @Override + public int deleteGenTableColumnByIds(String ids) { + return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); + } } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java index 5d968084..f14d1680 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; + import org.apache.commons.io.IOUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -38,12 +39,11 @@ import com.ruoyi.generator.util.VelocityUtils; /** * 业务 服务层实现 - * + * * @author ruoyi */ @Service -public class GenTableServiceImpl implements IGenTableService -{ +public class GenTableServiceImpl implements IGenTableService { private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class); @Autowired @@ -54,13 +54,12 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询业务信息 - * + * * @param id 业务ID * @return 业务信息 */ @Override - public GenTable selectGenTableById(Long id) - { + public GenTable selectGenTableById(Long id) { GenTable genTable = genTableMapper.selectGenTableById(id); setTableFromOptions(genTable); return genTable; @@ -68,68 +67,61 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询业务列表 - * + * * @param genTable 业务信息 * @return 业务集合 */ @Override - public List selectGenTableList(GenTable genTable) - { + public List selectGenTableList(GenTable genTable) { return genTableMapper.selectGenTableList(genTable); } /** * 查询据库列表 - * + * * @param genTable 业务信息 * @return 数据库表集合 */ @Override - public List selectDbTableList(GenTable genTable) - { + public List selectDbTableList(GenTable genTable) { return genTableMapper.selectDbTableList(genTable); } /** * 查询据库列表 - * + * * @param tableNames 表名称组 * @return 数据库表集合 */ @Override - public List selectDbTableListByNames(String[] tableNames) - { + public List selectDbTableListByNames(String[] tableNames) { return genTableMapper.selectDbTableListByNames(tableNames); } /** * 查询所有表信息 - * + * * @return 表信息集合 */ @Override - public List selectGenTableAll() - { + public List selectGenTableAll() { return genTableMapper.selectGenTableAll(); } /** * 修改业务 - * + * * @param genTable 业务信息 * @return 结果 */ @Override @Transactional - public void updateGenTable(GenTable genTable) - { + public void updateGenTable(GenTable genTable) { String options = JSON.toJSONString(genTable.getParams()); genTable.setOptions(options); int row = genTableMapper.updateGenTable(genTable); - if (row > 0) - { - for (GenTableColumn cenTableColumn : genTable.getColumns()) - { + if (row > 0) { + for (GenTableColumn cenTableColumn : genTable.getColumns()) { genTableColumnMapper.updateGenTableColumn(cenTableColumn); } } @@ -137,62 +129,53 @@ public class GenTableServiceImpl implements IGenTableService /** * 删除业务对象 - * + * * @param tableIds 需要删除的数据ID * @return 结果 */ @Override @Transactional - public void deleteGenTableByIds(Long[] tableIds) - { + public void deleteGenTableByIds(Long[] tableIds) { genTableMapper.deleteGenTableByIds(tableIds); genTableColumnMapper.deleteGenTableColumnByIds(tableIds); } /** * 导入表结构 - * + * * @param tableList 导入表列表 */ @Override @Transactional - public void importGenTable(List tableList) - { + public void importGenTable(List tableList) { String operName = SecurityUtils.getUsername(); - try - { - for (GenTable table : tableList) - { + try { + for (GenTable table : tableList) { String tableName = table.getTableName(); GenUtils.initTable(table, operName); int row = genTableMapper.insertGenTable(table); - if (row > 0) - { + if (row > 0) { // 保存列信息 List genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); - for (GenTableColumn column : genTableColumns) - { + for (GenTableColumn column : genTableColumns) { GenUtils.initColumnField(column, table); genTableColumnMapper.insertGenTableColumn(column); } } } - } - catch (Exception e) - { + } catch (Exception e) { throw new CustomException("导入失败:" + e.getMessage()); } } /** * 预览代码 - * + * * @param tableId 表编号 * @return 预览数据列表 */ @Override - public Map previewCode(Long tableId) - { + public Map previewCode(Long tableId) { Map dataMap = new LinkedHashMap<>(); // 查询表信息 GenTable table = genTableMapper.selectGenTableById(tableId); @@ -206,8 +189,7 @@ public class GenTableServiceImpl implements IGenTableService // 获取模板列表 List templates = VelocityUtils.getTemplateList(table.getTplCategory()); - for (String template : templates) - { + for (String template : templates) { // 渲染模板 StringWriter sw = new StringWriter(); Template tpl = Velocity.getTemplate(template, Constants.UTF8); @@ -219,13 +201,12 @@ public class GenTableServiceImpl implements IGenTableService /** * 生成代码(下载方式) - * + * * @param tableName 表名称 * @return 数据 */ @Override - public byte[] downloadCode(String tableName) - { + public byte[] downloadCode(String tableName) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ZipOutputStream zip = new ZipOutputStream(outputStream); generatorCode(tableName, zip); @@ -235,12 +216,11 @@ public class GenTableServiceImpl implements IGenTableService /** * 生成代码(自定义路径) - * + * * @param tableName 表名称 */ @Override - public void generatorCode(String tableName) - { + public void generatorCode(String tableName) { // 查询表信息 GenTable table = genTableMapper.selectGenTableByName(tableName); // 设置主子表信息 @@ -254,21 +234,16 @@ public class GenTableServiceImpl implements IGenTableService // 获取模板列表 List templates = VelocityUtils.getTemplateList(table.getTplCategory()); - for (String template : templates) - { - if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) - { + for (String template : templates) { + if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) { // 渲染模板 StringWriter sw = new StringWriter(); Template tpl = Velocity.getTemplate(template, Constants.UTF8); tpl.merge(context, sw); - try - { + try { String path = getGenPath(table, template); FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8); - } - catch (IOException e) - { + } catch (IOException e) { throw new CustomException("渲染模板失败,表名:" + table.getTableName()); } } @@ -277,52 +252,46 @@ public class GenTableServiceImpl implements IGenTableService /** * 同步数据库 - * + * * @param tableName 表名称 */ @Override @Transactional - public void synchDb(String tableName) - { + public void synchDb(String tableName) { GenTable table = genTableMapper.selectGenTableByName(tableName); List tableColumns = table.getColumns(); List tableColumnNames = tableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList()); List dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName); - if (StringUtils.isEmpty(dbTableColumns)) - { + if (StringUtils.isEmpty(dbTableColumns)) { throw new CustomException("同步数据失败,原表结构不存在"); } List dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList()); dbTableColumns.forEach(column -> { - if (!tableColumnNames.contains(column.getColumnName())) - { + if (!tableColumnNames.contains(column.getColumnName())) { GenUtils.initColumnField(column, table); genTableColumnMapper.insertGenTableColumn(column); } }); List delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList()); - if (StringUtils.isNotEmpty(delColumns)) - { + if (StringUtils.isNotEmpty(delColumns)) { genTableColumnMapper.deleteGenTableColumns(delColumns); } } /** * 批量生成代码(下载方式) - * + * * @param tableNames 表数组 * @return 数据 */ @Override - public byte[] downloadCode(String[] tableNames) - { + public byte[] downloadCode(String[] tableNames) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ZipOutputStream zip = new ZipOutputStream(outputStream); - for (String tableName : tableNames) - { + for (String tableName : tableNames) { generatorCode(tableName, zip); } IOUtils.closeQuietly(zip); @@ -332,8 +301,7 @@ public class GenTableServiceImpl implements IGenTableService /** * 查询表信息并生成代码 */ - private void generatorCode(String tableName, ZipOutputStream zip) - { + private void generatorCode(String tableName, ZipOutputStream zip) { // 查询表信息 GenTable table = genTableMapper.selectGenTableByName(tableName); // 设置主子表信息 @@ -347,23 +315,19 @@ public class GenTableServiceImpl implements IGenTableService // 获取模板列表 List templates = VelocityUtils.getTemplateList(table.getTplCategory()); - for (String template : templates) - { + for (String template : templates) { // 渲染模板 StringWriter sw = new StringWriter(); Template tpl = Velocity.getTemplate(template, Constants.UTF8); tpl.merge(context, sw); - try - { + try { // 添加到zip zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); IOUtils.write(sw.toString(), zip, Constants.UTF8); IOUtils.closeQuietly(sw); - zip.flush(); + zip.flush(); zip.closeEntry(); - } - catch (IOException e) - { + } catch (IOException e) { log.error("渲染模板失败,表名:" + table.getTableName(), e); } } @@ -371,36 +335,24 @@ public class GenTableServiceImpl implements IGenTableService /** * 修改保存参数校验 - * + * * @param genTable 业务信息 */ @Override - public void validateEdit(GenTable genTable) - { - if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) - { + public void validateEdit(GenTable genTable) { + if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) { String options = JSON.toJSONString(genTable.getParams()); JSONObject paramsObj = JSONObject.parseObject(options); - if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) - { + if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) { throw new CustomException("树编码字段不能为空"); - } - else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) - { + } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) { throw new CustomException("树父编码字段不能为空"); - } - else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) - { + } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) { throw new CustomException("树名称字段不能为空"); - } - else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) - { - if (StringUtils.isEmpty(genTable.getSubTableName())) - { + } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) { + if (StringUtils.isEmpty(genTable.getSubTableName())) { throw new CustomException("关联子表的表名不能为空"); - } - else if (StringUtils.isEmpty(genTable.getSubTableFkName())) - { + } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) { throw new CustomException("子表关联的外键名不能为空"); } } @@ -409,35 +361,27 @@ public class GenTableServiceImpl implements IGenTableService /** * 设置主键列信息 - * + * * @param table 业务表信息 */ - public void setPkColumn(GenTable table) - { - for (GenTableColumn column : table.getColumns()) - { - if (column.isPk()) - { + public void setPkColumn(GenTable table) { + for (GenTableColumn column : table.getColumns()) { + if (column.isPk()) { table.setPkColumn(column); break; } } - if (StringUtils.isNull(table.getPkColumn())) - { + if (StringUtils.isNull(table.getPkColumn())) { table.setPkColumn(table.getColumns().get(0)); } - if (GenConstants.TPL_SUB.equals(table.getTplCategory())) - { - for (GenTableColumn column : table.getSubTable().getColumns()) - { - if (column.isPk()) - { + if (GenConstants.TPL_SUB.equals(table.getTplCategory())) { + for (GenTableColumn column : table.getSubTable().getColumns()) { + if (column.isPk()) { table.getSubTable().setPkColumn(column); break; } } - if (StringUtils.isNull(table.getSubTable().getPkColumn())) - { + if (StringUtils.isNull(table.getSubTable().getPkColumn())) { table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0)); } } @@ -445,34 +389,30 @@ public class GenTableServiceImpl implements IGenTableService /** * 设置主子表信息 - * + * * @param table 业务表信息 */ - public void setSubTable(GenTable table) - { + public void setSubTable(GenTable table) { String subTableName = table.getSubTableName(); - if (StringUtils.isNotEmpty(subTableName)) - { + if (StringUtils.isNotEmpty(subTableName)) { table.setSubTable(genTableMapper.selectGenTableByName(subTableName)); } } /** * 设置代码生成其他选项值 - * + * * @param genTable 设置后的生成对象 */ - public void setTableFromOptions(GenTable genTable) - { + public void setTableFromOptions(GenTable genTable) { JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions()); - if (StringUtils.isNotNull(paramsObj)) - { + if (StringUtils.isNotNull(paramsObj)) { String treeCode = paramsObj.getString(GenConstants.TREE_CODE); String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE); String treeName = paramsObj.getString(GenConstants.TREE_NAME); String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID); String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME); - + genTable.setTreeCode(treeCode); genTable.setTreeParentCode(treeParentCode); genTable.setTreeName(treeName); @@ -483,16 +423,14 @@ public class GenTableServiceImpl implements IGenTableService /** * 获取代码生成地址 - * - * @param table 业务表信息 + * + * @param table 业务表信息 * @param template 模板文件路径 * @return 生成地址 */ - public static String getGenPath(GenTable table, String template) - { + public static String getGenPath(GenTable table, String template) { String genPath = table.getGenPath(); - if (StringUtils.equals(genPath, "/")) - { + if (StringUtils.equals(genPath, "/")) { return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table); } return genPath + File.separator + VelocityUtils.getFileName(template, table); diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java index 3037f707..417453af 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java @@ -1,18 +1,18 @@ package com.ruoyi.generator.service; import java.util.List; + import com.ruoyi.generator.domain.GenTableColumn; /** * 业务字段 服务层 - * + * * @author ruoyi */ -public interface IGenTableColumnService -{ +public interface IGenTableColumnService { /** * 查询业务字段列表 - * + * * @param tableId 业务字段编号 * @return 业务字段集合 */ @@ -20,7 +20,7 @@ public interface IGenTableColumnService /** * 新增业务字段 - * + * * @param genTableColumn 业务字段信息 * @return 结果 */ @@ -28,7 +28,7 @@ public interface IGenTableColumnService /** * 修改业务字段 - * + * * @param genTableColumn 业务字段信息 * @return 结果 */ @@ -36,7 +36,7 @@ public interface IGenTableColumnService /** * 删除业务字段信息 - * + * * @param ids 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java index 9d53f95f..e7419d07 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java @@ -2,18 +2,18 @@ package com.ruoyi.generator.service; import java.util.List; import java.util.Map; + import com.ruoyi.generator.domain.GenTable; /** * 业务 服务层 - * + * * @author ruoyi */ -public interface IGenTableService -{ +public interface IGenTableService { /** * 查询业务列表 - * + * * @param genTable 业务信息 * @return 业务集合 */ @@ -21,7 +21,7 @@ public interface IGenTableService /** * 查询据库列表 - * + * * @param genTable 业务信息 * @return 数据库表集合 */ @@ -29,7 +29,7 @@ public interface IGenTableService /** * 查询据库列表 - * + * * @param tableNames 表名称组 * @return 数据库表集合 */ @@ -37,14 +37,14 @@ public interface IGenTableService /** * 查询所有表信息 - * + * * @return 表信息集合 */ public List selectGenTableAll(); /** * 查询业务信息 - * + * * @param id 业务ID * @return 业务信息 */ @@ -52,7 +52,7 @@ public interface IGenTableService /** * 修改业务 - * + * * @param genTable 业务信息 * @return 结果 */ @@ -60,7 +60,7 @@ public interface IGenTableService /** * 删除业务信息 - * + * * @param tableIds 需要删除的表数据ID * @return 结果 */ @@ -68,14 +68,14 @@ public interface IGenTableService /** * 导入表结构 - * + * * @param tableList 导入表列表 */ public void importGenTable(List tableList); /** * 预览代码 - * + * * @param tableId 表编号 * @return 预览数据列表 */ @@ -83,7 +83,7 @@ public interface IGenTableService /** * 生成代码(下载方式) - * + * * @param tableName 表名称 * @return 数据 */ @@ -91,7 +91,7 @@ public interface IGenTableService /** * 生成代码(自定义路径) - * + * * @param tableName 表名称 * @return 数据 */ @@ -99,14 +99,14 @@ public interface IGenTableService /** * 同步数据库 - * + * * @param tableName 表名称 */ public void synchDb(String tableName); /** * 批量生成代码(下载方式) - * + * * @param tableNames 表数组 * @return 数据 */ @@ -114,7 +114,7 @@ public interface IGenTableService /** * 修改保存参数校验 - * + * * @param genTable 业务信息 */ public void validateEdit(GenTable genTable); diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java index 06c68214..395cdc87 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -1,6 +1,7 @@ package com.ruoyi.generator.util; import java.util.Arrays; + import org.apache.commons.lang3.RegExUtils; import com.ruoyi.common.constant.GenConstants; import com.ruoyi.common.utils.StringUtils; @@ -10,16 +11,14 @@ import com.ruoyi.generator.domain.GenTableColumn; /** * 代码生成器 工具类 - * + * * @author ruoyi */ -public class GenUtils -{ +public class GenUtils { /** * 初始化表信息 */ - public static void initTable(GenTable genTable, String operName) - { + public static void initTable(GenTable genTable, String operName) { genTable.setClassName(convertClassName(genTable.getTableName())); genTable.setPackageName(GenConfig.getPackageName()); genTable.setModuleName(getModuleName(GenConfig.getPackageName())); @@ -32,8 +31,7 @@ public class GenUtils /** * 初始化列属性字段 */ - public static void initColumnField(GenTableColumn column, GenTable table) - { + public static void initColumnField(GenTableColumn column, GenTable table) { String dataType = getDbType(column.getColumnType()); String columnName = column.getColumnName(); column.setTableId(table.getTableId()); @@ -43,36 +41,28 @@ public class GenUtils // 设置默认类型 column.setJavaType(GenConstants.TYPE_STRING); - if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) - { + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { // 字符串长度超过500设置为文本域 Integer columnLength = getColumnLength(column.getColumnType()); String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; column.setHtmlType(htmlType); - } - else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) - { + } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { column.setJavaType(GenConstants.TYPE_DATE); column.setHtmlType(GenConstants.HTML_DATETIME); - } - else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) - { + } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { column.setHtmlType(GenConstants.HTML_INPUT); // 如果是浮点型 统一用BigDecimal String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); - if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) - { + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { column.setJavaType(GenConstants.TYPE_BIGDECIMAL); } // 如果是整形 - else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) - { + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { column.setJavaType(GenConstants.TYPE_INTEGER); } // 长整形 - else - { + else { column.setJavaType(GenConstants.TYPE_LONG); } } @@ -81,74 +71,63 @@ public class GenUtils column.setIsInsert(GenConstants.REQUIRE); // 编辑字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) { column.setIsEdit(GenConstants.REQUIRE); } // 列表字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) { column.setIsList(GenConstants.REQUIRE); } // 查询字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) { column.setIsQuery(GenConstants.REQUIRE); } // 查询字段类型 - if (StringUtils.endsWithIgnoreCase(columnName, "name")) - { + if (StringUtils.endsWithIgnoreCase(columnName, "name")) { column.setQueryType(GenConstants.QUERY_LIKE); } // 状态字段设置单选框 - if (StringUtils.endsWithIgnoreCase(columnName, "status")) - { + if (StringUtils.endsWithIgnoreCase(columnName, "status")) { column.setHtmlType(GenConstants.HTML_RADIO); } // 类型&性别字段设置下拉框 else if (StringUtils.endsWithIgnoreCase(columnName, "type") - || StringUtils.endsWithIgnoreCase(columnName, "sex")) - { + || StringUtils.endsWithIgnoreCase(columnName, "sex")) { column.setHtmlType(GenConstants.HTML_SELECT); } // 图片字段设置图片上传控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "image")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) { column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); } // 文件字段设置文件上传控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "file")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { column.setHtmlType(GenConstants.HTML_FILE_UPLOAD); } // 内容字段设置富文本控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "content")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { column.setHtmlType(GenConstants.HTML_EDITOR); } } /** * 校验数组是否包含指定值 - * - * @param arr 数组 + * + * @param arr 数组 * @param targetValue 值 * @return 是否包含 */ - public static boolean arraysContains(String[] arr, String targetValue) - { + public static boolean arraysContains(String[] arr, String targetValue) { return Arrays.asList(arr).contains(targetValue); } /** * 获取模块名 - * + * * @param packageName 包名 * @return 模块名 */ - public static String getModuleName(String packageName) - { + public static String getModuleName(String packageName) { int lastIndex = packageName.lastIndexOf("."); int nameLength = packageName.length(); String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); @@ -157,12 +136,11 @@ public class GenUtils /** * 获取业务名 - * + * * @param tableName 表名 * @return 业务名 */ - public static String getBusinessName(String tableName) - { + public static String getBusinessName(String tableName) { int lastIndex = tableName.lastIndexOf("_"); int nameLength = tableName.length(); String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength); @@ -171,16 +149,14 @@ public class GenUtils /** * 表名转换成Java类名 - * + * * @param tableName 表名称 * @return 类名 */ - public static String convertClassName(String tableName) - { + public static String convertClassName(String tableName) { boolean autoRemovePre = GenConfig.getAutoRemovePre(); String tablePrefix = GenConfig.getTablePrefix(); - if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) - { + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { String[] searchList = StringUtils.split(tablePrefix, ","); tableName = replaceFirst(tableName, searchList); } @@ -189,18 +165,15 @@ public class GenUtils /** * 批量替换前缀 - * + * * @param replacementm 替换值 - * @param searchList 替换列表 + * @param searchList 替换列表 * @return */ - public static String replaceFirst(String replacementm, String[] searchList) - { + public static String replaceFirst(String replacementm, String[] searchList) { String text = replacementm; - for (String searchString : searchList) - { - if (replacementm.startsWith(searchString)) - { + for (String searchString : searchList) { + if (replacementm.startsWith(searchString)) { text = replacementm.replaceFirst(searchString, ""); break; } @@ -210,48 +183,39 @@ public class GenUtils /** * 关键字替换 - * + * * @param text 需要被替换的名字 * @return 替换后的名字 */ - public static String replaceText(String text) - { + public static String replaceText(String text) { return RegExUtils.replaceAll(text, "(?:表|若依)", ""); } /** * 获取数据库类型字段 - * + * * @param columnType 列类型 * @return 截取后的列类型 */ - public static String getDbType(String columnType) - { - if (StringUtils.indexOf(columnType, "(") > 0) - { + public static String getDbType(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { return StringUtils.substringBefore(columnType, "("); - } - else - { + } else { return columnType; } } /** * 获取字段长度 - * + * * @param columnType 列类型 * @return 截取后的列类型 */ - public static Integer getColumnLength(String columnType) - { - if (StringUtils.indexOf(columnType, "(") > 0) - { + public static Integer getColumnLength(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { String length = StringUtils.substringBetween(columnType, "(", ")"); return Integer.valueOf(length); - } - else - { + } else { return 0; } } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java index 3b7b3a10..06f8c8fc 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java @@ -1,24 +1,22 @@ package com.ruoyi.generator.util; import java.util.Properties; + import org.apache.velocity.app.Velocity; import com.ruoyi.common.constant.Constants; /** * VelocityEngine工厂 - * + * * @author ruoyi */ -public class VelocityInitializer -{ +public class VelocityInitializer { /** * 初始化vm方法 */ - public static void initVelocity() - { + public static void initVelocity() { Properties p = new Properties(); - try - { + try { // 加载classpath目录下的vm文件 p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); // 定义字符集 @@ -26,9 +24,7 @@ public class VelocityInitializer p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8); // 初始化Velocity引擎,指定配置Properties Velocity.init(p); - } - catch (Exception e) - { + } catch (Exception e) { throw new RuntimeException(e); } } diff --git a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index 1f8d8f18..ead5f928 100644 --- a/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/spring-boot/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -3,6 +3,7 @@ package com.ruoyi.generator.util; import java.util.ArrayList; import java.util.HashSet; import java.util.List; + import org.apache.velocity.VelocityContext; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.constant.GenConstants; @@ -13,18 +14,23 @@ import com.ruoyi.generator.domain.GenTableColumn; /** * 模板处理工具类 - * + * * @author ruoyi */ -public class VelocityUtils -{ - /** 项目空间路径 */ +public class VelocityUtils { + /** + * 项目空间路径 + */ private static final String PROJECT_PATH = "main/java"; - /** mybatis空间路径 */ + /** + * mybatis空间路径 + */ private static final String MYBATIS_PATH = "main/resources/mapper"; - /** 默认上级菜单,系统工具 */ + /** + * 默认上级菜单,系统工具 + */ private static final String DEFAULT_PARENT_MENU_ID = "3"; /** @@ -32,8 +38,7 @@ public class VelocityUtils * * @return 模板列表 */ - public static VelocityContext prepareContext(GenTable genTable) - { + public static VelocityContext prepareContext(GenTable genTable) { String moduleName = genTable.getModuleName(); String businessName = genTable.getBusinessName(); String packageName = genTable.getPackageName(); @@ -59,27 +64,23 @@ public class VelocityUtils velocityContext.put("columns", genTable.getColumns()); velocityContext.put("table", genTable); setMenuVelocityContext(velocityContext, genTable); - if (GenConstants.TPL_TREE.equals(tplCategory)) - { + if (GenConstants.TPL_TREE.equals(tplCategory)) { setTreeVelocityContext(velocityContext, genTable); } - if (GenConstants.TPL_SUB.equals(tplCategory)) - { + if (GenConstants.TPL_SUB.equals(tplCategory)) { setSubVelocityContext(velocityContext, genTable); } return velocityContext; } - public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) - { + public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) { String options = genTable.getOptions(); JSONObject paramsObj = JSONObject.parseObject(options); String parentMenuId = getParentMenuId(paramsObj); context.put("parentMenuId", parentMenuId); } - public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) - { + public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) { String options = genTable.getOptions(); JSONObject paramsObj = JSONObject.parseObject(options); String treeCode = getTreecode(paramsObj); @@ -90,18 +91,15 @@ public class VelocityUtils context.put("treeParentCode", treeParentCode); context.put("treeName", treeName); context.put("expandColumn", getExpandColumn(genTable)); - if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) - { + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); } - if (paramsObj.containsKey(GenConstants.TREE_NAME)) - { + if (paramsObj.containsKey(GenConstants.TREE_NAME)) { context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); } } - public static void setSubVelocityContext(VelocityContext context, GenTable genTable) - { + public static void setSubVelocityContext(VelocityContext context, GenTable genTable) { GenTable subTable = genTable.getSubTable(); String subTableName = genTable.getSubTableName(); String subTableFkName = genTable.getSubTableFkName(); @@ -123,8 +121,7 @@ public class VelocityUtils * * @return 模板列表 */ - public static List getTemplateList(String tplCategory) - { + public static List getTemplateList(String tplCategory) { List templates = new ArrayList(); templates.add("vm/java/domain.java.vm"); templates.add("vm/java/mapper.java.vm"); @@ -134,16 +131,11 @@ public class VelocityUtils templates.add("vm/xml/mapper.xml.vm"); templates.add("vm/sql/sql.vm"); templates.add("vm/js/api.js.vm"); - if (GenConstants.TPL_CRUD.equals(tplCategory)) - { + if (GenConstants.TPL_CRUD.equals(tplCategory)) { templates.add("vm/vue/index.vue.vm"); - } - else if (GenConstants.TPL_TREE.equals(tplCategory)) - { + } else if (GenConstants.TPL_TREE.equals(tplCategory)) { templates.add("vm/vue/index-tree.vue.vm"); - } - else if (GenConstants.TPL_SUB.equals(tplCategory)) - { + } else if (GenConstants.TPL_SUB.equals(tplCategory)) { templates.add("vm/vue/index.vue.vm"); templates.add("vm/java/sub-domain.java.vm"); } @@ -153,8 +145,7 @@ public class VelocityUtils /** * 获取文件名 */ - public static String getFileName(String template, GenTable genTable) - { + public static String getFileName(String template, GenTable genTable) { // 文件名称 String fileName = ""; // 包路径 @@ -170,48 +161,28 @@ public class VelocityUtils String mybatisPath = MYBATIS_PATH + "/" + moduleName; String vuePath = "vue"; - if (template.contains("domain.java.vm")) - { + if (template.contains("domain.java.vm")) { fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); } - if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) - { + if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) { fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); - } - else if (template.contains("mapper.java.vm")) - { + } else if (template.contains("mapper.java.vm")) { fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); - } - else if (template.contains("service.java.vm")) - { + } else if (template.contains("service.java.vm")) { fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); - } - else if (template.contains("serviceImpl.java.vm")) - { + } else if (template.contains("serviceImpl.java.vm")) { fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); - } - else if (template.contains("controller.java.vm")) - { + } else if (template.contains("controller.java.vm")) { fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); - } - else if (template.contains("mapper.xml.vm")) - { + } else if (template.contains("mapper.xml.vm")) { fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); - } - else if (template.contains("sql.vm")) - { + } else if (template.contains("sql.vm")) { fileName = businessName + "Menu.sql"; - } - else if (template.contains("api.js.vm")) - { + } else if (template.contains("api.js.vm")) { fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); - } - else if (template.contains("index.vue.vm")) - { + } else if (template.contains("index.vue.vm")) { fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); - } - else if (template.contains("index-tree.vue.vm")) - { + } else if (template.contains("index-tree.vue.vm")) { fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); } return fileName; @@ -223,8 +194,7 @@ public class VelocityUtils * @param packageName 包名称 * @return 包前缀名称 */ - public static String getPackagePrefix(String packageName) - { + public static String getPackagePrefix(String packageName) { int lastIndex = packageName.lastIndexOf("."); String basePackage = StringUtils.substring(packageName, 0, lastIndex); return basePackage; @@ -232,28 +202,22 @@ public class VelocityUtils /** * 根据列类型获取导入包 - * + * * @param genTable 业务表对象 * @return 返回需要导入的包列表 */ - public static HashSet getImportList(GenTable genTable) - { + public static HashSet getImportList(GenTable genTable) { List columns = genTable.getColumns(); GenTable subGenTable = genTable.getSubTable(); HashSet importList = new HashSet(); - if (StringUtils.isNotNull(subGenTable)) - { + if (StringUtils.isNotNull(subGenTable)) { importList.add("java.util.List"); } - for (GenTableColumn column : columns) - { - if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) - { + for (GenTableColumn column : columns) { + if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) { importList.add("java.util.Date"); importList.add("com.fasterxml.jackson.annotation.JsonFormat"); - } - else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) - { + } else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) { importList.add("java.math.BigDecimal"); } } @@ -263,12 +227,11 @@ public class VelocityUtils /** * 获取权限前缀 * - * @param moduleName 模块名称 + * @param moduleName 模块名称 * @param businessName 业务名称 * @return 返回权限前缀 */ - public static String getPermissionPrefix(String moduleName, String businessName) - { + public static String getPermissionPrefix(String moduleName, String businessName) { return StringUtils.format("{}:{}", moduleName, businessName); } @@ -278,10 +241,8 @@ public class VelocityUtils * @param paramsObj 生成其他选项 * @return 上级菜单ID字段 */ - public static String getParentMenuId(JSONObject paramsObj) - { - if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)) - { + public static String getParentMenuId(JSONObject paramsObj) { + if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)) { return paramsObj.getString(GenConstants.PARENT_MENU_ID); } return DEFAULT_PARENT_MENU_ID; @@ -293,10 +254,8 @@ public class VelocityUtils * @param paramsObj 生成其他选项 * @return 树编码 */ - public static String getTreecode(JSONObject paramsObj) - { - if (paramsObj.containsKey(GenConstants.TREE_CODE)) - { + public static String getTreecode(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_CODE)) { return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); } return StringUtils.EMPTY; @@ -308,10 +267,8 @@ public class VelocityUtils * @param paramsObj 生成其他选项 * @return 树父编码 */ - public static String getTreeParentCode(JSONObject paramsObj) - { - if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) - { + public static String getTreeParentCode(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) { return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); } return StringUtils.EMPTY; @@ -323,10 +280,8 @@ public class VelocityUtils * @param paramsObj 生成其他选项 * @return 树名称 */ - public static String getTreeName(JSONObject paramsObj) - { - if (paramsObj.containsKey(GenConstants.TREE_NAME)) - { + public static String getTreeName(JSONObject paramsObj) { + if (paramsObj.containsKey(GenConstants.TREE_NAME)) { return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); } return StringUtils.EMPTY; @@ -338,20 +293,16 @@ public class VelocityUtils * @param genTable 业务表对象 * @return 展开按钮列序号 */ - public static int getExpandColumn(GenTable genTable) - { + public static int getExpandColumn(GenTable genTable) { String options = genTable.getOptions(); JSONObject paramsObj = JSONObject.parseObject(options); String treeName = paramsObj.getString(GenConstants.TREE_NAME); int num = 0; - for (GenTableColumn column : genTable.getColumns()) - { - if (column.isList()) - { + for (GenTableColumn column : genTable.getColumns()) { + if (column.isList()) { num++; String columnName = column.getColumnName(); - if (columnName.equals(treeName)) - { + if (columnName.equals(treeName)) { break; } } diff --git a/spring-boot/ruoyi-generator/src/main/resources/generator.yml b/spring-boot/ruoyi-generator/src/main/resources/generator.yml index 5bd3dd67..55db2bd7 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/generator.yml +++ b/spring-boot/ruoyi-generator/src/main/resources/generator.yml @@ -1,7 +1,7 @@ # 代码生成 -gen: +gen: # 作者 - author: ruoyi + author: wxy # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool packageName: com.ruoyi.system # 自动去除表前缀,默认是false diff --git a/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml index 5fa790f5..27e3f654 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ b/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -1,94 +1,98 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, + is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, + create_by, create_time, update_by, update_time from gen_table_column - + - + - + select column_name, (case when (is_nullable = 'no' column_key != 'PRI') then '1' else null end) + as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, + column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type + from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName}) + order by ordinal_position + + insert into gen_table_column ( - table_id, - column_name, - column_comment, - column_type, - java_type, - java_field, - is_pk, - is_increment, - is_required, - is_insert, - is_edit, - is_list, - is_query, - query_type, - html_type, - dict_type, - sort, - create_by, - create_time - )values( - #{tableId}, - #{columnName}, - #{columnComment}, - #{columnType}, - #{javaType}, - #{javaField}, - #{isPk}, - #{isIncrement}, - #{isRequired}, - #{isInsert}, - #{isEdit}, - #{isList}, - #{isQuery}, - #{queryType}, - #{htmlType}, - #{dictType}, - #{sort}, - #{createBy}, - sysdate() - ) + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) - + update gen_table_column @@ -111,14 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from gen_table_column where table_id in + delete from gen_table_column where table_id in #{tableId} - + - delete from gen_table_column where column_id in + delete from gen_table_column where column_id in #{item.columnId} diff --git a/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml index 3162379b..089192d4 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/spring-boot/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -1,172 +1,183 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, + package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, + create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + insert into gen_table ( - table_name, - table_comment, - class_name, - tpl_category, - package_name, - module_name, - business_name, - function_name, - function_author, - gen_type, - gen_path, - remark, - create_by, - create_time - )values( - #{tableName}, - #{tableComment}, - #{className}, - #{tplCategory}, - #{packageName}, - #{moduleName}, - #{businessName}, - #{functionName}, - #{functionAuthor}, - #{genType}, - #{genPath}, - #{remark}, - #{createBy}, - sysdate() - ) + table_name, + table_comment, + class_name, + tpl_category, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) - + update gen_table @@ -190,9 +201,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where table_id = #{tableId} - + - delete from gen_table where table_id in + delete from gen_table where table_id in #{tableId} diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/controller.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/controller.java.vm index d41edd92..a66cdab0 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/controller.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/controller.java.vm @@ -1,6 +1,7 @@ package ${packageName}.controller; import java.util.List; + import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -25,36 +26,33 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * ${functionName}Controller - * + * * @author ${author} * @date ${datetime} */ @RestController @RequestMapping("/${moduleName}/${businessName}") -public class ${ClassName}Controller extends BaseController -{ +public class ${ClassName}Controller extends BaseController { @Autowired private I${ClassName}Service ${className}Service; - /** - * 查询${functionName}列表 - */ - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") - @GetMapping("/list") -#if($table.crud || $table.sub) - public TableDataInfo list(${ClassName} ${className}) - { +/** + * 查询${functionName}列表 + */ +@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") +@GetMapping("/list") + #if($table.crud || $table.sub) + public TableDataInfo list(${ClassName} ${className}) { startPage(); List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); return getDataTable(list); } -#elseif($table.tree) - public AjaxResult list(${ClassName} ${className}) - { - List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); - return AjaxResult.success(list); - } -#end + #elseif($table.tree) + public AjaxResult list(${ClassName} ${className}) { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return AjaxResult.success(list); + } + #end /** * 导出${functionName}列表 @@ -62,10 +60,9 @@ public class ${ClassName}Controller extends BaseController @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") @Log(title = "${functionName}", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(${ClassName} ${className}) - { + public AjaxResult export(${ClassName} ${className}) { List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); - ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}. class); return util.exportExcel(list, "${businessName}"); } @@ -74,8 +71,7 @@ public class ${ClassName}Controller extends BaseController */ @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") @GetMapping(value = "/{${pkColumn.javaField}}") - public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) - { + public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) { return AjaxResult.success(${className}Service.select${ClassName}ById(${pkColumn.javaField})); } @@ -85,8 +81,7 @@ public class ${ClassName}Controller extends BaseController @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") @Log(title = "${functionName}", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody ${ClassName} ${className}) - { + public AjaxResult add(@RequestBody ${ClassName} ${className}) { return toAjax(${className}Service.insert${ClassName}(${className})); } @@ -96,8 +91,7 @@ public class ${ClassName}Controller extends BaseController @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") @Log(title = "${functionName}", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody ${ClassName} ${className}) - { + public AjaxResult edit(@RequestBody ${ClassName} ${className}) { return toAjax(${className}Service.update${ClassName}(${className})); } @@ -106,9 +100,8 @@ public class ${ClassName}Controller extends BaseController */ @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") @Log(title = "${functionName}", businessType = BusinessType.DELETE) - @DeleteMapping("/{${pkColumn.javaField}s}") - public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) - { + @DeleteMapping("/{${pkColumn.javaField}s}") + public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { return toAjax(${className}Service.delete${ClassName}ByIds(${pkColumn.javaField}s)); } } diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index bd51c177..ea9d7aa2 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -14,92 +14,92 @@ import com.ruoyi.common.core.domain.TreeEntity; /** * ${functionName}对象 ${tableName} - * + * * @author ${author} * @date ${datetime} */ #if($table.crud || $table.sub) -#set($Entity="BaseEntity") + #set($Entity="BaseEntity") #elseif($table.tree) -#set($Entity="TreeEntity") + #set($Entity="TreeEntity") #end public class ${ClassName} extends ${Entity} -{ - private static final long serialVersionUID = 1L; + { +private static final long serialVersionUID=1L; #foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) + #if(!$table.isSuperColumn($column.javaField)) /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") -#else - @Excel(name = "${comment}") -#end -#end + #if($column.list) + #set($parentheseIndex=$column.columnComment.indexOf("(")) + #if($parentheseIndex != -1) + #set($comment=$column.columnComment.substring(0, $parentheseIndex)) + #else + #set($comment=$column.columnComment) + #end + #if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + #elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") + #else + @Excel(name = "${comment}") + #end + #end private $column.javaType $column.javaField; -#end + #end #end #if($table.sub) - /** $table.subTable.functionName信息 */ - private List<${subClassName}> ${subclassName}List; +/** $table.subTable.functionName信息 */ +private List<${subClassName}> ${subclassName}List; #end #foreach ($column in $columns) -#if(!$table.isSuperColumn($column.javaField)) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - public void set${AttrName}($column.javaType $column.javaField) - { - this.$column.javaField = $column.javaField; - } + #if(!$table.isSuperColumn($column.javaField)) + #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) + #set($AttrName=$column.javaField) + #else + #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + #end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } - public $column.javaType get${AttrName}() - { - return $column.javaField; - } -#end + public $column.javaType get${AttrName}() + { + return $column.javaField; + } + #end #end #if($table.sub) - public List<${subClassName}> get${subClassName}List() - { +public List<${subClassName}> get${subClassName}List() + { return ${subclassName}List; - } + } - public void set${subClassName}List(List<${subClassName}> ${subclassName}List) - { - this.${subclassName}List = ${subclassName}List; - } +public void set${subClassName}List(List<${subClassName}> ${subclassName}List) + { + this.${subclassName}List= ${subclassName}List; + } #end - @Override - public String toString() { +@Override +public String toString(){ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -#foreach ($column in $columns) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - .append("${column.javaField}", get${AttrName}()) -#end -#if($table.sub) - .append("${subclassName}List", get${subClassName}List()) -#end - .toString(); - } -} + #foreach ($column in $columns) + #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) + #set($AttrName=$column.javaField) + #else + #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + #end + .append("${column.javaField}",get${AttrName}()) + #end + #if($table.sub) + .append("${subclassName}List",get${subClassName}List()) + #end + .toString(); + } + } diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm index 1bb36d61..16d7807c 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm @@ -1,6 +1,7 @@ package ${packageName}.mapper; import java.util.List; + import ${packageName}.domain.${ClassName}; #if($table.sub) import ${packageName}.domain.${subClassName}; @@ -8,15 +9,14 @@ import ${packageName}.domain.${subClassName}; /** * ${functionName}Mapper接口 - * + * * @author ${author} * @date ${datetime} */ -public interface ${ClassName}Mapper -{ +public interface ${ClassName}Mapper { /** * 查询${functionName} - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return ${functionName} */ @@ -24,7 +24,7 @@ public interface ${ClassName}Mapper /** * 查询${functionName}列表 - * + * * @param ${className} ${functionName} * @return ${functionName}集合 */ @@ -32,7 +32,7 @@ public interface ${ClassName}Mapper /** * 新增${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ @@ -40,7 +40,7 @@ public interface ${ClassName}Mapper /** * 修改${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ @@ -48,7 +48,7 @@ public interface ${ClassName}Mapper /** * 删除${functionName} - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return 结果 */ @@ -56,36 +56,36 @@ public interface ${ClassName}Mapper /** * 批量删除${functionName} - * + * * @param ${pkColumn.javaField}s 需要删除的数据ID * @return 结果 */ public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s); -#if($table.sub) + #if($table.sub) - /** - * 批量删除${subTable.functionName} - * - * @param customerIds 需要删除的数据ID - * @return 结果 - */ - public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); - - /** - * 批量新增${subTable.functionName} - * - * @param ${subclassName}List ${subTable.functionName}列表 - * @return 结果 - */ - public int batch${subClassName}(List<${subClassName}> ${subclassName}List); - + /** + * 批量删除${subTable.functionName} + * + * @param customerIds 需要删除的数据ID + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); - /** - * 通过${functionName}ID删除${subTable.functionName}信息 - * - * @param roleId 角色ID - * @return 结果 - */ - public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); -#end + /** + * 批量新增${subTable.functionName} + * + * @param ${subclassName}List ${subTable.functionName}列表 + * @return 结果 + */ + public int batch${subClassName}(List<${subClassName}> ${subclassName}List); + + + /** + * 通过${functionName}ID删除${subTable.functionName}信息 + * + * @param roleId 角色ID + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); + #end } diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/service.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/service.java.vm index 1217d53c..ac08ba9b 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/service.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/service.java.vm @@ -1,19 +1,19 @@ package ${packageName}.service; import java.util.List; + import ${packageName}.domain.${ClassName}; /** * ${functionName}Service接口 - * + * * @author ${author} * @date ${datetime} */ -public interface I${ClassName}Service -{ +public interface I${ClassName}Service { /** * 查询${functionName} - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return ${functionName} */ @@ -21,7 +21,7 @@ public interface I${ClassName}Service /** * 查询${functionName}列表 - * + * * @param ${className} ${functionName} * @return ${functionName}集合 */ @@ -29,7 +29,7 @@ public interface I${ClassName}Service /** * 新增${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ @@ -37,7 +37,7 @@ public interface I${ClassName}Service /** * 修改${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ @@ -45,7 +45,7 @@ public interface I${ClassName}Service /** * 批量删除${functionName} - * + * * @param ${pkColumn.javaField}s 需要删除的${functionName}ID * @return 结果 */ @@ -53,7 +53,7 @@ public interface I${ClassName}Service /** * 删除${functionName}信息 - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return 结果 */ diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm index 13517384..fa0b6ee6 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -1,166 +1,158 @@ package ${packageName}.service.impl; import java.util.List; -#foreach ($column in $columns) -#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') -import com.ruoyi.common.utils.DateUtils; -#break -#end -#end + #foreach ($column in $columns) + #if($column.javaField == 'createTime' || $column.javaField == 'updateTime') + import com.ruoyi.common.utils.DateUtils; + #break + #end + #end import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -#if($table.sub) -import java.util.ArrayList; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import ${packageName}.domain.${subClassName}; -#end + #if($table.sub) + import java.util.ArrayList; + + import com.ruoyi.common.utils.StringUtils; + import org.springframework.transaction.annotation.Transactional; + import ${packageName}.domain.${subClassName}; + #end import ${packageName}.mapper.${ClassName}Mapper; import ${packageName}.domain.${ClassName}; import ${packageName}.service.I${ClassName}Service; /** * ${functionName}Service业务层处理 - * + * * @author ${author} * @date ${datetime} */ @Service -public class ${ClassName}ServiceImpl implements I${ClassName}Service -{ +public class ${ClassName}ServiceImpl implements I${ClassName}Service { @Autowired private ${ClassName}Mapper ${className}Mapper; /** * 查询${functionName} - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return ${functionName} */ @Override - public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) - { + public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) { return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField}); } /** * 查询${functionName}列表 - * + * * @param ${className} ${functionName} * @return ${functionName} */ @Override - public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) - { + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) { return ${className}Mapper.select${ClassName}List(${className}); } /** * 新增${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ -#if($table.sub) - @Transactional -#end + #if($table.sub) + @Transactional + #end @Override - public int insert${ClassName}(${ClassName} ${className}) - { -#foreach ($column in $columns) -#if($column.javaField == 'createTime') - ${className}.setCreateTime(DateUtils.getNowDate()); -#end -#end -#if($table.sub) - int rows = ${className}Mapper.insert${ClassName}(${className}); - insert${subClassName}(${className}); - return rows; -#else - return ${className}Mapper.insert${ClassName}(${className}); -#end + public int insert${ClassName}(${ClassName} ${className}) { + #foreach ($column in $columns) + #if($column.javaField == 'createTime') + ${className}.setCreateTime(DateUtils.getNowDate()); + #end + #end + #if($table.sub) + int rows = ${className}Mapper.insert${ClassName}(${className}); + insert${subClassName}(${className}); + return rows; + #else + return ${className}Mapper.insert${ClassName}(${className}); + #end } /** * 修改${functionName} - * + * * @param ${className} ${functionName} * @return 结果 */ -#if($table.sub) - @Transactional -#end + #if($table.sub) + @Transactional + #end @Override - public int update${ClassName}(${ClassName} ${className}) - { -#foreach ($column in $columns) -#if($column.javaField == 'updateTime') - ${className}.setUpdateTime(DateUtils.getNowDate()); -#end -#end -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); - insert${subClassName}(${className}); -#end + public int update${ClassName}(${ClassName} ${className}) { + #foreach ($column in $columns) + #if($column.javaField == 'updateTime') + ${className}.setUpdateTime(DateUtils.getNowDate()); + #end + #end + #if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()) + ; + insert${subClassName}(${className}); + #end return ${className}Mapper.update${ClassName}(${className}); } /** * 批量删除${functionName} - * + * * @param ${pkColumn.javaField}s 需要删除的${functionName}ID * @return 结果 */ -#if($table.sub) - @Transactional -#end + #if($table.sub) + @Transactional + #end @Override - public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s) - { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); -#end + public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s) { + #if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); + #end return ${className}Mapper.delete${ClassName}ByIds(${pkColumn.javaField}s); } /** * 删除${functionName}信息 - * + * * @param ${pkColumn.javaField} ${functionName}ID * @return 结果 */ @Override - public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) - { -#if($table.sub) - ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); -#end + public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField}) { + #if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); + #end return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField}); } -#if($table.sub) + #if($table.sub) - /** - * 新增${subTable.functionName}信息 - * - * @param ${className} ${functionName}对象 - */ - public void insert${subClassName}(${ClassName} ${className}) - { - List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); - Long ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); - if (StringUtils.isNotNull(${subclassName}List)) - { - List<${subClassName}> list = new ArrayList<${subClassName}>(); - for (${subClassName} ${subclassName} : ${subclassName}List) - { - ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); - list.add(${subclassName}); - } - if (list.size() > 0) - { - ${className}Mapper.batch${subClassName}(list); + /** + * 新增${subTable.functionName}信息 + * + * @param ${className} ${functionName}对象 + */ + public void insert${subClassName}(${ClassName} ${className}) { + List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); + Long ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); + if (StringUtils.isNotNull(${subclassName}List)) { + List<${subClassName}> list = new ArrayList<${subClassName}>(); + for (${subClassName} ${subclassName} :${subclassName}List) + { + ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); + list.add(${subclassName}); + } + if (list.size() > 0) { + ${className}Mapper.batch${subClassName}(list); + } } } - } -#end + #end } diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm index a3f53eba..ad3890a0 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm @@ -1,8 +1,8 @@ package ${packageName}.domain; -#foreach ($import in $subImportList) -import ${import}; -#end + #foreach ($import in $subImportList) + import ${import}; + #end import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -10,67 +10,67 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * ${subTable.functionName}对象 ${subTableName} - * + * * @author ${author} * @date ${datetime} */ public class ${subClassName} extends BaseEntity -{ - private static final long serialVersionUID = 1L; + { +private static final long serialVersionUID=1L; #foreach ($column in $subTable.columns) -#if(!$table.isSuperColumn($column.javaField)) + #if(!$table.isSuperColumn($column.javaField)) /** $column.columnComment */ -#if($column.list) -#set($parentheseIndex=$column.columnComment.indexOf("(")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end -#if($parentheseIndex != -1) - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") -#elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") -#else - @Excel(name = "${comment}") -#end -#end + #if($column.list) + #set($parentheseIndex=$column.columnComment.indexOf("(")) + #if($parentheseIndex != -1) + #set($comment=$column.columnComment.substring(0, $parentheseIndex)) + #else + #set($comment=$column.columnComment) + #end + #if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + #elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") + #else + @Excel(name = "${comment}") + #end + #end private $column.javaType $column.javaField; -#end + #end #end #foreach ($column in $subTable.columns) -#if(!$table.isSuperColumn($column.javaField)) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - public void set${AttrName}($column.javaType $column.javaField) - { - this.$column.javaField = $column.javaField; - } + #if(!$table.isSuperColumn($column.javaField)) + #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) + #set($AttrName=$column.javaField) + #else + #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + #end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } - public $column.javaType get${AttrName}() - { - return $column.javaField; - } -#end + public $column.javaType get${AttrName}() + { + return $column.javaField; + } + #end #end - @Override - public String toString() { +@Override +public String toString(){ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -#foreach ($column in $subTable.columns) -#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) -#set($AttrName=$column.javaField) -#else -#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) -#end - .append("${column.javaField}", get${AttrName}()) -#end - .toString(); - } -} + #foreach ($column in $subTable.columns) + #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) + #set($AttrName=$column.javaField) + #else + #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + #end + .append("${column.javaField}",get${AttrName}()) + #end + .toString(); + } + } diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/js/api.js.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/js/api.js.vm index 296d41ae..2947d623 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/js/api.js.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/js/api.js.vm @@ -2,52 +2,52 @@ import request from '@/utils/request' // 查询${functionName}列表 export function list${BusinessName}(query) { - return request({ - url: '/${moduleName}/${businessName}/list', - method: 'get', - params: query - }) + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) } // 查询${functionName}详细 export function get${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, - method: 'get' - }) + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) } // 新增${functionName} export function add${BusinessName}(data) { - return request({ - url: '/${moduleName}/${businessName}', - method: 'post', - data: data - }) + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) } // 修改${functionName} export function update${BusinessName}(data) { - return request({ - url: '/${moduleName}/${businessName}', - method: 'put', - data: data - }) + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) } // 删除${functionName} export function del${BusinessName}(${pkColumn.javaField}) { - return request({ - url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, - method: 'delete' - }) + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) } // 导出${functionName} export function export${BusinessName}(query) { - return request({ - url: '/${moduleName}/${businessName}/export', - method: 'get', - params: query - }) + return request({ + url: '/${moduleName}/${businessName}/export', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index 46e65cf4..3e23b928 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -1,523 +1,568 @@ diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index a8f9d144..9f6bfad7 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -1,641 +1,689 @@ diff --git a/spring-boot/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/spring-boot/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm index 1cc07954..53c3e50e 100644 --- a/spring-boot/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm +++ b/spring-boot/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm @@ -1,103 +1,131 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + -#foreach ($column in $columns) - -#end + #foreach ($column in $columns) + + #end -#if($table.sub) + #if($table.sub) - - - + + + - -#foreach ($column in $subTable.columns) - -#end - -#end + + #foreach ($column in $subTable.columns) + + #end + + #end - select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end from ${tableName} + select#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end + from ${tableName} - - + #if($table.crud || $table.tree) + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + #elseif($table.sub) + select#foreach($column in $columns) a.$column.columnName#if($velocityCount != $columns.size()),#end#end, + #foreach($column in $subTable.columns) b.$column.columnName#if($velocityCount != $subTable.columns.size()) + ,#end#end + + from ${tableName} a + left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName} + where a.${pkColumn.columnName} = #{${pkColumn.javaField}} + #end - - + + insert into ${tableName} -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) - $column.columnName, -#end -#end - + #foreach($column in $columns) + #if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, + + #end + #end + -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) - #{$column.javaField}, -#end -#end - + #foreach($column in $columns) + #if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, + + #end + #end + update ${tableName} -#foreach($column in $columns) -#if($column.columnName != $pkColumn.columnName) - $column.columnName = #{$column.javaField}, -#end -#end + #foreach($column in $columns) + #if($column.columnName != $pkColumn.columnName) + $column.columnName = + #{$column.javaField}, + + #end + #end where ${pkColumn.columnName} = #{${pkColumn.javaField}} @@ -107,29 +135,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ${tableName} where ${pkColumn.columnName} in + delete from ${tableName} where ${pkColumn.columnName} in #{${pkColumn.javaField}} -#if($table.sub) - - - delete from ${subTableName} where ${subTableFkName} in - - #{${subTableFkclassName}} - - + #if($table.sub) - - delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} - + + delete from ${subTableName} where ${subTableFkName} in + + #{${subTableFkclassName}} + + - - insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($velocityCount != $subTable.columns.size()),#end#end) values - - (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($velocityCount != $subTable.columns.size()),#end#end) - - -#end + + delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} + + + + insert into ${subTableName} + (#foreach($column in $subTable.columns) $column.columnName#if($velocityCount != $subTable.columns.size()) + ,#end#end) values + + (#foreach($column in $subTable.columns) #{item.$column.javaField + }#if($velocityCount != $subTable.columns.size()),#end#end) + + + #end \ No newline at end of file diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java index 58c69bc3..98b5bbb1 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java @@ -3,20 +3,19 @@ package com.ruoyi.quartz.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.quartz.SchedulerFactoryBean; + import javax.sql.DataSource; import java.util.Properties; /** * 定时任务配置 - * + * * @author ruoyi */ @Configuration -public class ScheduleConfig -{ +public class ScheduleConfig { @Bean - public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) - { + public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) { SchedulerFactoryBean factory = new SchedulerFactoryBean(); factory.setDataSource(dataSource); diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java index fc7614c9..ec35b03a 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java @@ -1,6 +1,7 @@ package com.ruoyi.quartz.controller; import java.util.List; + import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -26,13 +27,12 @@ import com.ruoyi.quartz.util.CronUtils; /** * 调度任务信息操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/job") -public class SysJobController extends BaseController -{ +public class SysJobController extends BaseController { @Autowired private ISysJobService jobService; @@ -41,8 +41,7 @@ public class SysJobController extends BaseController */ @PreAuthorize("@ss.hasPermi('monitor:job:list')") @GetMapping("/list") - public TableDataInfo list(SysJob sysJob) - { + public TableDataInfo list(SysJob sysJob) { startPage(); List list = jobService.selectJobList(sysJob); return getDataTable(list); @@ -54,8 +53,7 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:export')") @Log(title = "定时任务", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(SysJob sysJob) - { + public AjaxResult export(SysJob sysJob) { List list = jobService.selectJobList(sysJob); ExcelUtil util = new ExcelUtil(SysJob.class); return util.exportExcel(list, "定时任务"); @@ -66,8 +64,7 @@ public class SysJobController extends BaseController */ @PreAuthorize("@ss.hasPermi('monitor:job:query')") @GetMapping(value = "/{jobId}") - public AjaxResult getInfo(@PathVariable("jobId") Long jobId) - { + public AjaxResult getInfo(@PathVariable("jobId") Long jobId) { return AjaxResult.success(jobService.selectJobById(jobId)); } @@ -77,10 +74,8 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:add')") @Log(title = "定时任务", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException - { - if (!CronUtils.isValid(sysJob.getCronExpression())) - { + public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { + if (!CronUtils.isValid(sysJob.getCronExpression())) { return AjaxResult.error("cron表达式不正确"); } sysJob.setCreateBy(SecurityUtils.getUsername()); @@ -93,10 +88,8 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:edit')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException - { - if (!CronUtils.isValid(sysJob.getCronExpression())) - { + public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { + if (!CronUtils.isValid(sysJob.getCronExpression())) { return AjaxResult.error("cron表达式不正确"); } sysJob.setUpdateBy(SecurityUtils.getUsername()); @@ -109,8 +102,7 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException - { + public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException { SysJob newJob = jobService.selectJobById(job.getJobId()); newJob.setStatus(job.getStatus()); return toAjax(jobService.changeStatus(newJob)); @@ -122,8 +114,7 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/run") - public AjaxResult run(@RequestBody SysJob job) throws SchedulerException - { + public AjaxResult run(@RequestBody SysJob job) throws SchedulerException { jobService.run(job); return AjaxResult.success(); } @@ -134,8 +125,7 @@ public class SysJobController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:remove')") @Log(title = "定时任务", businessType = BusinessType.DELETE) @DeleteMapping("/{jobIds}") - public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException - { + public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException { jobService.deleteJobByIds(jobIds); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java index b1f8204e..52fc973a 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java @@ -1,6 +1,7 @@ package com.ruoyi.quartz.controller; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -19,13 +20,12 @@ import com.ruoyi.quartz.service.ISysJobLogService; /** * 调度日志操作处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/monitor/jobLog") -public class SysJobLogController extends BaseController -{ +public class SysJobLogController extends BaseController { @Autowired private ISysJobLogService jobLogService; @@ -34,8 +34,7 @@ public class SysJobLogController extends BaseController */ @PreAuthorize("@ss.hasPermi('monitor:job:list')") @GetMapping("/list") - public TableDataInfo list(SysJobLog sysJobLog) - { + public TableDataInfo list(SysJobLog sysJobLog) { startPage(); List list = jobLogService.selectJobLogList(sysJobLog); return getDataTable(list); @@ -47,20 +46,18 @@ public class SysJobLogController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:export')") @Log(title = "任务调度日志", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(SysJobLog sysJobLog) - { + public AjaxResult export(SysJobLog sysJobLog) { List list = jobLogService.selectJobLogList(sysJobLog); ExcelUtil util = new ExcelUtil(SysJobLog.class); return util.exportExcel(list, "调度日志"); } - + /** * 根据调度编号获取详细信息 */ @PreAuthorize("@ss.hasPermi('monitor:job:query')") @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long jobLogId) - { + public AjaxResult getInfo(@PathVariable Long jobLogId) { return AjaxResult.success(jobLogService.selectJobLogById(jobLogId)); } @@ -71,8 +68,7 @@ public class SysJobLogController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:remove')") @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE) @DeleteMapping("/{jobLogIds}") - public AjaxResult remove(@PathVariable Long[] jobLogIds) - { + public AjaxResult remove(@PathVariable Long[] jobLogIds) { return toAjax(jobLogService.deleteJobLogByIds(jobLogIds)); } @@ -82,8 +78,7 @@ public class SysJobLogController extends BaseController @PreAuthorize("@ss.hasPermi('monitor:job:remove')") @Log(title = "调度日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") - public AjaxResult clean() - { + public AjaxResult clean() { jobLogService.cleanJobLog(); return AjaxResult.success(); } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java index abe5b5d3..77b66e3a 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.Date; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.fasterxml.jackson.annotation.JsonFormat; @@ -16,157 +17,154 @@ import com.ruoyi.quartz.util.CronUtils; /** * 定时任务调度表 sys_job - * + * * @author ruoyi */ -public class SysJob extends BaseEntity implements Serializable -{ +public class SysJob extends BaseEntity implements Serializable { private static final long serialVersionUID = 1L; - /** 任务ID */ + /** + * 任务ID + */ @Excel(name = "任务序号", cellType = ColumnType.NUMERIC) private Long jobId; - /** 任务名称 */ + /** + * 任务名称 + */ @Excel(name = "任务名称") private String jobName; - /** 任务组名 */ + /** + * 任务组名 + */ @Excel(name = "任务组名") private String jobGroup; - /** 调用目标字符串 */ + /** + * 调用目标字符串 + */ @Excel(name = "调用目标字符串") private String invokeTarget; - /** cron执行表达式 */ + /** + * cron执行表达式 + */ @Excel(name = "执行表达式 ") private String cronExpression; - /** cron计划策略 */ + /** + * cron计划策略 + */ @Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行") private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT; - /** 是否并发执行(0允许 1禁止) */ + /** + * 是否并发执行(0允许 1禁止) + */ @Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止") private String concurrent; - /** 任务状态(0正常 1暂停) */ + /** + * 任务状态(0正常 1暂停) + */ @Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停") private String status; - public Long getJobId() - { + public Long getJobId() { return jobId; } - public void setJobId(Long jobId) - { + public void setJobId(Long jobId) { this.jobId = jobId; } @NotBlank(message = "任务名称不能为空") @Size(min = 0, max = 64, message = "任务名称不能超过64个字符") - public String getJobName() - { + public String getJobName() { return jobName; } - public void setJobName(String jobName) - { + public void setJobName(String jobName) { this.jobName = jobName; } - public String getJobGroup() - { + public String getJobGroup() { return jobGroup; } - public void setJobGroup(String jobGroup) - { + public void setJobGroup(String jobGroup) { this.jobGroup = jobGroup; } @NotBlank(message = "调用目标字符串不能为空") @Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符") - public String getInvokeTarget() - { + public String getInvokeTarget() { return invokeTarget; } - public void setInvokeTarget(String invokeTarget) - { + public void setInvokeTarget(String invokeTarget) { this.invokeTarget = invokeTarget; } @NotBlank(message = "Cron执行表达式不能为空") @Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符") - public String getCronExpression() - { + public String getCronExpression() { return cronExpression; } - public void setCronExpression(String cronExpression) - { + public void setCronExpression(String cronExpression) { this.cronExpression = cronExpression; } @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - public Date getNextValidTime() - { - if (StringUtils.isNotEmpty(cronExpression)) - { + public Date getNextValidTime() { + if (StringUtils.isNotEmpty(cronExpression)) { return CronUtils.getNextExecution(cronExpression); } return null; } - public String getMisfirePolicy() - { + public String getMisfirePolicy() { return misfirePolicy; } - public void setMisfirePolicy(String misfirePolicy) - { + public void setMisfirePolicy(String misfirePolicy) { this.misfirePolicy = misfirePolicy; } - public String getConcurrent() - { + public String getConcurrent() { return concurrent; } - public void setConcurrent(String concurrent) - { + public void setConcurrent(String concurrent) { this.concurrent = concurrent; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("jobId", getJobId()) - .append("jobName", getJobName()) - .append("jobGroup", getJobGroup()) - .append("cronExpression", getCronExpression()) - .append("nextValidTime", getNextValidTime()) - .append("misfirePolicy", getMisfirePolicy()) - .append("concurrent", getConcurrent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("jobId", getJobId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("cronExpression", getCronExpression()) + .append("nextValidTime", getNextValidTime()) + .append("misfirePolicy", getMisfirePolicy()) + .append("concurrent", getConcurrent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java index 121c0359..3f36a43c 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java @@ -1,6 +1,7 @@ package com.ruoyi.quartz.domain; import java.util.Date; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -8,148 +9,147 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 定时任务调度日志表 sys_job_log - * + * * @author ruoyi */ -public class SysJobLog extends BaseEntity -{ +public class SysJobLog extends BaseEntity { private static final long serialVersionUID = 1L; - /** ID */ + /** + * ID + */ @Excel(name = "日志序号") private Long jobLogId; - /** 任务名称 */ + /** + * 任务名称 + */ @Excel(name = "任务名称") private String jobName; - /** 任务组名 */ + /** + * 任务组名 + */ @Excel(name = "任务组名") private String jobGroup; - /** 调用目标字符串 */ + /** + * 调用目标字符串 + */ @Excel(name = "调用目标字符串") private String invokeTarget; - /** 日志信息 */ + /** + * 日志信息 + */ @Excel(name = "日志信息") private String jobMessage; - /** 执行状态(0正常 1失败) */ + /** + * 执行状态(0正常 1失败) + */ @Excel(name = "执行状态", readConverterExp = "0=正常,1=失败") private String status; - /** 异常信息 */ + /** + * 异常信息 + */ @Excel(name = "异常信息") private String exceptionInfo; - /** 开始时间 */ + /** + * 开始时间 + */ private Date startTime; - /** 停止时间 */ + /** + * 停止时间 + */ private Date stopTime; - public Long getJobLogId() - { + public Long getJobLogId() { return jobLogId; } - public void setJobLogId(Long jobLogId) - { + public void setJobLogId(Long jobLogId) { this.jobLogId = jobLogId; } - public String getJobName() - { + public String getJobName() { return jobName; } - public void setJobName(String jobName) - { + public void setJobName(String jobName) { this.jobName = jobName; } - public String getJobGroup() - { + public String getJobGroup() { return jobGroup; } - public void setJobGroup(String jobGroup) - { + public void setJobGroup(String jobGroup) { this.jobGroup = jobGroup; } - public String getInvokeTarget() - { + public String getInvokeTarget() { return invokeTarget; } - public void setInvokeTarget(String invokeTarget) - { + public void setInvokeTarget(String invokeTarget) { this.invokeTarget = invokeTarget; } - public String getJobMessage() - { + public String getJobMessage() { return jobMessage; } - public void setJobMessage(String jobMessage) - { + public void setJobMessage(String jobMessage) { this.jobMessage = jobMessage; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getExceptionInfo() - { + public String getExceptionInfo() { return exceptionInfo; } - public void setExceptionInfo(String exceptionInfo) - { + public void setExceptionInfo(String exceptionInfo) { this.exceptionInfo = exceptionInfo; } - public Date getStartTime() - { + public Date getStartTime() { return startTime; } - public void setStartTime(Date startTime) - { + public void setStartTime(Date startTime) { this.startTime = startTime; } - - public Date getStopTime() - { + + public Date getStopTime() { return stopTime; } - public void setStopTime(Date stopTime) - { + public void setStopTime(Date stopTime) { this.stopTime = stopTime; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("jobLogId", getJobLogId()) - .append("jobName", getJobName()) - .append("jobGroup", getJobGroup()) - .append("jobMessage", getJobMessage()) - .append("status", getStatus()) - .append("exceptionInfo", getExceptionInfo()) - .append("startTime", getStartTime()) - .append("stopTime", getStopTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("jobLogId", getJobLogId()) + .append("jobName", getJobName()) + .append("jobGroup", getJobGroup()) + .append("jobMessage", getJobMessage()) + .append("status", getStatus()) + .append("exceptionInfo", getExceptionInfo()) + .append("startTime", getStartTime()) + .append("stopTime", getStopTime()) + .toString(); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java index 727d9169..8fb2a851 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.quartz.mapper; import java.util.List; + import com.ruoyi.quartz.domain.SysJobLog; /** * 调度任务日志信息 数据层 - * + * * @author ruoyi */ -public interface SysJobLogMapper -{ +public interface SysJobLogMapper { /** * 获取quartz调度器日志的计划任务 - * + * * @param jobLog 调度日志信息 * @return 调度任务日志集合 */ @@ -27,7 +27,7 @@ public interface SysJobLogMapper /** * 通过调度任务日志ID查询调度信息 - * + * * @param jobLogId 调度任务日志ID * @return 调度任务日志对象信息 */ @@ -35,7 +35,7 @@ public interface SysJobLogMapper /** * 新增任务日志 - * + * * @param jobLog 调度日志信息 * @return 结果 */ @@ -43,7 +43,7 @@ public interface SysJobLogMapper /** * 批量删除调度日志信息 - * + * * @param logIds 需要删除的数据ID * @return 结果 */ @@ -51,7 +51,7 @@ public interface SysJobLogMapper /** * 删除任务日志 - * + * * @param jobId 调度日志ID * @return 结果 */ diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java index 20f45dbb..7650d484 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.quartz.mapper; import java.util.List; + import com.ruoyi.quartz.domain.SysJob; /** * 调度任务信息 数据层 - * + * * @author ruoyi */ -public interface SysJobMapper -{ +public interface SysJobMapper { /** * 查询调度任务日志集合 - * + * * @param job 调度信息 * @return 操作日志集合 */ @@ -20,14 +20,14 @@ public interface SysJobMapper /** * 查询所有调度任务 - * + * * @return 调度任务列表 */ public List selectJobAll(); /** * 通过调度ID查询调度任务信息 - * + * * @param jobId 调度ID * @return 角色对象信息 */ @@ -35,7 +35,7 @@ public interface SysJobMapper /** * 通过调度ID删除调度任务信息 - * + * * @param jobId 调度ID * @return 结果 */ @@ -43,7 +43,7 @@ public interface SysJobMapper /** * 批量删除调度任务信息 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @@ -51,7 +51,7 @@ public interface SysJobMapper /** * 修改调度任务信息 - * + * * @param job 调度任务信息 * @return 结果 */ @@ -59,7 +59,7 @@ public interface SysJobMapper /** * 新增调度任务信息 - * + * * @param job 调度任务信息 * @return 结果 */ diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java index 8546792a..41171f3b 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java @@ -1,18 +1,18 @@ package com.ruoyi.quartz.service; import java.util.List; + import com.ruoyi.quartz.domain.SysJobLog; /** * 定时任务调度日志信息信息 服务层 - * + * * @author ruoyi */ -public interface ISysJobLogService -{ +public interface ISysJobLogService { /** * 获取quartz调度器日志的计划任务 - * + * * @param jobLog 调度日志信息 * @return 调度任务日志集合 */ @@ -20,7 +20,7 @@ public interface ISysJobLogService /** * 通过调度任务日志ID查询调度信息 - * + * * @param jobLogId 调度任务日志ID * @return 调度任务日志对象信息 */ @@ -28,14 +28,14 @@ public interface ISysJobLogService /** * 新增任务日志 - * + * * @param jobLog 调度日志信息 */ public void addJobLog(SysJobLog jobLog); /** * 批量删除调度日志信息 - * + * * @param logIds 需要删除的日志ID * @return 结果 */ @@ -43,7 +43,7 @@ public interface ISysJobLogService /** * 删除任务日志 - * + * * @param jobId 调度日志ID * @return 结果 */ diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java index 6d62661c..f4d38586 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java @@ -1,20 +1,20 @@ package com.ruoyi.quartz.service; import java.util.List; + import org.quartz.SchedulerException; import com.ruoyi.common.exception.job.TaskException; import com.ruoyi.quartz.domain.SysJob; /** * 定时任务调度信息信息 服务层 - * + * * @author ruoyi */ -public interface ISysJobService -{ +public interface ISysJobService { /** * 获取quartz调度器的计划任务 - * + * * @param job 调度信息 * @return 调度任务集合 */ @@ -22,7 +22,7 @@ public interface ISysJobService /** * 通过调度任务ID查询调度信息 - * + * * @param jobId 调度任务ID * @return 调度任务对象信息 */ @@ -30,7 +30,7 @@ public interface ISysJobService /** * 暂停任务 - * + * * @param job 调度信息 * @return 结果 */ @@ -38,7 +38,7 @@ public interface ISysJobService /** * 恢复任务 - * + * * @param job 调度信息 * @return 结果 */ @@ -46,7 +46,7 @@ public interface ISysJobService /** * 删除任务后,所对应的trigger也将被删除 - * + * * @param job 调度信息 * @return 结果 */ @@ -54,7 +54,7 @@ public interface ISysJobService /** * 批量删除调度信息 - * + * * @param jobIds 需要删除的任务ID * @return 结果 */ @@ -62,7 +62,7 @@ public interface ISysJobService /** * 任务调度状态修改 - * + * * @param job 调度信息 * @return 结果 */ @@ -70,7 +70,7 @@ public interface ISysJobService /** * 立即运行任务 - * + * * @param job 调度信息 * @return 结果 */ @@ -78,7 +78,7 @@ public interface ISysJobService /** * 新增任务 - * + * * @param job 调度信息 * @return 结果 */ @@ -86,7 +86,7 @@ public interface ISysJobService /** * 更新任务 - * + * * @param job 调度信息 * @return 结果 */ @@ -94,7 +94,7 @@ public interface ISysJobService /** * 校验cron表达式是否有效 - * + * * @param cronExpression 表达式 * @return 结果 */ diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java index 812eed77..48d07073 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.quartz.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.quartz.domain.SysJobLog; @@ -9,70 +10,64 @@ import com.ruoyi.quartz.service.ISysJobLogService; /** * 定时任务调度日志信息 服务层 - * + * * @author ruoyi */ @Service -public class SysJobLogServiceImpl implements ISysJobLogService -{ +public class SysJobLogServiceImpl implements ISysJobLogService { @Autowired private SysJobLogMapper jobLogMapper; /** * 获取quartz调度器日志的计划任务 - * + * * @param jobLog 调度日志信息 * @return 调度任务日志集合 */ @Override - public List selectJobLogList(SysJobLog jobLog) - { + public List selectJobLogList(SysJobLog jobLog) { return jobLogMapper.selectJobLogList(jobLog); } /** * 通过调度任务日志ID查询调度信息 - * + * * @param jobLogId 调度任务日志ID * @return 调度任务日志对象信息 */ @Override - public SysJobLog selectJobLogById(Long jobLogId) - { + public SysJobLog selectJobLogById(Long jobLogId) { return jobLogMapper.selectJobLogById(jobLogId); } /** * 新增任务日志 - * + * * @param jobLog 调度日志信息 */ @Override - public void addJobLog(SysJobLog jobLog) - { + public void addJobLog(SysJobLog jobLog) { jobLogMapper.insertJobLog(jobLog); } /** * 批量删除调度日志信息 - * + * * @param logIds 需要删除的数据ID * @return 结果 */ @Override - public int deleteJobLogByIds(Long[] logIds) - { + public int deleteJobLogByIds(Long[] logIds) { return jobLogMapper.deleteJobLogByIds(logIds); } /** * 删除任务日志 - * + * * @param jobId 调度日志ID */ @Override - public int deleteJobLogById(Long jobId) - { + public int deleteJobLogById(Long jobId) { return jobLogMapper.deleteJobLogById(jobId); } @@ -80,8 +75,7 @@ public class SysJobLogServiceImpl implements ISysJobLogService * 清空任务日志 */ @Override - public void cleanJobLog() - { + public void cleanJobLog() { jobLogMapper.cleanJobLog(); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java index 57a52438..46e0eadb 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.quartz.service.impl; import java.util.List; import javax.annotation.PostConstruct; + import org.quartz.JobDataMap; import org.quartz.JobKey; import org.quartz.Scheduler; @@ -19,12 +20,11 @@ import com.ruoyi.quartz.util.ScheduleUtils; /** * 定时任务调度信息 服务层 - * + * * @author ruoyi */ @Service -public class SysJobServiceImpl implements ISysJobService -{ +public class SysJobServiceImpl implements ISysJobService { @Autowired private Scheduler scheduler; @@ -35,55 +35,49 @@ public class SysJobServiceImpl implements ISysJobService * 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据) */ @PostConstruct - public void init() throws SchedulerException, TaskException - { + public void init() throws SchedulerException, TaskException { scheduler.clear(); List jobList = jobMapper.selectJobAll(); - for (SysJob job : jobList) - { + for (SysJob job : jobList) { ScheduleUtils.createScheduleJob(scheduler, job); } } /** * 获取quartz调度器的计划任务列表 - * + * * @param job 调度信息 * @return */ @Override - public List selectJobList(SysJob job) - { + public List selectJobList(SysJob job) { return jobMapper.selectJobList(job); } /** * 通过调度任务ID查询调度信息 - * + * * @param jobId 调度任务ID * @return 调度任务对象信息 */ @Override - public SysJob selectJobById(Long jobId) - { + public SysJob selectJobById(Long jobId) { return jobMapper.selectJobById(jobId); } /** * 暂停任务 - * + * * @param job 调度信息 */ @Override @Transactional - public int pauseJob(SysJob job) throws SchedulerException - { + public int pauseJob(SysJob job) throws SchedulerException { Long jobId = job.getJobId(); String jobGroup = job.getJobGroup(); job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); int rows = jobMapper.updateJob(job); - if (rows > 0) - { + if (rows > 0) { scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); } return rows; @@ -91,19 +85,17 @@ public class SysJobServiceImpl implements ISysJobService /** * 恢复任务 - * + * * @param job 调度信息 */ @Override @Transactional - public int resumeJob(SysJob job) throws SchedulerException - { + public int resumeJob(SysJob job) throws SchedulerException { Long jobId = job.getJobId(); String jobGroup = job.getJobGroup(); job.setStatus(ScheduleConstants.Status.NORMAL.getValue()); int rows = jobMapper.updateJob(job); - if (rows > 0) - { + if (rows > 0) { scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup)); } return rows; @@ -111,18 +103,16 @@ public class SysJobServiceImpl implements ISysJobService /** * 删除任务后,所对应的trigger也将被删除 - * + * * @param job 调度信息 */ @Override @Transactional - public int deleteJob(SysJob job) throws SchedulerException - { + public int deleteJob(SysJob job) throws SchedulerException { Long jobId = job.getJobId(); String jobGroup = job.getJobGroup(); int rows = jobMapper.deleteJobById(jobId); - if (rows > 0) - { + if (rows > 0) { scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup)); } return rows; @@ -130,16 +120,14 @@ public class SysJobServiceImpl implements ISysJobService /** * 批量删除调度信息 - * + * * @param jobIds 需要删除的任务ID * @return 结果 */ @Override @Transactional - public void deleteJobByIds(Long[] jobIds) throws SchedulerException - { - for (Long jobId : jobIds) - { + public void deleteJobByIds(Long[] jobIds) throws SchedulerException { + for (Long jobId : jobIds) { SysJob job = jobMapper.selectJobById(jobId); deleteJob(job); } @@ -147,21 +135,17 @@ public class SysJobServiceImpl implements ISysJobService /** * 任务调度状态修改 - * + * * @param job 调度信息 */ @Override @Transactional - public int changeStatus(SysJob job) throws SchedulerException - { + public int changeStatus(SysJob job) throws SchedulerException { int rows = 0; String status = job.getStatus(); - if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) - { + if (ScheduleConstants.Status.NORMAL.getValue().equals(status)) { rows = resumeJob(job); - } - else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) - { + } else if (ScheduleConstants.Status.PAUSE.getValue().equals(status)) { rows = pauseJob(job); } return rows; @@ -169,13 +153,12 @@ public class SysJobServiceImpl implements ISysJobService /** * 立即运行任务 - * + * * @param job 调度信息 */ @Override @Transactional - public void run(SysJob job) throws SchedulerException - { + public void run(SysJob job) throws SchedulerException { Long jobId = job.getJobId(); String jobGroup = job.getJobGroup(); SysJob properties = selectJobById(job.getJobId()); @@ -187,17 +170,15 @@ public class SysJobServiceImpl implements ISysJobService /** * 新增任务 - * + * * @param job 调度信息 调度信息 */ @Override @Transactional - public int insertJob(SysJob job) throws SchedulerException, TaskException - { + public int insertJob(SysJob job) throws SchedulerException, TaskException { job.setStatus(ScheduleConstants.Status.PAUSE.getValue()); int rows = jobMapper.insertJob(job); - if (rows > 0) - { + if (rows > 0) { ScheduleUtils.createScheduleJob(scheduler, job); } return rows; @@ -205,17 +186,15 @@ public class SysJobServiceImpl implements ISysJobService /** * 更新任务的时间表达式 - * + * * @param job 调度信息 */ @Override @Transactional - public int updateJob(SysJob job) throws SchedulerException, TaskException - { + public int updateJob(SysJob job) throws SchedulerException, TaskException { SysJob properties = selectJobById(job.getJobId()); int rows = jobMapper.updateJob(job); - if (rows > 0) - { + if (rows > 0) { updateSchedulerJob(job, properties.getJobGroup()); } return rows; @@ -223,17 +202,15 @@ public class SysJobServiceImpl implements ISysJobService /** * 更新任务 - * - * @param job 任务对象 + * + * @param job 任务对象 * @param jobGroup 任务组名 */ - public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException - { + public void updateSchedulerJob(SysJob job, String jobGroup) throws SchedulerException, TaskException { Long jobId = job.getJobId(); // 判断是否存在 JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup); - if (scheduler.checkExists(jobKey)) - { + if (scheduler.checkExists(jobKey)) { // 防止创建时存在数据问题 先移除,然后在执行创建操作 scheduler.deleteJob(jobKey); } @@ -242,13 +219,12 @@ public class SysJobServiceImpl implements ISysJobService /** * 校验cron表达式是否有效 - * + * * @param cronExpression 表达式 * @return 结果 */ @Override - public boolean checkCronExpressionIsValid(String cronExpression) - { + public boolean checkCronExpressionIsValid(String cronExpression) { return CronUtils.isValid(cronExpression); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java index 853243ba..b4b94c89 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java @@ -5,24 +5,20 @@ import com.ruoyi.common.utils.StringUtils; /** * 定时任务调度测试 - * + * * @author ruoyi */ @Component("ryTask") -public class RyTask -{ - public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) - { +public class RyTask { + public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) { System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i)); } - public void ryParams(String params) - { + public void ryParams(String params) { System.out.println("执行有参方法:" + params); } - public void ryNoParams() - { + public void ryNoParams() { System.out.println("执行无参方法"); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java index 731a5eb5..f3db6aa1 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java @@ -1,6 +1,7 @@ package com.ruoyi.quartz.util; import java.util.Date; + import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -21,8 +22,7 @@ import com.ruoyi.quartz.service.ISysJobLogService; * * @author ruoyi */ -public abstract class AbstractQuartzJob implements Job -{ +public abstract class AbstractQuartzJob implements Job { private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class); /** @@ -31,21 +31,16 @@ public abstract class AbstractQuartzJob implements Job private static ThreadLocal threadLocal = new ThreadLocal<>(); @Override - public void execute(JobExecutionContext context) throws JobExecutionException - { + public void execute(JobExecutionContext context) throws JobExecutionException { SysJob sysJob = new SysJob(); BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES)); - try - { + try { before(context, sysJob); - if (sysJob != null) - { + if (sysJob != null) { doExecute(context, sysJob); } after(context, sysJob, null); - } - catch (Exception e) - { + } catch (Exception e) { log.error("任务执行异常 - :", e); after(context, sysJob, e); } @@ -55,10 +50,9 @@ public abstract class AbstractQuartzJob implements Job * 执行前 * * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 + * @param sysJob 系统计划任务 */ - protected void before(JobExecutionContext context, SysJob sysJob) - { + protected void before(JobExecutionContext context, SysJob sysJob) { threadLocal.set(new Date()); } @@ -66,10 +60,9 @@ public abstract class AbstractQuartzJob implements Job * 执行后 * * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 + * @param sysJob 系统计划任务 */ - protected void after(JobExecutionContext context, SysJob sysJob, Exception e) - { + protected void after(JobExecutionContext context, SysJob sysJob, Exception e) { Date startTime = threadLocal.get(); threadLocal.remove(); @@ -81,14 +74,11 @@ public abstract class AbstractQuartzJob implements Job sysJobLog.setStopTime(new Date()); long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime(); sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒"); - if (e != null) - { + if (e != null) { sysJobLog.setStatus(Constants.FAIL); String errorMsg = StringUtils.substring(ExceptionUtil.getExceptionMessage(e), 0, 2000); sysJobLog.setExceptionInfo(errorMsg); - } - else - { + } else { sysJobLog.setStatus(Constants.SUCCESS); } @@ -100,7 +90,7 @@ public abstract class AbstractQuartzJob implements Job * 执行方法,由子类重载 * * @param context 工作执行上下文对象 - * @param sysJob 系统计划任务 + * @param sysJob 系统计划任务 * @throws Exception 执行过程中的异常 */ protected abstract void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception; diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java index dd538397..a91e2505 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java @@ -2,24 +2,22 @@ package com.ruoyi.quartz.util; import java.text.ParseException; import java.util.Date; + import org.quartz.CronExpression; /** * cron表达式工具类 - * - * @author ruoyi * + * @author ruoyi */ -public class CronUtils -{ +public class CronUtils { /** * 返回一个布尔值代表一个给定的Cron表达式的有效性 * * @param cronExpression Cron表达式 * @return boolean 表达式是否有效 */ - public static boolean isValid(String cronExpression) - { + public static boolean isValid(String cronExpression) { return CronExpression.isValidExpression(cronExpression); } @@ -29,15 +27,11 @@ public class CronUtils * @param cronExpression Cron表达式 * @return String 无效时返回表达式错误描述,如果有效返回null */ - public static String getInvalidMessage(String cronExpression) - { - try - { + public static String getInvalidMessage(String cronExpression) { + try { new CronExpression(cronExpression); return null; - } - catch (ParseException pe) - { + } catch (ParseException pe) { return pe.getMessage(); } } @@ -48,15 +42,11 @@ public class CronUtils * @param cronExpression Cron表达式 * @return Date 下次Cron表达式执行时间 */ - public static Date getNextExecution(String cronExpression) - { - try - { + public static Date getNextExecution(String cronExpression) { + try { CronExpression cron = new CronExpression(cronExpression); return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis())); - } - catch (ParseException e) - { + } catch (ParseException e) { throw new IllegalArgumentException(e.getMessage()); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java index 40a19bde..7e5661a1 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java @@ -4,6 +4,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; + import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.quartz.domain.SysJob; @@ -13,27 +14,22 @@ import com.ruoyi.quartz.domain.SysJob; * * @author ruoyi */ -public class JobInvokeUtil -{ +public class JobInvokeUtil { /** * 执行方法 * * @param sysJob 系统任务 */ - public static void invokeMethod(SysJob sysJob) throws Exception - { + public static void invokeMethod(SysJob sysJob) throws Exception { String invokeTarget = sysJob.getInvokeTarget(); String beanName = getBeanName(invokeTarget); String methodName = getMethodName(invokeTarget); List methodParams = getMethodParams(invokeTarget); - if (!isValidClassName(beanName)) - { + if (!isValidClassName(beanName)) { Object bean = SpringUtils.getBean(beanName); invokeMethod(bean, methodName, methodParams); - } - else - { + } else { Object bean = Class.forName(beanName).newInstance(); invokeMethod(bean, methodName, methodParams); } @@ -42,21 +38,17 @@ public class JobInvokeUtil /** * 调用任务方法 * - * @param bean 目标对象 - * @param methodName 方法名称 + * @param bean 目标对象 + * @param methodName 方法名称 * @param methodParams 方法参数 */ private static void invokeMethod(Object bean, String methodName, List methodParams) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, - InvocationTargetException - { - if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) - { + InvocationTargetException { + if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) { Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams)); method.invoke(bean, getMethodParamsValue(methodParams)); - } - else - { + } else { Method method = bean.getClass().getDeclaredMethod(methodName); method.invoke(bean); } @@ -64,81 +56,70 @@ public class JobInvokeUtil /** * 校验是否为为class包名 - * + * * @param str 名称 * @return true是 false否 */ - public static boolean isValidClassName(String invokeTarget) - { + public static boolean isValidClassName(String invokeTarget) { return StringUtils.countMatches(invokeTarget, ".") > 1; } /** * 获取bean名称 - * + * * @param invokeTarget 目标字符串 * @return bean名称 */ - public static String getBeanName(String invokeTarget) - { + public static String getBeanName(String invokeTarget) { String beanName = StringUtils.substringBefore(invokeTarget, "("); return StringUtils.substringBeforeLast(beanName, "."); } /** * 获取bean方法 - * + * * @param invokeTarget 目标字符串 * @return method方法 */ - public static String getMethodName(String invokeTarget) - { + public static String getMethodName(String invokeTarget) { String methodName = StringUtils.substringBefore(invokeTarget, "("); return StringUtils.substringAfterLast(methodName, "."); } /** * 获取method方法参数相关列表 - * + * * @param invokeTarget 目标字符串 * @return method方法相关参数列表 */ - public static List getMethodParams(String invokeTarget) - { + public static List getMethodParams(String invokeTarget) { String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); - if (StringUtils.isEmpty(methodStr)) - { + if (StringUtils.isEmpty(methodStr)) { return null; } String[] methodParams = methodStr.split(","); List classs = new LinkedList<>(); - for (int i = 0; i < methodParams.length; i++) - { + for (int i = 0; i < methodParams.length; i++) { String str = StringUtils.trimToEmpty(methodParams[i]); // String字符串类型,包含' - if (StringUtils.contains(str, "'")) - { - classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class }); + if (StringUtils.contains(str, "'")) { + classs.add(new Object[]{StringUtils.replace(str, "'", ""), String.class}); } // boolean布尔类型,等于true或者false - else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) - { - classs.add(new Object[] { Boolean.valueOf(str), Boolean.class }); + else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) { + classs.add(new Object[]{Boolean.valueOf(str), Boolean.class}); } // long长整形,包含L - else if (StringUtils.containsIgnoreCase(str, "L")) - { - classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class }); + else if (StringUtils.containsIgnoreCase(str, "L")) { + classs.add(new Object[]{Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class}); } // double浮点类型,包含D - else if (StringUtils.containsIgnoreCase(str, "D")) - { - classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class }); + else if (StringUtils.containsIgnoreCase(str, "D")) { + classs.add(new Object[]{Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class}); } // 其他类型归类为整形 - else - { - classs.add(new Object[] { Integer.valueOf(str), Integer.class }); + else { + classs.add(new Object[]{Integer.valueOf(str), Integer.class}); } } return classs; @@ -146,16 +127,14 @@ public class JobInvokeUtil /** * 获取参数类型 - * + * * @param methodParams 参数相关列表 * @return 参数类型列表 */ - public static Class[] getMethodParamsType(List methodParams) - { + public static Class[] getMethodParamsType(List methodParams) { Class[] classs = new Class[methodParams.size()]; int index = 0; - for (Object[] os : methodParams) - { + for (Object[] os : methodParams) { classs[index] = (Class) os[1]; index++; } @@ -164,16 +143,14 @@ public class JobInvokeUtil /** * 获取参数值 - * + * * @param methodParams 参数相关列表 * @return 参数值列表 */ - public static Object[] getMethodParamsValue(List methodParams) - { + public static Object[] getMethodParamsValue(List methodParams) { Object[] classs = new Object[methodParams.size()]; int index = 0; - for (Object[] os : methodParams) - { + for (Object[] os : methodParams) { classs[index] = (Object) os[0]; index++; } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java index 5e135580..6d9c550d 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java @@ -6,16 +6,13 @@ import com.ruoyi.quartz.domain.SysJob; /** * 定时任务处理(禁止并发执行) - * - * @author ruoyi * + * @author ruoyi */ @DisallowConcurrentExecution -public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob -{ +public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob { @Override - protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception - { + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception { JobInvokeUtil.invokeMethod(sysJob); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java index e9753261..733f03e2 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java @@ -5,15 +5,12 @@ import com.ruoyi.quartz.domain.SysJob; /** * 定时任务处理(允许并发执行) - * - * @author ruoyi * + * @author ruoyi */ -public class QuartzJobExecution extends AbstractQuartzJob -{ +public class QuartzJobExecution extends AbstractQuartzJob { @Override - protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception - { + protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception { JobInvokeUtil.invokeMethod(sysJob); } } diff --git a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java index 7f4213f1..ec6dba39 100644 --- a/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java +++ b/spring-boot/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java @@ -17,20 +17,17 @@ import com.ruoyi.quartz.domain.SysJob; /** * 定时任务工具类 - * - * @author ruoyi * + * @author ruoyi */ -public class ScheduleUtils -{ +public class ScheduleUtils { /** * 得到quartz任务类 * * @param sysJob 执行计划 * @return 具体执行任务类 */ - private static Class getQuartzJobClass(SysJob sysJob) - { + private static Class getQuartzJobClass(SysJob sysJob) { boolean isConcurrent = "0".equals(sysJob.getConcurrent()); return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class; } @@ -38,24 +35,21 @@ public class ScheduleUtils /** * 构建任务触发对象 */ - public static TriggerKey getTriggerKey(Long jobId, String jobGroup) - { + public static TriggerKey getTriggerKey(Long jobId, String jobGroup) { return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); } /** * 构建任务键对象 */ - public static JobKey getJobKey(Long jobId, String jobGroup) - { + public static JobKey getJobKey(Long jobId, String jobGroup) { return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup); } /** * 创建定时任务 */ - public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException - { + public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException { Class jobClass = getQuartzJobClass(job); // 构建job信息 Long jobId = job.getJobId(); @@ -74,8 +68,7 @@ public class ScheduleUtils jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job); // 判断是否存在 - if (scheduler.checkExists(getJobKey(jobId, jobGroup))) - { + if (scheduler.checkExists(getJobKey(jobId, jobGroup))) { // 防止创建时存在数据问题 先移除,然后在执行创建操作 scheduler.deleteJob(getJobKey(jobId, jobGroup)); } @@ -83,8 +76,7 @@ public class ScheduleUtils scheduler.scheduleJob(jobDetail, trigger); // 暂停任务 - if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) - { + if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) { scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup)); } } @@ -93,10 +85,8 @@ public class ScheduleUtils * 设置定时任务策略 */ public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb) - throws TaskException - { - switch (job.getMisfirePolicy()) - { + throws TaskException { + switch (job.getMisfirePolicy()) { case ScheduleConstants.MISFIRE_DEFAULT: return cb; case ScheduleConstants.MISFIRE_IGNORE_MISFIRES: diff --git a/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml index e608e428..09ff5f2e 100644 --- a/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml +++ b/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml @@ -1,93 +1,93 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time - from sys_job_log + + + + + + + + + + + + + select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time + from sys_job_log - - - - - - - - - delete from sys_job_log where job_log_id = #{jobLogId} - - - - delete from sys_job_log where job_log_id in - - #{jobLogId} - - - - + + + + + + + + + delete from sys_job_log where job_log_id = #{jobLogId} + + + + delete from sys_job_log where job_log_id in + + #{jobLogId} + + + + truncate table sys_job_log - - - insert into sys_job_log( - job_log_id, - job_name, - job_group, - invoke_target, - job_message, - status, - exception_info, - create_time - )values( - #{jobLogId}, - #{jobName}, - #{jobGroup}, - #{invokeTarget}, - #{jobMessage}, - #{status}, - #{exceptionInfo}, - sysdate() - ) - + + + insert into sys_job_log( + job_log_id, + job_name, + job_group, + invoke_target, + job_message, + status, + exception_info, + create_time + )values( + #{jobLogId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{jobMessage}, + #{status}, + #{exceptionInfo}, + sysdate() + ) + \ No newline at end of file diff --git a/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml index 5605c444..225b82fb 100644 --- a/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml +++ b/spring-boot/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml @@ -1,111 +1,112 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark - from sys_job + + + + + + + + + + + + + + + + + + select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, + create_by, create_time, remark + from sys_job - - - - - - - - - delete from sys_job where job_id = #{jobId} - - - - delete from sys_job where job_id in - - #{jobId} - - - - - update sys_job - - job_name = #{jobName}, - job_group = #{jobGroup}, - invoke_target = #{invokeTarget}, - cron_expression = #{cronExpression}, - misfire_policy = #{misfirePolicy}, - concurrent = #{concurrent}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where job_id = #{jobId} - - - - insert into sys_job( - job_id, - job_name, - job_group, - invoke_target, - cron_expression, - misfire_policy, - concurrent, - status, - remark, - create_by, - create_time - )values( - #{jobId}, - #{jobName}, - #{jobGroup}, - #{invokeTarget}, - #{cronExpression}, - #{misfirePolicy}, - #{concurrent}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - + + + + + + + + + delete from sys_job where job_id = #{jobId} + + + + delete from sys_job where job_id in + + #{jobId} + + + + + update sys_job + + job_name = #{jobName}, + job_group = #{jobGroup}, + invoke_target = #{invokeTarget}, + cron_expression = #{cronExpression}, + misfire_policy = #{misfirePolicy}, + concurrent = #{concurrent}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where job_id = #{jobId} + + + + insert into sys_job( + job_id, + job_name, + job_group, + invoke_target, + cron_expression, + misfire_policy, + concurrent, + status, + remark, + create_by, + create_time + )values( + #{jobId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{cronExpression}, + #{misfirePolicy}, + #{concurrent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/pom.xml b/spring-boot/ruoyi-system/pom.xml index 5c27adc7..64215f92 100644 --- a/spring-boot/ruoyi-system/pom.xml +++ b/spring-boot/ruoyi-system/pom.xml @@ -48,7 +48,29 @@ 1.5.21 compile - + + org.springframework.boot + spring-boot-test + 2.5.4 + test + + + junit + junit + 4.13.1 + test + + + com.alibaba + druid + 1.2.6 + + + + com.zaxxer + HikariCP + 3.2.0 + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotCategoryController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotCategoryController.java index d2d7062a..bfdf5b7b 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotCategoryController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotCategoryController.java @@ -35,15 +35,14 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 设备分类Controller - * + * * @author kerwincui * @date 2021-05-07 */ -@Api(value="设备分类",tags="设备分类") +@Api(value = "设备分类", tags = "设备分类") @RestController @RequestMapping("/system/category") -public class IotCategoryController extends BaseController -{ +public class IotCategoryController extends BaseController { @Autowired private IIotCategoryService iotCategoryService; @@ -53,8 +52,7 @@ public class IotCategoryController extends BaseController @ApiOperation(value = "分类列表", notes = "分类列表") @PreAuthorize("@ss.hasPermi('system:category:list')") @GetMapping("/list") - public TableDataInfo list(IotCategory iotCategory) - { + public TableDataInfo list(IotCategory iotCategory) { startPage(); List list = iotCategoryService.selectIotCategoryList(iotCategory); return getDataTable(list); @@ -67,8 +65,7 @@ public class IotCategoryController extends BaseController @PreAuthorize("@ss.hasPermi('system:category:export')") @Log(title = "设备分类", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(IotCategory iotCategory) - { + public AjaxResult export(IotCategory iotCategory) { List list = iotCategoryService.selectIotCategoryList(iotCategory); ExcelUtil util = new ExcelUtil(IotCategory.class); return util.exportExcel(list, "category"); @@ -80,8 +77,7 @@ public class IotCategoryController extends BaseController @ApiOperation(value = "获取分类详情", notes = "获取分类详情") @PreAuthorize("@ss.hasPermi('system:category:query')") @GetMapping(value = "/{categoryId}") - public AjaxResult getInfo(@PathVariable("categoryId") Long categoryId) - { + public AjaxResult getInfo(@PathVariable("categoryId") Long categoryId) { return AjaxResult.success(iotCategoryService.selectIotCategoryById(categoryId)); } @@ -92,8 +88,7 @@ public class IotCategoryController extends BaseController @PreAuthorize("@ss.hasPermi('system:category:add')") @Log(title = "设备分类", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody IotCategory iotCategory) - { + public AjaxResult add(@RequestBody IotCategory iotCategory) { return toAjax(iotCategoryService.insertIotCategory(iotCategory)); } @@ -104,8 +99,7 @@ public class IotCategoryController extends BaseController @PreAuthorize("@ss.hasPermi('system:category:edit')") @Log(title = "设备分类", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody IotCategory iotCategory) - { + public AjaxResult edit(@RequestBody IotCategory iotCategory) { return toAjax(iotCategoryService.updateIotCategory(iotCategory)); } @@ -115,9 +109,8 @@ public class IotCategoryController extends BaseController @ApiOperation(value = "删除分类", notes = "删除分类") @PreAuthorize("@ss.hasPermi('system:category:remove')") @Log(title = "设备分类", businessType = BusinessType.DELETE) - @DeleteMapping("/{categoryIds}") - public AjaxResult remove(@PathVariable Long[] categoryIds) - { + @DeleteMapping("/{categoryIds}") + public AjaxResult remove(@PathVariable Long[] categoryIds) { return toAjax(iotCategoryService.deleteIotCategoryByIds(categoryIds)); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceController.java index 44d643a4..49866cc7 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceController.java @@ -14,7 +14,10 @@ import java.math.BigDecimal; import java.util.List; import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.vo.DeviceControlCMD; import com.ruoyi.system.domain.vo.IotDeviceListDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -22,14 +25,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.token.TokenService; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -39,17 +35,18 @@ import com.ruoyi.system.service.IIotDeviceService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import javax.validation.constraints.Size; + /** * 设备Controller - * + * * @author kerwincui * @date 2021-05-06 */ -@Api(value="设备",tags="设备") +@Api(value = "设备", tags = "设备") @RestController @RequestMapping("/system/device") -public class IotDeviceController extends BaseController -{ +public class IotDeviceController extends BaseController { @Autowired private IIotDeviceService iotDeviceService; @@ -59,15 +56,16 @@ public class IotDeviceController extends BaseController @ApiOperation(value = "设备列表", notes = "设备列表") @PreAuthorize("@ss.hasPermi('system:device:list')") @GetMapping("/list") - public TableDataInfo list(IotDevice iotDevice) - { + public TableDataInfo list(IotDevice iotDevice) { startPage(); - LoginUser user=(LoginUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); iotDevice.setOwnerId(user.getUser().getUserId().toString()); List list = iotDeviceService.selectIotDeviceList(iotDevice); return getDataTable(list); } + + /** * 导出设备列表 */ @@ -75,8 +73,7 @@ public class IotDeviceController extends BaseController @PreAuthorize("@ss.hasPermi('system:device:export')") @Log(title = "设备", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(IotDevice iotDevice) - { + public AjaxResult export(IotDevice iotDevice) { List list = iotDeviceService.selectIotDeviceList(iotDevice); ExcelUtil util = new ExcelUtil(IotDeviceListDto.class); return util.exportExcel(list, "device"); @@ -88,8 +85,7 @@ public class IotDeviceController extends BaseController @ApiOperation(value = "获取设备详情", notes = "获取设备详情") @PreAuthorize("@ss.hasPermi('system:device:query')") @GetMapping(value = "/{deviceId}") - public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) - { + public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) { return AjaxResult.success(iotDeviceService.selectIotDeviceById(deviceId)); } @@ -99,8 +95,7 @@ public class IotDeviceController extends BaseController @ApiOperation(value = "根据设备编号获取设备详情", notes = "根据设备编号获取设备详情") @PreAuthorize("@ss.hasPermi('system:device:query')") @GetMapping(value = "/getByNum/{deviceNum}") - public AjaxResult getInfoByNum(@PathVariable("deviceNum") String deviceNum) - { + public AjaxResult getInfoByNum(@PathVariable("deviceNum") String deviceNum) { return AjaxResult.success(iotDeviceService.selectIotDeviceByNum(deviceNum)); } @@ -111,12 +106,11 @@ public class IotDeviceController extends BaseController @PreAuthorize("@ss.hasPermi('system:device:add')") @Log(title = "设备", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody IotDevice iotDevice) - { - LoginUser user=(LoginUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + public AjaxResult add(@RequestBody IotDevice iotDevice) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); iotDevice.setOwnerId(user.getUser().getUserId().toString()); - IotDevice device=iotDeviceService.selectIotDeviceByNum(iotDevice.getDeviceNum()); - if(device!=null){ + IotDevice device = iotDeviceService.selectIotDeviceByNum(iotDevice.getDeviceNum()); + if (device != null) { return AjaxResult.error("设备编号已存在,请重新填写"); } return toAjax(iotDeviceService.insertIotDevice(iotDevice)); @@ -129,8 +123,7 @@ public class IotDeviceController extends BaseController @PreAuthorize("@ss.hasPermi('system:device:edit')") @Log(title = "设备", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody IotDevice iotDevice) - { + public AjaxResult edit(@RequestBody IotDevice iotDevice) { return toAjax(iotDeviceService.updateIotDevice(iotDevice)); } @@ -140,9 +133,103 @@ public class IotDeviceController extends BaseController @ApiOperation(value = "删除设备", notes = "删除设备") @PreAuthorize("@ss.hasPermi('system:device:remove')") @Log(title = "设备", businessType = BusinessType.DELETE) - @DeleteMapping("/{deviceIds}") - public AjaxResult remove(@PathVariable Long[] deviceIds) - { + @DeleteMapping("/{deviceIds}") + public AjaxResult remove(@PathVariable Long[] deviceIds) { return toAjax(iotDeviceService.deleteIotDeviceByIds(deviceIds)); } + + + @ApiOperation(value = "绑定设备", notes = "绑定设备") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @PostMapping("/bindDevice") + public AjaxResult bindDevice(@RequestBody IotDevice iotDevice) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + String username = user.getUsername(); + String deviceNum = iotDevice.getDeviceNum(); + String deviceName = iotDevice.getDeviceName(); + Long categoryId = iotDevice.getCategoryId(); + String remark = iotDevice.getRemark(); + return AjaxResult.success(iotDeviceService.bindDevice(userId,username,deviceNum,deviceName,categoryId, remark)); + } + + @ApiOperation(value = "控制设备", notes = "控制设备") + @PreAuthorize("@ss.hasPermi('system:device:control')") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @PostMapping("/control") + public AjaxResult control(@RequestBody DeviceControlCMD deviceControlCMD) { + String deviceNum = deviceControlCMD.getDeviceNum(); + String cmd = deviceControlCMD.getCmd(); + if(StringUtils.isBlank(deviceNum)) { + throw new CustomException("设备编号不能为空"); + } + if(StringUtils.isBlank(cmd)) { + throw new CustomException("控制指令不能为空"); + } + return toAjax(iotDeviceService.controlDeviceByNum(deviceNum,cmd)); + } + + @ApiOperation(value = "小程序设备列表", notes = "小程序设备列表") + @PreAuthorize("@ss.hasPermi('system:device:list')") + @GetMapping("/listDevice") + public TableDataInfo listDevice(IotDevice iotDevice) { + startPage(); + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + iotDevice.setOwnerId(user.getUser().getUserId().toString()); + List list = iotDeviceService.selectMpIotDeviceList(iotDevice); + return getDataTable(list); + } + + @ApiOperation(value = "修改设备名称和备注", notes = "修改设备名称和备注") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @PostMapping("/updateDeviceInfo") + public AjaxResult updateDeviceInfo(@RequestBody IotDevice iotDevice) { + Long deviceId = iotDevice.getDeviceId(); + String deviceName = iotDevice.getDeviceName(); + String remark = iotDevice.getRemark(); + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + String nickName = user.getUser().getNickName(); + return AjaxResult.success(iotDeviceService.updateDeviceInfo( userId, nickName, deviceId, deviceName, remark)); + } + + @ApiOperation(value = "根据用户设备编号获取设备详情", notes = "根据设备编号获取设备详情") + @GetMapping(value = "/getByUserAndNum/{deviceNum}") + public AjaxResult getInfoByUserAndNum(@PathVariable("deviceNum") String deviceNum) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + return AjaxResult.success(iotDeviceService.selectIotDeviceByUserAndNum(userId,deviceNum)); + } + + @ApiOperation(value = "解除绑定设备", notes = "解除绑定设备") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @PostMapping("/unBindDevice") + public AjaxResult unBindDevice(@RequestBody IotDevice iotDevice) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + String username = user.getUsername(); + Long deviceId = iotDevice.getDeviceId(); + return AjaxResult.success(iotDeviceService.unBindDevice(userId,username,deviceId)); + } + + @ApiOperation(value = "根据设备编号查询设备信息", notes = "根据设备编号查询设备信息") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @GetMapping("/getDeviceInfoByDeviceNum") + public AjaxResult getDeviceInfoByDeviceNum(@RequestParam String deviceNum ) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + String username = user.getUsername(); + return AjaxResult.success(iotDeviceService.getDeviceInfoByDeviceNum(userId,username,deviceNum)); + } + + @ApiOperation(value = "根据设备编号查询设备信息", notes = "根据设备编号查询设备信息") + @Log(title = "设备", businessType = BusinessType.UPDATE) + @GetMapping("/getDeviceInfoByDeviceId") + public AjaxResult getDeviceInfoByDeviceId(@RequestParam Long deviceId ) { + LoginUser user = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + Long userId = user.getUser().getUserId(); + String username = user.getUsername(); + return AjaxResult.success(iotDeviceService.getDeviceInfoByDeviceId(userId,username,deviceId)); + } + } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceSetController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceSetController.java index a1b83594..68827ffc 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceSetController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceSetController.java @@ -41,15 +41,14 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 设备配置Controller - * + * * @author kerwincui * @date 2021-05-06 */ -@Api(value="设备配置",tags="设备配置") +@Api(value = "设备配置", tags = "设备配置") @RestController @RequestMapping("/system/set") -public class IotDeviceSetController extends BaseController -{ +public class IotDeviceSetController extends BaseController { @Autowired private IIotDeviceSetService iotDeviceSetService; @Autowired @@ -66,8 +65,7 @@ public class IotDeviceSetController extends BaseController @ApiOperation(value = "查询设备配置列表", notes = "查询设备配置列表") @PreAuthorize("@ss.hasPermi('system:set:list')") @GetMapping("/list") - public TableDataInfo list(IotDeviceSet iotDeviceSet) - { + public TableDataInfo list(IotDeviceSet iotDeviceSet) { startPage(); List list = iotDeviceSetService.selectIotDeviceSetList(iotDeviceSet); return getDataTable(list); @@ -80,8 +78,7 @@ public class IotDeviceSetController extends BaseController @PreAuthorize("@ss.hasPermi('system:set:export')") @Log(title = "设备配置", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(IotDeviceSet iotDeviceSet) - { + public AjaxResult export(IotDeviceSet iotDeviceSet) { List list = iotDeviceSetService.selectIotDeviceSetList(iotDeviceSet); ExcelUtil util = new ExcelUtil(IotDeviceSet.class); return util.exportExcel(list, "set"); @@ -93,8 +90,7 @@ public class IotDeviceSetController extends BaseController @ApiOperation(value = "获取设备配置详情", notes = "获取设备配置详情") @PreAuthorize("@ss.hasPermi('system:set:query')") @GetMapping(value = "/{deviceSetId}") - public AjaxResult getInfo(@PathVariable("deviceSetId") Long deviceSetId) - { + public AjaxResult getInfo(@PathVariable("deviceSetId") Long deviceSetId) { return AjaxResult.success(iotDeviceSetService.selectIotDeviceSetById(deviceSetId)); } @@ -104,14 +100,13 @@ public class IotDeviceSetController extends BaseController @ApiOperation(value = "获取最新设备配置详情", notes = "获取最新设备配置详情") @PreAuthorize("@ss.hasPermi('system:set:query')") @GetMapping(value = "/new/{deviceId}") - public AjaxResult getNewInfo(@PathVariable("deviceId") Long deviceId) - { - IotDeviceSet set=iotDeviceSetService.selectIotDeviceSetByDeviceId(deviceId); - if(set==null){ + public AjaxResult getNewInfo(@PathVariable("deviceId") Long deviceId) { + IotDeviceSet set = iotDeviceSetService.selectIotDeviceSetByDeviceId(deviceId); + if (set == null) { // 构建默认数据 - IotDevice device=iotDeviceService.selectIotDeviceById(deviceId); - if(device!=null) { - set=new IotDeviceSet(); + IotDevice device = iotDeviceService.selectIotDeviceById(deviceId); + if (device != null) { + set = new IotDeviceSet(); set.setDeviceId(device.getDeviceId()); set.setDeviceNum(device.getDeviceNum()); set.setOwnerId(device.getOwnerId()); @@ -139,8 +134,7 @@ public class IotDeviceSetController extends BaseController @PreAuthorize("@ss.hasPermi('system:set:add')") @Log(title = "设备配置", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody IotDeviceSet iotDeviceSet) - { + public AjaxResult add(@RequestBody IotDeviceSet iotDeviceSet) { return toAjax(iotDeviceSetService.insertIotDeviceSet(iotDeviceSet)); } @@ -151,62 +145,67 @@ public class IotDeviceSetController extends BaseController @PreAuthorize("@ss.hasPermi('system:set:edit')") @Log(title = "设备配置", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody IotDeviceSet iotDeviceSet) - { - IotDeviceStatus status=iotDeviceStatusService.selectIotDeviceStatusByDeviceId(iotDeviceSet.getDeviceId()); - if(status==null || status.getIsOnline()==0){return AjaxResult.error("设备已离线,不能更新状态。");} + public AjaxResult edit(@RequestBody IotDeviceSet iotDeviceSet) { + IotDeviceStatus status = iotDeviceStatusService.selectIotDeviceStatusByDeviceId(iotDeviceSet.getDeviceId()); + if (status == null || status.getIsOnline() == 0) { + return AjaxResult.error("设备已离线,不能更新状态。"); + } // 存储 iotDeviceSetService.updateIotDeviceSet(iotDeviceSet); //mqtt发布 - IotDeviceSet set=iotDeviceSetService.selectIotDeviceSetByDeviceId(iotDeviceSet.getDeviceId()); - if(iotDeviceSet.getIsRadar()!=null){ + IotDeviceSet set = iotDeviceSetService.selectIotDeviceSetByDeviceId(iotDeviceSet.getDeviceId()); + if (iotDeviceSet.getIsRadar() != null) { set.setIsRadar(iotDeviceSet.getIsRadar()); } - if(iotDeviceSet.getIsAlarm()!=null){ + if (iotDeviceSet.getIsAlarm() != null) { set.setIsAlarm(iotDeviceSet.getIsAlarm()); } - if(iotDeviceSet.getRadarInterval()!=null){ + if (iotDeviceSet.getRadarInterval() != null) { set.setRadarInterval(iotDeviceSet.getRadarInterval()); } - if(iotDeviceSet.getIsRfControl()!=null){ + if (iotDeviceSet.getIsRfControl() != null) { set.setIsRfControl(iotDeviceSet.getIsRfControl()); } - if(iotDeviceSet.getRfOneFunc()!=null){ + if (iotDeviceSet.getRfOneFunc() != null) { set.setRfOneFunc(iotDeviceSet.getRfOneFunc()); } - if(iotDeviceSet.getRfTwoFunc()!=null){ + if (iotDeviceSet.getRfTwoFunc() != null) { set.setRfTwoFunc(iotDeviceSet.getRfTwoFunc()); } - if(iotDeviceSet.getRfThreeFunc()!=null){ + if (iotDeviceSet.getRfThreeFunc() != null) { set.setRfThreeFunc(iotDeviceSet.getRfThreeFunc()); } - if(iotDeviceSet.getRfFourFunc()!=null){ + if (iotDeviceSet.getRfFourFunc() != null) { set.setRfFourFunc(iotDeviceSet.getRfFourFunc()); } - if(iotDeviceSet.getIsRfLearn()!=null){ + if (iotDeviceSet.getIsRfLearn() != null) { set.setIsRfLearn(iotDeviceSet.getIsRfLearn()); } - if(iotDeviceSet.getIsRfClear()!=null){ + if (iotDeviceSet.getIsRfClear() != null) { set.setIsRfClear(iotDeviceSet.getIsRfClear()); } - if(iotDeviceSet.getIsAp()!=null){ + if (iotDeviceSet.getIsAp() != null) { set.setIsAp(iotDeviceSet.getIsAp()); } - if(iotDeviceSet.getIsReset()!=null){ + if (iotDeviceSet.getIsReset() != null) { set.setIsReset(iotDeviceSet.getIsReset()); } String content = JSON.toJSONString(set); - boolean isSuccess=mqttPushClient.publish(0,true,"setting/set/"+set.getDeviceNum(),content); - if(isSuccess){return AjaxResult.success("mqtt 发布成功");} + boolean isSuccess = mqttPushClient.publish(0, true, "setting/set/" + set.getDeviceNum(), content); + if (isSuccess) { + return AjaxResult.success("mqtt 发布成功"); + } return AjaxResult.error("mqtt 发布失败。"); } @ApiOperation(value = "mqtt获取设备配置", notes = "mqtt获取设备配置") @GetMapping(value = "/getSetting/{deviceNum}") - public AjaxResult getSetting(@PathVariable("deviceNum") String deviceNum){ - boolean isSuccess=mqttPushClient.publish(0,true,"setting/get/"+deviceNum,"wumei.live"); - if(isSuccess){return AjaxResult.success("mqtt 发布成功");} + public AjaxResult getSetting(@PathVariable("deviceNum") String deviceNum) { + boolean isSuccess = mqttPushClient.publish(0, true, "setting/get/" + deviceNum, "wumei.live"); + if (isSuccess) { + return AjaxResult.success("mqtt 发布成功"); + } return AjaxResult.error("mqtt 发布失败。"); } @@ -216,9 +215,8 @@ public class IotDeviceSetController extends BaseController @ApiOperation(value = "删除设备配置", notes = "删除设备配置") @PreAuthorize("@ss.hasPermi('system:set:remove')") @Log(title = "设备配置", businessType = BusinessType.DELETE) - @DeleteMapping("/{deviceSetIds}") - public AjaxResult remove(@PathVariable Long[] deviceSetIds) - { + @DeleteMapping("/{deviceSetIds}") + public AjaxResult remove(@PathVariable Long[] deviceSetIds) { return toAjax(iotDeviceSetService.deleteIotDeviceSetByIds(deviceSetIds)); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceStatusController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceStatusController.java index 56998555..6a0fe27b 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceStatusController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceStatusController.java @@ -40,15 +40,14 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 设备状态Controller - * + * * @author kerwincui * @date 2021-05-06 */ -@Api(value="设备状态",tags="设备状态") +@Api(value = "设备状态", tags = "设备状态") @RestController @RequestMapping("/system/status") -public class IotDeviceStatusController extends BaseController -{ +public class IotDeviceStatusController extends BaseController { @Autowired private IIotDeviceStatusService iotDeviceStatusService; @Autowired @@ -63,8 +62,7 @@ public class IotDeviceStatusController extends BaseController @ApiOperation(value = "查询设备状态列表", notes = "查询设备状态列表") @PreAuthorize("@ss.hasPermi('system:status:list')") @GetMapping("/list") - public TableDataInfo list(IotDeviceStatus iotDeviceStatus) - { + public TableDataInfo list(IotDeviceStatus iotDeviceStatus) { startPage(); List list = iotDeviceStatusService.selectIotDeviceStatusList(iotDeviceStatus); return getDataTable(list); @@ -77,8 +75,7 @@ public class IotDeviceStatusController extends BaseController @PreAuthorize("@ss.hasPermi('system:status:export')") @Log(title = "设备状态", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(IotDeviceStatus iotDeviceStatus) - { + public AjaxResult export(IotDeviceStatus iotDeviceStatus) { List list = iotDeviceStatusService.selectIotDeviceStatusList(iotDeviceStatus); ExcelUtil util = new ExcelUtil(IotDeviceStatus.class); return util.exportExcel(list, "status"); @@ -90,8 +87,7 @@ public class IotDeviceStatusController extends BaseController @ApiOperation(value = "获取设备状态详情", notes = "获取设备状态详情") @PreAuthorize("@ss.hasPermi('system:status:query')") @GetMapping(value = "/{deviceStatusId}") - public AjaxResult getInfo(@PathVariable("deviceStatusId") Long deviceStatusId) - { + public AjaxResult getInfo(@PathVariable("deviceStatusId") Long deviceStatusId) { return AjaxResult.success(iotDeviceStatusService.selectIotDeviceStatusById(deviceStatusId)); } @@ -101,8 +97,7 @@ public class IotDeviceStatusController extends BaseController @ApiOperation(value = "根据设备编号获取最新设备状态", notes = "根据设备编号获取最新设备状态") @PreAuthorize("@ss.hasPermi('system:status:query')") @GetMapping(value = "/newByNum/{deviceNum}") - public AjaxResult getNewStatus(@PathVariable("deviceNum") String deviceNum) - { + public AjaxResult getNewStatus(@PathVariable("deviceNum") String deviceNum) { return AjaxResult.success(iotDeviceStatusService.selectIotDeviceStatusByDeviceNum(deviceNum)); } @@ -112,14 +107,13 @@ public class IotDeviceStatusController extends BaseController @ApiOperation(value = "获取最新设备状态详情", notes = "获取最新设备状态详情") @PreAuthorize("@ss.hasPermi('system:status:query')") @GetMapping(value = "/new/{deviceId}") - public AjaxResult getNewInfo(@PathVariable("deviceId") Long deviceId) - { - IotDeviceStatus status=iotDeviceStatusService.selectIotDeviceStatusByDeviceId(deviceId); - if(status==null){ + public AjaxResult getNewInfo(@PathVariable("deviceId") Long deviceId) { + IotDeviceStatus status = iotDeviceStatusService.selectIotDeviceStatusByDeviceId(deviceId); + if (status == null) { // 构建默认数据 - IotDevice device=iotDeviceService.selectIotDeviceById(deviceId); - if(device!=null) { - status=new IotDeviceStatus(); + IotDevice device = iotDeviceService.selectIotDeviceById(deviceId); + if (device != null) { + status = new IotDeviceStatus(); status.setDeviceId(device.getDeviceId()); status.setDeviceNum(device.getDeviceNum()); status.setRelayStatus(0); @@ -146,8 +140,7 @@ public class IotDeviceStatusController extends BaseController @PreAuthorize("@ss.hasPermi('system:status:add')") @Log(title = "设备状态", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody IotDeviceStatus iotDeviceStatus) - { + public AjaxResult add(@RequestBody IotDeviceStatus iotDeviceStatus) { return toAjax(iotDeviceStatusService.insertIotDeviceStatus(iotDeviceStatus)); } @@ -158,53 +151,58 @@ public class IotDeviceStatusController extends BaseController @PreAuthorize("@ss.hasPermi('system:status:edit')") @Log(title = "设备状态", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody IotDeviceStatus iotDeviceStatus) - { - IotDeviceStatus status=iotDeviceStatusService.selectIotDeviceStatusByDeviceId(iotDeviceStatus.getDeviceId()); - if(status==null || status.getIsOnline()==0){return AjaxResult.error("设备已离线,不能更新状态。");} + public AjaxResult edit(@RequestBody IotDeviceStatus iotDeviceStatus) { + IotDeviceStatus status = iotDeviceStatusService.selectIotDeviceStatusByDeviceId(iotDeviceStatus.getDeviceId()); + if (status == null || status.getIsOnline() == 0) { + return AjaxResult.error("设备已离线,不能更新状态。"); + } // 存储 iotDeviceStatusService.updateIotDeviceStatus(iotDeviceStatus); // mqtt发布 - if(iotDeviceStatus.getRelayStatus()!=null){ + if (iotDeviceStatus.getRelayStatus() != null) { status.setRelayStatus(iotDeviceStatus.getRelayStatus()); } - if(iotDeviceStatus.getLightStatus()!=null){ + if (iotDeviceStatus.getLightStatus() != null) { status.setLightStatus(iotDeviceStatus.getLightStatus()); } - if(iotDeviceStatus.getLightMode()!=null){ + if (iotDeviceStatus.getLightMode() != null) { status.setLightMode(iotDeviceStatus.getLightMode()); } - if(iotDeviceStatus.getLightInterval()!=null){ + if (iotDeviceStatus.getLightInterval() != null) { status.setLightInterval(iotDeviceStatus.getLightInterval()); } - if(iotDeviceStatus.getFadeTime()!=null){ + if (iotDeviceStatus.getFadeTime() != null) { status.setFadeTime(iotDeviceStatus.getFadeTime()); } - if(iotDeviceStatus.getBrightness()!=null){ + if (iotDeviceStatus.getBrightness() != null) { status.setBrightness(iotDeviceStatus.getBrightness()); } - if(iotDeviceStatus.getRed()!=null){ + if (iotDeviceStatus.getRed() != null) { status.setRed(iotDeviceStatus.getRed()); } - if(iotDeviceStatus.getGreen()!=null){ + if (iotDeviceStatus.getGreen() != null) { status.setGreen(iotDeviceStatus.getGreen()); } - if(iotDeviceStatus.getBlue()!=null){ + if (iotDeviceStatus.getBlue() != null) { status.setBlue(iotDeviceStatus.getBlue()); } String content = JSON.toJSONString(status); - boolean isSuccess=mqttPushClient.publish(1,true,"status/set/"+status.getDeviceNum(),content); - if(isSuccess){return AjaxResult.success("mqtt 发布成功");} + boolean isSuccess = mqttPushClient.publish(1, true, "status/set/" + status.getDeviceNum(), content); + if (isSuccess) { + return AjaxResult.success("mqtt 发布成功"); + } return AjaxResult.error("mqtt 发布失败。"); } @ApiOperation(value = "mqtt获取设备状态", notes = "mqtt获取设备状态") @GetMapping(value = "/getStatus/{deviceNum}") - public AjaxResult getStatus(@PathVariable("deviceNum") String deviceNum){ - boolean isSuccess=mqttPushClient.publish(0,true,"status/get/"+deviceNum,"wumei.live"); - if(isSuccess){return AjaxResult.success("mqtt 发布成功");} + public AjaxResult getStatus(@PathVariable("deviceNum") String deviceNum) { + boolean isSuccess = mqttPushClient.publish(0, true, "status/get/" + deviceNum, "wumei.live"); + if (isSuccess) { + return AjaxResult.success("mqtt 发布成功"); + } return AjaxResult.error("mqtt 发布失败。"); } @@ -214,9 +212,8 @@ public class IotDeviceStatusController extends BaseController @ApiOperation(value = "删除设备状态", notes = "删除设备状态") @PreAuthorize("@ss.hasPermi('system:status:remove')") @Log(title = "设备状态", businessType = BusinessType.DELETE) - @DeleteMapping("/{deviceStatusIds}") - public AjaxResult remove(@PathVariable Long[] deviceStatusIds) - { + @DeleteMapping("/{deviceStatusIds}") + public AjaxResult remove(@PathVariable Long[] deviceStatusIds) { return toAjax(iotDeviceStatusService.deleteIotDeviceStatusByIds(deviceStatusIds)); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceUserRelationController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceUserRelationController.java new file mode 100644 index 00000000..816cec51 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotDeviceUserRelationController.java @@ -0,0 +1,97 @@ +package com.ruoyi.system.controller; + +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.IotDeviceUserRelation; +import com.ruoyi.system.service.IIotDeviceUserRelationService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 【请填写功能名称】Controller + * + * @author wxy + * @date 2021-08-27 + */ +@RestController +@RequestMapping("/system/relation") +public class IotDeviceUserRelationController extends BaseController { + @Autowired + private IIotDeviceUserRelationService iotDeviceUserRelationService; + +/** + * 查询【请填写功能名称】列表 + */ +@PreAuthorize("@ss.hasPermi('system:relation:list')") +@GetMapping("/list") + public TableDataInfo list(IotDeviceUserRelation iotDeviceUserRelation) { + startPage(); + List list = iotDeviceUserRelationService.selectIotDeviceUserRelationList(iotDeviceUserRelation); + return getDataTable(list); + } + + /** + * 导出【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:relation:export')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(IotDeviceUserRelation iotDeviceUserRelation) { + List list = iotDeviceUserRelationService.selectIotDeviceUserRelationList(iotDeviceUserRelation); + ExcelUtil util = new ExcelUtil(IotDeviceUserRelation. class); + return util.exportExcel(list, "relation"); + } + + /** + * 获取【请填写功能名称】详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:relation:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(iotDeviceUserRelationService.selectIotDeviceUserRelationById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:relation:add')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IotDeviceUserRelation iotDeviceUserRelation) { + return toAjax(iotDeviceUserRelationService.insertIotDeviceUserRelation(iotDeviceUserRelation)); + } + + /** + * 修改【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:relation:edit')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IotDeviceUserRelation iotDeviceUserRelation) { + return toAjax(iotDeviceUserRelationService.updateIotDeviceUserRelation(iotDeviceUserRelation)); + } + + /** + * 删除【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:relation:remove')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(iotDeviceUserRelationService.deleteIotDeviceUserRelationByIds(ids)); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotGroupController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotGroupController.java index 61a43c5a..3afdaf8b 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotGroupController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/IotGroupController.java @@ -35,15 +35,14 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 分组Controller - * + * * @author kerwincui * @date 2021-05-18 */ -@Api(value="设备分组",tags="设备分组") +@Api(value = "设备分组", tags = "设备分组") @RestController @RequestMapping("/system/group") -public class IotGroupController extends BaseController -{ +public class IotGroupController extends BaseController { @Autowired private IIotGroupService iotGroupService; @@ -53,8 +52,7 @@ public class IotGroupController extends BaseController @ApiOperation(value = "分组列表", notes = "分组列表") @PreAuthorize("@ss.hasPermi('system:group:list')") @GetMapping("/list") - public TableDataInfo list(IotGroup iotGroup) - { + public TableDataInfo list(IotGroup iotGroup) { startPage(); List list = iotGroupService.selectIotGroupList(iotGroup); return getDataTable(list); @@ -67,8 +65,7 @@ public class IotGroupController extends BaseController @PreAuthorize("@ss.hasPermi('system:group:export')") @Log(title = "分组", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(IotGroup iotGroup) - { + public AjaxResult export(IotGroup iotGroup) { List list = iotGroupService.selectIotGroupList(iotGroup); ExcelUtil util = new ExcelUtil(IotGroup.class); return util.exportExcel(list, "group"); @@ -80,8 +77,7 @@ public class IotGroupController extends BaseController @ApiOperation(value = "获取分组详情", notes = "获取分组详情") @PreAuthorize("@ss.hasPermi('system:group:query')") @GetMapping(value = "/{groupId}") - public AjaxResult getInfo(@PathVariable("groupId") Long groupId) - { + public AjaxResult getInfo(@PathVariable("groupId") Long groupId) { return AjaxResult.success(iotGroupService.selectIotGroupById(groupId)); } @@ -92,8 +88,7 @@ public class IotGroupController extends BaseController @PreAuthorize("@ss.hasPermi('system:group:add')") @Log(title = "分组", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody IotGroup iotGroup) - { + public AjaxResult add(@RequestBody IotGroup iotGroup) { return toAjax(iotGroupService.insertIotGroup(iotGroup)); } @@ -104,8 +99,7 @@ public class IotGroupController extends BaseController @PreAuthorize("@ss.hasPermi('system:group:edit')") @Log(title = "分组", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody IotGroup iotGroup) - { + public AjaxResult edit(@RequestBody IotGroup iotGroup) { return toAjax(iotGroupService.updateIotGroup(iotGroup)); } @@ -115,9 +109,8 @@ public class IotGroupController extends BaseController @ApiOperation(value = "删除分组", notes = "删除分组") @PreAuthorize("@ss.hasPermi('system:group:remove')") @Log(title = "分组", businessType = BusinessType.DELETE) - @DeleteMapping("/{groupIds}") - public AjaxResult remove(@PathVariable Long[] groupIds) - { + @DeleteMapping("/{groupIds}") + public AjaxResult remove(@PathVariable Long[] groupIds) { return toAjax(iotGroupService.deleteIotGroupByIds(groupIds)); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/MqttController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/MqttController.java index ae6416f1..4c9e6bf3 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/MqttController.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/MqttController.java @@ -22,16 +22,13 @@ import org.springframework.web.bind.annotation.*; import org.springframework.beans.factory.annotation.Autowired; - /** * mqtt接口 - * */ -@Api(value="mqtt消息发布",tags="mqtt消息发布") +@Api(value = "mqtt消息发布", tags = "mqtt消息发布") @RestController @RequestMapping("/system/mqtt") -public class MqttController extends BaseController -{ +public class MqttController extends BaseController { // @Autowired // private MqttPushClient mqttPushClient; // diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserAccountInfoController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserAccountInfoController.java new file mode 100644 index 00000000..6589adcc --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserAccountInfoController.java @@ -0,0 +1,97 @@ +package com.ruoyi.system.controller; + +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.TUserAccountInfo; +import com.ruoyi.system.service.ITUserAccountInfoService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 小程序用户Controller + * + * @author wxy + * @date 2021-08-26 + */ +@RestController +@RequestMapping("/system/info") +public class TUserAccountInfoController extends BaseController { + @Autowired + private ITUserAccountInfoService tUserAccountInfoService; + + /** + * 查询小程序用户列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:list')") + @GetMapping("/list") + public TableDataInfo list(TUserAccountInfo tUserAccountInfo) { + startPage(); + List list = tUserAccountInfoService.selectTUserAccountInfoList(tUserAccountInfo); + return getDataTable(list); + } + + /** + * 导出小程序用户列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:export')") + @Log(title = "小程序用户", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(TUserAccountInfo tUserAccountInfo) { + List list = tUserAccountInfoService.selectTUserAccountInfoList(tUserAccountInfo); + ExcelUtil util = new ExcelUtil(TUserAccountInfo.class); + return util.exportExcel(list, "info"); + } + + /** + * 获取小程序用户详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(tUserAccountInfoService.selectTUserAccountInfoById(id)); + } + + /** + * 新增小程序用户 + */ + @PreAuthorize("@ss.hasPermi('system:info:add')") + @Log(title = "小程序用户", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TUserAccountInfo tUserAccountInfo) { + return toAjax(tUserAccountInfoService.insertTUserAccountInfo(tUserAccountInfo)); + } + + /** + * 修改小程序用户 + */ + @PreAuthorize("@ss.hasPermi('system:info:edit')") + @Log(title = "小程序用户", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TUserAccountInfo tUserAccountInfo) { + return toAjax(tUserAccountInfoService.updateTUserAccountInfo(tUserAccountInfo)); + } + + /** + * 删除小程序用户 + */ + @PreAuthorize("@ss.hasPermi('system:info:remove')") + @Log(title = "小程序用户", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(tUserAccountInfoService.deleteTUserAccountInfoByIds(ids)); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserLoginLogController.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserLoginLogController.java new file mode 100644 index 00000000..0aa8868f --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/controller/TUserLoginLogController.java @@ -0,0 +1,97 @@ +package com.ruoyi.system.controller; + +import java.util.List; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.TUserLoginLog; +import com.ruoyi.system.service.ITUserLoginLogService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 【请填写功能名称】Controller + * + * @author wxy + * @date 2021-08-26 + */ +@RestController +@RequestMapping("/system/log") +public class TUserLoginLogController extends BaseController { + @Autowired + private ITUserLoginLogService tUserLoginLogService; + + /** + * 查询【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:log:list')") + @GetMapping("/list") + public TableDataInfo list(TUserLoginLog tUserLoginLog) { + startPage(); + List list = tUserLoginLogService.selectTUserLoginLogList(tUserLoginLog); + return getDataTable(list); + } + + /** + * 导出【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:log:export')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(TUserLoginLog tUserLoginLog) { + List list = tUserLoginLogService.selectTUserLoginLogList(tUserLoginLog); + ExcelUtil util = new ExcelUtil(TUserLoginLog.class); + return util.exportExcel(list, "log"); + } + + /** + * 获取【请填写功能名称】详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:log:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(tUserLoginLogService.selectTUserLoginLogById(id)); + } + + /** + * 新增【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:log:add')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TUserLoginLog tUserLoginLog) { + return toAjax(tUserLoginLogService.insertTUserLoginLog(tUserLoginLog)); + } + + /** + * 修改【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:log:edit')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TUserLoginLog tUserLoginLog) { + return toAjax(tUserLoginLogService.updateTUserLoginLog(tUserLoginLog)); + } + + /** + * 删除【请填写功能名称】 + */ + @PreAuthorize("@ss.hasPermi('system:log:remove')") + @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(tUserLoginLogService.deleteTUserLoginLogByIds(ids)); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotCategory.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotCategory.java index e54fb226..458644c9 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotCategory.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotCategory.java @@ -17,63 +17,64 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 设备分类对象 iot_category - * + * * @author kerwincui * @date 2021-05-07 */ -public class IotCategory extends BaseEntity -{ +public class IotCategory extends BaseEntity { private static final long serialVersionUID = 1L; - /** 序号 */ + /** + * 序号 + */ private Long categoryId; - /** 分类名称 */ + /** + * 分类名称 + */ @Excel(name = "分类名称") private String categoryName; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - public void setCategoryId(Long categoryId) - { + public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } - public Long getCategoryId() - { + public Long getCategoryId() { return categoryId; } - public void setCategoryName(String categoryName) - { + + public void setCategoryName(String categoryName) { this.categoryName = categoryName; } - public String getCategoryName() - { + public String getCategoryName() { return categoryName; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("categoryId", getCategoryId()) - .append("categoryName", getCategoryName()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("categoryId", getCategoryId()) + .append("categoryName", getCategoryName()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDevice.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDevice.java index 096196ab..c010fd97 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDevice.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDevice.java @@ -19,150 +19,178 @@ import java.math.BigDecimal; /** * 设备对象 iot_device - * + * * @author kerwincui * @date 2021-05-06 */ -public class IotDevice extends BaseEntity -{ +public class IotDevice extends BaseEntity { private static final long serialVersionUID = 1L; - /** 序号 */ + /** + * 序号 + */ private Long deviceId; - /** 编号 */ + /** + * 编号 + */ @Excel(name = "编号") private String deviceNum; - /** 分类 */ + /** + * 分类 + */ @Excel(name = "分类") private Long categoryId; - /** 分类名称 */ + /** + * 分类名称 + */ @Excel(name = "分类名称") private String categoryName; - /** 分类名称 */ + /** + * 分类名称 + */ @Excel(name = "分类名称") private BigDecimal deviceTemp; - /** 名称 */ + /** + * 名称 + */ @Excel(name = "名称") private String deviceName; - /** 固件版本 */ + /** + * 固件版本 + */ @Excel(name = "固件版本") private String firmwareVersion; - /** 用户 */ + /** 设备状态:未激活,未绑定,已绑定 */ + @Excel(name = "设备状态:未激活,未绑定,已绑定") + private String status; + + /** + * 用户 + */ @Excel(name = "用户") private String ownerId; - /** 分组ID */ + /** + * 分组ID + */ private Long groupId; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - public void setDeviceId(Long deviceId) - { + public void setDeviceId(Long deviceId) { this.deviceId = deviceId; } - public Long getDeviceId() - { + + public Long getDeviceId() { return deviceId; } - public void setDeviceNum(String deviceNum) - { + + public void setDeviceNum(String deviceNum) { this.deviceNum = deviceNum; } - public String getDeviceNum() - { + + public String getDeviceNum() { return deviceNum; } - public void setCategoryId(Long categoryId) - { + + public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } - public Long getCategoryId() - { + + public Long getCategoryId() { return categoryId; } - public void setDeviceName(String deviceName) - { + + public void setDeviceName(String deviceName) { this.deviceName = deviceName; } - public String getDeviceName() - { + + public String getDeviceName() { return deviceName; } - public void setFirmwareVersion(String firmwareVersion) - { + + public void setFirmwareVersion(String firmwareVersion) { this.firmwareVersion = firmwareVersion; } - public String getFirmwareVersion() - { + + public String getFirmwareVersion() { return firmwareVersion; } - public void setOwnerId(String ownerId) - { + + public void setOwnerId(String ownerId) { this.ownerId = ownerId; } - public String getOwnerId() - { + + public String getOwnerId() { return ownerId; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() - { + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + public String getDelFlag() { return delFlag; } - public Long getGroupId() - { + + public Long getGroupId() { return groupId; } - public void setGroupId(Long groupId) - { + + public void setGroupId(Long groupId) { this.groupId = groupId; } - public void setDeviceTemp(BigDecimal deviceTemp) - { + + public void setDeviceTemp(BigDecimal deviceTemp) { this.deviceTemp = deviceTemp; } - public BigDecimal getDeviceTemp() - { + + public BigDecimal getDeviceTemp() { return deviceTemp; } - public void setCategoryName(String categoryName) - { + + public void setCategoryName(String categoryName) { this.categoryName = categoryName; } - public String getCategoryName() - { + + public String getCategoryName() { return categoryName; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deviceId", getDeviceId()) - .append("deviceNum", getDeviceNum()) - .append("categoryName", getCategoryName()) - .append("deviceTemp", getDeviceTemp()) - .append("categoryId", getCategoryId()) - .append("groupId", getGroupId()) - .append("deviceName", getDeviceName()) - .append("firmwareVersion", getFirmwareVersion()) - .append("ownerId", getOwnerId()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deviceId", getDeviceId()) + .append("deviceNum", getDeviceNum()) + .append("categoryName", getCategoryName()) + .append("deviceTemp", getDeviceTemp()) + .append("categoryId", getCategoryId()) + .append("groupId", getGroupId()) + .append("deviceName", getDeviceName()) + .append("firmwareVersion", getFirmwareVersion()) + .append("ownerId", getOwnerId()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceSet.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceSet.java index 43315aef..1527531e 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceSet.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceSet.java @@ -17,343 +17,362 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 设备配置对象 iot_device_set - * + * * @author kerwincui * @date 2021-05-06 */ -public class IotDeviceSet extends BaseEntity -{ +public class IotDeviceSet extends BaseEntity { private static final long serialVersionUID = 1L; - /** 序号 */ + /** + * 序号 + */ private Long deviceSetId; - /** 设备 */ + /** + * 设备 + */ @Excel(name = "设备") private Long deviceId; - /** 设备编号 */ + /** + * 设备编号 + */ @Excel(name = "设备编号") private String deviceNum; - /** 报警 */ + /** + * 报警 + */ @Excel(name = "报警") private Integer isAlarm; - /** 雷达感应 */ + /** + * 雷达感应 + */ @Excel(name = "雷达感应") private Integer isRadar; - /** 托管 */ + /** + * 托管 + */ @Excel(name = "托管") private Integer isHost; - /** 重启 */ + /** + * 重启 + */ @Excel(name = "重启") private Integer isReset; - /** 打开AP */ + /** + * 打开AP + */ @Excel(name = "打开AP") private Integer isAp; - /** 是否离线使用 */ + /** + * 是否离线使用 + */ @Excel(name = "是否离线使用") private Integer isWifiOffline; - /** 是否使用证书 */ + /** + * 是否使用证书 + */ @Excel(name = "是否使用证书") private Integer isOpenCertifi; - /** 智能配网 */ + /** + * 智能配网 + */ @Excel(name = "智能配网") private Integer isSmartConfig; - /** 射频遥控 */ + /** + * 射频遥控 + */ @Excel(name = "射频遥控") private Integer isRfControl; - /** 遥控配对 */ + /** + * 遥控配对 + */ @Excel(name = "遥控配对") private Integer isRfLearn; - /** 遥控清码 */ + /** + * 遥控清码 + */ @Excel(name = "遥控清码") private Integer isRfClear; - /** 按键一 */ + /** + * 按键一 + */ @Excel(name = "按键一") private Integer rfOneFunc; - /** 按键二 */ + /** + * 按键二 + */ @Excel(name = "按键二") private Integer rfTwoFunc; - /** 按键三 */ + /** + * 按键三 + */ @Excel(name = "按键三") private Integer rfThreeFunc; - /** 按键四 */ + /** + * 按键四 + */ @Excel(name = "按键四") private Integer rfFourFunc; - /** 用户 */ + /** + * 用户 + */ @Excel(name = "用户") private String ownerId; - /** 配网地址 */ + /** + * 配网地址 + */ @Excel(name = "配网地址") private String networkAddress; - /** 配网IP */ + /** + * 配网IP + */ @Excel(name = "配网IP") private String networkIp; - /** 雷达感应间隔 */ + /** + * 雷达感应间隔 + */ @Excel(name = "雷达感应间隔") private Integer radarInterval; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - public void setDeviceSetId(Long deviceSetId) - { + public void setDeviceSetId(Long deviceSetId) { this.deviceSetId = deviceSetId; } - public Long getDeviceSetId() - { + public Long getDeviceSetId() { return deviceSetId; } - public void setDeviceId(Long deviceId) - { + + public void setDeviceId(Long deviceId) { this.deviceId = deviceId; } - public Long getDeviceId() - { + public Long getDeviceId() { return deviceId; } - public void setDeviceNum(String deviceNum) - { + + public void setDeviceNum(String deviceNum) { this.deviceNum = deviceNum; } - public String getDeviceNum() - { + public String getDeviceNum() { return deviceNum; } - public void setIsAlarm(Integer isAlarm) - { + + public void setIsAlarm(Integer isAlarm) { this.isAlarm = isAlarm; } - public Integer getIsAlarm() - { + public Integer getIsAlarm() { return isAlarm; } - public void setIsRadar(Integer isRadar) - { + + public void setIsRadar(Integer isRadar) { this.isRadar = isRadar; } - public Integer getIsRadar() - { + public Integer getIsRadar() { return isRadar; } - public void setIsHost(Integer isHost) - { + + public void setIsHost(Integer isHost) { this.isHost = isHost; } - public Integer getIsHost() - { + public Integer getIsHost() { return isHost; } - public void setIsReset(Integer isReset) - { + + public void setIsReset(Integer isReset) { this.isReset = isReset; } - public Integer getIsReset() - { + public Integer getIsReset() { return isReset; } - public void setIsAp(Integer isAp) - { + public void setIsAp(Integer isAp) { this.isAp = isAp; } - public Integer getIsAp() - { + + public Integer getIsAp() { return isAp; } - public void setIsWifiOffline(Integer isWifiOffline) - { + public void setIsWifiOffline(Integer isWifiOffline) { this.isWifiOffline = isWifiOffline; } - public Integer getIsWifiOffline() - { + + public Integer getIsWifiOffline() { return isWifiOffline; } - public void setIsOpenCertifi(Integer isOpenCertifi) - { + public void setIsOpenCertifi(Integer isOpenCertifi) { this.isOpenCertifi = isOpenCertifi; } - public Integer getIsOpenCertifi() - { + + public Integer getIsOpenCertifi() { return isOpenCertifi; } - public void setIsSmartConfig(Integer isSmartConfig) - { + public void setIsSmartConfig(Integer isSmartConfig) { this.isSmartConfig = isSmartConfig; } - public Integer getIsSmartConfig() - { + public Integer getIsSmartConfig() { return isSmartConfig; } - public void setIsRfControl(Integer isRfControl) - { + + public void setIsRfControl(Integer isRfControl) { this.isRfControl = isRfControl; } - public Integer getIsRfControl() - { + public Integer getIsRfControl() { return isRfControl; } - public void setIsRfLearn(Integer isRfLearn) - { + + public void setIsRfLearn(Integer isRfLearn) { this.isRfLearn = isRfLearn; } - public Integer getIsRfLearn() - { + public Integer getIsRfLearn() { return isRfLearn; } - public void setIsRfClear(Integer isRfClear) - { + + public void setIsRfClear(Integer isRfClear) { this.isRfClear = isRfClear; } - public Integer getIsRfClear() - { + public Integer getIsRfClear() { return isRfClear; } - public void setRfOneFunc(Integer rfOneFunc) - { + + public void setRfOneFunc(Integer rfOneFunc) { this.rfOneFunc = rfOneFunc; } - public Integer getRfOneFunc() - { + public Integer getRfOneFunc() { return rfOneFunc; } - public void setRfTwoFunc(Integer rfTwoFunc) - { + + public void setRfTwoFunc(Integer rfTwoFunc) { this.rfTwoFunc = rfTwoFunc; } - public Integer getRfTwoFunc() - { + public Integer getRfTwoFunc() { return rfTwoFunc; } - public void setRfThreeFunc(Integer rfThreeFunc) - { + + public void setRfThreeFunc(Integer rfThreeFunc) { this.rfThreeFunc = rfThreeFunc; } - public Integer getRfThreeFunc() - { + public Integer getRfThreeFunc() { return rfThreeFunc; } - public void setRfFourFunc(Integer rfFourFunc) - { + + public void setRfFourFunc(Integer rfFourFunc) { this.rfFourFunc = rfFourFunc; } - public Integer getRfFourFunc() - { + public Integer getRfFourFunc() { return rfFourFunc; } - public void setOwnerId(String ownerId) - { + + public void setOwnerId(String ownerId) { this.ownerId = ownerId; } - public String getOwnerId() - { + public String getOwnerId() { return ownerId; } - public void setNetworkAddress(String networkAddress) - { + + public void setNetworkAddress(String networkAddress) { this.networkAddress = networkAddress; } - public String getNetworkAddress() - { + public String getNetworkAddress() { return networkAddress; } - public void setNetworkIp(String networkIp) - { + + public void setNetworkIp(String networkIp) { this.networkIp = networkIp; } - public String getNetworkIp() - { + public String getNetworkIp() { return networkIp; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public void setRadarInterval(Integer radarInterval) - { + public void setRadarInterval(Integer radarInterval) { this.radarInterval = radarInterval; } - public Integer getRadarInterval() - { + public Integer getRadarInterval() { return radarInterval; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deviceSetId", getDeviceSetId()) - .append("deviceId", getDeviceId()) - .append("deviceNum", getDeviceNum()) - .append("isAlarm", getIsAlarm()) - .append("isRadar", getIsRadar()) - .append("isHost", getIsHost()) - .append("isReset", getIsReset()) - .append("isAp", getIsAp()) - .append("isSmartConfig", getIsSmartConfig()) - .append("isRfControl", getIsRfControl()) - .append("isRfLearn", getIsRfLearn()) - .append("isRfClear", getIsRfClear()) - .append("rfOneFunc", getRfOneFunc()) - .append("rfTwoFunc", getRfTwoFunc()) - .append("rfThreeFunc", getRfThreeFunc()) - .append("rfFourFunc", getRfFourFunc()) - .append("ownerId", getOwnerId()) - .append("networkAddress", getNetworkAddress()) - .append("networkIp", getNetworkIp()) - .append("radarInterval", getRadarInterval()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deviceSetId", getDeviceSetId()) + .append("deviceId", getDeviceId()) + .append("deviceNum", getDeviceNum()) + .append("isAlarm", getIsAlarm()) + .append("isRadar", getIsRadar()) + .append("isHost", getIsHost()) + .append("isReset", getIsReset()) + .append("isAp", getIsAp()) + .append("isSmartConfig", getIsSmartConfig()) + .append("isRfControl", getIsRfControl()) + .append("isRfLearn", getIsRfLearn()) + .append("isRfClear", getIsRfClear()) + .append("rfOneFunc", getRfOneFunc()) + .append("rfTwoFunc", getRfTwoFunc()) + .append("rfThreeFunc", getRfThreeFunc()) + .append("rfFourFunc", getRfFourFunc()) + .append("ownerId", getOwnerId()) + .append("networkAddress", getNetworkAddress()) + .append("networkIp", getNetworkIp()) + .append("radarInterval", getRadarInterval()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceStatus.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceStatus.java index 8e1261a7..b3839e23 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceStatus.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceStatus.java @@ -11,6 +11,7 @@ package com.ruoyi.system.domain; import java.math.BigDecimal; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -18,287 +19,304 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 设备状态对象 iot_device_status - * + * * @author kerwincui * @date 2021-05-06 */ -public class IotDeviceStatus extends BaseEntity -{ +public class IotDeviceStatus extends BaseEntity { private static final long serialVersionUID = 1L; - /** 序号 */ + /** + * 序号 + */ private Long deviceStatusId; - /** 设备 */ + /** + * 设备 + */ @Excel(name = "设备") private Long deviceId; - /** 设备编号 */ + /** + * 设备编号 + */ @Excel(name = "设备编号") private String deviceNum; - /** 继电器 */ + /** + * 继电器 + */ @Excel(name = "继电器") private Integer relayStatus; - /** 灯状态 */ + /** + * 灯状态 + */ @Excel(name = "灯状态") private Integer lightStatus; - /** 在线 */ + /** + * 在线 + */ @Excel(name = "在线") private Integer isOnline; - /** 设备温度 */ + /** + * 设备温度 + */ @Excel(name = "设备温度") private BigDecimal deviceTemperature; - /** 设备湿度 */ + /** + * 设备湿度 + */ @Excel(name = "信号") private Integer rssi; - /** 空气温度 */ + /** + * 空气温度 + */ @Excel(name = "空气温度") private BigDecimal airTemperature; - /** 空气湿度 */ + /** + * 空气湿度 + */ @Excel(name = "空气湿度") private BigDecimal airHumidity; - /** 触发源 */ + /** + * 触发源 + */ @Excel(name = "触发源") private Integer triggerSource; - /** 彩灯亮度 */ + /** + * 彩灯亮度 + */ @Excel(name = "彩灯亮度") private Integer brightness; - /** 渐变间隔 */ + /** + * 渐变间隔 + */ @Excel(name = "渐变间隔") private Integer lightInterval; - /** 彩灯模式 */ + /** + * 彩灯模式 + */ @Excel(name = "彩灯模式") private Integer lightMode; - /** 灯渐变时间 */ + /** + * 灯渐变时间 + */ @Excel(name = "渐变时间") private Integer fadeTime; - /** 红灯 */ + /** + * 红灯 + */ @Excel(name = "红灯") private Long red; - /** 绿灯 */ + /** + * 绿灯 + */ @Excel(name = "绿灯") private Long green; - /** 蓝灯 */ + /** + * 蓝灯 + */ @Excel(name = "蓝灯") private Long blue; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - public void setDeviceStatusId(Long deviceStatusId) - { + public void setDeviceStatusId(Long deviceStatusId) { this.deviceStatusId = deviceStatusId; } - public Long getDeviceStatusId() - { + public Long getDeviceStatusId() { return deviceStatusId; } - public void setDeviceId(Long deviceId) - { + + public void setDeviceId(Long deviceId) { this.deviceId = deviceId; } - public Long getDeviceId() - { + public Long getDeviceId() { return deviceId; } - public void setDeviceNum(String deviceNum) - { + + public void setDeviceNum(String deviceNum) { this.deviceNum = deviceNum; } - public String getDeviceNum() - { + public String getDeviceNum() { return deviceNum; } - public void setRelayStatus(Integer relayStatus) - { + + public void setRelayStatus(Integer relayStatus) { this.relayStatus = relayStatus; } - public Integer getRelayStatus() - { + public Integer getRelayStatus() { return relayStatus; } - public void setLightStatus(Integer lightStatus) - { + + public void setLightStatus(Integer lightStatus) { this.lightStatus = lightStatus; } - public Integer getLightStatus() - { + public Integer getLightStatus() { return lightStatus; } - public void setIsOnline(Integer isOnline) - { + + public void setIsOnline(Integer isOnline) { this.isOnline = isOnline; } - public Integer getIsOnline() - { + public Integer getIsOnline() { return isOnline; } - public void setDeviceTemperature(BigDecimal deviceTemperature) - { + + public void setDeviceTemperature(BigDecimal deviceTemperature) { this.deviceTemperature = deviceTemperature; } - public BigDecimal getDeviceTemperature() - { + public BigDecimal getDeviceTemperature() { return deviceTemperature; } - public void setRssi(Integer rssi) - { + + public void setRssi(Integer rssi) { this.rssi = rssi; } - public Integer getRssi() - { + public Integer getRssi() { return rssi; } - public void setAirTemperature(BigDecimal airTemperature) - { + + public void setAirTemperature(BigDecimal airTemperature) { this.airTemperature = airTemperature; } - public BigDecimal getAirTemperature() - { + public BigDecimal getAirTemperature() { return airTemperature; } - public void setAirHumidity(BigDecimal airHumidity) - { + + public void setAirHumidity(BigDecimal airHumidity) { this.airHumidity = airHumidity; } - public BigDecimal getAirHumidity() - { + public BigDecimal getAirHumidity() { return airHumidity; } - public void setTriggerSource(Integer triggerSource) - { + + public void setTriggerSource(Integer triggerSource) { this.triggerSource = triggerSource; } - public Integer getTriggerSource() - { + public Integer getTriggerSource() { return triggerSource; } - public void setBrightness(Integer brightness) - { + + public void setBrightness(Integer brightness) { this.brightness = brightness; } - public Integer getBrightness() - { + public Integer getBrightness() { return brightness; } - public void setLightInterval(Integer lightInterval) - { + + public void setLightInterval(Integer lightInterval) { this.lightInterval = lightInterval; } - public Integer getLightInterval() - { + public Integer getLightInterval() { return lightInterval; } - public void setLightMode(Integer lightMode) - { + + public void setLightMode(Integer lightMode) { this.lightMode = lightMode; } - public Integer getLightMode() - { + public Integer getLightMode() { return lightMode; } - public void setRed(Long red) - { + + public void setRed(Long red) { this.red = red; } - public Long getRed() - { + public Long getRed() { return red; } - public void setGreen(Long green) - { + + public void setGreen(Long green) { this.green = green; } - public Long getGreen() - { + public Long getGreen() { return green; } - public void setBlue(Long blue) - { + + public void setBlue(Long blue) { this.blue = blue; } - public Long getBlue() - { + public Long getBlue() { return blue; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public void setFadeTime(Integer fadeTime) - { + public void setFadeTime(Integer fadeTime) { this.fadeTime = fadeTime; } - public Integer getFadeTime() - { + + public Integer getFadeTime() { return fadeTime; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deviceStatusId", getDeviceStatusId()) - .append("deviceId", getDeviceId()) - .append("deviceNum", getDeviceNum()) - .append("relayStatus", getRelayStatus()) - .append("lightStatus", getLightStatus()) - .append("isOnline", getIsOnline()) - .append("deviceTemperature", getDeviceTemperature()) - .append("rssid", getRssi()) - .append("airTemperature", getAirTemperature()) - .append("airHumidity", getAirHumidity()) - .append("triggerSource", getTriggerSource()) - .append("brightness", getBrightness()) - .append("lightInterval", getLightInterval()) - .append("lightMode", getLightMode()) - .append("fadeTime", getFadeTime()) - .append("red", getRed()) - .append("green", getGreen()) - .append("blue", getBlue()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deviceStatusId", getDeviceStatusId()) + .append("deviceId", getDeviceId()) + .append("deviceNum", getDeviceNum()) + .append("relayStatus", getRelayStatus()) + .append("lightStatus", getLightStatus()) + .append("isOnline", getIsOnline()) + .append("deviceTemperature", getDeviceTemperature()) + .append("rssid", getRssi()) + .append("airTemperature", getAirTemperature()) + .append("airHumidity", getAirHumidity()) + .append("triggerSource", getTriggerSource()) + .append("brightness", getBrightness()) + .append("lightInterval", getLightInterval()) + .append("lightMode", getLightMode()) + .append("fadeTime", getFadeTime()) + .append("red", getRed()) + .append("green", getGreen()) + .append("blue", getBlue()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceUserRelation.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceUserRelation.java new file mode 100644 index 00000000..ad182195 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotDeviceUserRelation.java @@ -0,0 +1,136 @@ +package com.ruoyi.system.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 【请填写功能名称】对象 iot_device_user_relation + * + * @author wxy + * @date 2021-08-27 + */ +public class IotDeviceUserRelation extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long userId; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long deviceId; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String deviceNum; + + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String deviceName; + + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String remark; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtTime; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Date gmtUpdate; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceName() { + return deviceName; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public void setDeviceNum(String deviceNum) { + this.deviceNum = deviceNum; + } + + public String getDeviceNum() { + return deviceNum; + } + + public void setGmtTime(Date gmtTime) { + this.gmtTime = gmtTime; + } + + public Date getGmtTime() { + return gmtTime; + } + + public void setGmtUpdate(Date gmtUpdate) { + this.gmtUpdate = gmtUpdate; + } + + public Date getGmtUpdate() { + return gmtUpdate; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userId", getUserId()) + .append("deviceId", getDeviceId()) + .append("deviceNum", getDeviceNum()) + .append("gmtTime", getGmtTime()) + .append("gmtUpdate", getGmtUpdate()) + .toString(); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotGroup.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotGroup.java index c9ab4d1a..015abf9b 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotGroup.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/IotGroup.java @@ -17,91 +17,94 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 分组对象 iot_group - * + * * @author kerwincui * @date 2021-05-18 */ -public class IotGroup extends BaseEntity -{ +public class IotGroup extends BaseEntity { private static final long serialVersionUID = 1L; - /** 设备分组 */ + /** + * 设备分组 + */ private Long groupId; - /** 用户 */ + /** + * 用户 + */ @Excel(name = "用户") private Long userId; - /** 分组名称 */ + /** + * 分组名称 + */ @Excel(name = "分组名称") private String groupName; - /** 排序 */ + /** + * 排序 + */ @Excel(name = "排序") private Integer groupOrder; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - public void setGroupId(Long groupId) - { + public void setGroupId(Long groupId) { this.groupId = groupId; } - public Long getGroupId() - { + public Long getGroupId() { return groupId; } - public void setUserId(Long userId) - { + + public void setUserId(Long userId) { this.userId = userId; } - public Long getUserId() - { + public Long getUserId() { return userId; } - public void setGroupName(String groupName) - { + + public void setGroupName(String groupName) { this.groupName = groupName; } - public String getGroupName() - { + public String getGroupName() { return groupName; } - public void setGroupOrder(Integer groupOrder) - { + + public void setGroupOrder(Integer groupOrder) { this.groupOrder = groupOrder; } - public Integer getGroupOrder() - { + public Integer getGroupOrder() { return groupOrder; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("groupId", getGroupId()) - .append("userId", getUserId()) - .append("groupName", getGroupName()) - .append("groupOrder", getGroupOrder()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("groupId", getGroupId()) + .append("userId", getUserId()) + .append("groupName", getGroupName()) + .append("groupOrder", getGroupOrder()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java index 52e18988..d57786ba 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java @@ -12,6 +12,7 @@ package com.ruoyi.system.domain; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -20,102 +21,101 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 参数配置表 sys_config - * + * * @author ruoyi */ -public class SysConfig extends BaseEntity -{ +public class SysConfig extends BaseEntity { private static final long serialVersionUID = 1L; - /** 参数主键 */ + /** + * 参数主键 + */ @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) private Long configId; - /** 参数名称 */ + /** + * 参数名称 + */ @Excel(name = "参数名称") private String configName; - /** 参数键名 */ + /** + * 参数键名 + */ @Excel(name = "参数键名") private String configKey; - /** 参数键值 */ + /** + * 参数键值 + */ @Excel(name = "参数键值") private String configValue; - /** 系统内置(Y是 N否) */ + /** + * 系统内置(Y是 N否) + */ @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") private String configType; - public Long getConfigId() - { + public Long getConfigId() { return configId; } - public void setConfigId(Long configId) - { + public void setConfigId(Long configId) { this.configId = configId; } @NotBlank(message = "参数名称不能为空") @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") - public String getConfigName() - { + public String getConfigName() { return configName; } - public void setConfigName(String configName) - { + public void setConfigName(String configName) { this.configName = configName; } @NotBlank(message = "参数键名长度不能为空") @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") - public String getConfigKey() - { + public String getConfigKey() { return configKey; } - public void setConfigKey(String configKey) - { + public void setConfigKey(String configKey) { this.configKey = configKey; } @NotBlank(message = "参数键值不能为空") @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") - public String getConfigValue() - { + public String getConfigValue() { return configValue; } - public void setConfigValue(String configValue) - { + public void setConfigValue(String configValue) { this.configValue = configValue; } - public String getConfigType() - { + public String getConfigType() { return configType; } - public void setConfigType(String configType) - { + public void setConfigType(String configType) { this.configType = configType; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("configId", getConfigId()) - .append("configName", getConfigName()) - .append("configKey", getConfigKey()) - .append("configValue", getConfigValue()) - .append("configType", getConfigType()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("configId", getConfigId()) + .append("configName", getConfigName()) + .append("configKey", getConfigKey()) + .append("configValue", getConfigValue()) + .append("configType", getConfigType()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java index 34c42ba2..de1f8edb 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java @@ -11,6 +11,7 @@ package com.ruoyi.system.domain; import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel.ColumnType; @@ -18,137 +19,136 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 系统访问记录表 sys_logininfor - * + * * @author ruoyi */ -public class SysLogininfor extends BaseEntity -{ +public class SysLogininfor extends BaseEntity { private static final long serialVersionUID = 1L; - /** ID */ + /** + * ID + */ @Excel(name = "序号", cellType = ColumnType.NUMERIC) private Long infoId; - /** 用户账号 */ + /** + * 用户账号 + */ @Excel(name = "用户账号") private String userName; - /** 登录状态 0成功 1失败 */ + /** + * 登录状态 0成功 1失败 + */ @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败") private String status; - /** 登录IP地址 */ + /** + * 登录IP地址 + */ @Excel(name = "登录地址") private String ipaddr; - /** 登录地点 */ + /** + * 登录地点 + */ @Excel(name = "登录地点") private String loginLocation; - /** 浏览器类型 */ + /** + * 浏览器类型 + */ @Excel(name = "浏览器") private String browser; - /** 操作系统 */ + /** + * 操作系统 + */ @Excel(name = "操作系统") private String os; - /** 提示消息 */ + /** + * 提示消息 + */ @Excel(name = "提示消息") private String msg; - /** 访问时间 */ + /** + * 访问时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date loginTime; - public Long getInfoId() - { + public Long getInfoId() { return infoId; } - public void setInfoId(Long infoId) - { + public void setInfoId(Long infoId) { this.infoId = infoId; } - public String getUserName() - { + public String getUserName() { return userName; } - public void setUserName(String userName) - { + public void setUserName(String userName) { this.userName = userName; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getIpaddr() - { + public String getIpaddr() { return ipaddr; } - public void setIpaddr(String ipaddr) - { + public void setIpaddr(String ipaddr) { this.ipaddr = ipaddr; } - public String getLoginLocation() - { + public String getLoginLocation() { return loginLocation; } - public void setLoginLocation(String loginLocation) - { + public void setLoginLocation(String loginLocation) { this.loginLocation = loginLocation; } - public String getBrowser() - { + public String getBrowser() { return browser; } - public void setBrowser(String browser) - { + public void setBrowser(String browser) { this.browser = browser; } - public String getOs() - { + public String getOs() { return os; } - public void setOs(String os) - { + public void setOs(String os) { this.os = os; } - public String getMsg() - { + public String getMsg() { return msg; } - public void setMsg(String msg) - { + public void setMsg(String msg) { this.msg = msg; } - public Date getLoginTime() - { + public Date getLoginTime() { return loginTime; } - public void setLoginTime(Date loginTime) - { + public void setLoginTime(Date loginTime) { this.loginTime = loginTime; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java index 457c2647..1007fb44 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java @@ -12,99 +12,99 @@ package com.ruoyi.system.domain; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.domain.BaseEntity; /** * 通知公告表 sys_notice - * + * * @author ruoyi */ -public class SysNotice extends BaseEntity -{ +public class SysNotice extends BaseEntity { private static final long serialVersionUID = 1L; - /** 公告ID */ + /** + * 公告ID + */ private Long noticeId; - /** 公告标题 */ + /** + * 公告标题 + */ private String noticeTitle; - /** 公告类型(1通知 2公告) */ + /** + * 公告类型(1通知 2公告) + */ private String noticeType; - /** 公告内容 */ + /** + * 公告内容 + */ private String noticeContent; - /** 公告状态(0正常 1关闭) */ + /** + * 公告状态(0正常 1关闭) + */ private String status; - public Long getNoticeId() - { + public Long getNoticeId() { return noticeId; } - public void setNoticeId(Long noticeId) - { + public void setNoticeId(Long noticeId) { this.noticeId = noticeId; } - public void setNoticeTitle(String noticeTitle) - { + public void setNoticeTitle(String noticeTitle) { this.noticeTitle = noticeTitle; } @NotBlank(message = "公告标题不能为空") @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") - public String getNoticeTitle() - { + public String getNoticeTitle() { return noticeTitle; } - public void setNoticeType(String noticeType) - { + public void setNoticeType(String noticeType) { this.noticeType = noticeType; } - public String getNoticeType() - { + public String getNoticeType() { return noticeType; } - public void setNoticeContent(String noticeContent) - { + public void setNoticeContent(String noticeContent) { this.noticeContent = noticeContent; } - public String getNoticeContent() - { + public String getNoticeContent() { return noticeContent; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getStatus() - { + public String getStatus() { return status; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("noticeId", getNoticeId()) - .append("noticeTitle", getNoticeTitle()) - .append("noticeType", getNoticeType()) - .append("noticeContent", getNoticeContent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("noticeId", getNoticeId()) + .append("noticeTitle", getNoticeTitle()) + .append("noticeType", getNoticeType()) + .append("noticeContent", getNoticeContent()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java index 175ee03f..b4fa4782 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; import java.util.Date; + import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel.ColumnType; @@ -8,248 +9,247 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 操作日志记录表 oper_log - * + * * @author ruoyi */ -public class SysOperLog extends BaseEntity -{ +public class SysOperLog extends BaseEntity { private static final long serialVersionUID = 1L; - /** 日志主键 */ + /** + * 日志主键 + */ @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) private Long operId; - /** 操作模块 */ + /** + * 操作模块 + */ @Excel(name = "操作模块") private String title; - /** 业务类型(0其它 1新增 2修改 3删除) */ + /** + * 业务类型(0其它 1新增 2修改 3删除) + */ @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据") private Integer businessType; - /** 业务类型数组 */ + /** + * 业务类型数组 + */ private Integer[] businessTypes; - /** 请求方法 */ + /** + * 请求方法 + */ @Excel(name = "请求方法") private String method; - /** 请求方式 */ + /** + * 请求方式 + */ @Excel(name = "请求方式") private String requestMethod; - /** 操作类别(0其它 1后台用户 2手机端用户) */ + /** + * 操作类别(0其它 1后台用户 2手机端用户) + */ @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") private Integer operatorType; - /** 操作人员 */ + /** + * 操作人员 + */ @Excel(name = "操作人员") private String operName; - /** 部门名称 */ + /** + * 部门名称 + */ @Excel(name = "部门名称") private String deptName; - /** 请求url */ + /** + * 请求url + */ @Excel(name = "请求地址") private String operUrl; - /** 操作地址 */ + /** + * 操作地址 + */ @Excel(name = "操作地址") private String operIp; - /** 操作地点 */ + /** + * 操作地点 + */ @Excel(name = "操作地点") private String operLocation; - /** 请求参数 */ + /** + * 请求参数 + */ @Excel(name = "请求参数") private String operParam; - /** 返回参数 */ + /** + * 返回参数 + */ @Excel(name = "返回参数") private String jsonResult; - /** 操作状态(0正常 1异常) */ + /** + * 操作状态(0正常 1异常) + */ @Excel(name = "状态", readConverterExp = "0=正常,1=异常") private Integer status; - /** 错误消息 */ + /** + * 错误消息 + */ @Excel(name = "错误消息") private String errorMsg; - /** 操作时间 */ + /** + * 操作时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date operTime; - public Long getOperId() - { + public Long getOperId() { return operId; } - public void setOperId(Long operId) - { + public void setOperId(Long operId) { this.operId = operId; } - public String getTitle() - { + public String getTitle() { return title; } - public void setTitle(String title) - { + public void setTitle(String title) { this.title = title; } - public Integer getBusinessType() - { + public Integer getBusinessType() { return businessType; } - public void setBusinessType(Integer businessType) - { + public void setBusinessType(Integer businessType) { this.businessType = businessType; } - public Integer[] getBusinessTypes() - { + public Integer[] getBusinessTypes() { return businessTypes; } - public void setBusinessTypes(Integer[] businessTypes) - { + public void setBusinessTypes(Integer[] businessTypes) { this.businessTypes = businessTypes; } - public String getMethod() - { + public String getMethod() { return method; } - public void setMethod(String method) - { + public void setMethod(String method) { this.method = method; } - public String getRequestMethod() - { + public String getRequestMethod() { return requestMethod; } - public void setRequestMethod(String requestMethod) - { + public void setRequestMethod(String requestMethod) { this.requestMethod = requestMethod; } - public Integer getOperatorType() - { + public Integer getOperatorType() { return operatorType; } - public void setOperatorType(Integer operatorType) - { + public void setOperatorType(Integer operatorType) { this.operatorType = operatorType; } - public String getOperName() - { + public String getOperName() { return operName; } - public void setOperName(String operName) - { + public void setOperName(String operName) { this.operName = operName; } - public String getDeptName() - { + public String getDeptName() { return deptName; } - public void setDeptName(String deptName) - { + public void setDeptName(String deptName) { this.deptName = deptName; } - public String getOperUrl() - { + public String getOperUrl() { return operUrl; } - public void setOperUrl(String operUrl) - { + public void setOperUrl(String operUrl) { this.operUrl = operUrl; } - public String getOperIp() - { + public String getOperIp() { return operIp; } - public void setOperIp(String operIp) - { + public void setOperIp(String operIp) { this.operIp = operIp; } - public String getOperLocation() - { + public String getOperLocation() { return operLocation; } - public void setOperLocation(String operLocation) - { + public void setOperLocation(String operLocation) { this.operLocation = operLocation; } - public String getOperParam() - { + public String getOperParam() { return operParam; } - public void setOperParam(String operParam) - { + public void setOperParam(String operParam) { this.operParam = operParam; } - public String getJsonResult() - { + public String getJsonResult() { return jsonResult; } - public void setJsonResult(String jsonResult) - { + public void setJsonResult(String jsonResult) { this.jsonResult = jsonResult; } - public Integer getStatus() - { + public Integer getStatus() { return status; } - public void setStatus(Integer status) - { + public void setStatus(Integer status) { this.status = status; } - public String getErrorMsg() - { + public String getErrorMsg() { return errorMsg; } - public void setErrorMsg(String errorMsg) - { + public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; } - public Date getOperTime() - { + public Date getOperTime() { return operTime; } - public void setOperTime(Date operTime) - { + public void setOperTime(Date operTime) { this.operTime = operTime; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java index 1f1fcf4c..fcd24ed8 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java @@ -2,6 +2,7 @@ package com.ruoyi.system.domain; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -10,114 +11,113 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 岗位表 sys_post - * + * * @author ruoyi */ -public class SysPost extends BaseEntity -{ +public class SysPost extends BaseEntity { private static final long serialVersionUID = 1L; - /** 岗位序号 */ + /** + * 岗位序号 + */ @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) private Long postId; - /** 岗位编码 */ + /** + * 岗位编码 + */ @Excel(name = "岗位编码") private String postCode; - /** 岗位名称 */ + /** + * 岗位名称 + */ @Excel(name = "岗位名称") private String postName; - /** 岗位排序 */ + /** + * 岗位排序 + */ @Excel(name = "岗位排序") private String postSort; - /** 状态(0正常 1停用) */ + /** + * 状态(0正常 1停用) + */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private String status; - /** 用户是否存在此岗位标识 默认不存在 */ + /** + * 用户是否存在此岗位标识 默认不存在 + */ private boolean flag = false; - public Long getPostId() - { + public Long getPostId() { return postId; } - public void setPostId(Long postId) - { + public void setPostId(Long postId) { this.postId = postId; } @NotBlank(message = "岗位编码不能为空") @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") - public String getPostCode() - { + public String getPostCode() { return postCode; } - public void setPostCode(String postCode) - { + public void setPostCode(String postCode) { this.postCode = postCode; } @NotBlank(message = "岗位名称不能为空") @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") - public String getPostName() - { + public String getPostName() { return postName; } - public void setPostName(String postName) - { + public void setPostName(String postName) { this.postName = postName; } @NotBlank(message = "显示顺序不能为空") - public String getPostSort() - { + public String getPostSort() { return postSort; } - public void setPostSort(String postSort) - { + public void setPostSort(String postSort) { this.postSort = postSort; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public boolean isFlag() - { + public boolean isFlag() { return flag; } - public void setFlag(boolean flag) - { + public void setFlag(boolean flag) { this.flag = flag; } - + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("postId", getPostId()) - .append("postCode", getPostCode()) - .append("postName", getPostName()) - .append("postSort", getPostSort()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("postId", getPostId()) + .append("postCode", getPostCode()) + .append("postName", getPostName()) + .append("postSort", getPostSort()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java index 47b21bf7..aaaa06e4 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java @@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle; /** * 角色和部门关联 sys_role_dept - * + * * @author ruoyi */ -public class SysRoleDept -{ - /** 角色ID */ +public class SysRoleDept { + /** + * 角色ID + */ private Long roleId; - - /** 部门ID */ + + /** + * 部门ID + */ private Long deptId; - public Long getRoleId() - { + public Long getRoleId() { return roleId; } - public void setRoleId(Long roleId) - { + public void setRoleId(Long roleId) { this.roleId = roleId; } - public Long getDeptId() - { + public Long getDeptId() { return deptId; } - public void setDeptId(Long deptId) - { + public void setDeptId(Long deptId) { this.deptId = deptId; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("deptId", getDeptId()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("deptId", getDeptId()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java index de10a747..af6ac320 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java @@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle; /** * 角色和菜单关联 sys_role_menu - * + * * @author ruoyi */ -public class SysRoleMenu -{ - /** 角色ID */ +public class SysRoleMenu { + /** + * 角色ID + */ private Long roleId; - - /** 菜单ID */ + + /** + * 菜单ID + */ private Long menuId; - public Long getRoleId() - { + public Long getRoleId() { return roleId; } - public void setRoleId(Long roleId) - { + public void setRoleId(Long roleId) { this.roleId = roleId; } - public Long getMenuId() - { + public Long getMenuId() { return menuId; } - public void setMenuId(Long menuId) - { + public void setMenuId(Long menuId) { this.menuId = menuId; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("menuId", getMenuId()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("roleId", getRoleId()) + .append("menuId", getMenuId()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java index 2bbd3188..d066cf8a 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java @@ -2,112 +2,111 @@ package com.ruoyi.system.domain; /** * 当前在线会话 - * + * * @author ruoyi */ -public class SysUserOnline -{ - /** 会话编号 */ +public class SysUserOnline { + /** + * 会话编号 + */ private String tokenId; - /** 部门名称 */ + /** + * 部门名称 + */ private String deptName; - /** 用户名称 */ + /** + * 用户名称 + */ private String userName; - /** 登录IP地址 */ + /** + * 登录IP地址 + */ private String ipaddr; - /** 登录地址 */ + /** + * 登录地址 + */ private String loginLocation; - /** 浏览器类型 */ + /** + * 浏览器类型 + */ private String browser; - /** 操作系统 */ + /** + * 操作系统 + */ private String os; - /** 登录时间 */ + /** + * 登录时间 + */ private Long loginTime; - public String getTokenId() - { + public String getTokenId() { return tokenId; } - public void setTokenId(String tokenId) - { + public void setTokenId(String tokenId) { this.tokenId = tokenId; } - public String getDeptName() - { + public String getDeptName() { return deptName; } - public void setDeptName(String deptName) - { + public void setDeptName(String deptName) { this.deptName = deptName; } - public String getUserName() - { + public String getUserName() { return userName; } - public void setUserName(String userName) - { + public void setUserName(String userName) { this.userName = userName; } - public String getIpaddr() - { + public String getIpaddr() { return ipaddr; } - public void setIpaddr(String ipaddr) - { + public void setIpaddr(String ipaddr) { this.ipaddr = ipaddr; } - public String getLoginLocation() - { + public String getLoginLocation() { return loginLocation; } - public void setLoginLocation(String loginLocation) - { + public void setLoginLocation(String loginLocation) { this.loginLocation = loginLocation; } - public String getBrowser() - { + public String getBrowser() { return browser; } - public void setBrowser(String browser) - { + public void setBrowser(String browser) { this.browser = browser; } - public String getOs() - { + public String getOs() { return os; } - public void setOs(String os) - { + public void setOs(String os) { this.os = os; } - public Long getLoginTime() - { + public Long getLoginTime() { return loginTime; } - public void setLoginTime(Long loginTime) - { + public void setLoginTime(Long loginTime) { this.loginTime = loginTime; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java index 6e8c416f..eb2ba7b1 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java @@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle; /** * 用户和岗位关联 sys_user_post - * + * * @author ruoyi */ -public class SysUserPost -{ - /** 用户ID */ +public class SysUserPost { + /** + * 用户ID + */ private Long userId; - - /** 岗位ID */ + + /** + * 岗位ID + */ private Long postId; - public Long getUserId() - { + public Long getUserId() { return userId; } - public void setUserId(Long userId) - { + public void setUserId(Long userId) { this.userId = userId; } - public Long getPostId() - { + public Long getPostId() { return postId; } - public void setPostId(Long postId) - { + public void setPostId(Long postId) { this.postId = postId; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("postId", getPostId()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("postId", getPostId()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java index 4d158101..6e0073fa 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java @@ -5,42 +5,41 @@ import org.apache.commons.lang3.builder.ToStringStyle; /** * 用户和角色关联 sys_user_role - * + * * @author ruoyi */ -public class SysUserRole -{ - /** 用户ID */ +public class SysUserRole { + /** + * 用户ID + */ private Long userId; - - /** 角色ID */ + + /** + * 角色ID + */ private Long roleId; - public Long getUserId() - { + public Long getUserId() { return userId; } - public void setUserId(Long userId) - { + public void setUserId(Long userId) { this.userId = userId; } - public Long getRoleId() - { + public Long getRoleId() { return roleId; } - public void setRoleId(Long roleId) - { + public void setRoleId(Long roleId) { this.roleId = roleId; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("roleId", getRoleId()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("userId", getUserId()) + .append("roleId", getRoleId()) + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserAccountInfo.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserAccountInfo.java new file mode 100644 index 00000000..f1ee21fd --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserAccountInfo.java @@ -0,0 +1,327 @@ +package com.ruoyi.system.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 小程序用户对象 t_user_account_info + * + * @author wxy + * @date 2021-08-26 + */ +public class TUserAccountInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * sessionKey + */ + @Excel(name = "sessionKey") + private String sessionkey; + + /** + * accessToken + */ + @Excel(name = "accessToken") + private String accessToken; + + /** + * $column.columnComment + */ + @Excel(name = "accessToken") + private String openId; + + /** + * $column.columnComment + */ + @Excel(name = "accessToken") + private String unionId; + + /** + * 昵称 + */ + @Excel(name = "昵称") + private String nickName; + + /** + * 头像 + */ + @Excel(name = "头像") + private String avatar; + + /** + * 手机号 + */ + @Excel(name = "手机号") + private String phone; + + /** + * 生日 + */ + @Excel(name = "生日") + private String birthday; + + /** + * 用户状态:0-冻结,1-正常 + */ + @Excel(name = "用户状态:0-冻结,1-正常") + private Long status; + + /** + * 国家 + */ + @Excel(name = "国家") + private String country; + + /** + * 省份 + */ + @Excel(name = "省份") + private String province; + + /** + * 城市 + */ + @Excel(name = "城市") + private String city; + + /** + * 地址 + */ + @Excel(name = "地址") + private String address; + + /** + * 用户类型:0-未授权用户,1-消费者,2-商家 + */ + @Excel(name = "用户类型:0-未授权用户,1-消费者,2-商家") + private Long userType; + + /** + * 绑定的管理员编号 + */ + @Excel(name = "绑定的管理员编号") + private Long adminId; + + /** + * $column.columnComment + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "绑定的管理员编号", width = 30, dateFormat = "yyyy-MM-dd") + private Date lastLoginTime; + + /** + * $column.columnComment + */ + @Excel(name = "绑定的管理员编号") + private String lastLoginIp; + + /** + * $column.columnComment + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "绑定的管理员编号", width = 30, dateFormat = "yyyy-MM-dd") + private Date gmtTime; + + /** + * $column.columnComment + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "绑定的管理员编号", width = 30, dateFormat = "yyyy-MM-dd") + private Date gmtUpdate; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setSessionkey(String sessionkey) { + this.sessionkey = sessionkey; + } + + public String getSessionkey() { + return sessionkey; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getAccessToken() { + return accessToken; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getOpenId() { + return openId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId; + } + + public String getUnionId() { + return unionId; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getNickName() { + return nickName; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public String getAvatar() { + return avatar; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhone() { + return phone; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public String getBirthday() { + return birthday; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getCountry() { + return country; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getProvince() { + return province; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCity() { + return city; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getAddress() { + return address; + } + + public void setUserType(Long userType) { + this.userType = userType; + } + + public Long getUserType() { + return userType; + } + + public void setAdminId(Long adminId) { + this.adminId = adminId; + } + + public Long getAdminId() { + return adminId; + } + + public void setLastLoginTime(Date lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public Date getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginIp(String lastLoginIp) { + this.lastLoginIp = lastLoginIp; + } + + public String getLastLoginIp() { + return lastLoginIp; + } + + public void setGmtTime(Date gmtTime) { + this.gmtTime = gmtTime; + } + + public Date getGmtTime() { + return gmtTime; + } + + public void setGmtUpdate(Date gmtUpdate) { + this.gmtUpdate = gmtUpdate; + } + + public Date getGmtUpdate() { + return gmtUpdate; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sessionkey", getSessionkey()) + .append("accessToken", getAccessToken()) + .append("openId", getOpenId()) + .append("unionId", getUnionId()) + .append("nickName", getNickName()) + .append("avatar", getAvatar()) + .append("phone", getPhone()) + .append("birthday", getBirthday()) + .append("status", getStatus()) + .append("country", getCountry()) + .append("province", getProvince()) + .append("city", getCity()) + .append("address", getAddress()) + .append("userType", getUserType()) + .append("adminId", getAdminId()) + .append("lastLoginTime", getLastLoginTime()) + .append("lastLoginIp", getLastLoginIp()) + .append("gmtTime", getGmtTime()) + .append("gmtUpdate", getGmtUpdate()) + .toString(); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserLoginLog.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserLoginLog.java new file mode 100644 index 00000000..cf6bb8f1 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/TUserLoginLog.java @@ -0,0 +1,146 @@ +package com.ruoyi.system.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 【请填写功能名称】对象 t_user_login_log + * + * @author wxy + * @date 2021-08-26 + */ +public class TUserLoginLog extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 用户类型 + */ + @Excel(name = "用户类型") + private String userType; + + /** + * $column.columnComment + */ + @Excel(name = "用户类型") + private Long userId; + + /** + * $column.columnComment + */ + @Excel(name = "用户类型") + private String code; + + /** + * $column.columnComment + */ + @Excel(name = "用户类型") + private String openId; + + /** + * IP地址 + */ + @Excel(name = "IP地址") + private String ip; + + /** + * $column.columnComment + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "IP地址", width = 30, dateFormat = "yyyy-MM-dd") + private Date gmtTime; + + /** + * $column.columnComment + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "IP地址", width = 30, dateFormat = "yyyy-MM-dd") + private Date gmtUpdate; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public String getUserType() { + return userType; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getUserId() { + return userId; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getOpenId() { + return openId; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getIp() { + return ip; + } + + public void setGmtTime(Date gmtTime) { + this.gmtTime = gmtTime; + } + + public Date getGmtTime() { + return gmtTime; + } + + public void setGmtUpdate(Date gmtUpdate) { + this.gmtUpdate = gmtUpdate; + } + + public Date getGmtUpdate() { + return gmtUpdate; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userType", getUserType()) + .append("userId", getUserId()) + .append("code", getCode()) + .append("openId", getOpenId()) + .append("ip", getIp()) + .append("gmtTime", getGmtTime()) + .append("gmtUpdate", getGmtUpdate()) + .toString(); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/DeviceControlCMD.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/DeviceControlCMD.java new file mode 100644 index 00000000..b0246e56 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/DeviceControlCMD.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.domain.vo; + +import lombok.Data; + +/** + * 类名: DeviceControlCMD + * 描述: 设备控制指令参数 + * 时间: 2021-08-26,0026 18:54 + * 开发人: admin + */ +@Data +public class DeviceControlCMD { + private Long deviceId; + String deviceNum; + String cmd; +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/IotDeviceListDto.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/IotDeviceListDto.java index 146efb26..8e656937 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/IotDeviceListDto.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/IotDeviceListDto.java @@ -19,263 +19,316 @@ import java.math.BigDecimal; /** * 设备对象 iot_device - * + * * @author kerwincui * @date 2021-05-06 */ -public class IotDeviceListDto extends BaseEntity -{ +public class IotDeviceListDto extends BaseEntity { private static final long serialVersionUID = 1L; - /** 序号 */ + /** + * 序号 + */ private Long deviceId; - /** 编号 */ + /** + * 编号 + */ @Excel(name = "编号") private String deviceNum; - /** 分类 */ + /** + * 分类 + */ @Excel(name = "分类") private Long categoryId; - /** 分类名称 */ + /** + * 分类名称 + */ @Excel(name = "分类名称") private String categoryName; - /** 名称 */ + /** + * 名称 + */ @Excel(name = "名称") private String deviceName; - /** 固件版本 */ + /** + * 固件版本 + */ @Excel(name = "固件版本") private String firmwareVersion; - /** 用户 */ + /** + * 用户 + */ @Excel(name = "用户") private String ownerId; - @Excel(name="用户昵称") + @Excel(name = "设备状态") + private String status; + + @Excel(name = "用户昵称") private String nickName; - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - /** 报警 */ + /** + * 报警 + */ @Excel(name = "报警") private Integer isAlarm; - /** 雷达感应 */ + /** + * 雷达感应 + */ @Excel(name = "雷达感应") private Integer isRadar; - /** 射频遥控 */ + /** + * 射频遥控 + */ @Excel(name = "射频遥控") private Integer isRfControl; - /** 配网地址 */ + /** + * 配网地址 + */ @Excel(name = "配网地址") private String networkAddress; - /** 配网IP */ + /** + * 配网IP + */ @Excel(name = "配网IP") private String networkIp; - /** 继电器 */ + /** + * 继电器 + */ @Excel(name = "继电器") private Integer relayStatus; - /** 灯状态 */ + /** + * 灯状态 + */ @Excel(name = "灯状态") private Integer lightStatus; - /** 在线 */ + /** + * 在线 + */ @Excel(name = "在线") private Integer isOnline; - /** 设备温度 */ + /** + * 设备温度 + */ @Excel(name = "设备温度") private BigDecimal deviceTemperature; - /** 设备湿度 */ + /** + * 设备湿度 + */ @Excel(name = "信号") private Integer rssi; + @Excel(name = "备注") + private String remark; - public void setDeviceId(Long deviceId) - { + public void setDeviceId(Long deviceId) { this.deviceId = deviceId; } - public Long getDeviceId() - { + + public Long getDeviceId() { return deviceId; } - public void setDeviceNum(String deviceNum) - { + + public void setDeviceNum(String deviceNum) { this.deviceNum = deviceNum; } - public String getDeviceNum() - { + + public String getDeviceNum() { return deviceNum; } - public void setCategoryId(Long categoryId) - { + + public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } - public Long getCategoryId() - { + + public Long getCategoryId() { return categoryId; } - public void setCategoryName(String categoryName) - { + + public void setCategoryName(String categoryName) { this.categoryName = categoryName; } - public String getCategoryName() - { + + public String getCategoryName() { return categoryName; } - public void setDeviceName(String deviceName) - { + + public void setDeviceName(String deviceName) { this.deviceName = deviceName; } - public String getDeviceName() - { + + public String getDeviceName() { return deviceName; } - public void setFirmwareVersion(String firmwareVersion) - { + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + + public void setFirmwareVersion(String firmwareVersion) { this.firmwareVersion = firmwareVersion; } - public String getFirmwareVersion() - { + + public String getFirmwareVersion() { return firmwareVersion; } - public void setOwnerId(String ownerId) - { + + public void setOwnerId(String ownerId) { this.ownerId = ownerId; } - public String getOwnerId() - { + + public String getOwnerId() { return ownerId; } - public void setNickName(String nickName) - { + + public void setNickName(String nickName) { this.nickName = nickName; } - public String getNickName() - { + + public String getNickName() { return nickName; } - public void setDelFlag(String delFlag) - { + + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() - { + + public String getDelFlag() { return delFlag; } - public void setIsAlarm(Integer isAlarm) - { + public void setIsAlarm(Integer isAlarm) { this.isAlarm = isAlarm; } - public Integer getIsAlarm() - { + + public Integer getIsAlarm() { return isAlarm; } - public void setIsRadar(Integer isRadar) - { + + public void setIsRadar(Integer isRadar) { this.isRadar = isRadar; } - public Integer getIsRadar() - { + + public Integer getIsRadar() { return isRadar; } - public void setIsRfControl(Integer isRfControl) - { + + public void setIsRfControl(Integer isRfControl) { this.isRfControl = isRfControl; } - public Integer getIsRfControl() - { + + public Integer getIsRfControl() { return isRfControl; } - public void setNetworkAddress(String networkAddress) - { + + public void setNetworkAddress(String networkAddress) { this.networkAddress = networkAddress; } - public String getNetworkAddress() - { + + public String getNetworkAddress() { return networkAddress; } - public void setNetworkIp(String networkIp) - { + + public void setNetworkIp(String networkIp) { this.networkIp = networkIp; } - public String getNetworkIp() - { + + public String getNetworkIp() { return networkIp; } - public void setRelayStatus(Integer relayStatus) - { + public void setRelayStatus(Integer relayStatus) { this.relayStatus = relayStatus; } - public Integer getRelayStatus() - { + + public Integer getRelayStatus() { return relayStatus; } - public void setLightStatus(Integer lightStatus) - { + + public void setLightStatus(Integer lightStatus) { this.lightStatus = lightStatus; } - public Integer getLightStatus() - { + + public Integer getLightStatus() { return lightStatus; } - public void setIsOnline(Integer isOnline) - { + + public void setIsOnline(Integer isOnline) { this.isOnline = isOnline; } - public Integer getIsOnline() - { + + public Integer getIsOnline() { return isOnline; } - public void setDeviceTemperature(BigDecimal deviceTemperature) - { + + public void setDeviceTemperature(BigDecimal deviceTemperature) { this.deviceTemperature = deviceTemperature; } - public BigDecimal getDeviceTemperature() - { + + public BigDecimal getDeviceTemperature() { return deviceTemperature; } - public void setRssi(Integer rssi) - { + + public void setRssi(Integer rssi) { this.rssi = rssi; } - public Integer getRssi() - { + + public Integer getRssi() { return rssi; } + public void setRemark(String remark) { + this.remark = remark; + } + + public String getRemark() { + return remark; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deviceId", getDeviceId()) - .append("deviceNum", getDeviceNum()) - .append("categoryId", getCategoryId()) - .append("categoryName", getCategoryName()) - .append("deviceName", getDeviceName()) - .append("firmwareVersion", getFirmwareVersion()) - .append("ownerId", getOwnerId()) - .append("nickName", getNickName()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deviceId", getDeviceId()) + .append("deviceNum", getDeviceNum()) + .append("categoryId", getCategoryId()) + .append("categoryName", getCategoryName()) + .append("deviceName", getDeviceName()) + .append("firmwareVersion", getFirmwareVersion()) + .append("ownerId", getOwnerId()) + .append("nickName", getNickName()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) .append("isAlarm", getIsAlarm()) .append("isRadar", getIsRadar()) .append("isRfControl", getIsRfControl()) @@ -286,6 +339,6 @@ public class IotDeviceListDto extends BaseEntity .append("isOnline", getIsOnline()) .append("deviceTemperature", getDeviceTemperature()) .append("rssid", getRssi()) - .toString(); + .toString(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java index af7234c1..908b5823 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java @@ -2,11 +2,10 @@ package com.ruoyi.system.domain.vo; /** * 路由显示信息 - * + * * @author ruoyi */ -public class MetaVo -{ +public class MetaVo { /** * 设置该路由在侧边栏和面包屑中展示的名字 */ @@ -22,50 +21,41 @@ public class MetaVo */ private boolean noCache; - public MetaVo() - { + public MetaVo() { } - public MetaVo(String title, String icon) - { + public MetaVo(String title, String icon) { this.title = title; this.icon = icon; } - public MetaVo(String title, String icon, boolean noCache) - { + public MetaVo(String title, String icon, boolean noCache) { this.title = title; this.icon = icon; this.noCache = noCache; } - public boolean isNoCache() - { + public boolean isNoCache() { return noCache; } - public void setNoCache(boolean noCache) - { + public void setNoCache(boolean noCache) { this.noCache = noCache; } - public String getTitle() - { + public String getTitle() { return title; } - public void setTitle(String title) - { + public void setTitle(String title) { this.title = title; } - public String getIcon() - { + public String getIcon() { return icon; } - public void setIcon(String icon) - { + public void setIcon(String icon) { this.icon = icon; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java index b5501b77..9538383f 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java @@ -1,16 +1,16 @@ package com.ruoyi.system.domain.vo; import com.fasterxml.jackson.annotation.JsonInclude; + import java.util.List; /** * 路由配置信息 - * + * * @author ruoyi */ @JsonInclude(JsonInclude.Include.NON_EMPTY) -public class RouterVo -{ +public class RouterVo { /** * 路由名字 */ @@ -51,83 +51,67 @@ public class RouterVo */ private List children; - public String getName() - { + public String getName() { return name; } - public void setName(String name) - { + public void setName(String name) { this.name = name; } - public String getPath() - { + public String getPath() { return path; } - public void setPath(String path) - { + public void setPath(String path) { this.path = path; } - public boolean getHidden() - { + public boolean getHidden() { return hidden; } - public void setHidden(boolean hidden) - { + public void setHidden(boolean hidden) { this.hidden = hidden; } - public String getRedirect() - { + public String getRedirect() { return redirect; } - public void setRedirect(String redirect) - { + public void setRedirect(String redirect) { this.redirect = redirect; } - public String getComponent() - { + public String getComponent() { return component; } - public void setComponent(String component) - { + public void setComponent(String component) { this.component = component; } - public Boolean getAlwaysShow() - { + public Boolean getAlwaysShow() { return alwaysShow; } - public void setAlwaysShow(Boolean alwaysShow) - { + public void setAlwaysShow(Boolean alwaysShow) { this.alwaysShow = alwaysShow; } - public MetaVo getMeta() - { + public MetaVo getMeta() { return meta; } - public void setMeta(MetaVo meta) - { + public void setMeta(MetaVo meta) { this.meta = meta; } - public List getChildren() - { + public List getChildren() { return children; } - public void setChildren(List children) - { + public void setChildren(List children) { this.children = children; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotCategoryMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotCategoryMapper.java index 904cc738..b3d2708a 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotCategoryMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotCategoryMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.IotCategory; +import org.springframework.stereotype.Repository; /** * 设备分类Mapper接口 - * + * * @author kerwincui * @date 2021-05-07 */ -public interface IotCategoryMapper -{ +@Repository +public interface IotCategoryMapper { /** * 查询设备分类 - * + * * @param categoryId 设备分类ID * @return 设备分类 */ @@ -21,7 +23,7 @@ public interface IotCategoryMapper /** * 查询设备分类列表 - * + * * @param iotCategory 设备分类 * @return 设备分类集合 */ @@ -29,7 +31,7 @@ public interface IotCategoryMapper /** * 新增设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @@ -37,7 +39,7 @@ public interface IotCategoryMapper /** * 修改设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @@ -45,7 +47,7 @@ public interface IotCategoryMapper /** * 删除设备分类 - * + * * @param categoryId 设备分类ID * @return 结果 */ @@ -53,7 +55,7 @@ public interface IotCategoryMapper /** * 批量删除设备分类 - * + * * @param categoryIds 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceMapper.java index 84578dd8..81e58779 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceMapper.java @@ -1,20 +1,24 @@ package com.ruoyi.system.mapper; import java.util.List; + +import com.alibaba.fastjson.JSONObject; import com.ruoyi.system.domain.IotDevice; import com.ruoyi.system.domain.vo.IotDeviceListDto; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; /** * 设备Mapper接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IotDeviceMapper -{ +@Repository +public interface IotDeviceMapper { /** * 查询设备 - * + * * @param deviceId 设备ID * @return 设备 */ @@ -30,7 +34,7 @@ public interface IotDeviceMapper /** * 查询设备列表 - * + * * @param iotDevice 设备 * @return 设备集合 */ @@ -38,7 +42,7 @@ public interface IotDeviceMapper /** * 新增设备 - * + * * @param iotDevice 设备 * @return 结果 */ @@ -46,7 +50,7 @@ public interface IotDeviceMapper /** * 修改设备 - * + * * @param iotDevice 设备 * @return 结果 */ @@ -54,7 +58,7 @@ public interface IotDeviceMapper /** * 删除设备 - * + * * @param deviceId 设备ID * @return 结果 */ @@ -62,9 +66,15 @@ public interface IotDeviceMapper /** * 批量删除设备 - * + * * @param deviceIds 需要删除的数据ID * @return 结果 */ public int deleteIotDeviceByIds(Long[] deviceIds); + + List selectMpIotDeviceList(IotDevice iotDevice); + + JSONObject getDeviceInfoByDeviceNum(@Param("userId") Long userId,@Param("deviceNum") String deviceNum); + + JSONObject getDeviceInfoByDeviceId(@Param("userId") Long userId,@Param("deviceId") Long deviceId); } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceSetMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceSetMapper.java index 8f532bf7..c65ddcea 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceSetMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceSetMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.IotDeviceSet; +import org.springframework.stereotype.Repository; /** * 设备配置Mapper接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IotDeviceSetMapper -{ +@Repository +public interface IotDeviceSetMapper { /** * 查询设备配置 - * + * * @param deviceSetId 设备配置ID * @return 设备配置 */ @@ -29,7 +31,7 @@ public interface IotDeviceSetMapper /** * 查询设备配置列表 - * + * * @param iotDeviceSet 设备配置 * @return 设备配置集合 */ @@ -37,7 +39,7 @@ public interface IotDeviceSetMapper /** * 新增设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @@ -45,7 +47,7 @@ public interface IotDeviceSetMapper /** * 修改设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @@ -53,7 +55,7 @@ public interface IotDeviceSetMapper /** * 删除设备配置 - * + * * @param deviceConfigId 设备配置ID * @return 结果 */ @@ -61,7 +63,7 @@ public interface IotDeviceSetMapper /** * 批量删除设备配置 - * + * * @param deviceConfigIds 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceStatusMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceStatusMapper.java index e0a150df..439e30ed 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceStatusMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceStatusMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.IotDeviceStatus; +import org.springframework.stereotype.Repository; /** * 设备状态Mapper接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IotDeviceStatusMapper -{ +@Repository +public interface IotDeviceStatusMapper { /** * 查询设备状态 - * + * * @param deviceStatusId 设备状态ID * @return 设备状态 */ @@ -37,7 +39,7 @@ public interface IotDeviceStatusMapper /** * 查询设备状态列表 - * + * * @param iotDeviceStatus 设备状态 * @return 设备状态集合 */ @@ -45,7 +47,7 @@ public interface IotDeviceStatusMapper /** * 新增设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @@ -53,7 +55,7 @@ public interface IotDeviceStatusMapper /** * 修改设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @@ -61,7 +63,7 @@ public interface IotDeviceStatusMapper /** * 删除设备状态 - * + * * @param deviceStatusId 设备状态ID * @return 结果 */ @@ -69,7 +71,7 @@ public interface IotDeviceStatusMapper /** * 批量删除设备状态 - * + * * @param deviceStatusIds 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceUserRelationMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceUserRelationMapper.java new file mode 100644 index 00000000..7d70943b --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotDeviceUserRelationMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.mapper; + +import java.util.List; + +import com.ruoyi.system.domain.IotDeviceUserRelation; +import org.springframework.stereotype.Repository; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author wxy + * @date 2021-08-27 + */ +@Repository +public interface IotDeviceUserRelationMapper { + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + public IotDeviceUserRelation selectIotDeviceUserRelationById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectIotDeviceUserRelationList(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 新增【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + public int insertIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 修改【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + public int updateIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + public int deleteIotDeviceUserRelationById(Long id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteIotDeviceUserRelationByIds(Long[] ids); + } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotGroupMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotGroupMapper.java index 8c333667..3f72812f 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotGroupMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/IotGroupMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.IotGroup; +import org.springframework.stereotype.Repository; /** * 分组Mapper接口 - * + * * @author kerwincui * @date 2021-05-18 */ -public interface IotGroupMapper -{ +@Repository +public interface IotGroupMapper { /** * 查询分组 - * + * * @param groupId 分组ID * @return 分组 */ @@ -21,7 +23,7 @@ public interface IotGroupMapper /** * 查询分组列表 - * + * * @param iotGroup 分组 * @return 分组集合 */ @@ -29,7 +31,7 @@ public interface IotGroupMapper /** * 新增分组 - * + * * @param iotGroup 分组 * @return 结果 */ @@ -37,7 +39,7 @@ public interface IotGroupMapper /** * 修改分组 - * + * * @param iotGroup 分组 * @return 结果 */ @@ -45,7 +47,7 @@ public interface IotGroupMapper /** * 删除分组 - * + * * @param groupId 分组ID * @return 结果 */ @@ -53,7 +55,7 @@ public interface IotGroupMapper /** * 批量删除分组 - * + * * @param groupIds 需要删除的数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java index 0ed0c0af..0e9a2d8a 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysConfig; +import org.springframework.stereotype.Repository; /** * 参数配置 数据层 - * + * * @author ruoyi */ -public interface SysConfigMapper -{ +@Repository +public interface SysConfigMapper { /** * 查询参数配置信息 - * + * * @param config 参数配置信息 * @return 参数配置信息 */ @@ -20,7 +22,7 @@ public interface SysConfigMapper /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @@ -28,7 +30,7 @@ public interface SysConfigMapper /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数键名 * @return 参数配置信息 */ @@ -36,7 +38,7 @@ public interface SysConfigMapper /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -44,7 +46,7 @@ public interface SysConfigMapper /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -52,7 +54,7 @@ public interface SysConfigMapper /** * 删除参数配置 - * + * * @param configId 参数ID * @return 结果 */ @@ -60,7 +62,7 @@ public interface SysConfigMapper /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index 000bf668..8837187d 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysDept; +import org.springframework.stereotype.Repository; /** * 部门管理 数据层 - * + * * @author ruoyi */ -public interface SysDeptMapper -{ +@Repository +public interface SysDeptMapper { /** * 查询部门管理数据 - * + * * @param dept 部门信息 * @return 部门信息集合 */ @@ -21,8 +23,8 @@ public interface SysDeptMapper /** * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID + * + * @param roleId 角色ID * @param deptCheckStrictly 部门树选择项是否关联显示 * @return 选中部门列表 */ @@ -30,7 +32,7 @@ public interface SysDeptMapper /** * 根据部门ID查询信息 - * + * * @param deptId 部门ID * @return 部门信息 */ @@ -38,7 +40,7 @@ public interface SysDeptMapper /** * 根据ID查询所有子部门 - * + * * @param deptId 部门ID * @return 部门列表 */ @@ -46,7 +48,7 @@ public interface SysDeptMapper /** * 根据ID查询所有子部门(正常状态) - * + * * @param deptId 部门ID * @return 子部门数 */ @@ -54,7 +56,7 @@ public interface SysDeptMapper /** * 是否存在子节点 - * + * * @param deptId 部门ID * @return 结果 */ @@ -62,7 +64,7 @@ public interface SysDeptMapper /** * 查询部门是否存在用户 - * + * * @param deptId 部门ID * @return 结果 */ @@ -70,7 +72,7 @@ public interface SysDeptMapper /** * 校验部门名称是否唯一 - * + * * @param deptName 部门名称 * @param parentId 父部门ID * @return 结果 @@ -79,7 +81,7 @@ public interface SysDeptMapper /** * 新增部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @@ -87,7 +89,7 @@ public interface SysDeptMapper /** * 修改部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @@ -95,14 +97,14 @@ public interface SysDeptMapper /** * 修改所在部门的父级部门状态 - * + * * @param dept 部门 */ public void updateDeptStatus(SysDept dept); /** * 修改子元素关系 - * + * * @param depts 子元素 * @return 结果 */ @@ -110,7 +112,7 @@ public interface SysDeptMapper /** * 删除部门管理信息 - * + * * @param deptId 部门ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java index a341f1e3..72ef927b 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysDictData; +import org.springframework.stereotype.Repository; /** * 字典表 数据层 - * + * * @author ruoyi */ -public interface SysDictDataMapper -{ +@Repository +public interface SysDictDataMapper { /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @@ -21,7 +23,7 @@ public interface SysDictDataMapper /** * 根据字典类型查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据集合信息 */ @@ -29,8 +31,8 @@ public interface SysDictDataMapper /** * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ @@ -38,7 +40,7 @@ public interface SysDictDataMapper /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ @@ -46,7 +48,7 @@ public interface SysDictDataMapper /** * 查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据 */ @@ -54,7 +56,7 @@ public interface SysDictDataMapper /** * 通过字典ID删除字典数据信息 - * + * * @param dictCode 字典数据ID * @return 结果 */ @@ -62,7 +64,7 @@ public interface SysDictDataMapper /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID * @return 结果 */ @@ -70,7 +72,7 @@ public interface SysDictDataMapper /** * 新增字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @@ -78,7 +80,7 @@ public interface SysDictDataMapper /** * 修改字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @@ -86,7 +88,7 @@ public interface SysDictDataMapper /** * 同步修改字典类型 - * + * * @param oldDictType 旧字典类型 * @param newDictType 新旧字典类型 * @return 结果 diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java index 17545cd9..2249832d 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java @@ -1,20 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.ruoyi.common.core.domain.entity.SysDictType; /** * 字典表 数据层 - * + * * @author ruoyi */ @Mapper -public interface SysDictTypeMapper -{ +public interface SysDictTypeMapper { /** * 根据条件分页查询字典类型 - * + * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ @@ -22,14 +22,14 @@ public interface SysDictTypeMapper /** * 根据所有字典类型 - * + * * @return 字典类型集合信息 */ public List selectDictTypeAll(); /** * 根据字典类型ID查询信息 - * + * * @param dictId 字典类型ID * @return 字典类型 */ @@ -37,7 +37,7 @@ public interface SysDictTypeMapper /** * 根据字典类型查询信息 - * + * * @param dictType 字典类型 * @return 字典类型 */ @@ -45,7 +45,7 @@ public interface SysDictTypeMapper /** * 通过字典ID删除字典信息 - * + * * @param dictId 字典ID * @return 结果 */ @@ -53,7 +53,7 @@ public interface SysDictTypeMapper /** * 批量删除字典类型信息 - * + * * @param dictIds 需要删除的字典ID * @return 结果 */ @@ -61,7 +61,7 @@ public interface SysDictTypeMapper /** * 新增字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @@ -69,7 +69,7 @@ public interface SysDictTypeMapper /** * 修改字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @@ -77,7 +77,7 @@ public interface SysDictTypeMapper /** * 校验字典类型称是否唯一 - * + * * @param dictType 字典类型 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java index 629866f5..89305f20 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java @@ -1,25 +1,27 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysLogininfor; +import org.springframework.stereotype.Repository; /** * 系统访问日志情况信息 数据层 - * + * * @author ruoyi */ -public interface SysLogininforMapper -{ +@Repository +public interface SysLogininforMapper { /** * 新增系统登录日志 - * + * * @param logininfor 访问日志对象 */ public void insertLogininfor(SysLogininfor logininfor); /** * 查询系统登录日志集合 - * + * * @param logininfor 访问日志对象 * @return 登录记录集合 */ @@ -27,7 +29,7 @@ public interface SysLogininforMapper /** * 批量删除系统登录日志 - * + * * @param infoIds 需要删除的登录日志ID * @return 结果 */ @@ -35,7 +37,7 @@ public interface SysLogininforMapper /** * 清空系统登录日志 - * + * * @return 结果 */ public int cleanLogininfor(); diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java index 1c2e8530..e2d6ef02 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java @@ -1,16 +1,18 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysMenu; +import org.springframework.stereotype.Repository; /** * 菜单表 数据层 * * @author ruoyi */ -public interface SysMenuMapper -{ +@Repository +public interface SysMenuMapper { /** * 查询系统菜单列表 * @@ -59,8 +61,8 @@ public interface SysMenuMapper /** * 根据角色ID查询菜单树信息 - * - * @param roleId 角色ID + * + * @param roleId 角色ID * @param menuCheckStrictly 菜单树选择项是否关联显示 * @return 选中菜单列表 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java index c34f0a27..689ff57c 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysNotice; +import org.springframework.stereotype.Repository; /** * 通知公告表 数据层 - * + * * @author ruoyi */ -public interface SysNoticeMapper -{ +@Repository +public interface SysNoticeMapper { /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ @@ -20,7 +22,7 @@ public interface SysNoticeMapper /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ @@ -28,7 +30,7 @@ public interface SysNoticeMapper /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -36,7 +38,7 @@ public interface SysNoticeMapper /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -44,7 +46,7 @@ public interface SysNoticeMapper /** * 批量删除公告 - * + * * @param noticeId 公告ID * @return 结果 */ @@ -52,7 +54,7 @@ public interface SysNoticeMapper /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java index 2ae6457f..90b74661 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java @@ -1,25 +1,27 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysOperLog; +import org.springframework.stereotype.Repository; /** * 操作日志 数据层 - * + * * @author ruoyi */ -public interface SysOperLogMapper -{ +@Repository +public interface SysOperLogMapper { /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ public void insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ @@ -27,7 +29,7 @@ public interface SysOperLogMapper /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ @@ -35,7 +37,7 @@ public interface SysOperLogMapper /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java index b4287479..5cce981e 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysPost; +import org.springframework.stereotype.Repository; /** * 岗位信息 数据层 - * + * * @author ruoyi */ -public interface SysPostMapper -{ +@Repository +public interface SysPostMapper { /** * 查询岗位数据集合 - * + * * @param post 岗位信息 * @return 岗位数据集合 */ @@ -20,14 +22,14 @@ public interface SysPostMapper /** * 查询所有岗位 - * + * * @return 岗位列表 */ public List selectPostAll(); /** * 通过岗位ID查询岗位信息 - * + * * @param postId 岗位ID * @return 角色对象信息 */ @@ -35,7 +37,7 @@ public interface SysPostMapper /** * 根据用户ID获取岗位选择框列表 - * + * * @param userId 用户ID * @return 选中岗位ID列表 */ @@ -43,7 +45,7 @@ public interface SysPostMapper /** * 查询用户所属岗位组 - * + * * @param userName 用户名 * @return 结果 */ @@ -51,7 +53,7 @@ public interface SysPostMapper /** * 删除岗位信息 - * + * * @param postId 岗位ID * @return 结果 */ @@ -59,7 +61,7 @@ public interface SysPostMapper /** * 批量删除岗位信息 - * + * * @param postIds 需要删除的岗位ID * @return 结果 */ @@ -67,7 +69,7 @@ public interface SysPostMapper /** * 修改岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ @@ -75,7 +77,7 @@ public interface SysPostMapper /** * 新增岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ @@ -83,7 +85,7 @@ public interface SysPostMapper /** * 校验岗位名称 - * + * * @param postName 岗位名称 * @return 结果 */ @@ -91,7 +93,7 @@ public interface SysPostMapper /** * 校验岗位编码 - * + * * @param postCode 岗位编码 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java index f9d3a2f3..a3b8b4a6 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysRoleDept; +import org.springframework.stereotype.Repository; /** * 角色与部门关联表 数据层 - * + * * @author ruoyi */ -public interface SysRoleDeptMapper -{ +@Repository +public interface SysRoleDeptMapper { /** * 通过角色ID删除角色和部门关联 - * + * * @param roleId 角色ID * @return 结果 */ @@ -20,7 +22,7 @@ public interface SysRoleDeptMapper /** * 批量删除角色部门关联信息 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @@ -28,7 +30,7 @@ public interface SysRoleDeptMapper /** * 查询部门使用数量 - * + * * @param deptId 部门ID * @return 结果 */ @@ -36,7 +38,7 @@ public interface SysRoleDeptMapper /** * 批量新增角色部门信息 - * + * * @param roleDeptList 角色部门列表 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java index 16d55943..cbc2738f 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.common.core.domain.entity.SysRole; +import org.springframework.stereotype.Repository; /** * 角色表 数据层 - * + * * @author ruoyi */ -public interface SysRoleMapper -{ +@Repository +public interface SysRoleMapper { /** * 根据条件分页查询角色数据 - * + * * @param role 角色信息 * @return 角色数据集合信息 */ @@ -20,7 +22,7 @@ public interface SysRoleMapper /** * 根据用户ID查询角色 - * + * * @param userId 用户ID * @return 角色列表 */ @@ -28,14 +30,14 @@ public interface SysRoleMapper /** * 查询所有角色 - * + * * @return 角色列表 */ public List selectRoleAll(); /** * 根据用户ID获取角色选择框列表 - * + * * @param userId 用户ID * @return 选中角色ID列表 */ @@ -43,7 +45,7 @@ public interface SysRoleMapper /** * 通过角色ID查询角色 - * + * * @param roleId 角色ID * @return 角色对象信息 */ @@ -51,7 +53,7 @@ public interface SysRoleMapper /** * 根据用户ID查询角色 - * + * * @param userName 用户名 * @return 角色列表 */ @@ -59,7 +61,7 @@ public interface SysRoleMapper /** * 校验角色名称是否唯一 - * + * * @param roleName 角色名称 * @return 角色信息 */ @@ -67,7 +69,7 @@ public interface SysRoleMapper /** * 校验角色权限是否唯一 - * + * * @param roleKey 角色权限 * @return 角色信息 */ @@ -75,7 +77,7 @@ public interface SysRoleMapper /** * 修改角色信息 - * + * * @param role 角色信息 * @return 结果 */ @@ -83,7 +85,7 @@ public interface SysRoleMapper /** * 新增角色信息 - * + * * @param role 角色信息 * @return 结果 */ @@ -91,7 +93,7 @@ public interface SysRoleMapper /** * 通过角色ID删除角色 - * + * * @param roleId 角色ID * @return 结果 */ @@ -99,7 +101,7 @@ public interface SysRoleMapper /** * 批量删除角色信息 - * + * * @param roleIds 需要删除的角色ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java index 6602bee1..29170f75 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysRoleMenu; +import org.springframework.stereotype.Repository; /** * 角色与菜单关联表 数据层 - * + * * @author ruoyi */ -public interface SysRoleMenuMapper -{ +@Repository +public interface SysRoleMenuMapper { /** * 查询菜单使用数量 - * + * * @param menuId 菜单ID * @return 结果 */ @@ -20,7 +22,7 @@ public interface SysRoleMenuMapper /** * 通过角色ID删除角色和菜单关联 - * + * * @param roleId 角色ID * @return 结果 */ @@ -28,7 +30,7 @@ public interface SysRoleMenuMapper /** * 批量删除角色菜单关联信息 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @@ -36,7 +38,7 @@ public interface SysRoleMenuMapper /** * 批量新增角色菜单信息 - * + * * @param roleMenuList 角色菜单列表 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 39f62bc2..a111936e 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysUser; +import org.springframework.stereotype.Repository; /** * 用户表 数据层 - * + * * @author ruoyi */ -public interface SysUserMapper -{ +@Repository +public interface SysUserMapper { /** * 根据条件分页查询用户列表 - * + * * @param sysUser 用户信息 * @return 用户信息集合信息 */ @@ -21,15 +23,17 @@ public interface SysUserMapper /** * 通过用户名查询用户 - * + * * @param userName 用户名 * @return 用户对象信息 */ public SysUser selectUserByUserName(String userName); + public SysUser selectUserByOpenId(String openId); + /** * 通过用户ID查询用户 - * + * * @param userId 用户ID * @return 用户对象信息 */ @@ -37,7 +41,7 @@ public interface SysUserMapper /** * 新增用户信息 - * + * * @param user 用户信息 * @return 结果 */ @@ -45,7 +49,7 @@ public interface SysUserMapper /** * 修改用户信息 - * + * * @param user 用户信息 * @return 结果 */ @@ -53,16 +57,16 @@ public interface SysUserMapper /** * 修改用户头像 - * + * * @param userName 用户名 - * @param avatar 头像地址 + * @param avatar 头像地址 * @return 结果 */ public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); /** * 重置用户密码 - * + * * @param userName 用户名 * @param password 密码 * @return 结果 @@ -71,7 +75,7 @@ public interface SysUserMapper /** * 通过用户ID删除用户 - * + * * @param userId 用户ID * @return 结果 */ @@ -79,7 +83,7 @@ public interface SysUserMapper /** * 批量删除用户信息 - * + * * @param userIds 需要删除的用户ID * @return 结果 */ @@ -87,7 +91,7 @@ public interface SysUserMapper /** * 校验用户名称是否唯一 - * + * * @param userName 用户名称 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java index e08991de..58c7808f 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java @@ -1,18 +1,20 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysUserPost; +import org.springframework.stereotype.Repository; /** * 用户与岗位关联表 数据层 - * + * * @author ruoyi */ -public interface SysUserPostMapper -{ +@Repository +public interface SysUserPostMapper { /** * 通过用户ID删除用户和岗位关联 - * + * * @param userId 用户ID * @return 结果 */ @@ -20,7 +22,7 @@ public interface SysUserPostMapper /** * 通过岗位ID查询岗位使用数量 - * + * * @param postId 岗位ID * @return 结果 */ @@ -28,7 +30,7 @@ public interface SysUserPostMapper /** * 批量删除用户和岗位关联 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @@ -36,7 +38,7 @@ public interface SysUserPostMapper /** * 批量新增用户岗位信息 - * + * * @param userPostList 用户角色列表 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java index 3143ec82..528878b6 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -1,19 +1,21 @@ package com.ruoyi.system.mapper; import java.util.List; + import org.apache.ibatis.annotations.Param; import com.ruoyi.system.domain.SysUserRole; +import org.springframework.stereotype.Repository; /** * 用户与角色关联表 数据层 - * + * * @author ruoyi */ -public interface SysUserRoleMapper -{ +@Repository +public interface SysUserRoleMapper { /** * 通过用户ID删除用户和角色关联 - * + * * @param userId 用户ID * @return 结果 */ @@ -21,7 +23,7 @@ public interface SysUserRoleMapper /** * 批量删除用户和角色关联 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @@ -29,7 +31,7 @@ public interface SysUserRoleMapper /** * 通过角色ID查询角色使用数量 - * + * * @param roleId 角色ID * @return 结果 */ @@ -37,7 +39,7 @@ public interface SysUserRoleMapper /** * 批量新增用户角色信息 - * + * * @param userRoleList 用户角色列表 * @return 结果 */ @@ -45,7 +47,7 @@ public interface SysUserRoleMapper /** * 删除用户和角色关联信息 - * + * * @param userRole 用户和角色关联信息 * @return 结果 */ @@ -53,8 +55,8 @@ public interface SysUserRoleMapper /** * 批量取消授权用户角色 - * - * @param roleId 角色ID + * + * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserAccountInfoMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserAccountInfoMapper.java new file mode 100644 index 00000000..3076be70 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserAccountInfoMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.mapper; + +import java.util.List; + +import com.ruoyi.system.domain.TUserAccountInfo; +import org.springframework.stereotype.Repository; + +/** + * 小程序用户Mapper接口 + * + * @author wxy + * @date 2021-08-26 + */ +@Repository +public interface TUserAccountInfoMapper { + /** + * 查询小程序用户 + * + * @param id 小程序用户ID + * @return 小程序用户 + */ + public TUserAccountInfo selectTUserAccountInfoById(Long id); + + /** + * 查询小程序用户列表 + * + * @param tUserAccountInfo 小程序用户 + * @return 小程序用户集合 + */ + public List selectTUserAccountInfoList(TUserAccountInfo tUserAccountInfo); + + /** + * 新增小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + public int insertTUserAccountInfo(TUserAccountInfo tUserAccountInfo); + + /** + * 修改小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + public int updateTUserAccountInfo(TUserAccountInfo tUserAccountInfo); + + /** + * 删除小程序用户 + * + * @param id 小程序用户ID + * @return 结果 + */ + public int deleteTUserAccountInfoById(Long id); + + /** + * 批量删除小程序用户 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteTUserAccountInfoByIds(Long[] ids); +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserLoginLogMapper.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserLoginLogMapper.java new file mode 100644 index 00000000..d293de0a --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TUserLoginLogMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.mapper; + +import java.util.List; + +import com.ruoyi.system.domain.TUserLoginLog; +import org.springframework.stereotype.Repository; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author wxy + * @date 2021-08-26 + */ +@Repository +public interface TUserLoginLogMapper { + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + public TUserLoginLog selectTUserLoginLogById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectTUserLoginLogList(TUserLoginLog tUserLoginLog); + + /** + * 新增【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + public int insertTUserLoginLog(TUserLoginLog tUserLoginLog); + + /** + * 修改【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + public int updateTUserLoginLog(TUserLoginLog tUserLoginLog); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + public int deleteTUserLoginLogById(Long id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteTUserLoginLogByIds(Long[] ids); +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttConfig.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttConfig.java index 715ba163..a56873fb 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttConfig.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttConfig.java @@ -55,47 +55,61 @@ public class MqttConfig { private int keepalive; - public String getusername() - { + public String getusername() { return username; } - public void setusername(String username) {this.username = username;} - public String getpassword() - { + public void setusername(String username) { + this.username = username; + } + + public String getpassword() { return password; } - public void setpassword(String password) {this.password = password;} - public String gethostUrl() - { + public void setpassword(String password) { + this.password = password; + } + + public String gethostUrl() { return hostUrl; } - public void sethostUrl(String hostUrl) {this.hostUrl = hostUrl;} - public String getclientId() - { + public void sethostUrl(String hostUrl) { + this.hostUrl = hostUrl; + } + + public String getclientId() { return clientId; } - public void setclientId(String clientId) {this.clientId = clientId;} - public String getdefaultTopic() - { + public void setclientId(String clientId) { + this.clientId = clientId; + } + + public String getdefaultTopic() { return defaultTopic; } - public void setdefaultTopic(String defaultTopic) {this.defaultTopic = defaultTopic;} - public int gettimeout() - { + public void setdefaultTopic(String defaultTopic) { + this.defaultTopic = defaultTopic; + } + + public int gettimeout() { return timeout; } - public void settimeout(int timeout) {this.timeout = timeout;} - public int getkeepalive() - { + public void settimeout(int timeout) { + this.timeout = timeout; + } + + public int getkeepalive() { return keepalive; } - public void setkeepalive(int keepalive) {this.keepalive = keepalive;} + + public void setkeepalive(int keepalive) { + this.keepalive = keepalive; + } @Bean public MqttPushClient getMqttPushClient() { diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttPushClient.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttPushClient.java index 8c998ecb..be6dfc29 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttPushClient.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/MqttPushClient.java @@ -15,6 +15,7 @@ import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; /** @@ -22,6 +23,7 @@ import org.springframework.stereotype.Component; * @Description mqtt推送客户端 */ @Component +@Primary public class MqttPushClient { private static final Logger logger = LoggerFactory.getLogger(MqttPushClient.class); @@ -40,6 +42,7 @@ public class MqttPushClient { /** * 客户端连接 + * * @param host ip+端口 * @param clientID 客户端Id * @param username 用户名 @@ -61,6 +64,7 @@ public class MqttPushClient { try { client.setCallback(pushCallback); client.connect(options); + System.out.println("MQTT Server Connected ..."); } catch (Exception e) { e.printStackTrace(); } @@ -71,6 +75,7 @@ public class MqttPushClient { /** * 发布 + * * @param qos 连接方式 * @param retained 是否保留 * @param topic 主题 @@ -101,6 +106,7 @@ public class MqttPushClient { /** * 订阅某个主题 + * * @param topic 主题 * @param qos 连接方式 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/PushCallback.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/PushCallback.java index dfc3693b..e9387559 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/PushCallback.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/mqtt/config/PushCallback.java @@ -11,9 +11,11 @@ package com.ruoyi.system.mqtt.config; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.ip.AddressUtils; import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.system.domain.IotCategory; @@ -32,6 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; + import java.util.Random; /** @@ -72,40 +75,45 @@ public class PushCallback implements MqttCallback { logger.info("接收消息主题 : " + topic); logger.info("接收消息Qos : " + mqttMessage.getQos()); logger.info("接收消息内容 : " + new String(mqttMessage.getPayload())); - - if(topic.equals("device_info")){ + try { + JSONObject jsonObject = JSON.parseObject(new String(mqttMessage.getPayload())); + }catch (Exception e){ + System.err.println("===未知消息格式:"+new String(mqttMessage.getPayload())); + return; + } + if (topic.equals("device_info")) { //添加设备信息 IotDevice device = JSON.parseObject(new String(mqttMessage.getPayload()), IotDevice.class); - IotDevice deviceEntity=iotDeviceService.selectIotDeviceByNum(device.getDeviceNum()); - if(deviceEntity!=null){ + IotDevice deviceEntity = iotDeviceService.selectIotDeviceByNum(device.getDeviceNum()); + if (deviceEntity != null) { device.setDeviceId(deviceEntity.getDeviceId()); iotDeviceService.updateIotDevice(device); - }else { - IotCategory categoryEntity=iotCategoryService.selectIotCategoryById(device.getCategoryId()); - if(device.getDeviceName()==null || device.getDeviceNum().length()==0) { + } else { + IotCategory categoryEntity = iotCategoryService.selectIotCategoryById(device.getCategoryId()); + if (device.getDeviceName() == null || device.getDeviceNum().length() == 0) { Random rand = new Random(); //随机生成两位数 - device.setDeviceName(categoryEntity.getCategoryName()+(rand.nextInt(90) + 10)); + device.setDeviceName(categoryEntity.getCategoryName() + (rand.nextInt(90) + 10)); } iotDeviceService.insertIotDevice(device); } //获取设备状态(消息内容不能为空,硬件获取不到数据报错) - mqttPushClient.publish(1,false,"status/get/"+device.getDeviceNum(),"wumei.live"); + mqttPushClient.publish(1, false, "status/get/" + device.getDeviceNum(), "wumei.live"); //获取设备配置 - mqttPushClient.publish(1,false,"setting/get/"+device.getDeviceNum(),"wumei.live"); - }else if(topic.equals("status")){ + mqttPushClient.publish(1, false, "setting/get/" + device.getDeviceNum(), "wumei.live"); + } else if (topic.equals("status")) { IotDeviceStatus deviceStatus = JSON.parseObject(new String(mqttMessage.getPayload()), IotDeviceStatus.class); - IotDevice device=iotDeviceService.selectIotDeviceByNum(deviceStatus.getDeviceNum()); + IotDevice device = iotDeviceService.selectIotDeviceByNum(deviceStatus.getDeviceNum()); //添加设备状态 deviceStatus.setDeviceId(device.getDeviceId()); iotDeviceStatusService.insertIotDeviceStatus(deviceStatus); - }else if(topic.equals("setting")){ + } else if (topic.equals("setting")) { IotDeviceSet deviceSet = JSON.parseObject(new String(mqttMessage.getPayload()), IotDeviceSet.class); // 智能配网时需要获取IP、地址和设备用户 - IotDevice device=iotDeviceService.selectIotDeviceByNum(deviceSet.getDeviceNum()); - if(deviceSet.getIsSmartConfig()==1){ + IotDevice device = iotDeviceService.selectIotDeviceByNum(deviceSet.getDeviceNum()); + if (deviceSet.getIsSmartConfig() == 1) { final String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); deviceSet.setNetworkIp(ip); - deviceSet.setNetworkAddress( AddressUtils.getRealAddressByIP(ip)); + deviceSet.setNetworkAddress(AddressUtils.getRealAddressByIP(ip)); //更新设备用户 device.setOwnerId(deviceSet.getOwnerId()); iotDeviceService.updateIotDevice(device); @@ -113,12 +121,12 @@ public class PushCallback implements MqttCallback { //添加设备配置 deviceSet.setDeviceId(device.getDeviceId()); iotDeviceSetService.insertIotDeviceSet(deviceSet); - }else if(topic.equals("offline")){ + } else if (topic.equals("offline")) { //离线遗嘱 IotDeviceStatus deviceStatus = JSON.parseObject(new String(mqttMessage.getPayload()), IotDeviceStatus.class); - IotDeviceStatus deviceStatusEntity=iotDeviceStatusService.selectIotDeviceStatusByDeviceNum(deviceStatus.getDeviceNum()); + IotDeviceStatus deviceStatusEntity = iotDeviceStatusService.selectIotDeviceStatusByDeviceNum(deviceStatus.getDeviceNum()); //设备状态为离线 - if(deviceStatusEntity!=null) { + if (deviceStatusEntity != null) { deviceStatusEntity.setIsOnline(0); iotDeviceStatusService.insertIotDeviceStatus(deviceStatusEntity); } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotCategoryService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotCategoryService.java index e05ce15a..344041ec 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotCategoryService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotCategoryService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.IotCategory; /** * 设备分类Service接口 - * + * * @author kerwincui * @date 2021-05-07 */ -public interface IIotCategoryService -{ +public interface IIotCategoryService { /** * 查询设备分类 - * + * * @param categoryId 设备分类ID * @return 设备分类 */ @@ -21,7 +21,7 @@ public interface IIotCategoryService /** * 查询设备分类列表 - * + * * @param iotCategory 设备分类 * @return 设备分类集合 */ @@ -29,7 +29,7 @@ public interface IIotCategoryService /** * 新增设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IIotCategoryService /** * 修改设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IIotCategoryService /** * 批量删除设备分类 - * + * * @param categoryIds 需要删除的设备分类ID * @return 结果 */ @@ -53,7 +53,7 @@ public interface IIotCategoryService /** * 删除设备分类信息 - * + * * @param categoryId 设备分类ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceService.java index a6ee191a..7aa0a4e9 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceService.java @@ -1,20 +1,22 @@ package com.ruoyi.system.service; import java.util.List; + +import com.alibaba.fastjson.JSONObject; import com.ruoyi.system.domain.IotDevice; import com.ruoyi.system.domain.vo.IotDeviceListDto; +import org.springframework.transaction.annotation.Transactional; /** * 设备Service接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IIotDeviceService -{ +public interface IIotDeviceService { /** * 查询设备 - * + * * @param deviceId 设备ID * @return 设备 */ @@ -27,7 +29,7 @@ public interface IIotDeviceService /** * 查询设备列表 - * + * * @param iotDevice 设备 * @return 设备集合 */ @@ -35,7 +37,7 @@ public interface IIotDeviceService /** * 新增设备 - * + * * @param iotDevice 设备 * @return 结果 */ @@ -43,7 +45,7 @@ public interface IIotDeviceService /** * 修改设备 - * + * * @param iotDevice 设备 * @return 结果 */ @@ -51,7 +53,7 @@ public interface IIotDeviceService /** * 批量删除设备 - * + * * @param deviceIds 需要删除的设备ID * @return 结果 */ @@ -59,9 +61,27 @@ public interface IIotDeviceService /** * 删除设备信息 - * + * * @param deviceId 设备ID * @return 结果 */ public int deleteIotDeviceById(Long deviceId); + + int controlDeviceByNum(String deviceNum, String cmd); + + int bindDevice(Long userId,String nickname,String deviceNum,String name,Long categoryId,String remark); + + List selectMpIotDeviceList(IotDevice iotDevice); + + @Transactional + int updateDeviceInfo(Long userId, String nickName, Long deviceId, String name, String remark); + + IotDevice selectIotDeviceByUserAndNum(Long userId, String deviceNum); + + int unBindDevice(Long userId,String username,Long deviceId); + + JSONObject getDeviceInfoByDeviceNum(Long userId,String nickName,String deviceNum); + + JSONObject getDeviceInfoByDeviceId(Long userId, String username, Long deviceId); } + diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceSetService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceSetService.java index 885ada12..4f2c8bef 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceSetService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceSetService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.IotDeviceSet; /** * 设备配置Service接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IIotDeviceSetService -{ +public interface IIotDeviceSetService { /** * 查询设备配置 - * + * * @param deviceConfigId 设备配置ID * @return 设备配置 */ @@ -29,7 +29,7 @@ public interface IIotDeviceSetService /** * 查询设备配置列表 - * + * * @param iotDeviceSet 设备配置 * @return 设备配置集合 */ @@ -37,7 +37,7 @@ public interface IIotDeviceSetService /** * 新增设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IIotDeviceSetService /** * 修改设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @@ -53,7 +53,7 @@ public interface IIotDeviceSetService /** * 批量删除设备配置 - * + * * @param deviceConfigIds 需要删除的设备配置ID * @return 结果 */ @@ -61,7 +61,7 @@ public interface IIotDeviceSetService /** * 删除设备配置信息 - * + * * @param deviceConfigId 设备配置ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceStatusService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceStatusService.java index 70169e8e..f19213a7 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceStatusService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceStatusService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.IotDeviceStatus; /** * 设备状态Service接口 - * + * * @author kerwincui * @date 2021-05-06 */ -public interface IIotDeviceStatusService -{ +public interface IIotDeviceStatusService { /** * 查询设备状态 - * + * * @param deviceStatusId 设备状态ID * @return 设备状态 */ @@ -37,7 +37,7 @@ public interface IIotDeviceStatusService /** * 查询设备状态列表 - * + * * @param iotDeviceStatus 设备状态 * @return 设备状态集合 */ @@ -45,7 +45,7 @@ public interface IIotDeviceStatusService /** * 新增设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @@ -53,7 +53,7 @@ public interface IIotDeviceStatusService /** * 修改设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @@ -61,7 +61,7 @@ public interface IIotDeviceStatusService /** * 批量删除设备状态 - * + * * @param deviceStatusIds 需要删除的设备状态ID * @return 结果 */ @@ -69,7 +69,7 @@ public interface IIotDeviceStatusService /** * 删除设备状态信息 - * + * * @param deviceStatusId 设备状态ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceUserRelationService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceUserRelationService.java new file mode 100644 index 00000000..1bda7cf2 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotDeviceUserRelationService.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.service; + +import java.util.List; + +import com.ruoyi.system.domain.IotDeviceUserRelation; + +/** + * 【请填写功能名称】Service接口 + * + * @author wxy + * @date 2021-08-27 + */ +public interface IIotDeviceUserRelationService { + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + public IotDeviceUserRelation selectIotDeviceUserRelationById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectIotDeviceUserRelationList(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 新增【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + public int insertIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 修改【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + public int updateIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】ID + * @return 结果 + */ + public int deleteIotDeviceUserRelationByIds(Long[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + public int deleteIotDeviceUserRelationById(Long id); + + List selectIotDeviceUserRelationByDeviceId(Long deviceId); + + List selectIotDeviceUserRelationByUserId(Long userId); + + IotDeviceUserRelation selectIotDeviceUserRelationByDeviceIdAndUserId(Long deviceId,Long userId); + +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotGroupService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotGroupService.java index 6705b446..bb9ae4f8 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotGroupService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/IIotGroupService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.IotGroup; /** * 分组Service接口 - * + * * @author kerwincui * @date 2021-05-18 */ -public interface IIotGroupService -{ +public interface IIotGroupService { /** * 查询分组 - * + * * @param groupId 分组ID * @return 分组 */ @@ -21,7 +21,7 @@ public interface IIotGroupService /** * 查询分组列表 - * + * * @param iotGroup 分组 * @return 分组集合 */ @@ -29,7 +29,7 @@ public interface IIotGroupService /** * 新增分组 - * + * * @param iotGroup 分组 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IIotGroupService /** * 修改分组 - * + * * @param iotGroup 分组 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IIotGroupService /** * 批量删除分组 - * + * * @param groupIds 需要删除的分组ID * @return 结果 */ @@ -53,7 +53,7 @@ public interface IIotGroupService /** * 删除分组信息 - * + * * @param groupId 分组ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index 9bca585b..0f7d9ed5 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -1,18 +1,18 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.SysConfig; /** * 参数配置 服务层 - * + * * @author ruoyi */ -public interface ISysConfigService -{ +public interface ISysConfigService { /** * 查询参数配置信息 - * + * * @param configId 参数配置ID * @return 参数配置信息 */ @@ -20,7 +20,7 @@ public interface ISysConfigService /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数键名 * @return 参数键值 */ @@ -28,7 +28,7 @@ public interface ISysConfigService /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @@ -36,7 +36,7 @@ public interface ISysConfigService /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -44,7 +44,7 @@ public interface ISysConfigService /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -52,7 +52,7 @@ public interface ISysConfigService /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID * @return 结果 */ @@ -65,7 +65,7 @@ public interface ISysConfigService /** * 校验参数键名是否唯一 - * + * * @param config 参数信息 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index bf8ab3e8..44a7e107 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysDept; /** * 部门管理 服务层 - * + * * @author ruoyi */ -public interface ISysDeptService -{ +public interface ISysDeptService { /** * 查询部门管理数据 - * + * * @param dept 部门信息 * @return 部门信息集合 */ @@ -21,7 +21,7 @@ public interface ISysDeptService /** * 构建前端所需要树结构 - * + * * @param depts 部门列表 * @return 树结构列表 */ @@ -29,7 +29,7 @@ public interface ISysDeptService /** * 构建前端所需要下拉树结构 - * + * * @param depts 部门列表 * @return 下拉树结构列表 */ @@ -37,7 +37,7 @@ public interface ISysDeptService /** * 根据角色ID查询部门树信息 - * + * * @param roleId 角色ID * @return 选中部门列表 */ @@ -45,7 +45,7 @@ public interface ISysDeptService /** * 根据部门ID查询信息 - * + * * @param deptId 部门ID * @return 部门信息 */ @@ -53,7 +53,7 @@ public interface ISysDeptService /** * 根据ID查询所有子部门(正常状态) - * + * * @param deptId 部门ID * @return 子部门数 */ @@ -61,7 +61,7 @@ public interface ISysDeptService /** * 是否存在部门子节点 - * + * * @param deptId 部门ID * @return 结果 */ @@ -69,7 +69,7 @@ public interface ISysDeptService /** * 查询部门是否存在用户 - * + * * @param deptId 部门ID * @return 结果 true 存在 false 不存在 */ @@ -77,7 +77,7 @@ public interface ISysDeptService /** * 校验部门名称是否唯一 - * + * * @param dept 部门信息 * @return 结果 */ @@ -85,7 +85,7 @@ public interface ISysDeptService /** * 新增保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @@ -93,7 +93,7 @@ public interface ISysDeptService /** * 修改保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @@ -101,7 +101,7 @@ public interface ISysDeptService /** * 删除部门管理信息 - * + * * @param deptId 部门ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java index 6cebd695..849417ff 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java @@ -1,18 +1,18 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.common.core.domain.entity.SysDictData; /** * 字典 业务层 - * + * * @author ruoyi */ -public interface ISysDictDataService -{ +public interface ISysDictDataService { /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @@ -20,8 +20,8 @@ public interface ISysDictDataService /** * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ @@ -29,7 +29,7 @@ public interface ISysDictDataService /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ @@ -37,7 +37,7 @@ public interface ISysDictDataService /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID * @return 结果 */ @@ -45,7 +45,7 @@ public interface ISysDictDataService /** * 新增保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @@ -53,7 +53,7 @@ public interface ISysDictDataService /** * 修改保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index 310809e5..aaa899e6 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -1,19 +1,19 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysDictType; /** * 字典 业务层 - * + * * @author ruoyi */ -public interface ISysDictTypeService -{ +public interface ISysDictTypeService { /** * 根据条件分页查询字典类型 - * + * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ @@ -21,14 +21,14 @@ public interface ISysDictTypeService /** * 根据所有字典类型 - * + * * @return 字典类型集合信息 */ public List selectDictTypeAll(); /** * 根据字典类型查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据集合信息 */ @@ -36,7 +36,7 @@ public interface ISysDictTypeService /** * 根据字典类型ID查询信息 - * + * * @param dictId 字典类型ID * @return 字典类型 */ @@ -44,7 +44,7 @@ public interface ISysDictTypeService /** * 根据字典类型查询信息 - * + * * @param dictType 字典类型 * @return 字典类型 */ @@ -52,7 +52,7 @@ public interface ISysDictTypeService /** * 批量删除字典信息 - * + * * @param dictIds 需要删除的字典ID * @return 结果 */ @@ -65,7 +65,7 @@ public interface ISysDictTypeService /** * 新增保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @@ -73,7 +73,7 @@ public interface ISysDictTypeService /** * 修改保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @@ -81,7 +81,7 @@ public interface ISysDictTypeService /** * 校验字典类型称是否唯一 - * + * * @param dictType 字典类型 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java index 96c4d547..d36e2739 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java @@ -1,25 +1,25 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.SysLogininfor; /** * 系统访问日志情况信息 服务层 - * + * * @author ruoyi */ -public interface ISysLogininforService -{ +public interface ISysLogininforService { /** * 新增系统登录日志 - * + * * @param logininfor 访问日志对象 */ public void insertLogininfor(SysLogininfor logininfor); /** * 查询系统登录日志集合 - * + * * @param logininfor 访问日志对象 * @return 登录记录集合 */ @@ -27,7 +27,7 @@ public interface ISysLogininforService /** * 批量删除系统登录日志 - * + * * @param infoIds 需要删除的登录日志ID * @return */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index f64bee11..6405c0dc 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -2,20 +2,20 @@ package com.ruoyi.system.service; import java.util.List; import java.util.Set; + import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysMenu; import com.ruoyi.system.domain.vo.RouterVo; /** * 菜单 业务层 - * + * * @author ruoyi */ -public interface ISysMenuService -{ +public interface ISysMenuService { /** * 根据用户查询系统菜单列表 - * + * * @param userId 用户ID * @return 菜单列表 */ @@ -23,8 +23,8 @@ public interface ISysMenuService /** * 根据用户查询系统菜单列表 - * - * @param menu 菜单信息 + * + * @param menu 菜单信息 * @param userId 用户ID * @return 菜单列表 */ @@ -32,7 +32,7 @@ public interface ISysMenuService /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ @@ -40,7 +40,7 @@ public interface ISysMenuService /** * 根据用户ID查询菜单树信息 - * + * * @param userId 用户ID * @return 菜单列表 */ @@ -48,7 +48,7 @@ public interface ISysMenuService /** * 根据角色ID查询菜单树信息 - * + * * @param roleId 角色ID * @return 选中菜单列表 */ @@ -56,7 +56,7 @@ public interface ISysMenuService /** * 构建前端路由所需要的菜单 - * + * * @param menus 菜单列表 * @return 路由列表 */ @@ -64,7 +64,7 @@ public interface ISysMenuService /** * 构建前端所需要树结构 - * + * * @param menus 菜单列表 * @return 树结构列表 */ @@ -72,7 +72,7 @@ public interface ISysMenuService /** * 构建前端所需要下拉树结构 - * + * * @param menus 菜单列表 * @return 下拉树结构列表 */ @@ -80,7 +80,7 @@ public interface ISysMenuService /** * 根据菜单ID查询信息 - * + * * @param menuId 菜单ID * @return 菜单信息 */ @@ -88,7 +88,7 @@ public interface ISysMenuService /** * 是否存在菜单子节点 - * + * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ @@ -96,7 +96,7 @@ public interface ISysMenuService /** * 查询菜单是否存在角色 - * + * * @param menuId 菜单ID * @return 结果 true 存在 false 不存在 */ @@ -104,7 +104,7 @@ public interface ISysMenuService /** * 新增保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @@ -112,7 +112,7 @@ public interface ISysMenuService /** * 修改保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @@ -120,7 +120,7 @@ public interface ISysMenuService /** * 删除菜单管理信息 - * + * * @param menuId 菜单ID * @return 结果 */ @@ -128,7 +128,7 @@ public interface ISysMenuService /** * 校验菜单名称是否唯一 - * + * * @param menu 菜单信息 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java index 47ce1b71..6ae35629 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -1,18 +1,18 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.SysNotice; /** * 公告 服务层 - * + * * @author ruoyi */ -public interface ISysNoticeService -{ +public interface ISysNoticeService { /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ @@ -20,7 +20,7 @@ public interface ISysNoticeService /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ @@ -28,7 +28,7 @@ public interface ISysNoticeService /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -36,7 +36,7 @@ public interface ISysNoticeService /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -44,15 +44,15 @@ public interface ISysNoticeService /** * 删除公告信息 - * + * * @param noticeId 公告ID * @return 结果 */ public int deleteNoticeById(Long noticeId); - + /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java index 4fd8e5a8..f9b55283 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java @@ -1,25 +1,25 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.SysOperLog; /** * 操作日志 服务层 - * + * * @author ruoyi */ -public interface ISysOperLogService -{ +public interface ISysOperLogService { /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ public void insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ @@ -27,7 +27,7 @@ public interface ISysOperLogService /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ @@ -35,7 +35,7 @@ public interface ISysOperLogService /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java index aab216d8..e251d503 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java @@ -1,18 +1,18 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.system.domain.SysPost; /** * 岗位信息 服务层 - * + * * @author ruoyi */ -public interface ISysPostService -{ +public interface ISysPostService { /** * 查询岗位信息集合 - * + * * @param post 岗位信息 * @return 岗位列表 */ @@ -20,14 +20,14 @@ public interface ISysPostService /** * 查询所有岗位 - * + * * @return 岗位列表 */ public List selectPostAll(); /** * 通过岗位ID查询岗位信息 - * + * * @param postId 岗位ID * @return 角色对象信息 */ @@ -35,7 +35,7 @@ public interface ISysPostService /** * 根据用户ID获取岗位选择框列表 - * + * * @param userId 用户ID * @return 选中岗位ID列表 */ @@ -43,7 +43,7 @@ public interface ISysPostService /** * 校验岗位名称 - * + * * @param post 岗位信息 * @return 结果 */ @@ -51,7 +51,7 @@ public interface ISysPostService /** * 校验岗位编码 - * + * * @param post 岗位信息 * @return 结果 */ @@ -59,7 +59,7 @@ public interface ISysPostService /** * 通过岗位ID查询岗位使用数量 - * + * * @param postId 岗位ID * @return 结果 */ @@ -67,7 +67,7 @@ public interface ISysPostService /** * 删除岗位信息 - * + * * @param postId 岗位ID * @return 结果 */ @@ -75,7 +75,7 @@ public interface ISysPostService /** * 批量删除岗位信息 - * + * * @param postIds 需要删除的岗位ID * @return 结果 * @throws Exception 异常 @@ -84,7 +84,7 @@ public interface ISysPostService /** * 新增保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ @@ -92,7 +92,7 @@ public interface ISysPostService /** * 修改保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java index 070a5cee..2cb3871c 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java @@ -2,18 +2,18 @@ package com.ruoyi.system.service; import java.util.List; import java.util.Set; + import com.ruoyi.common.core.domain.entity.SysRole; /** * 角色业务层 - * + * * @author ruoyi */ -public interface ISysRoleService -{ +public interface ISysRoleService { /** * 根据条件分页查询角色数据 - * + * * @param role 角色信息 * @return 角色数据集合信息 */ @@ -21,7 +21,7 @@ public interface ISysRoleService /** * 根据用户ID查询角色 - * + * * @param userId 用户ID * @return 权限列表 */ @@ -29,14 +29,14 @@ public interface ISysRoleService /** * 查询所有角色 - * + * * @return 角色列表 */ public List selectRoleAll(); /** * 根据用户ID获取角色选择框列表 - * + * * @param userId 用户ID * @return 选中角色ID列表 */ @@ -44,7 +44,7 @@ public interface ISysRoleService /** * 通过角色ID查询角色 - * + * * @param roleId 角色ID * @return 角色对象信息 */ @@ -52,7 +52,7 @@ public interface ISysRoleService /** * 校验角色名称是否唯一 - * + * * @param role 角色信息 * @return 结果 */ @@ -60,7 +60,7 @@ public interface ISysRoleService /** * 校验角色权限是否唯一 - * + * * @param role 角色信息 * @return 结果 */ @@ -68,14 +68,14 @@ public interface ISysRoleService /** * 校验角色是否允许操作 - * + * * @param role 角色信息 */ public void checkRoleAllowed(SysRole role); /** * 通过角色ID查询角色使用数量 - * + * * @param roleId 角色ID * @return 结果 */ @@ -83,7 +83,7 @@ public interface ISysRoleService /** * 新增保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ @@ -91,7 +91,7 @@ public interface ISysRoleService /** * 修改保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ @@ -99,7 +99,7 @@ public interface ISysRoleService /** * 修改角色状态 - * + * * @param role 角色信息 * @return 结果 */ @@ -107,7 +107,7 @@ public interface ISysRoleService /** * 修改数据权限信息 - * + * * @param role 角色信息 * @return 结果 */ @@ -115,7 +115,7 @@ public interface ISysRoleService /** * 通过角色ID删除角色 - * + * * @param roleId 角色ID * @return 结果 */ @@ -123,7 +123,7 @@ public interface ISysRoleService /** * 批量删除角色信息 - * + * * @param roleIds 需要删除的角色ID * @return 结果 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java index 8eb5448c..4e006497 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java @@ -5,42 +5,41 @@ import com.ruoyi.system.domain.SysUserOnline; /** * 在线用户 服务层 - * + * * @author ruoyi */ -public interface ISysUserOnlineService -{ +public interface ISysUserOnlineService { /** * 通过登录地址查询信息 - * + * * @param ipaddr 登录地址 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); /** * 通过用户名称查询信息 - * + * * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); /** * 通过登录地址/用户名称查询信息 - * - * @param ipaddr 登录地址 + * + * @param ipaddr 登录地址 * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); /** * 设置在线用户信息 - * + * * @param user 用户信息 * @return 在线用户 */ diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index ea0333b5..c3643f56 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -1,18 +1,18 @@ package com.ruoyi.system.service; import java.util.List; + import com.ruoyi.common.core.domain.entity.SysUser; /** * 用户 业务层 - * + * * @author ruoyi */ -public interface ISysUserService -{ +public interface ISysUserService { /** * 根据条件分页查询用户列表 - * + * * @param user 用户信息 * @return 用户信息集合信息 */ @@ -20,15 +20,17 @@ public interface ISysUserService /** * 通过用户名查询用户 - * + * * @param userName 用户名 * @return 用户对象信息 */ public SysUser selectUserByUserName(String userName); + public SysUser selectUserByOpenId(String openId); + /** * 通过用户ID查询用户 - * + * * @param userId 用户ID * @return 用户对象信息 */ @@ -36,7 +38,7 @@ public interface ISysUserService /** * 根据用户ID查询用户所属角色组 - * + * * @param userName 用户名 * @return 结果 */ @@ -44,7 +46,7 @@ public interface ISysUserService /** * 根据用户ID查询用户所属岗位组 - * + * * @param userName 用户名 * @return 结果 */ @@ -52,7 +54,7 @@ public interface ISysUserService /** * 校验用户名称是否唯一 - * + * * @param userName 用户名称 * @return 结果 */ @@ -76,14 +78,14 @@ public interface ISysUserService /** * 校验用户是否允许操作 - * + * * @param user 用户信息 */ public void checkUserAllowed(SysUser user); /** * 新增用户信息 - * + * * @param user 用户信息 * @return 结果 */ @@ -91,7 +93,7 @@ public interface ISysUserService /** * 修改用户信息 - * + * * @param user 用户信息 * @return 结果 */ @@ -99,7 +101,7 @@ public interface ISysUserService /** * 修改用户状态 - * + * * @param user 用户信息 * @return 结果 */ @@ -107,7 +109,7 @@ public interface ISysUserService /** * 修改用户基本信息 - * + * * @param user 用户信息 * @return 结果 */ @@ -115,16 +117,16 @@ public interface ISysUserService /** * 修改用户头像 - * + * * @param userName 用户名 - * @param avatar 头像地址 + * @param avatar 头像地址 * @return 结果 */ public boolean updateUserAvatar(String userName, String avatar); /** * 重置用户密码 - * + * * @param user 用户信息 * @return 结果 */ @@ -132,7 +134,7 @@ public interface ISysUserService /** * 重置用户密码 - * + * * @param userName 用户名 * @param password 密码 * @return 结果 @@ -141,7 +143,7 @@ public interface ISysUserService /** * 通过用户ID删除用户 - * + * * @param userId 用户ID * @return 结果 */ @@ -149,7 +151,7 @@ public interface ISysUserService /** * 批量删除用户信息 - * + * * @param userIds 需要删除的用户ID * @return 结果 */ @@ -157,10 +159,10 @@ public interface ISysUserService /** * 导入用户数据 - * - * @param userList 用户数据列表 + * + * @param userList 用户数据列表 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 - * @param operName 操作用户 + * @param operName 操作用户 * @return 结果 */ public String importUser(List userList, Boolean isUpdateSupport, String operName); diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserAccountInfoService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserAccountInfoService.java new file mode 100644 index 00000000..d63efa1b --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserAccountInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; + +import com.ruoyi.system.domain.TUserAccountInfo; + +/** + * 小程序用户Service接口 + * + * @author wxy + * @date 2021-08-26 + */ +public interface ITUserAccountInfoService { + /** + * 查询小程序用户 + * + * @param id 小程序用户ID + * @return 小程序用户 + */ + public TUserAccountInfo selectTUserAccountInfoById(Long id); + + /** + * 查询小程序用户列表 + * + * @param tUserAccountInfo 小程序用户 + * @return 小程序用户集合 + */ + public List selectTUserAccountInfoList(TUserAccountInfo tUserAccountInfo); + + /** + * 新增小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + public int insertTUserAccountInfo(TUserAccountInfo tUserAccountInfo); + + /** + * 修改小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + public int updateTUserAccountInfo(TUserAccountInfo tUserAccountInfo); + + /** + * 批量删除小程序用户 + * + * @param ids 需要删除的小程序用户ID + * @return 结果 + */ + public int deleteTUserAccountInfoByIds(Long[] ids); + + /** + * 删除小程序用户信息 + * + * @param id 小程序用户ID + * @return 结果 + */ + public int deleteTUserAccountInfoById(Long id); +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserLoginLogService.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserLoginLogService.java new file mode 100644 index 00000000..8030a1ec --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/ITUserLoginLogService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; + +import com.ruoyi.system.domain.TUserLoginLog; + +/** + * 【请填写功能名称】Service接口 + * + * @author wxy + * @date 2021-08-26 + */ +public interface ITUserLoginLogService { + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + public TUserLoginLog selectTUserLoginLogById(Long id); + + /** + * 查询【请填写功能名称】列表 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectTUserLoginLogList(TUserLoginLog tUserLoginLog); + + /** + * 新增【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + public int insertTUserLoginLog(TUserLoginLog tUserLoginLog); + + /** + * 修改【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + public int updateTUserLoginLog(TUserLoginLog tUserLoginLog); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】ID + * @return 结果 + */ + public int deleteTUserLoginLogByIds(Long[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + public int deleteTUserLoginLogById(Long id); +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotCategoryServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotCategoryServiceImpl.java index abc3f490..eb023664 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotCategoryServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotCategoryServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,87 +11,80 @@ import com.ruoyi.system.service.IIotCategoryService; /** * 设备分类Service业务层处理 - * + * * @author kerwincui * @date 2021-05-07 */ @Service -public class IotCategoryServiceImpl implements IIotCategoryService -{ +public class IotCategoryServiceImpl implements IIotCategoryService { @Autowired private IotCategoryMapper iotCategoryMapper; /** * 查询设备分类 - * + * * @param categoryId 设备分类ID * @return 设备分类 */ @Override - public IotCategory selectIotCategoryById(Long categoryId) - { + public IotCategory selectIotCategoryById(Long categoryId) { return iotCategoryMapper.selectIotCategoryById(categoryId); } /** * 查询设备分类列表 - * + * * @param iotCategory 设备分类 * @return 设备分类 */ @Override - public List selectIotCategoryList(IotCategory iotCategory) - { + public List selectIotCategoryList(IotCategory iotCategory) { return iotCategoryMapper.selectIotCategoryList(iotCategory); } /** * 新增设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @Override - public int insertIotCategory(IotCategory iotCategory) - { + public int insertIotCategory(IotCategory iotCategory) { iotCategory.setCreateTime(DateUtils.getNowDate()); return iotCategoryMapper.insertIotCategory(iotCategory); } /** * 修改设备分类 - * + * * @param iotCategory 设备分类 * @return 结果 */ @Override - public int updateIotCategory(IotCategory iotCategory) - { + public int updateIotCategory(IotCategory iotCategory) { iotCategory.setUpdateTime(DateUtils.getNowDate()); return iotCategoryMapper.updateIotCategory(iotCategory); } /** * 批量删除设备分类 - * + * * @param categoryIds 需要删除的设备分类ID * @return 结果 */ @Override - public int deleteIotCategoryByIds(Long[] categoryIds) - { + public int deleteIotCategoryByIds(Long[] categoryIds) { return iotCategoryMapper.deleteIotCategoryByIds(categoryIds); } /** * 删除设备分类信息 - * + * * @param categoryId 设备分类ID * @return 结果 */ @Override - public int deleteIotCategoryById(Long categoryId) - { + public int deleteIotCategoryById(Long categoryId) { return iotCategoryMapper.deleteIotCategoryById(categoryId); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceServiceImpl.java index d565daa1..cf7c6a35 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceServiceImpl.java @@ -1,35 +1,56 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.CustomException; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.vo.IotDeviceListDto; +import com.ruoyi.system.mqtt.config.MqttPushClient; +import com.ruoyi.system.service.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.IotDeviceMapper; -import com.ruoyi.system.domain.IotDevice; -import com.ruoyi.system.service.IIotDeviceService; +import org.springframework.transaction.annotation.Transactional; /** * 设备Service业务层处理 - * + * * @author kerwincui * @date 2021-05-06 */ @Service -public class IotDeviceServiceImpl implements IIotDeviceService -{ +@Slf4j +public class IotDeviceServiceImpl implements IIotDeviceService { @Autowired private IotDeviceMapper iotDeviceMapper; + @Autowired + private MqttPushClient pushClient; + + @Autowired + private ITUserAccountInfoService userAccountInfoService; + + @Autowired + private IIotDeviceUserRelationService deviceUserRelationService; + + @Autowired + private IIotDeviceSetService iotDeviceSetService; + @Autowired + private IIotDeviceStatusService iotDeviceStatusService; + /** * 查询设备 - * + * * @param deviceId 设备ID * @return 设备 */ @Override - public IotDevice selectIotDeviceById(Long deviceId) - { + public IotDevice selectIotDeviceById(Long deviceId) { return iotDeviceMapper.selectIotDeviceById(deviceId); } @@ -40,70 +61,276 @@ public class IotDeviceServiceImpl implements IIotDeviceService * @return 设备 */ @Override - public IotDevice selectIotDeviceByNum(String deviceNum) - { + public IotDevice selectIotDeviceByNum(String deviceNum) { return iotDeviceMapper.selectIotDeviceByNum(deviceNum); } /** * 查询设备列表 - * + * * @param iotDevice 设备 * @return 设备 */ @Override - public List selectIotDeviceList(IotDevice iotDevice) - { + public List selectIotDeviceList(IotDevice iotDevice) { return iotDeviceMapper.selectIotDeviceList(iotDevice); } /** * 新增设备 - * + * * @param iotDevice 设备 * @return 结果 */ @Override - public int insertIotDevice(IotDevice iotDevice) - { + public int insertIotDevice(IotDevice iotDevice) { iotDevice.setCreateTime(DateUtils.getNowDate()); return iotDeviceMapper.insertIotDevice(iotDevice); } /** * 修改设备 - * + * * @param iotDevice 设备 * @return 结果 */ @Override - public int updateIotDevice(IotDevice iotDevice) - { + public int updateIotDevice(IotDevice iotDevice) { iotDevice.setUpdateTime(DateUtils.getNowDate()); return iotDeviceMapper.updateIotDevice(iotDevice); } /** * 批量删除设备 - * + * * @param deviceIds 需要删除的设备ID * @return 结果 */ @Override - public int deleteIotDeviceByIds(Long[] deviceIds) - { + public int deleteIotDeviceByIds(Long[] deviceIds) { return iotDeviceMapper.deleteIotDeviceByIds(deviceIds); } /** * 删除设备信息 - * + * * @param deviceId 设备ID * @return 结果 */ @Override - public int deleteIotDeviceById(Long deviceId) - { + public int deleteIotDeviceById(Long deviceId) { return iotDeviceMapper.deleteIotDeviceById(deviceId); } + + @Override + public int controlDeviceByNum(String deviceNum, String cmd) { + IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByNum(deviceNum); + if(iotDevice==null) + { + throw new CustomException("设备不存在"); + } + Long deviceId = iotDevice.getDeviceId(); + + + +// IotDeviceStatus status = iotDeviceStatusService.selectIotDeviceStatusByDeviceId(iotDeviceSet.getDeviceId()); +// if (status == null || status.getIsOnline() == 0) { +// return AjaxResult.error("设备已离线,不能更新状态。"); +// } +// // 存储 +// iotDeviceSetService.updateIotDeviceSet(iotDeviceSet); +// +// //mqtt发布 +// IotDeviceSet set = iotDeviceSetService.selectIotDeviceSetByDeviceId(iotDeviceSet.getDeviceId()); +// if (iotDeviceSet.getIsRadar() != null) { +// set.setIsRadar(iotDeviceSet.getIsRadar()); +// } +// if (iotDeviceSet.getIsAlarm() != null) { +// set.setIsAlarm(iotDeviceSet.getIsAlarm()); +// } +// if (iotDeviceSet.getRadarInterval() != null) { +// set.setRadarInterval(iotDeviceSet.getRadarInterval()); +// } +// if (iotDeviceSet.getIsRfControl() != null) { +// set.setIsRfControl(iotDeviceSet.getIsRfControl()); +// } +// if (iotDeviceSet.getRfOneFunc() != null) { +// set.setRfOneFunc(iotDeviceSet.getRfOneFunc()); +// } +// if (iotDeviceSet.getRfTwoFunc() != null) { +// set.setRfTwoFunc(iotDeviceSet.getRfTwoFunc()); +// } +// if (iotDeviceSet.getRfThreeFunc() != null) { +// set.setRfThreeFunc(iotDeviceSet.getRfThreeFunc()); +// } +// if (iotDeviceSet.getRfFourFunc() != null) { +// set.setRfFourFunc(iotDeviceSet.getRfFourFunc()); +// } +// if (iotDeviceSet.getIsRfLearn() != null) { +// set.setIsRfLearn(iotDeviceSet.getIsRfLearn()); +// } +// if (iotDeviceSet.getIsRfClear() != null) { +// set.setIsRfClear(iotDeviceSet.getIsRfClear()); +// } +// if (iotDeviceSet.getIsAp() != null) { +// set.setIsAp(iotDeviceSet.getIsAp()); +// } +// if (iotDeviceSet.getIsReset() != null) { +// set.setIsReset(iotDeviceSet.getIsReset()); +// } +// String content = JSON.toJSONString(set); + +// String topic = "xiaoyi/swtich/devices/"+deviceNum; + IotDeviceStatus iotDeviceStatus = new IotDeviceStatus(); + iotDeviceStatus.setDeviceId(deviceId); + if("on".equalsIgnoreCase(cmd)) + { + iotDeviceStatus.setRelayStatus(1); + }else{ + iotDeviceStatus.setRelayStatus(0); + } + + String topic = "status/set/" + deviceNum; + String content = JSON.toJSONString(iotDeviceStatus); +// content="{\"deviceId\":\"4\",\"params\":{},\"relayStatus\":\"1\"}"; + System.out.println("topic:"+topic); + System.out.println("content:"+content); + boolean publish = pushClient.publish(2, true, topic, content); + if(publish) + { + return 1; + }else{ + throw new CustomException("指令发送失败"); + } + } + + /** + * @Method + * @Description 用户添加设备 + * @Param null + * @return + * @date 2021-08-27,0027 11:33 + * @author admin + * + */ + @Override + @Transactional + public int bindDevice(Long userId,String nickName, String deviceNum, String name, Long categoryId, String remark) { + IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByNum(deviceNum); + if(iotDevice==null) + { + throw new CustomException("设备【"+deviceNum+"】不存在"); + } + + Long deviceId = iotDevice.getDeviceId(); + IotDeviceUserRelation iotDeviceUserRelation = deviceUserRelationService.selectIotDeviceUserRelationByDeviceIdAndUserId(deviceId, userId); + + if(iotDeviceUserRelation!=null) + { + throw new CustomException("该设备已被绑定!"); +// throw new CustomException("设备【"+deviceNum+"】已经绑定,请换其他设备!"); + } + + log.info("用户: "+nickName+",添加设备【"+deviceNum+"】,名称为:"+name); +// iotDevice.setDeviceName(name); + iotDevice.setRemark(remark); + if("未激活".equals(iotDevice.getStatus())) + { + throw new CustomException("该设备未激活不能绑定!"); + } + iotDeviceMapper.updateIotDevice(iotDevice); + + //保存设备用户关联 + IotDeviceUserRelation iotDeviceUserRelation1 = new IotDeviceUserRelation(); + iotDeviceUserRelation1.setDeviceId(deviceId); + iotDeviceUserRelation1.setDeviceNum(deviceNum); + iotDeviceUserRelation1.setUserId(userId); + iotDeviceUserRelation1.setDeviceName(name); + return deviceUserRelationService.insertIotDeviceUserRelation(iotDeviceUserRelation1); + } + + @Override + public List selectMpIotDeviceList(IotDevice iotDevice) { + return iotDeviceMapper.selectMpIotDeviceList(iotDevice); + } + + @Override + @Transactional + public int updateDeviceInfo(Long userId, String nickName, Long deviceId, String name, String remark) { + IotDevice iotDevice = iotDeviceMapper.selectIotDeviceById(deviceId); + if(iotDevice==null) + { + throw new CustomException("设备不存在"); + } + + IotDeviceUserRelation iotDeviceUserRelation = deviceUserRelationService.selectIotDeviceUserRelationByDeviceIdAndUserId(deviceId, userId); + + if(iotDeviceUserRelation==null) + { + throw new CustomException("设备不存在!"); + } + String deviceNum=iotDevice.getDeviceNum(); + log.info("用户: "+nickName+",修改设备【"+deviceNum+"】名称为:"+name); + +// iotDeviceMapper.updateIotDevice(iotDevice); + + //保存设备用户关联 + IotDeviceUserRelation iotDeviceUserRelation1 = new IotDeviceUserRelation(); + iotDeviceUserRelation1.setId(iotDeviceUserRelation.getId()); + iotDeviceUserRelation1.setDeviceId(deviceId); + iotDeviceUserRelation1.setDeviceNum(deviceNum); + iotDeviceUserRelation1.setUserId(userId); + iotDeviceUserRelation1.setDeviceName(name); + iotDeviceUserRelation1.setRemark(remark); + return deviceUserRelationService.updateIotDeviceUserRelation(iotDeviceUserRelation1); + } + + @Override + public IotDevice selectIotDeviceByUserAndNum(Long userId, String deviceNum) { + IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByNum(deviceNum); + if(iotDevice==null) + { + throw new CustomException("设备不存在"); + } + Long deviceId = iotDevice.getDeviceId(); + IotDeviceUserRelation iotDeviceUserRelation = deviceUserRelationService.selectIotDeviceUserRelationByDeviceIdAndUserId(deviceId, userId); + + if(iotDeviceUserRelation==null) + { + throw new CustomException("设备不存在!"); + } + iotDevice.setDeviceName(iotDeviceUserRelation.getDeviceName()); + iotDevice.setRemark(iotDeviceUserRelation.getRemark()); + return iotDevice; + } + + @Override + public int unBindDevice(Long userId, String nickName, Long deviceId) { + IotDevice iotDevice = iotDeviceMapper.selectIotDeviceById(deviceId); + if(iotDevice==null) + { + throw new CustomException("设备不存在"); + } + + IotDeviceUserRelation iotDeviceUserRelation = deviceUserRelationService.selectIotDeviceUserRelationByDeviceIdAndUserId(deviceId, userId); + + if(iotDeviceUserRelation==null) + { + throw new CustomException("设备不存在,或已解绑!"); + } + String deviceNum = iotDevice.getDeviceNum(); + log.info("用户: "+nickName+",解绑设备【"+deviceNum+"】"); + + return deviceUserRelationService.deleteIotDeviceUserRelationById(iotDeviceUserRelation.getId()); + } + + @Override + public JSONObject getDeviceInfoByDeviceNum(Long userId, String nickname,String deviceNum) { + return iotDeviceMapper.getDeviceInfoByDeviceNum(userId,deviceNum); + } + + @Override + public JSONObject getDeviceInfoByDeviceId(Long userId, String nickname,Long deviceId) { + return iotDeviceMapper.getDeviceInfoByDeviceId(userId,deviceId); + } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceSetServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceSetServiceImpl.java index 391f9985..4b730a35 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceSetServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceSetServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,25 +11,23 @@ import com.ruoyi.system.service.IIotDeviceSetService; /** * 设备配置Service业务层处理 - * + * * @author kerwincui * @date 2021-05-06 */ @Service -public class IotDeviceSetServiceImpl implements IIotDeviceSetService -{ +public class IotDeviceSetServiceImpl implements IIotDeviceSetService { @Autowired private IotDeviceSetMapper iotDeviceSetMapper; /** * 查询设备配置 - * + * * @param deviceConfigId 设备配置ID * @return 设备配置 */ @Override - public IotDeviceSet selectIotDeviceSetById(Long deviceSetId) - { + public IotDeviceSet selectIotDeviceSetById(Long deviceSetId) { return iotDeviceSetMapper.selectIotDeviceSetById(deviceSetId); } @@ -39,70 +38,64 @@ public class IotDeviceSetServiceImpl implements IIotDeviceSetService * @return 设备配置 */ @Override - public IotDeviceSet selectIotDeviceSetByDeviceId(Long deviceId) - { + public IotDeviceSet selectIotDeviceSetByDeviceId(Long deviceId) { return iotDeviceSetMapper.selectIotDeviceSetByDeviceId(deviceId); } /** * 查询设备配置列表 - * + * * @param iotDeviceSet 设备配置 * @return 设备配置 */ @Override - public List selectIotDeviceSetList(IotDeviceSet iotDeviceSet) - { + public List selectIotDeviceSetList(IotDeviceSet iotDeviceSet) { return iotDeviceSetMapper.selectIotDeviceSetList(iotDeviceSet); } /** * 新增设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @Override - public int insertIotDeviceSet(IotDeviceSet iotDeviceSet) - { + public int insertIotDeviceSet(IotDeviceSet iotDeviceSet) { iotDeviceSet.setCreateTime(DateUtils.getNowDate()); return iotDeviceSetMapper.insertIotDeviceSet(iotDeviceSet); } /** * 修改设备配置 - * + * * @param iotDeviceSet 设备配置 * @return 结果 */ @Override - public int updateIotDeviceSet(IotDeviceSet iotDeviceSet) - { + public int updateIotDeviceSet(IotDeviceSet iotDeviceSet) { iotDeviceSet.setUpdateTime(DateUtils.getNowDate()); return iotDeviceSetMapper.updateIotDeviceSet(iotDeviceSet); } /** * 批量删除设备配置 - * + * * @param deviceConfigIds 需要删除的设备配置ID * @return 结果 */ @Override - public int deleteIotDeviceSetByIds(Long[] deviceConfigIds) - { + public int deleteIotDeviceSetByIds(Long[] deviceConfigIds) { return iotDeviceSetMapper.deleteIotDeviceSetByIds(deviceConfigIds); } /** * 删除设备配置信息 - * + * * @param deviceConfigId 设备配置ID * @return 结果 */ @Override - public int deleteIotDeviceSetById(Long deviceConfigId) - { + public int deleteIotDeviceSetById(Long deviceConfigId) { return iotDeviceSetMapper.deleteIotDeviceSetById(deviceConfigId); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceStatusServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceStatusServiceImpl.java index 1fb94517..38c46733 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceStatusServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceStatusServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,25 +11,23 @@ import com.ruoyi.system.service.IIotDeviceStatusService; /** * 设备状态Service业务层处理 - * + * * @author kerwincui * @date 2021-05-06 */ @Service -public class IotDeviceStatusServiceImpl implements IIotDeviceStatusService -{ +public class IotDeviceStatusServiceImpl implements IIotDeviceStatusService { @Autowired private IotDeviceStatusMapper iotDeviceStatusMapper; /** * 查询设备状态 - * + * * @param deviceStatusId 设备状态ID * @return 设备状态 */ @Override - public IotDeviceStatus selectIotDeviceStatusById(Long deviceStatusId) - { + public IotDeviceStatus selectIotDeviceStatusById(Long deviceStatusId) { return iotDeviceStatusMapper.selectIotDeviceStatusById(deviceStatusId); } @@ -39,8 +38,7 @@ public class IotDeviceStatusServiceImpl implements IIotDeviceStatusService * @return 设备状态 */ @Override - public IotDeviceStatus selectIotDeviceStatusByDeviceId(Long deviceId) - { + public IotDeviceStatus selectIotDeviceStatusByDeviceId(Long deviceId) { return iotDeviceStatusMapper.selectIotDeviceStatusByDeviceId(deviceId); } @@ -51,70 +49,64 @@ public class IotDeviceStatusServiceImpl implements IIotDeviceStatusService * @return 设备状态 */ @Override - public IotDeviceStatus selectIotDeviceStatusByDeviceNum(String deviceNum) - { + public IotDeviceStatus selectIotDeviceStatusByDeviceNum(String deviceNum) { return iotDeviceStatusMapper.selectIotDeviceStatusByDeviceNum(deviceNum); } /** * 查询设备状态列表 - * + * * @param iotDeviceStatus 设备状态 * @return 设备状态 */ @Override - public List selectIotDeviceStatusList(IotDeviceStatus iotDeviceStatus) - { + public List selectIotDeviceStatusList(IotDeviceStatus iotDeviceStatus) { return iotDeviceStatusMapper.selectIotDeviceStatusList(iotDeviceStatus); } /** * 新增设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @Override - public int insertIotDeviceStatus(IotDeviceStatus iotDeviceStatus) - { + public int insertIotDeviceStatus(IotDeviceStatus iotDeviceStatus) { iotDeviceStatus.setCreateTime(DateUtils.getNowDate()); return iotDeviceStatusMapper.insertIotDeviceStatus(iotDeviceStatus); } /** * 修改设备状态 - * + * * @param iotDeviceStatus 设备状态 * @return 结果 */ @Override - public int updateIotDeviceStatus(IotDeviceStatus iotDeviceStatus) - { + public int updateIotDeviceStatus(IotDeviceStatus iotDeviceStatus) { iotDeviceStatus.setUpdateTime(DateUtils.getNowDate()); return iotDeviceStatusMapper.updateIotDeviceStatus(iotDeviceStatus); } /** * 批量删除设备状态 - * + * * @param deviceStatusIds 需要删除的设备状态ID * @return 结果 */ @Override - public int deleteIotDeviceStatusByIds(Long[] deviceStatusIds) - { + public int deleteIotDeviceStatusByIds(Long[] deviceStatusIds) { return iotDeviceStatusMapper.deleteIotDeviceStatusByIds(deviceStatusIds); } /** * 删除设备状态信息 - * + * * @param deviceStatusId 设备状态ID * @return 结果 */ @Override - public int deleteIotDeviceStatusById(Long deviceStatusId) - { + public int deleteIotDeviceStatusById(Long deviceStatusId) { return iotDeviceStatusMapper.deleteIotDeviceStatusById(deviceStatusId); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceUserRelationServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceUserRelationServiceImpl.java new file mode 100644 index 00000000..aa56076f --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotDeviceUserRelationServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.ruoyi.system.mapper.IotDeviceUserRelationMapper; +import com.ruoyi.system.domain.IotDeviceUserRelation; +import com.ruoyi.system.service.IIotDeviceUserRelationService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author wxy + * @date 2021-08-27 + */ +@Service +public class IotDeviceUserRelationServiceImpl implements IIotDeviceUserRelationService { + @Autowired + private IotDeviceUserRelationMapper iotDeviceUserRelationMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + @Override + public IotDeviceUserRelation selectIotDeviceUserRelationById(Long id) { + return iotDeviceUserRelationMapper.selectIotDeviceUserRelationById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectIotDeviceUserRelationList(IotDeviceUserRelation iotDeviceUserRelation) { + return iotDeviceUserRelationMapper.selectIotDeviceUserRelationList(iotDeviceUserRelation); + } + + /** + * 新增【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation) { + return iotDeviceUserRelationMapper.insertIotDeviceUserRelation(iotDeviceUserRelation); + } + + /** + * 修改【请填写功能名称】 + * + * @param iotDeviceUserRelation 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateIotDeviceUserRelation(IotDeviceUserRelation iotDeviceUserRelation) { + return iotDeviceUserRelationMapper.updateIotDeviceUserRelation(iotDeviceUserRelation); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】ID + * @return 结果 + */ + @Override + public int deleteIotDeviceUserRelationByIds(Long[] ids) { + return iotDeviceUserRelationMapper.deleteIotDeviceUserRelationByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + @Override + public int deleteIotDeviceUserRelationById(Long id) { + return iotDeviceUserRelationMapper.deleteIotDeviceUserRelationById(id); + } + + @Override + public List selectIotDeviceUserRelationByDeviceId(Long deviceId) { + IotDeviceUserRelation iotDeviceUserRelation = new IotDeviceUserRelation(); + iotDeviceUserRelation.setDeviceId(deviceId); + return iotDeviceUserRelationMapper.selectIotDeviceUserRelationList(iotDeviceUserRelation); + } + + @Override + public List selectIotDeviceUserRelationByUserId(Long userId) { + IotDeviceUserRelation iotDeviceUserRelation = new IotDeviceUserRelation(); + iotDeviceUserRelation.setUserId(userId); + return iotDeviceUserRelationMapper.selectIotDeviceUserRelationList(iotDeviceUserRelation); + } + + @Override + public IotDeviceUserRelation selectIotDeviceUserRelationByDeviceIdAndUserId(Long deviceId, Long userId) { + IotDeviceUserRelation iotDeviceUserRelation = new IotDeviceUserRelation(); + iotDeviceUserRelation.setUserId(userId); + List iotDeviceUserRelations = iotDeviceUserRelationMapper.selectIotDeviceUserRelationList(iotDeviceUserRelation); + if(iotDeviceUserRelations==null || iotDeviceUserRelations.size()==0) + { + return null; + } + return iotDeviceUserRelations.get(0); + } + +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotGroupServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotGroupServiceImpl.java index 35c0cd93..53457361 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotGroupServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IotGroupServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,87 +11,80 @@ import com.ruoyi.system.service.IIotGroupService; /** * 分组Service业务层处理 - * + * * @author kerwincui * @date 2021-05-18 */ @Service -public class IotGroupServiceImpl implements IIotGroupService -{ +public class IotGroupServiceImpl implements IIotGroupService { @Autowired private IotGroupMapper iotGroupMapper; /** * 查询分组 - * + * * @param groupId 分组ID * @return 分组 */ @Override - public IotGroup selectIotGroupById(Long groupId) - { + public IotGroup selectIotGroupById(Long groupId) { return iotGroupMapper.selectIotGroupById(groupId); } /** * 查询分组列表 - * + * * @param iotGroup 分组 * @return 分组 */ @Override - public List selectIotGroupList(IotGroup iotGroup) - { + public List selectIotGroupList(IotGroup iotGroup) { return iotGroupMapper.selectIotGroupList(iotGroup); } /** * 新增分组 - * + * * @param iotGroup 分组 * @return 结果 */ @Override - public int insertIotGroup(IotGroup iotGroup) - { + public int insertIotGroup(IotGroup iotGroup) { iotGroup.setCreateTime(DateUtils.getNowDate()); return iotGroupMapper.insertIotGroup(iotGroup); } /** * 修改分组 - * + * * @param iotGroup 分组 * @return 结果 */ @Override - public int updateIotGroup(IotGroup iotGroup) - { + public int updateIotGroup(IotGroup iotGroup) { iotGroup.setUpdateTime(DateUtils.getNowDate()); return iotGroupMapper.updateIotGroup(iotGroup); } /** * 批量删除分组 - * + * * @param groupIds 需要删除的分组ID * @return 结果 */ @Override - public int deleteIotGroupByIds(Long[] groupIds) - { + public int deleteIotGroupByIds(Long[] groupIds) { return iotGroupMapper.deleteIotGroupByIds(groupIds); } /** * 删除分组信息 - * + * * @param groupId 分组ID * @return 结果 */ @Override - public int deleteIotGroupById(Long groupId) - { + public int deleteIotGroupById(Long groupId) { return iotGroupMapper.deleteIotGroupById(groupId); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index 9cd51de0..ca88e985 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; import java.util.Collection; import java.util.List; import javax.annotation.PostConstruct; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.annotation.DataSource; @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysConfigService; /** * 参数配置 服务层实现 - * + * * @author ruoyi */ @Service -public class SysConfigServiceImpl implements ISysConfigService -{ +public class SysConfigServiceImpl implements ISysConfigService { @Autowired private SysConfigMapper configMapper; @@ -35,25 +35,22 @@ public class SysConfigServiceImpl implements ISysConfigService * 项目启动时,初始化参数到缓存 */ @PostConstruct - public void init() - { + public void init() { List configsList = configMapper.selectConfigList(new SysConfig()); - for (SysConfig config : configsList) - { + for (SysConfig config : configsList) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } } /** * 查询参数配置信息 - * + * * @param configId 参数配置ID * @return 参数配置信息 */ @Override @DataSource(DataSourceType.MASTER) - public SysConfig selectConfigById(Long configId) - { + public SysConfig selectConfigById(Long configId) { SysConfig config = new SysConfig(); config.setConfigId(configId); return configMapper.selectConfig(config); @@ -61,23 +58,20 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数key * @return 参数键值 */ @Override - public String selectConfigByKey(String configKey) - { + public String selectConfigByKey(String configKey) { String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); - if (StringUtils.isNotEmpty(configValue)) - { + if (StringUtils.isNotEmpty(configValue)) { return configValue; } SysConfig config = new SysConfig(); config.setConfigKey(configKey); SysConfig retConfig = configMapper.selectConfig(config); - if (StringUtils.isNotNull(retConfig)) - { + if (StringUtils.isNotNull(retConfig)) { redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); return retConfig.getConfigValue(); } @@ -86,28 +80,25 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @Override - public List selectConfigList(SysConfig config) - { + public List selectConfigList(SysConfig config) { return configMapper.selectConfigList(config); } /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public int insertConfig(SysConfig config) - { + public int insertConfig(SysConfig config) { int row = configMapper.insertConfig(config); - if (row > 0) - { + if (row > 0) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; @@ -115,16 +106,14 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public int updateConfig(SysConfig config) - { + public int updateConfig(SysConfig config) { int row = configMapper.updateConfig(config); - if (row > 0) - { + if (row > 0) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; @@ -132,24 +121,20 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID * @return 结果 */ @Override - public int deleteConfigByIds(Long[] configIds) - { - for (Long configId : configIds) - { + public int deleteConfigByIds(Long[] configIds) { + for (Long configId : configIds) { SysConfig config = selectConfigById(configId); - if (StringUtils.equals(UserConstants.YES, config.getConfigType())) - { + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); } } int count = configMapper.deleteConfigByIds(configIds); - if (count > 0) - { + if (count > 0) { Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); redisCache.deleteObject(keys); } @@ -160,25 +145,22 @@ public class SysConfigServiceImpl implements ISysConfigService * 清空缓存数据 */ @Override - public void clearCache() - { + public void clearCache() { Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); redisCache.deleteObject(keys); } /** * 校验参数键名是否唯一 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public String checkConfigKeyUnique(SysConfig config) - { + public String checkConfigKeyUnique(SysConfig config) { Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); - if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -186,12 +168,11 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 设置cache key - * + * * @param configKey 参数键 * @return 缓存键key */ - private String getCacheKey(String configKey) - { + private String getCacheKey(String configKey) { return Constants.SYS_CONFIG_KEY + configKey; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 7d6984db..f18682a9 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.annotation.DataScope; @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysDeptService; /** * 部门管理 服务实现 - * + * * @author ruoyi */ @Service -public class SysDeptServiceImpl implements ISysDeptService -{ +public class SysDeptServiceImpl implements ISysDeptService { @Autowired private SysDeptMapper deptMapper; @@ -33,44 +33,38 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 查询部门管理数据 - * + * * @param dept 部门信息 * @return 部门信息集合 */ @Override @DataScope(deptAlias = "d") - public List selectDeptList(SysDept dept) - { + public List selectDeptList(SysDept dept) { return deptMapper.selectDeptList(dept); } /** * 构建前端所需要树结构 - * + * * @param depts 部门列表 * @return 树结构列表 */ @Override - public List buildDeptTree(List depts) - { + public List buildDeptTree(List depts) { List returnList = new ArrayList(); List tempList = new ArrayList(); - for (SysDept dept : depts) - { + for (SysDept dept : depts) { tempList.add(dept.getDeptId()); } - for (Iterator iterator = depts.iterator(); iterator.hasNext();) - { + for (Iterator iterator = depts.iterator(); iterator.hasNext(); ) { SysDept dept = (SysDept) iterator.next(); // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(dept.getParentId())) - { + if (!tempList.contains(dept.getParentId())) { recursionFn(depts, dept); returnList.add(dept); } } - if (returnList.isEmpty()) - { + if (returnList.isEmpty()) { returnList = depts; } return returnList; @@ -78,93 +72,85 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 构建前端所需要下拉树结构 - * + * * @param depts 部门列表 * @return 下拉树结构列表 */ @Override - public List buildDeptTreeSelect(List depts) - { + public List buildDeptTreeSelect(List depts) { List deptTrees = buildDeptTree(depts); return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } /** * 根据角色ID查询部门树信息 - * + * * @param roleId 角色ID * @return 选中部门列表 */ @Override - public List selectDeptListByRoleId(Long roleId) - { + public List selectDeptListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); } /** * 根据部门ID查询信息 - * + * * @param deptId 部门ID * @return 部门信息 */ @Override - public SysDept selectDeptById(Long deptId) - { + public SysDept selectDeptById(Long deptId) { return deptMapper.selectDeptById(deptId); } /** * 根据ID查询所有子部门(正常状态) - * + * * @param deptId 部门ID * @return 子部门数 */ @Override - public int selectNormalChildrenDeptById(Long deptId) - { + public int selectNormalChildrenDeptById(Long deptId) { return deptMapper.selectNormalChildrenDeptById(deptId); } /** * 是否存在子节点 - * + * * @param deptId 部门ID * @return 结果 */ @Override - public boolean hasChildByDeptId(Long deptId) - { + public boolean hasChildByDeptId(Long deptId) { int result = deptMapper.hasChildByDeptId(deptId); return result > 0 ? true : false; } /** * 查询部门是否存在用户 - * + * * @param deptId 部门ID * @return 结果 true 存在 false 不存在 */ @Override - public boolean checkDeptExistUser(Long deptId) - { + public boolean checkDeptExistUser(Long deptId) { int result = deptMapper.checkDeptExistUser(deptId); return result > 0 ? true : false; } /** * 校验部门名称是否唯一 - * + * * @param dept 部门信息 * @return 结果 */ @Override - public String checkDeptNameUnique(SysDept dept) - { + public String checkDeptNameUnique(SysDept dept) { Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); - if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -172,17 +158,15 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 新增保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @Override - public int insertDept(SysDept dept) - { + public int insertDept(SysDept dept) { SysDept info = deptMapper.selectDeptById(dept.getParentId()); // 如果父节点不为正常状态,则不允许新增子节点 - if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) - { + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { throw new CustomException("部门停用,不允许新增"); } dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); @@ -191,25 +175,22 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 修改保存部门信息 - * + * * @param dept 部门信息 * @return 结果 */ @Override - public int updateDept(SysDept dept) - { + public int updateDept(SysDept dept) { SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); - if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) - { + if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) { String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); String oldAncestors = oldDept.getAncestors(); dept.setAncestors(newAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); } int result = deptMapper.updateDept(dept); - if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) - { + if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) { // 如果该部门是启用状态,则启用该部门的所有上级部门 updateParentDeptStatus(dept); } @@ -218,11 +199,10 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 修改该部门的父级部门状态 - * + * * @param dept 当前部门 */ - private void updateParentDeptStatus(SysDept dept) - { + private void updateParentDeptStatus(SysDept dept) { String updateBy = dept.getUpdateBy(); dept = deptMapper.selectDeptById(dept.getDeptId()); dept.setUpdateBy(updateBy); @@ -231,48 +211,41 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 修改子元素关系 - * - * @param deptId 被修改的部门ID + * + * @param deptId 被修改的部门ID * @param newAncestors 新的父ID集合 * @param oldAncestors 旧的父ID集合 */ - public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) - { + public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) { List children = deptMapper.selectChildrenDeptById(deptId); - for (SysDept child : children) - { + for (SysDept child : children) { child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors)); } - if (children.size() > 0) - { + if (children.size() > 0) { deptMapper.updateDeptChildren(children); } } /** * 删除部门管理信息 - * + * * @param deptId 部门ID * @return 结果 */ @Override - public int deleteDeptById(Long deptId) - { + public int deleteDeptById(Long deptId) { return deptMapper.deleteDeptById(deptId); } /** * 递归列表 */ - private void recursionFn(List list, SysDept t) - { + private void recursionFn(List list, SysDept t) { // 得到子节点列表 List childList = getChildList(list, t); t.setChildren(childList); - for (SysDept tChild : childList) - { - if (hasChild(list, tChild)) - { + for (SysDept tChild : childList) { + if (hasChild(list, tChild)) { recursionFn(list, tChild); } } @@ -281,15 +254,12 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 得到子节点列表 */ - private List getChildList(List list, SysDept t) - { + private List getChildList(List list, SysDept t) { List tlist = new ArrayList(); Iterator it = list.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { SysDept n = (SysDept) it.next(); - if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) - { + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) { tlist.add(n); } } @@ -299,8 +269,7 @@ public class SysDeptServiceImpl implements ISysDeptService /** * 判断是否有子节点 */ - private boolean hasChild(List list, SysDept t) - { + private boolean hasChild(List list, SysDept t) { return getChildList(list, t).size() > 0 ? true : false; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java index 2ee7a6ce..f6dc8381 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.core.domain.entity.SysDictData; @@ -10,64 +11,58 @@ import com.ruoyi.system.service.ISysDictDataService; /** * 字典 业务层处理 - * + * * @author ruoyi */ @Service -public class SysDictDataServiceImpl implements ISysDictDataService -{ +public class SysDictDataServiceImpl implements ISysDictDataService { @Autowired private SysDictDataMapper dictDataMapper; /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @Override - public List selectDictDataList(SysDictData dictData) - { + public List selectDictDataList(SysDictData dictData) { return dictDataMapper.selectDictDataList(dictData); } /** * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ @Override - public String selectDictLabel(String dictType, String dictValue) - { + public String selectDictLabel(String dictType, String dictValue) { return dictDataMapper.selectDictLabel(dictType, dictValue); } /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ @Override - public SysDictData selectDictDataById(Long dictCode) - { + public SysDictData selectDictDataById(Long dictCode) { return dictDataMapper.selectDictDataById(dictCode); } /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID * @return 结果 */ @Override - public int deleteDictDataByIds(Long[] dictCodes) - { + public int deleteDictDataByIds(Long[] dictCodes) { int row = dictDataMapper.deleteDictDataByIds(dictCodes); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -75,16 +70,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 新增保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @Override - public int insertDictData(SysDictData dictData) - { + public int insertDictData(SysDictData dictData) { int row = dictDataMapper.insertDictData(dictData); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -92,16 +85,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 修改保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @Override - public int updateDictData(SysDictData dictData) - { + public int updateDictData(SysDictData dictData) { int row = dictDataMapper.updateDictData(dictData); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 48ba3c62..3c54bf8d 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import java.util.List; import javax.annotation.PostConstruct; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -17,12 +18,11 @@ import com.ruoyi.system.service.ISysDictTypeService; /** * 字典 业务层处理 - * + * * @author ruoyi */ @Service -public class SysDictTypeServiceImpl implements ISysDictTypeService -{ +public class SysDictTypeServiceImpl implements ISysDictTypeService { @Autowired private SysDictTypeMapper dictTypeMapper; @@ -33,11 +33,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * 项目启动时,初始化字典到缓存 */ @PostConstruct - public void init() - { + public void init() { List dictTypeList = dictTypeMapper.selectDictTypeAll(); - for (SysDictType dictType : dictTypeList) - { + for (SysDictType dictType : dictTypeList) { List dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); DictUtils.setDictCache(dictType.getDictType(), dictDatas); } @@ -45,44 +43,39 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 根据条件分页查询字典类型 - * + * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ @Override - public List selectDictTypeList(SysDictType dictType) - { + public List selectDictTypeList(SysDictType dictType) { return dictTypeMapper.selectDictTypeList(dictType); } /** * 根据所有字典类型 - * + * * @return 字典类型集合信息 */ @Override - public List selectDictTypeAll() - { + public List selectDictTypeAll() { return dictTypeMapper.selectDictTypeAll(); } /** * 根据字典类型查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据集合信息 */ @Override - public List selectDictDataByType(String dictType) - { + public List selectDictDataByType(String dictType) { List dictDatas = DictUtils.getDictCache(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { + if (StringUtils.isNotEmpty(dictDatas)) { return dictDatas; } dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { + if (StringUtils.isNotEmpty(dictDatas)) { DictUtils.setDictCache(dictType, dictDatas); return dictDatas; } @@ -91,48 +84,42 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 根据字典类型ID查询信息 - * + * * @param dictId 字典类型ID * @return 字典类型 */ @Override - public SysDictType selectDictTypeById(Long dictId) - { + public SysDictType selectDictTypeById(Long dictId) { return dictTypeMapper.selectDictTypeById(dictId); } /** * 根据字典类型查询信息 - * + * * @param dictType 字典类型 * @return 字典类型 */ @Override - public SysDictType selectDictTypeByType(String dictType) - { + public SysDictType selectDictTypeByType(String dictType) { return dictTypeMapper.selectDictTypeByType(dictType); } /** * 批量删除字典类型信息 - * + * * @param dictIds 需要删除的字典ID * @return 结果 */ @Override - public int deleteDictTypeByIds(Long[] dictIds) - { - for (Long dictId : dictIds) - { + public int deleteDictTypeByIds(Long[] dictIds) { + for (Long dictId : dictIds) { SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } } int count = dictTypeMapper.deleteDictTypeByIds(dictIds); - if (count > 0) - { + if (count > 0) { DictUtils.clearDictCache(); } return count; @@ -142,23 +129,20 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * 清空缓存数据 */ @Override - public void clearCache() - { + public void clearCache() { DictUtils.clearDictCache(); } /** * 新增保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @Override - public int insertDictType(SysDictType dictType) - { + public int insertDictType(SysDictType dictType) { int row = dictTypeMapper.insertDictType(dictType); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -166,19 +150,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 修改保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @Override @Transactional - public int updateDictType(SysDictType dictType) - { + public int updateDictType(SysDictType dictType) { SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); int row = dictTypeMapper.updateDictType(dictType); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -186,17 +168,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 校验字典类型称是否唯一 - * + * * @param dict 字典类型 * @return 结果 */ @Override - public String checkDictTypeUnique(SysDictType dict) - { + public String checkDictTypeUnique(SysDictType dict) { Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); - if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) - { + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java index a3b5257c..bddfd4aa 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.SysLogininfor; @@ -9,48 +10,44 @@ import com.ruoyi.system.service.ISysLogininforService; /** * 系统访问日志情况信息 服务层处理 - * + * * @author ruoyi */ @Service -public class SysLogininforServiceImpl implements ISysLogininforService -{ +public class SysLogininforServiceImpl implements ISysLogininforService { @Autowired private SysLogininforMapper logininforMapper; /** * 新增系统登录日志 - * + * * @param logininfor 访问日志对象 */ @Override - public void insertLogininfor(SysLogininfor logininfor) - { + public void insertLogininfor(SysLogininfor logininfor) { logininforMapper.insertLogininfor(logininfor); } /** * 查询系统登录日志集合 - * + * * @param logininfor 访问日志对象 * @return 登录记录集合 */ @Override - public List selectLogininforList(SysLogininfor logininfor) - { + public List selectLogininforList(SysLogininfor logininfor) { return logininforMapper.selectLogininforList(logininfor); } /** * 批量删除系统登录日志 - * + * * @param infoIds 需要删除的登录日志ID * @return */ @Override - public int deleteLogininforByIds(Long[] infoIds) - { + public int deleteLogininforByIds(Long[] infoIds) { return logininforMapper.deleteLogininforByIds(infoIds); } @@ -58,8 +55,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService * 清空系统登录日志 */ @Override - public void cleanLogininfor() - { + public void cleanLogininfor() { logininforMapper.cleanLogininfor(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 7083d8d4..5bd219d3 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -8,6 +8,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.stream.Collectors; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.UserConstants; @@ -26,12 +27,11 @@ import com.ruoyi.system.service.ISysMenuService; /** * 菜单 业务层处理 - * + * * @author ruoyi */ @Service -public class SysMenuServiceImpl implements ISysMenuService -{ +public class SysMenuServiceImpl implements ISysMenuService { public static final String PREMISSION_STRING = "perms[\"{0}\"]"; @Autowired @@ -45,33 +45,28 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户查询系统菜单列表 - * + * * @param userId 用户ID * @return 菜单列表 */ @Override - public List selectMenuList(Long userId) - { + public List selectMenuList(Long userId) { return selectMenuList(new SysMenu(), userId); } /** * 查询系统菜单列表 - * + * * @param menu 菜单信息 * @return 菜单列表 */ @Override - public List selectMenuList(SysMenu menu, Long userId) - { + public List selectMenuList(SysMenu menu, Long userId) { List menuList = null; // 管理员显示所有菜单信息 - if (SysUser.isAdmin(userId)) - { + if (SysUser.isAdmin(userId)) { menuList = menuMapper.selectMenuList(menu); - } - else - { + } else { menu.getParams().put("userId", userId); menuList = menuMapper.selectMenuListByUserId(menu); } @@ -80,19 +75,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ @Override - public Set selectMenuPermsByUserId(Long userId) - { + public Set selectMenuPermsByUserId(Long userId) { List perms = menuMapper.selectMenuPermsByUserId(userId); Set permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { + for (String perm : perms) { + if (StringUtils.isNotEmpty(perm)) { permsSet.addAll(Arrays.asList(perm.trim().split(","))); } } @@ -101,20 +93,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据用户ID查询菜单 - * + * * @param userId 用户名称 * @return 菜单列表 */ @Override - public List selectMenuTreeByUserId(Long userId) - { + public List selectMenuTreeByUserId(Long userId) { List menus = null; - if (SecurityUtils.isAdmin(userId)) - { + if (SecurityUtils.isAdmin(userId)) { menus = menuMapper.selectMenuTreeAll(); - } - else - { + } else { menus = menuMapper.selectMenuTreeByUserId(userId); } return getChildPerms(menus, 0); @@ -122,29 +110,26 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 根据角色ID查询菜单树信息 - * + * * @param roleId 角色ID * @return 选中菜单列表 */ @Override - public List selectMenuListByRoleId(Long roleId) - { + public List selectMenuListByRoleId(Long roleId) { SysRole role = roleMapper.selectRoleById(roleId); return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); } /** * 构建前端路由所需要的菜单 - * + * * @param menus 菜单列表 * @return 路由列表 */ @Override - public List buildMenus(List menus) - { + public List buildMenus(List menus) { List routers = new LinkedList(); - for (SysMenu menu : menus) - { + for (SysMenu menu : menus) { RouterVo router = new RouterVo(); router.setHidden("1".equals(menu.getVisible())); router.setName(getRouteName(menu)); @@ -152,14 +137,11 @@ public class SysMenuServiceImpl implements ISysMenuService router.setComponent(getComponent(menu)); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()))); List cMenus = menu.getChildren(); - if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) - { + if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { router.setAlwaysShow(true); router.setRedirect("noRedirect"); router.setChildren(buildMenus(cMenus)); - } - else if (isMeunFrame(menu)) - { + } else if (isMeunFrame(menu)) { List childrenList = new ArrayList(); RouterVo children = new RouterVo(); children.setPath(menu.getPath()); @@ -176,31 +158,26 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 构建前端所需要树结构 - * + * * @param menus 菜单列表 * @return 树结构列表 */ @Override - public List buildMenuTree(List menus) - { + public List buildMenuTree(List menus) { List returnList = new ArrayList(); List tempList = new ArrayList(); - for (SysMenu dept : menus) - { + for (SysMenu dept : menus) { tempList.add(dept.getMenuId()); } - for (Iterator iterator = menus.iterator(); iterator.hasNext();) - { + for (Iterator iterator = menus.iterator(); iterator.hasNext(); ) { SysMenu menu = (SysMenu) iterator.next(); // 如果是顶级节点, 遍历该父节点的所有子节点 - if (!tempList.contains(menu.getParentId())) - { + if (!tempList.contains(menu.getParentId())) { recursionFn(menus, menu); returnList.add(menu); } } - if (returnList.isEmpty()) - { + if (returnList.isEmpty()) { returnList = menus; } return returnList; @@ -208,104 +185,95 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 构建前端所需要下拉树结构 - * + * * @param menus 菜单列表 * @return 下拉树结构列表 */ @Override - public List buildMenuTreeSelect(List menus) - { + public List buildMenuTreeSelect(List menus) { List menuTrees = buildMenuTree(menus); return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); } /** * 根据菜单ID查询信息 - * + * * @param menuId 菜单ID * @return 菜单信息 */ @Override - public SysMenu selectMenuById(Long menuId) - { + public SysMenu selectMenuById(Long menuId) { return menuMapper.selectMenuById(menuId); } /** * 是否存在菜单子节点 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean hasChildByMenuId(Long menuId) - { + public boolean hasChildByMenuId(Long menuId) { int result = menuMapper.hasChildByMenuId(menuId); return result > 0 ? true : false; } /** * 查询菜单使用数量 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public boolean checkMenuExistRole(Long menuId) - { + public boolean checkMenuExistRole(Long menuId) { int result = roleMenuMapper.checkMenuExistRole(menuId); return result > 0 ? true : false; } /** * 新增保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int insertMenu(SysMenu menu) - { + public int insertMenu(SysMenu menu) { return menuMapper.insertMenu(menu); } /** * 修改保存菜单信息 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public int updateMenu(SysMenu menu) - { + public int updateMenu(SysMenu menu) { return menuMapper.updateMenu(menu); } /** * 删除菜单管理信息 - * + * * @param menuId 菜单ID * @return 结果 */ @Override - public int deleteMenuById(Long menuId) - { + public int deleteMenuById(Long menuId) { return menuMapper.deleteMenuById(menuId); } /** * 校验菜单名称是否唯一 - * + * * @param menu 菜单信息 * @return 结果 */ @Override - public String checkMenuNameUnique(SysMenu menu) - { + public String checkMenuNameUnique(SysMenu menu) { Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); - if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -313,16 +281,14 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取路由名称 - * + * * @param menu 菜单信息 * @return 路由名称 */ - public String getRouteName(SysMenu menu) - { + public String getRouteName(SysMenu menu) { String routerName = StringUtils.capitalize(menu.getPath()); // 非外链并且是一级目录(类型为目录) - if (isMeunFrame(menu)) - { + if (isMeunFrame(menu)) { routerName = StringUtils.EMPTY; } return routerName; @@ -330,22 +296,19 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取路由地址 - * + * * @param menu 菜单信息 * @return 路由地址 */ - public String getRouterPath(SysMenu menu) - { + public String getRouterPath(SysMenu menu) { String routerPath = menu.getPath(); // 非外链并且是一级目录(类型为目录) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) - && UserConstants.NO_FRAME.equals(menu.getIsFrame())) - { + && UserConstants.NO_FRAME.equals(menu.getIsFrame())) { routerPath = "/" + menu.getPath(); } // 非外链并且是一级目录(类型为菜单) - else if (isMeunFrame(menu)) - { + else if (isMeunFrame(menu)) { routerPath = "/"; } return routerPath; @@ -353,19 +316,15 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 获取组件信息 - * + * * @param menu 菜单信息 * @return 组件信息 */ - public String getComponent(SysMenu menu) - { + public String getComponent(SysMenu menu) { String component = UserConstants.LAYOUT; - if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) - { + if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) { component = menu.getComponent(); - } - else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) - { + } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) { component = UserConstants.PARENT_VIEW; } return component; @@ -373,43 +332,38 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 是否为菜单内部跳转 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isMeunFrame(SysMenu menu) - { + public boolean isMeunFrame(SysMenu menu) { return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME); } /** * 是否为parent_view组件 - * + * * @param menu 菜单信息 * @return 结果 */ - public boolean isParentView(SysMenu menu) - { + public boolean isParentView(SysMenu menu) { return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); } /** * 根据父节点的ID获取所有子节点 - * - * @param list 分类表 + * + * @param list 分类表 * @param parentId 传入的父节点ID * @return String */ - public List getChildPerms(List list, int parentId) - { + public List getChildPerms(List list, int parentId) { List returnList = new ArrayList(); - for (Iterator iterator = list.iterator(); iterator.hasNext();) - { + for (Iterator iterator = list.iterator(); iterator.hasNext(); ) { SysMenu t = (SysMenu) iterator.next(); // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 - if (t.getParentId() == parentId) - { + if (t.getParentId() == parentId) { recursionFn(list, t); returnList.add(t); } @@ -419,19 +373,16 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 递归列表 - * + * * @param list * @param t */ - private void recursionFn(List list, SysMenu t) - { + private void recursionFn(List list, SysMenu t) { // 得到子节点列表 List childList = getChildList(list, t); t.setChildren(childList); - for (SysMenu tChild : childList) - { - if (hasChild(list, tChild)) - { + for (SysMenu tChild : childList) { + if (hasChild(list, tChild)) { recursionFn(list, tChild); } } @@ -440,15 +391,12 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 得到子节点列表 */ - private List getChildList(List list, SysMenu t) - { + private List getChildList(List list, SysMenu t) { List tlist = new ArrayList(); Iterator it = list.iterator(); - while (it.hasNext()) - { + while (it.hasNext()) { SysMenu n = (SysMenu) it.next(); - if (n.getParentId().longValue() == t.getMenuId().longValue()) - { + if (n.getParentId().longValue() == t.getMenuId().longValue()) { tlist.add(n); } } @@ -458,8 +406,7 @@ public class SysMenuServiceImpl implements ISysMenuService /** * 判断是否有子节点 */ - private boolean hasChild(List list, SysMenu t) - { + private boolean hasChild(List list, SysMenu t) { return getChildList(list, t).size() > 0 ? true : false; } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java index 765438b8..bdd94ac3 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.SysNotice; @@ -9,84 +10,77 @@ import com.ruoyi.system.service.ISysNoticeService; /** * 公告 服务层实现 - * + * * @author ruoyi */ @Service -public class SysNoticeServiceImpl implements ISysNoticeService -{ +public class SysNoticeServiceImpl implements ISysNoticeService { @Autowired private SysNoticeMapper noticeMapper; /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ @Override - public SysNotice selectNoticeById(Long noticeId) - { + public SysNotice selectNoticeById(Long noticeId) { return noticeMapper.selectNoticeById(noticeId); } /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ @Override - public List selectNoticeList(SysNotice notice) - { + public List selectNoticeList(SysNotice notice) { return noticeMapper.selectNoticeList(notice); } /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ @Override - public int insertNotice(SysNotice notice) - { + public int insertNotice(SysNotice notice) { return noticeMapper.insertNotice(notice); } /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ @Override - public int updateNotice(SysNotice notice) - { + public int updateNotice(SysNotice notice) { return noticeMapper.updateNotice(notice); } /** * 删除公告对象 - * + * * @param noticeId 公告ID * @return 结果 */ @Override - public int deleteNoticeById(Long noticeId) - { + public int deleteNoticeById(Long noticeId) { return noticeMapper.deleteNoticeById(noticeId); } /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ @Override - public int deleteNoticeByIds(Long[] noticeIds) - { + public int deleteNoticeByIds(Long[] noticeIds) { return noticeMapper.deleteNoticeByIds(noticeIds); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java index 54898152..0dc2ec77 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.SysOperLog; @@ -9,59 +10,54 @@ import com.ruoyi.system.service.ISysOperLogService; /** * 操作日志 服务层处理 - * + * * @author ruoyi */ @Service -public class SysOperLogServiceImpl implements ISysOperLogService -{ +public class SysOperLogServiceImpl implements ISysOperLogService { @Autowired private SysOperLogMapper operLogMapper; /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ @Override - public void insertOperlog(SysOperLog operLog) - { + public void insertOperlog(SysOperLog operLog) { operLogMapper.insertOperlog(operLog); } /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ @Override - public List selectOperLogList(SysOperLog operLog) - { + public List selectOperLogList(SysOperLog operLog) { return operLogMapper.selectOperLogList(operLog); } /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ @Override - public int deleteOperLogByIds(Long[] operIds) - { + public int deleteOperLogByIds(Long[] operIds) { return operLogMapper.deleteOperLogByIds(operIds); } /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ @Override - public SysOperLog selectOperLogById(Long operId) - { + public SysOperLog selectOperLogById(Long operId) { return operLogMapper.selectOperLogById(operId); } @@ -69,8 +65,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService * 清空操作日志 */ @Override - public void cleanOperLog() - { + public void cleanOperLog() { operLogMapper.cleanOperLog(); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index c0da6d4d..9e93a8f9 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.UserConstants; @@ -13,12 +14,11 @@ import com.ruoyi.system.service.ISysPostService; /** * 岗位信息 服务层处理 - * + * * @author ruoyi */ @Service -public class SysPostServiceImpl implements ISysPostService -{ +public class SysPostServiceImpl implements ISysPostService { @Autowired private SysPostMapper postMapper; @@ -27,64 +27,58 @@ public class SysPostServiceImpl implements ISysPostService /** * 查询岗位信息集合 - * + * * @param post 岗位信息 * @return 岗位信息集合 */ @Override - public List selectPostList(SysPost post) - { + public List selectPostList(SysPost post) { return postMapper.selectPostList(post); } /** * 查询所有岗位 - * + * * @return 岗位列表 */ @Override - public List selectPostAll() - { + public List selectPostAll() { return postMapper.selectPostAll(); } /** * 通过岗位ID查询岗位信息 - * + * * @param postId 岗位ID * @return 角色对象信息 */ @Override - public SysPost selectPostById(Long postId) - { + public SysPost selectPostById(Long postId) { return postMapper.selectPostById(postId); } /** * 根据用户ID获取岗位选择框列表 - * + * * @param userId 用户ID * @return 选中岗位ID列表 */ @Override - public List selectPostListByUserId(Long userId) - { + public List selectPostListByUserId(Long userId) { return postMapper.selectPostListByUserId(userId); } /** * 校验岗位名称是否唯一 - * + * * @param post 岗位信息 * @return 结果 */ @Override - public String checkPostNameUnique(SysPost post) - { + public String checkPostNameUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostNameUnique(post.getPostName()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -92,17 +86,15 @@ public class SysPostServiceImpl implements ISysPostService /** * 校验岗位编码是否唯一 - * + * * @param post 岗位信息 * @return 结果 */ @Override - public String checkPostCodeUnique(SysPost post) - { + public String checkPostCodeUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -110,43 +102,38 @@ public class SysPostServiceImpl implements ISysPostService /** * 通过岗位ID查询岗位使用数量 - * + * * @param postId 岗位ID * @return 结果 */ @Override - public int countUserPostById(Long postId) - { + public int countUserPostById(Long postId) { return userPostMapper.countUserPostById(postId); } /** * 删除岗位信息 - * + * * @param postId 岗位ID * @return 结果 */ @Override - public int deletePostById(Long postId) - { + public int deletePostById(Long postId) { return postMapper.deletePostById(postId); } /** * 批量删除岗位信息 - * + * * @param postIds 需要删除的岗位ID * @return 结果 * @throws Exception 异常 */ @Override - public int deletePostByIds(Long[] postIds) - { - for (Long postId : postIds) - { + public int deletePostByIds(Long[] postIds) { + for (Long postId : postIds) { SysPost post = selectPostById(postId); - if (countUserPostById(postId) > 0) - { + if (countUserPostById(postId) > 0) { throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName())); } } @@ -155,25 +142,23 @@ public class SysPostServiceImpl implements ISysPostService /** * 新增保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ @Override - public int insertPost(SysPost post) - { + public int insertPost(SysPost post) { return postMapper.insertPost(post); } /** * 修改保存岗位信息 - * + * * @param post 岗位信息 * @return 结果 */ @Override - public int updatePost(SysPost post) - { + public int updatePost(SysPost post) { return postMapper.updatePost(post); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 22714721..657d1829 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,12 +25,11 @@ import com.ruoyi.system.service.ISysRoleService; /** * 角色 业务层处理 - * + * * @author ruoyi */ @Service -public class SysRoleServiceImpl implements ISysRoleService -{ +public class SysRoleServiceImpl implements ISysRoleService { @Autowired private SysRoleMapper roleMapper; @@ -44,32 +44,28 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 根据条件分页查询角色数据 - * + * * @param role 角色信息 * @return 角色数据集合信息 */ @Override @DataScope(deptAlias = "d") - public List selectRoleList(SysRole role) - { + public List selectRoleList(SysRole role) { return roleMapper.selectRoleList(role); } /** * 根据用户ID查询权限 - * + * * @param userId 用户ID * @return 权限列表 */ @Override - public Set selectRolePermissionByUserId(Long userId) - { + public Set selectRolePermissionByUserId(Long userId) { List perms = roleMapper.selectRolePermissionByUserId(userId); Set permsSet = new HashSet<>(); - for (SysRole perm : perms) - { - if (StringUtils.isNotNull(perm)) - { + for (SysRole perm : perms) { + if (StringUtils.isNotNull(perm)) { permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); } } @@ -78,52 +74,47 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 查询所有角色 - * + * * @return 角色列表 */ @Override - public List selectRoleAll() - { + public List selectRoleAll() { return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); } /** * 根据用户ID获取角色选择框列表 - * + * * @param userId 用户ID * @return 选中角色ID列表 */ @Override - public List selectRoleListByUserId(Long userId) - { + public List selectRoleListByUserId(Long userId) { return roleMapper.selectRoleListByUserId(userId); } /** * 通过角色ID查询角色 - * + * * @param roleId 角色ID * @return 角色对象信息 */ @Override - public SysRole selectRoleById(Long roleId) - { + public SysRole selectRoleById(Long roleId) { return roleMapper.selectRoleById(roleId); } /** * 校验角色名称是否唯一 - * + * * @param role 角色信息 * @return 结果 */ @Override - public String checkRoleNameUnique(SysRole role) - { + public String checkRoleNameUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -131,17 +122,15 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 校验角色权限是否唯一 - * + * * @param role 角色信息 * @return 结果 */ @Override - public String checkRoleKeyUnique(SysRole role) - { + public String checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -149,40 +138,36 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 校验角色是否允许操作 - * + * * @param role 角色信息 */ @Override - public void checkRoleAllowed(SysRole role) - { - if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) - { + public void checkRoleAllowed(SysRole role) { + if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) { throw new CustomException("不允许操作超级管理员角色"); } } /** * 通过角色ID查询角色使用数量 - * + * * @param roleId 角色ID * @return 结果 */ @Override - public int countUserRoleByRoleId(Long roleId) - { + public int countUserRoleByRoleId(Long roleId) { return userRoleMapper.countUserRoleByRoleId(roleId); } /** * 新增保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ @Override @Transactional - public int insertRole(SysRole role) - { + public int insertRole(SysRole role) { // 新增角色信息 roleMapper.insertRole(role); return insertRoleMenu(role); @@ -190,14 +175,13 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 修改保存角色信息 - * + * * @param role 角色信息 * @return 结果 */ @Override @Transactional - public int updateRole(SysRole role) - { + public int updateRole(SysRole role) { // 修改角色信息 roleMapper.updateRole(role); // 删除角色与菜单关联 @@ -207,26 +191,24 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 修改角色状态 - * + * * @param role 角色信息 * @return 结果 */ @Override - public int updateRoleStatus(SysRole role) - { + public int updateRoleStatus(SysRole role) { return roleMapper.updateRole(role); } /** * 修改数据权限信息 - * + * * @param role 角色信息 * @return 结果 */ @Override @Transactional - public int authDataScope(SysRole role) - { + public int authDataScope(SysRole role) { // 修改角色信息 roleMapper.updateRole(role); // 删除角色与部门关联 @@ -237,23 +219,20 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 新增角色菜单信息 - * + * * @param role 角色对象 */ - public int insertRoleMenu(SysRole role) - { + public int insertRoleMenu(SysRole role) { int rows = 1; // 新增用户与角色管理 List list = new ArrayList(); - for (Long menuId : role.getMenuIds()) - { + for (Long menuId : role.getMenuIds()) { SysRoleMenu rm = new SysRoleMenu(); rm.setRoleId(role.getRoleId()); rm.setMenuId(menuId); list.add(rm); } - if (list.size() > 0) - { + if (list.size() > 0) { rows = roleMenuMapper.batchRoleMenu(list); } return rows; @@ -264,20 +243,17 @@ public class SysRoleServiceImpl implements ISysRoleService * * @param role 角色对象 */ - public int insertRoleDept(SysRole role) - { + public int insertRoleDept(SysRole role) { int rows = 1; // 新增角色与部门(数据权限)管理 List list = new ArrayList(); - for (Long deptId : role.getDeptIds()) - { + for (Long deptId : role.getDeptIds()) { SysRoleDept rd = new SysRoleDept(); rd.setRoleId(role.getRoleId()); rd.setDeptId(deptId); list.add(rd); } - if (list.size() > 0) - { + if (list.size() > 0) { rows = roleDeptMapper.batchRoleDept(list); } return rows; @@ -285,14 +261,13 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 通过角色ID删除角色 - * + * * @param roleId 角色ID * @return 结果 */ @Override @Transactional - public int deleteRoleById(Long roleId) - { + public int deleteRoleById(Long roleId) { // 删除角色与菜单关联 roleMenuMapper.deleteRoleMenuByRoleId(roleId); // 删除角色与部门关联 @@ -302,20 +277,17 @@ public class SysRoleServiceImpl implements ISysRoleService /** * 批量删除角色信息 - * + * * @param roleIds 需要删除的角色ID * @return 结果 */ @Override @Transactional - public int deleteRoleByIds(Long[] roleIds) - { - for (Long roleId : roleIds) - { + public int deleteRoleByIds(Long[] roleIds) { + for (Long roleId : roleIds) { checkRoleAllowed(new SysRole(roleId)); SysRole role = selectRoleById(roleId); - if (countUserRoleByRoleId(roleId) > 0) - { + if (countUserRoleByRoleId(roleId) > 0) { throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName())); } } diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java index f80a8771..f0a29982 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java @@ -8,24 +8,21 @@ import com.ruoyi.system.service.ISysUserOnlineService; /** * 在线用户 服务层处理 - * + * * @author ruoyi */ @Service -public class SysUserOnlineServiceImpl implements ISysUserOnlineService -{ +public class SysUserOnlineServiceImpl implements ISysUserOnlineService { /** * 通过登录地址查询信息 - * + * * @param ipaddr 登录地址 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) { + if (StringUtils.equals(ipaddr, user.getIpaddr())) { return loginUserToUserOnline(user); } return null; @@ -33,16 +30,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 通过用户名称查询信息 - * + * * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) - { - if (StringUtils.equals(userName, user.getUsername())) - { + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) { + if (StringUtils.equals(userName, user.getUsername())) { return loginUserToUserOnline(user); } return null; @@ -50,17 +45,15 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 通过登录地址/用户名称查询信息 - * - * @param ipaddr 登录地址 + * + * @param ipaddr 登录地址 * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) { + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) { return loginUserToUserOnline(user); } return null; @@ -68,15 +61,13 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 设置在线用户信息 - * + * * @param user 用户信息 * @return 在线用户 */ @Override - public SysUserOnline loginUserToUserOnline(LoginUser user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) - { + public SysUserOnline loginUserToUserOnline(LoginUser user) { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) { return null; } SysUserOnline sysUserOnline = new SysUserOnline(); @@ -87,8 +78,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService sysUserOnline.setBrowser(user.getBrowser()); sysUserOnline.setOs(user.getOs()); sysUserOnline.setLoginTime(user.getLoginTime()); - if (StringUtils.isNotNull(user.getUser().getDept())) - { + if (StringUtils.isNotNull(user.getUser().getDept())) { sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); } return sysUserOnline; diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index b48a7de0..9d9697df 100644 --- a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import java.util.ArrayList; import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -27,12 +28,11 @@ import com.ruoyi.system.service.ISysUserService; /** * 用户 业务层处理 - * + * * @author ruoyi */ @Service -public class SysUserServiceImpl implements ISysUserService -{ +public class SysUserServiceImpl implements ISysUserService { private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); @Autowired @@ -55,58 +55,57 @@ public class SysUserServiceImpl implements ISysUserService /** * 根据条件分页查询用户列表 - * + * * @param user 用户信息 * @return 用户信息集合信息 */ @Override @DataScope(deptAlias = "d", userAlias = "u") - public List selectUserList(SysUser user) - { + public List selectUserList(SysUser user) { return userMapper.selectUserList(user); } /** * 通过用户名查询用户 - * + * * @param userName 用户名 * @return 用户对象信息 */ @Override - public SysUser selectUserByUserName(String userName) - { + public SysUser selectUserByUserName(String userName) { return userMapper.selectUserByUserName(userName); } + @Override + public SysUser selectUserByOpenId(String openId) { + return userMapper.selectUserByOpenId(openId); + } + /** * 通过用户ID查询用户 - * + * * @param userId 用户ID * @return 用户对象信息 */ @Override - public SysUser selectUserById(Long userId) - { + public SysUser selectUserById(Long userId) { return userMapper.selectUserById(userId); } /** * 查询用户所属角色组 - * + * * @param userName 用户名 * @return 结果 */ @Override - public String selectUserRoleGroup(String userName) - { + public String selectUserRoleGroup(String userName) { List list = roleMapper.selectRolesByUserName(userName); StringBuffer idsStr = new StringBuffer(); - for (SysRole role : list) - { + for (SysRole role : list) { idsStr.append(role.getRoleName()).append(","); } - if (StringUtils.isNotEmpty(idsStr.toString())) - { + if (StringUtils.isNotEmpty(idsStr.toString())) { return idsStr.substring(0, idsStr.length() - 1); } return idsStr.toString(); @@ -114,21 +113,18 @@ public class SysUserServiceImpl implements ISysUserService /** * 查询用户所属岗位组 - * + * * @param userName 用户名 * @return 结果 */ @Override - public String selectUserPostGroup(String userName) - { + public String selectUserPostGroup(String userName) { List list = postMapper.selectPostsByUserName(userName); StringBuffer idsStr = new StringBuffer(); - for (SysPost post : list) - { + for (SysPost post : list) { idsStr.append(post.getPostName()).append(","); } - if (StringUtils.isNotEmpty(idsStr.toString())) - { + if (StringUtils.isNotEmpty(idsStr.toString())) { return idsStr.substring(0, idsStr.length() - 1); } return idsStr.toString(); @@ -136,16 +132,14 @@ public class SysUserServiceImpl implements ISysUserService /** * 校验用户名称是否唯一 - * + * * @param userName 用户名称 * @return 结果 */ @Override - public String checkUserNameUnique(String userName) - { + public String checkUserNameUnique(String userName) { int count = userMapper.checkUserNameUnique(userName); - if (count > 0) - { + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -158,12 +152,10 @@ public class SysUserServiceImpl implements ISysUserService * @return */ @Override - public String checkPhoneUnique(SysUser user) - { + public String checkPhoneUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -176,12 +168,10 @@ public class SysUserServiceImpl implements ISysUserService * @return */ @Override - public String checkEmailUnique(SysUser user) - { + public String checkEmailUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkEmailUnique(user.getEmail()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { + if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -189,28 +179,25 @@ public class SysUserServiceImpl implements ISysUserService /** * 校验用户是否允许操作 - * + * * @param user 用户信息 */ @Override - public void checkUserAllowed(SysUser user) - { - if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) - { + public void checkUserAllowed(SysUser user) { + if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) { throw new CustomException("不允许操作超级管理员用户"); } } /** * 新增保存用户信息 - * + * * @param user 用户信息 * @return 结果 */ @Override @Transactional - public int insertUser(SysUser user) - { + public int insertUser(SysUser user) { // 新增用户信息 int rows = userMapper.insertUser(user); // 新增用户岗位关联 @@ -222,14 +209,13 @@ public class SysUserServiceImpl implements ISysUserService /** * 修改保存用户信息 - * + * * @param user 用户信息 * @return 结果 */ @Override @Transactional - public int updateUser(SysUser user) - { + public int updateUser(SysUser user) { Long userId = user.getUserId(); // 删除用户与角色关联 userRoleMapper.deleteUserRoleByUserId(userId); @@ -244,87 +230,78 @@ public class SysUserServiceImpl implements ISysUserService /** * 修改用户状态 - * + * * @param user 用户信息 * @return 结果 */ @Override - public int updateUserStatus(SysUser user) - { + public int updateUserStatus(SysUser user) { return userMapper.updateUser(user); } /** * 修改用户基本信息 - * + * * @param user 用户信息 * @return 结果 */ @Override - public int updateUserProfile(SysUser user) - { + public int updateUserProfile(SysUser user) { return userMapper.updateUser(user); } /** * 修改用户头像 - * + * * @param userName 用户名 - * @param avatar 头像地址 + * @param avatar 头像地址 * @return 结果 */ @Override - public boolean updateUserAvatar(String userName, String avatar) - { + public boolean updateUserAvatar(String userName, String avatar) { return userMapper.updateUserAvatar(userName, avatar) > 0; } /** * 重置用户密码 - * + * * @param user 用户信息 * @return 结果 */ @Override - public int resetPwd(SysUser user) - { + public int resetPwd(SysUser user) { return userMapper.updateUser(user); } /** * 重置用户密码 - * + * * @param userName 用户名 * @param password 密码 * @return 结果 */ @Override - public int resetUserPwd(String userName, String password) - { + public int resetUserPwd(String userName, String password) { return userMapper.resetUserPwd(userName, password); } /** * 新增用户角色信息 - * + * * @param user 用户对象 */ - public void insertUserRole(SysUser user) - { + public void insertUserRole(SysUser user) { Long[] roles = user.getRoleIds(); - if (StringUtils.isNotNull(roles)) - { + if (StringUtils.isNotNull(roles)) { // 新增用户与角色管理 List list = new ArrayList(); - for (Long roleId : roles) - { + for (Long roleId : roles) { SysUserRole ur = new SysUserRole(); ur.setUserId(user.getUserId()); ur.setRoleId(roleId); list.add(ur); } - if (list.size() > 0) - { + if (list.size() > 0) { userRoleMapper.batchUserRole(list); } } @@ -332,25 +309,21 @@ public class SysUserServiceImpl implements ISysUserService /** * 新增用户岗位信息 - * + * * @param user 用户对象 */ - public void insertUserPost(SysUser user) - { + public void insertUserPost(SysUser user) { Long[] posts = user.getPostIds(); - if (StringUtils.isNotNull(posts)) - { + if (StringUtils.isNotNull(posts)) { // 新增用户与岗位管理 List list = new ArrayList(); - for (Long postId : posts) - { + for (Long postId : posts) { SysUserPost up = new SysUserPost(); up.setUserId(user.getUserId()); up.setPostId(postId); list.add(up); } - if (list.size() > 0) - { + if (list.size() > 0) { userPostMapper.batchUserPost(list); } } @@ -358,14 +331,13 @@ public class SysUserServiceImpl implements ISysUserService /** * 通过用户ID删除用户 - * + * * @param userId 用户ID * @return 结果 */ @Override @Transactional - public int deleteUserById(Long userId) - { + public int deleteUserById(Long userId) { // 删除用户与角色关联 userRoleMapper.deleteUserRoleByUserId(userId); // 删除用户与岗位表 @@ -375,16 +347,14 @@ public class SysUserServiceImpl implements ISysUserService /** * 批量删除用户信息 - * + * * @param userIds 需要删除的用户ID * @return 结果 */ @Override @Transactional - public int deleteUserByIds(Long[] userIds) - { - for (Long userId : userIds) - { + public int deleteUserByIds(Long[] userIds) { + for (Long userId : userIds) { checkUserAllowed(new SysUser(userId)); } // 删除用户与角色关联 @@ -396,17 +366,15 @@ public class SysUserServiceImpl implements ISysUserService /** * 导入用户数据 - * - * @param userList 用户数据列表 + * + * @param userList 用户数据列表 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 - * @param operName 操作用户 + * @param operName 操作用户 * @return 结果 */ @Override - public String importUser(List userList, Boolean isUpdateSupport, String operName) - { - if (StringUtils.isNull(userList) || userList.size() == 0) - { + public String importUser(List userList, Boolean isUpdateSupport, String operName) { + if (StringUtils.isNull(userList) || userList.size() == 0) { throw new CustomException("导入用户数据不能为空!"); } int successNum = 0; @@ -414,48 +382,36 @@ public class SysUserServiceImpl implements ISysUserService StringBuilder successMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder(); String password = configService.selectConfigByKey("sys.user.initPassword"); - for (SysUser user : userList) - { - try - { + for (SysUser user : userList) { + try { // 验证是否存在这个用户 SysUser u = userMapper.selectUserByUserName(user.getUserName()); - if (StringUtils.isNull(u)) - { + if (StringUtils.isNull(u)) { user.setPassword(SecurityUtils.encryptPassword(password)); user.setCreateBy(operName); this.insertUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); - } - else if (isUpdateSupport) - { + } else if (isUpdateSupport) { user.setUpdateBy(operName); this.updateUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 更新成功"); - } - else - { + } else { failureNum++; failureMsg.append("
" + failureNum + "、账号 " + user.getUserName() + " 已存在"); } - } - catch (Exception e) - { + } catch (Exception e) { failureNum++; String msg = "
" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; failureMsg.append(msg + e.getMessage()); log.error(msg, e); } } - if (failureNum > 0) - { + if (failureNum > 0) { failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); throw new CustomException(failureMsg.toString()); - } - else - { + } else { successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); } return successMsg.toString(); diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserAccountInfoServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserAccountInfoServiceImpl.java new file mode 100644 index 00000000..ac820062 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserAccountInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.TUserAccountInfoMapper; +import com.ruoyi.system.domain.TUserAccountInfo; +import com.ruoyi.system.service.ITUserAccountInfoService; + +/** + * 小程序用户Service业务层处理 + * + * @author wxy + * @date 2021-08-26 + */ +@Service +public class TUserAccountInfoServiceImpl implements ITUserAccountInfoService { + @Autowired + private TUserAccountInfoMapper tUserAccountInfoMapper; + + /** + * 查询小程序用户 + * + * @param id 小程序用户ID + * @return 小程序用户 + */ + @Override + public TUserAccountInfo selectTUserAccountInfoById(Long id) { + return tUserAccountInfoMapper.selectTUserAccountInfoById(id); + } + + /** + * 查询小程序用户列表 + * + * @param tUserAccountInfo 小程序用户 + * @return 小程序用户 + */ + @Override + public List selectTUserAccountInfoList(TUserAccountInfo tUserAccountInfo) { + return tUserAccountInfoMapper.selectTUserAccountInfoList(tUserAccountInfo); + } + + /** + * 新增小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + @Override + public int insertTUserAccountInfo(TUserAccountInfo tUserAccountInfo) { + return tUserAccountInfoMapper.insertTUserAccountInfo(tUserAccountInfo); + } + + /** + * 修改小程序用户 + * + * @param tUserAccountInfo 小程序用户 + * @return 结果 + */ + @Override + public int updateTUserAccountInfo(TUserAccountInfo tUserAccountInfo) { + return tUserAccountInfoMapper.updateTUserAccountInfo(tUserAccountInfo); + } + + /** + * 批量删除小程序用户 + * + * @param ids 需要删除的小程序用户ID + * @return 结果 + */ + @Override + public int deleteTUserAccountInfoByIds(Long[] ids) { + return tUserAccountInfoMapper.deleteTUserAccountInfoByIds(ids); + } + + /** + * 删除小程序用户信息 + * + * @param id 小程序用户ID + * @return 结果 + */ + @Override + public int deleteTUserAccountInfoById(Long id) { + return tUserAccountInfoMapper.deleteTUserAccountInfoById(id); + } +} diff --git a/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserLoginLogServiceImpl.java b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserLoginLogServiceImpl.java new file mode 100644 index 00000000..83e7c1e5 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TUserLoginLogServiceImpl.java @@ -0,0 +1,87 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.TUserLoginLogMapper; +import com.ruoyi.system.domain.TUserLoginLog; +import com.ruoyi.system.service.ITUserLoginLogService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author wxy + * @date 2021-08-26 + */ +@Service +public class TUserLoginLogServiceImpl implements ITUserLoginLogService { + @Autowired + private TUserLoginLogMapper tUserLoginLogMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】ID + * @return 【请填写功能名称】 + */ + @Override + public TUserLoginLog selectTUserLoginLogById(Long id) { + return tUserLoginLogMapper.selectTUserLoginLogById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectTUserLoginLogList(TUserLoginLog tUserLoginLog) { + return tUserLoginLogMapper.selectTUserLoginLogList(tUserLoginLog); + } + + /** + * 新增【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertTUserLoginLog(TUserLoginLog tUserLoginLog) { + return tUserLoginLogMapper.insertTUserLoginLog(tUserLoginLog); + } + + /** + * 修改【请填写功能名称】 + * + * @param tUserLoginLog 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateTUserLoginLog(TUserLoginLog tUserLoginLog) { + return tUserLoginLogMapper.updateTUserLoginLog(tUserLoginLog); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】ID + * @return 结果 + */ + @Override + public int deleteTUserLoginLogByIds(Long[] ids) { + return tUserLoginLogMapper.deleteTUserLoginLogByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】ID + * @return 结果 + */ + @Override + public int deleteTUserLoginLogById(Long id) { + return tUserLoginLogMapper.deleteTUserLoginLogById(id); + } +} diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotCategoryMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotCategoryMapper.xml index b360e642..d7edf4d7 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotCategoryMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotCategoryMapper.xml @@ -1,17 +1,17 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - + + + + + + + @@ -22,15 +22,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag= '0' - and category_name like concat('%', #{categoryName}, '%') + and category_name like concat('%', #{categoryName}, + '%') + - + - + insert into iot_category @@ -40,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, - + #{categoryName}, #{createBy}, @@ -48,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, - + diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceMapper.xml index 1ffe0124..907763e0 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceMapper.xml @@ -1,93 +1,154 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - select d.device_id, d.device_num, d.category_id, d.device_name, d.firmware_version, d.owner_id, d.create_by, d.create_time, d.update_by, d.update_time, d.remark, - c.category_name, - s.device_temperature as device_temp + select d.device_id, d.device_num, d.category_id, d.device_name, d.firmware_version, d.owner_id,d.status, d.create_by, + d.create_time, d.update_by, d.update_time, d.remark, + c.category_name, + s.device_temperature as device_temp from iot_device d - left join iot_category c on d.category_id=c.category_id - left join (select device_id,device_temperature from iot_device_status - right join (select max(device_status_id) as status_id from iot_device_status group by device_id) mt - on mt.status_id=device_status_id ) as s - on d.device_id=s.device_id + left join iot_category c on d.category_id=c.category_id + left join (select device_id,device_temperature from iot_device_status + right join (select max(device_status_id) as status_id from iot_device_status group by device_id) mt + on mt.status_id=device_status_id ) as s + on d.device_id=s.device_id - select d.device_id, d.device_num, d.category_id, d.device_name, d.firmware_version, d.owner_id, d.create_time, - s.relay_status,s.light_status,s.is_online,s.rssi,s.device_temperature, - t.network_address, t.network_ip,t.is_alarm, t.is_radar,t.is_rf_control, - u.nick_name, - c.category_name - ,g.group_id + select d.device_id,d.status, d.device_num, d.category_id, d.device_name, d.firmware_version, d.owner_id, d.create_time, + s.relay_status,s.light_status,s.is_online,s.rssi,s.device_temperature, + t.network_address, t.network_ip,t.is_alarm, t.is_radar,t.is_rf_control, + u.nick_name, + c.category_name + ,g.group_id from iot_device d - left join (select * from iot_device_set - right join (select max(device_set_id) as set_id from iot_device_set group by device_id) ms on ms.set_id=device_set_id ) as t - on d.device_id = t.device_id - left join (select * from iot_device_status - right join (select max(device_status_id) as status_id from iot_device_status group by device_id) mt on mt.status_id=device_status_id ) as s - on d.device_id=s.device_id - left join sys_user u on d.owner_id=u.user_id - left join iot_category c on d.category_id=c.category_id - left join iot_device_group g on d.device_id=g.device_id + left join (select * from iot_device_set + right join (select max(device_set_id) as set_id from iot_device_set group by device_id) ms on + ms.set_id=device_set_id ) as t + on d.device_id = t.device_id + left join (select * from iot_device_status + right join (select max(device_status_id) as status_id from iot_device_status group by device_id) mt on + mt.status_id=device_status_id ) as s + on d.device_id=s.device_id + left join sys_user u on d.owner_id=u.user_id + left join iot_category c on d.category_id=c.category_id + left join iot_device_group g on d.device_id=g.device_id + + SELECT + t2.device_id, + t2.status, + t2.device_num, + t2.category_id, + t1.device_name, + t2.firmware_version, + t2.owner_id, + t2.create_time, + s.relay_status, + s.light_status, + s.is_online, + s.rssi, + s.device_temperature, + t.network_address, + t.network_ip, + t.is_alarm, + t.is_radar, + t.is_rf_control, + t4.nick_name, + t3.category_name, + t1.remark + FROM + iot_device_user_relation t1 + LEFT JOIN iot_device t2 ON t1.device_id = t2.device_id + AND t1.user_id = #{ownerId} + LEFT JOIN sys_user t4 on t4.user_id = t1.user_id + LEFT JOIN iot_category t3 ON t3.category_id = t2.category_id + LEFT JOIN ( + SELECT + * + FROM + iot_device_set + RIGHT JOIN ( SELECT max( device_set_id ) AS set_id FROM iot_device_set GROUP BY device_id ) ms ON ms.set_id = device_set_id + ) AS t ON t2.device_id = t.device_id + LEFT JOIN ( + SELECT + * + FROM + iot_device_status + RIGHT JOIN ( SELECT max( device_status_id ) AS status_id FROM iot_device_status GROUP BY device_id ) mt ON mt.status_id = device_status_id + ) AS s ON t2.device_id = s.device_id + - + - + insert into iot_device @@ -106,24 +167,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" device_name, firmware_version, owner_id, + status, + create_by, create_time, update_by, update_time, remark, - + #{deviceNum}, #{categoryId}, #{deviceName}, #{firmwareVersion}, #{ownerId}, + #{status}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, - + @@ -134,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" device_name = #{deviceName}, firmware_version = #{firmwareVersion}, owner_id = #{ownerId}, + status = #{status}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, @@ -153,4 +218,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deviceId}
+ + + + + +
\ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceSetMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceSetMapper.xml index 285a1b15..33b96c00 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceSetMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceSetMapper.xml @@ -1,60 +1,67 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - select device_set_id, device_id, device_num, is_alarm, is_radar, is_host, is_reset, is_ap, is_wifi_offline, is_open_certifi, is_smart_config, is_rf_control, is_rf_learn, is_rf_clear, rf_one_func, rf_two_func, rf_three_func, rf_four_func, owner_id, network_address, network_ip,radar_interval, create_by, create_time, update_by, update_time, remark from iot_device_set + select device_set_id, device_id, device_num, is_alarm, is_radar, is_host, is_reset, is_ap, is_wifi_offline, + is_open_certifi, is_smart_config, is_rf_control, is_rf_learn, is_rf_clear, rf_one_func, rf_two_func, + rf_three_func, rf_four_func, owner_id, network_address, network_ip,radar_interval, create_by, create_time, + update_by, update_time, remark from iot_device_set - + - + insert into iot_device_set @@ -97,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, - + #{deviceSetId}, #{deviceId}, @@ -126,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, - + diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceStatusMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceStatusMapper.xml index e87232dc..49ae7adb 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceStatusMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceStatusMapper.xml @@ -1,54 +1,58 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - select device_status_id, device_id, device_num, relay_status, light_status, is_online, device_temperature, rssi, air_temperature, air_humidity, trigger_source, brightness, light_interval, light_mode,fade_time, red, green, blue, create_by, create_time, update_by, update_time, remark from iot_device_status + select device_status_id, device_id, device_num, relay_status, light_status, is_online, device_temperature, rssi, + air_temperature, air_humidity, trigger_source, brightness, light_interval, light_mode,fade_time, red, green, + blue, create_by, create_time, update_by, update_time, remark from iot_device_status - + - - + + insert into iot_device_status device_id, @@ -93,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, - + #{deviceId}, #{deviceNum}, @@ -117,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, - + diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceUserRelationMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceUserRelationMapper.xml new file mode 100644 index 00000000..81c00ede --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotDeviceUserRelationMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + select id, user_id, device_id, device_num,device_name,remark, gmt_time, gmt_update from iot_device_user_relation + + + + + + + + insert into iot_device_user_relation + + user_id, + + device_id, + + device_num, + + device_name, + + remark, + + gmt_time, + + gmt_update, + + + + #{userId}, + + #{deviceId}, + + #{deviceNum}, + + #{deviceName}, + + #{remark}, + + + #{gmtTime}, + + #{gmtUpdate}, + + + + + + update iot_device_user_relation + + user_id = + #{userId}, + + device_id = + #{deviceId}, + + device_num = + #{deviceNum}, + + device_name = + #{deviceName}, + + remark = + #{remark}, + + gmt_time = + #{gmtTime}, + + gmt_update = + #{gmtUpdate}, + + + where id = #{id} + + + + delete from iot_device_user_relation where id = #{id} + + + + delete from iot_device_user_relation where id in + + #{id} + + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotGroupMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotGroupMapper.xml index ec7a4b74..ba188a3f 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotGroupMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/IotGroupMapper.xml @@ -1,40 +1,43 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - + + + + + + + + + + - select group_id, user_id, group_name, group_order, del_flag, create_by, create_time, update_by, update_time, remark from iot_group + select group_id, user_id, group_name, group_order, del_flag, create_by, create_time, update_by, update_time, + remark from iot_group - + - + insert into iot_group @@ -47,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, remark, - + #{userId}, #{groupName}, @@ -58,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{remark}, - + @@ -82,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from iot_group where group_id in + delete from iot_group where group_id in #{groupId} diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml index 8b979061..35f3e922 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -1,91 +1,92 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - + + + + + + + + + - + - select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark - from sys_config + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, + update_time, remark + from sys_config - + - - - - and config_id = #{configId} - - - and config_key = #{configKey} - - - - + + + + and config_id = #{configId} + + + and config_key = #{configKey} + + + + - + - + - + insert into sys_config ( - config_name, - config_key, - config_value, - config_type, - create_by, - remark, - create_time + config_name, + config_key, + config_value, + config_type, + create_by, + remark, + create_time )values( - #{configName}, - #{configKey}, - #{configValue}, - #{configType}, - #{createBy}, - #{remark}, - sysdate() - ) + #{configName}, + #{configKey}, + #{configValue}, + #{configType}, + #{createBy}, + #{remark}, + sysdate() + ) - + - update sys_config + update sys_config config_name = #{configName}, config_key = #{configKey}, @@ -93,20 +94,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" config_type = #{configType}, update_by = #{updateBy}, remark = #{remark}, - update_time = sysdate() + update_time = sysdate() where config_id = #{configId} - + delete from sys_config where config_id = #{configId} - + - delete from sys_config where config_id in + delete from sys_config where config_id in - #{configId} + #{configId} - + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 8777b406..d7f454a0 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -1,157 +1,159 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, + d.del_flag, d.create_by, d.create_time from sys_dept d - - where d.del_flag = '0' - AND parent_id = #{parentId} - - - AND dept_name like concat('%', #{deptName}, '%') - - - AND status = #{status} - - - ${params.dataScope} - order by d.parent_id, d.order_num + AND parent_id = #{parentId} + + + AND dept_name like concat('%', #{deptName}, '%') + + + AND status = #{status} + + + ${params.dataScope} + order by d.parent_id, d.order_num - + - + + and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = + rd.dept_id and rd.role_id = #{roleId}) + + order by d.parent_id, d.order_num + + - + + where dept_id = #{deptId} + + - - - - - - - - - + select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' + + + + + + + + + + - insert into sys_dept( - dept_id, - parent_id, - dept_name, - ancestors, - order_num, - leader, - phone, - email, - status, - create_by, - create_time - )values( - #{deptId}, - #{parentId}, - #{deptName}, - #{ancestors}, - #{orderNum}, - #{leader}, - #{phone}, - #{email}, - #{status}, - #{createBy}, - sysdate() - ) - - - - update sys_dept - - parent_id = #{parentId}, - dept_name = #{deptName}, - ancestors = #{ancestors}, - order_num = #{orderNum}, - leader = #{leader}, - phone = #{phone}, - email = #{email}, - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where dept_id = #{deptId} - - - - update sys_dept set ancestors = - - when #{item.deptId} then #{item.ancestors} - - where dept_id in - - #{item.deptId} - - - - - update sys_dept - - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() - where dept_id in (${ancestors}) - - - - update sys_dept set del_flag = '2' where dept_id = #{deptId} - + where dept_id = #{deptId} + + + + update sys_dept set ancestors = + + when #{item.deptId} then #{item.ancestors} + + where dept_id in + + #{item.deptId} + + + + + update sys_dept + + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where dept_id in (${ancestors}) + + + + update sys_dept set del_flag = '2' where dept_id = #{deptId} + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml index 8da9030b..814a4db4 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -1,124 +1,125 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark - from sys_dict_data + + + + + + + + + + + + + + + + + + + select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, + create_by, create_time, remark + from sys_dict_data - - - - - - - - - - - - delete from sys_dict_data where dict_code = #{dictCode} - - - - delete from sys_dict_data where dict_code in - - #{dictCode} - - - - - update sys_dict_data - - dict_sort = #{dictSort}, - dict_label = #{dictLabel}, - dict_value = #{dictValue}, - dict_type = #{dictType}, - css_class = #{cssClass}, - list_class = #{listClass}, - is_default = #{isDefault}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_code = #{dictCode} - - - - update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} - - - - insert into sys_dict_data( - dict_sort, - dict_label, - dict_value, - dict_type, - css_class, - list_class, - is_default, - status, - remark, - create_by, - create_time - )values( - #{dictSort}, - #{dictLabel}, - #{dictValue}, - #{dictType}, - #{cssClass}, - #{listClass}, - #{isDefault}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - + + + + + + + + + + + + delete from sys_dict_data where dict_code = #{dictCode} + + + + delete from sys_dict_data where dict_code in + + #{dictCode} + + + + + update sys_dict_data + + dict_sort = #{dictSort}, + dict_label = #{dictLabel}, + dict_value = #{dictValue}, + dict_type = #{dictType}, + css_class = #{cssClass}, + list_class = #{listClass}, + is_default = #{isDefault}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_code = #{dictCode} + + + + update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} + + + + insert into sys_dict_data( + dict_sort, + dict_label, + dict_value, + dict_type, + css_class, + list_class, + is_default, + status, + remark, + create_by, + create_time + )values( + #{dictSort}, + #{dictLabel}, + #{dictValue}, + #{dictType}, + #{cssClass}, + #{listClass}, + #{isDefault}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 55b4075f..546afc54 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -1,105 +1,105 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type + + + + + + + + + + + + + select dict_id, dict_name, dict_type, status, create_by, create_time, remark + from sys_dict_type - - - - - - - - - - - - delete from sys_dict_type where dict_id = #{dictId} - - - - delete from sys_dict_type where dict_id in - - #{dictId} - - + + + + + + + + + + + + delete from sys_dict_type where dict_id = #{dictId} + + + + delete from sys_dict_type where dict_id in + + #{dictId} + + + + + update sys_dict_type + + dict_name = #{dictName}, + dict_type = #{dictType}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_id = #{dictId} + + + + insert into sys_dict_type( + dict_name, + dict_type, + status, + remark, + create_by, + create_time + )values( + #{dictName}, + #{dictType}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + - - update sys_dict_type - - dict_name = #{dictName}, - dict_type = #{dictType}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_id = #{dictId} - - - - insert into sys_dict_type( - dict_name, - dict_type, - status, - remark, - create_by, - create_time - )values( - #{dictName}, - #{dictType}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml index b8178fa3..add7d539 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -1,57 +1,57 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - + + + + + + + + + + + + + + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) + values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) + + + + + + delete from sys_logininfor where info_id in + + #{infoId} + + - - insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) - values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) - - - - - - delete from sys_logininfor where info_id in - - #{infoId} - - - truncate table sys_logininfor - + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index 22a4cd10..f1ce3578 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -1,191 +1,196 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - select menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time - from sys_menu + + select menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, ifnull(perms,'') as perms, icon, create_time + from sys_menu - + - - - - - - - - - - + + AND visible = #{visible} + + + AND status = #{status} + + + order by parent_id, order_num + - - - - - - - - - - update sys_menu - - menu_name = #{menuName}, - parent_id = #{parentId}, - order_num = #{orderNum}, - path = #{path}, - component = #{component}, - is_frame = #{isFrame}, - is_cache = #{isCache}, - menu_type = #{menuType}, - visible = #{visible}, - status = #{status}, - perms = #{perms}, - icon = #{icon}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where menu_id = #{menuId} - + - - insert into sys_menu( - menu_id, - parent_id, - menu_name, - order_num, - path, - component, - is_frame, - is_cache, - menu_type, - visible, - status, - perms, - icon, - remark, - create_by, - create_time - )values( - #{menuId}, - #{parentId}, - #{menuName}, - #{orderNum}, - #{path}, - #{component}, - #{isFrame}, - #{isCache}, - #{menuType}, - #{visible}, - #{status}, - #{perms}, - #{icon}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_menu where menu_id = #{menuId} - + + + + + + + + + + + + + + + + + + update sys_menu + + menu_name = #{menuName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + path = #{path}, + component = #{component}, + is_frame = #{isFrame}, + is_cache = #{isCache}, + menu_type = #{menuType}, + visible = #{visible}, + status = #{status}, + perms = #{perms}, + icon = #{icon}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where menu_id = #{menuId} + + + + insert into sys_menu( + menu_id, + parent_id, + menu_name, + order_num, + path, + component, + is_frame, + is_cache, + menu_type, + visible, + status, + perms, + icon, + remark, + create_by, + create_time + )values( + #{menuId}, + #{parentId}, + #{menuName}, + #{orderNum}, + #{path}, + #{component}, + #{isFrame}, + #{isCache}, + #{menuType}, + #{visible}, + #{status}, + #{perms}, + #{icon}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_menu where menu_id = #{menuId} + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml index 65d30794..af674c37 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -1,89 +1,90 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - + + + + + + + + + + - + - select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark - from sys_notice + select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, + create_time, update_by, update_time, remark + from sys_notice - + - + - + insert into sys_notice ( - notice_title, - notice_type, - notice_content, - status, - remark, - create_by, - create_time - )values( - #{noticeTitle}, - #{noticeType}, - #{noticeContent}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) + notice_title, + notice_type, + notice_content, + status, + remark, + create_by, + create_time + )values( + #{noticeTitle}, + #{noticeType}, + #{noticeContent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) - + - update sys_notice + update sys_notice - notice_title = #{noticeTitle}, - notice_type = #{noticeType}, - notice_content = #{noticeContent}, - status = #{status}, + notice_title = #{noticeTitle}, + notice_type = #{noticeType}, + notice_content = #{noticeContent}, + status = #{status}, update_by = #{updateBy}, - update_time = sysdate() + update_time = sysdate() where notice_id = #{noticeId} - + delete from sys_notice where notice_id = #{noticeId} - + - delete from sys_notice where notice_id in + delete from sys_notice where notice_id in #{noticeId} - + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml index f017ef86..8a06ded7 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -1,82 +1,85 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time + + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, + oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time from sys_oper_log - - - insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) - values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) - - - - - - delete from sys_oper_log where oper_id in - - #{operId} - - - - - - + + + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, + oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, + #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + truncate table sys_oper_log diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index c82d808f..a4bd4c6e 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -1,122 +1,122 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark - from sys_post + + + + + + + + + + + + + + + select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark + from sys_post - - - - - - - - + + + + AND post_code like concat('%', #{postCode}, '%') + + + AND status = #{status} + + + AND post_name like concat('%', #{postName}, '%') + + + + + + + + + - - - - - - - - - update sys_post - - post_code = #{postCode}, - post_name = #{postName}, - post_sort = #{postSort}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where post_id = #{postId} - - - - insert into sys_post( - post_id, - post_code, - post_name, - post_sort, - status, - remark, - create_by, - create_time - )values( - #{postId}, - #{postCode}, - #{postName}, - #{postSort}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_post where post_id = #{postId} - - - - delete from sys_post where post_id in - - #{postId} - - + left join sys_user_post up on up.post_id = p.post_id + left join sys_user u on u.user_id = up.user_id + where u.user_id = #{userId} + + + + + + + + + + update sys_post + + post_code = #{postCode}, + post_name = #{postName}, + post_sort = #{postSort}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where post_id = #{postId} + + + + insert into sys_post( + post_id, + post_code, + post_name, + post_sort, + status, + remark, + create_by, + create_time + )values( + #{postId}, + #{postCode}, + #{postName}, + #{postSort}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_post where post_id = #{postId} + + + + delete from sys_post where post_id in + + #{postId} + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml index 7c4139bc..fb2f449c 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -1,34 +1,34 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - + + + + + + + delete from sys_role_dept where role_id=#{roleId} + + + + + + delete from sys_role_dept where role_id in + + #{roleId} + + + + + insert into sys_role_dept(role_id, dept_id) values + + (#{item.roleId},#{item.deptId}) + + - - delete from sys_role_dept where role_id=#{roleId} - - - - - - delete from sys_role_dept where role_id in - - #{roleId} - - - - - insert into sys_role_dept(role_id, dept_id) values - - (#{item.roleId},#{item.deptId}) - - - \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index 3506de8e..3caa3c40 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -1,153 +1,154 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, - r.status, r.del_flag, r.create_time, r.remark + + + + + + + + + + + + + + + + + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, + r.dept_check_strictly, + r.status, r.del_flag, r.create_time, r.remark from sys_role r - left join sys_user_role ur on ur.role_id = r.role_id - left join sys_user u on u.user_id = ur.user_id - left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on ur.role_id = r.role_id + left join sys_user u on u.user_id = ur.user_id + left join sys_dept d on u.dept_id = d.dept_id - + - - - - - - + + + + + + - - - - - - - - - - - insert into sys_role( - role_id, - role_name, - role_key, - role_sort, - data_scope, - menu_check_strictly, - dept_check_strictly, - status, - remark, - create_by, - create_time - )values( - #{roleId}, - #{roleName}, - #{roleKey}, - #{roleSort}, - #{dataScope}, - #{menuCheckStrictly}, - #{deptCheckStrictly}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - update sys_role - - role_name = #{roleName}, - role_key = #{roleKey}, - role_sort = #{roleSort}, - data_scope = #{dataScope}, - menu_check_strictly = #{menuCheckStrictly}, - dept_check_strictly = #{deptCheckStrictly}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where role_id = #{roleId} - - - - update sys_user set status = #{status} where user_id = #{userId} - - - - delete from sys_role where role_id = #{roleId} - - - - update sys_role set del_flag = '2' where role_id in - - #{roleId} - - - + left join sys_user_role ur on ur.role_id = r.role_id + left join sys_user u on u.user_id = ur.user_id + where u.user_id = #{userId} + + + + + + + + + + + + insert into sys_role( + role_id, + role_name, + role_key, + role_sort, + data_scope, + menu_check_strictly, + dept_check_strictly, + status, + remark, + create_by, + create_time + )values( + #{roleId}, + #{roleName}, + #{roleKey}, + #{roleSort}, + #{dataScope}, + #{menuCheckStrictly}, + #{deptCheckStrictly}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_role + + role_name = #{roleName}, + role_key = #{roleKey}, + role_sort = #{roleSort}, + data_scope = #{dataScope}, + menu_check_strictly = #{menuCheckStrictly}, + dept_check_strictly = #{deptCheckStrictly}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where role_id = #{roleId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + delete from sys_role where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id in + + #{roleId} + + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml index cb60a852..34f8f18c 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -1,34 +1,34 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - + + + + + + + + + delete from sys_role_menu where role_id=#{roleId} + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + + insert into sys_role_menu(role_id, menu_id) values + + (#{item.roleId},#{item.menuId}) + + - - delete from sys_role_menu where role_id=#{roleId} - - - - delete from sys_role_menu where role_id in - - #{roleId} - - - - - insert into sys_role_menu(role_id, menu_id) values - - (#{item.roleId},#{item.menuId}) - - - \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 296912d2..09eef49c 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -1,182 +1,199 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select u.user_id,open_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, + u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u - left join sys_dept d on u.dept_id = d.dept_id - left join sys_user_role ur on u.user_id = ur.user_id - left join sys_role r on r.role_id = ur.role_id + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on u.user_id = ur.user_id + left join sys_role r on r.role_id = ur.role_id - + - - - - - - - - - - - - - insert into sys_user( - user_id, - dept_id, - user_name, - nick_name, - email, - avatar, - phonenumber, - sex, - password, - status, - create_by, - remark, - create_time - )values( - #{userId}, - #{deptId}, - #{userName}, - #{nickName}, - #{email}, - #{avatar}, - #{phonenumber}, - #{sex}, - #{password}, - #{status}, - #{createBy}, - #{remark}, - sysdate() - ) - - - - update sys_user - - dept_id = #{deptId}, - user_name = #{userName}, - nick_name = #{nickName}, - email = #{email}, - phonenumber = #{phonenumber}, - sex = #{sex}, - avatar = #{avatar}, - password = #{password}, - status = #{status}, - login_ip = #{loginIp}, - login_date = #{loginDate}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where user_id = #{userId} - - - - update sys_user set status = #{status} where user_id = #{userId} - - - - update sys_user set avatar = #{avatar} where user_name = #{userName} - - - - update sys_user set password = #{password} where user_name = #{userName} - - - - delete from sys_user where user_id = #{userId} - - - - update sys_user set del_flag = '2' where user_id in - - #{userId} - - - - \ No newline at end of file + select u.user_id,open_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, + u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from + sys_user u + left join sys_dept d on u.dept_id = d.dept_id + where u.del_flag = '0' + + AND u.user_name like concat('%', #{userName}, '%') + + + AND u.status = #{status} + + + AND u.open_id = #{openId} + + , + AND u.phonenumber like concat('%', #{phonenumber}, '%') + + + AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + + + AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + + + AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, + ancestors) )) + + + ${params.dataScope} + + + + + + + + + + + + + + + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + open_id, + email, + avatar, + phonenumber, + sex, + password, + status, + create_by, + remark, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{openId}, + #{email}, + #{avatar}, + #{phonenumber}, + #{sex}, + #{password}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + open_id = #{openId}, + email = #{email}, + phonenumber = #{phonenumber}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where user_id = #{userId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + update sys_user set avatar = #{avatar} where user_name = #{userName} + + + + update sys_user set password = #{password} where user_name = #{userName} + + + + delete from sys_user where user_id = #{userId} + + + + update sys_user set del_flag = '2' where user_id in + + #{userId} + + + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml index 2b90bc40..4e103d3b 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -1,34 +1,34 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - + + + + + + + delete from sys_user_post where user_id=#{userId} + + + + + + delete from sys_user_post where user_id in + + #{userId} + + + + + insert into sys_user_post(user_id, post_id) values + + (#{item.userId},#{item.postId}) + + - - delete from sys_user_post where user_id=#{userId} - - - - - - delete from sys_user_post where user_id in - - #{userId} - - - - - insert into sys_user_post(user_id, post_id) values - - (#{item.userId},#{item.postId}) - - - \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index dd726891..3f696a53 100644 --- a/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -1,44 +1,44 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - + + + + - - delete from sys_user_role where user_id=#{userId} - - - - - - delete from sys_user_role where user_id in - - #{userId} - - - - - insert into sys_user_role(user_id, role_id) values - - (#{item.userId},#{item.roleId}) - - - - - delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} - - - - delete from sys_user_role where role_id=#{roleId} and user_id in - - #{userId} - - + + delete from sys_user_role where user_id=#{userId} + + + + + + delete from sys_user_role where user_id in + + #{userId} + + + + + insert into sys_user_role(user_id, role_id) values + + (#{item.userId},#{item.roleId}) + + + + + delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} + + + + delete from sys_user_role where role_id=#{roleId} and user_id in + + #{userId} + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserAccountInfoMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserAccountInfoMapper.xml new file mode 100644 index 00000000..77362242 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserAccountInfoMapper.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, sessionKey, access_token, open_id, union_id, nick_name, avatar, phone, birthday, status, country, + province, city, address, user_type, admin_id, last_login_time, last_login_ip, gmt_time, gmt_update from + t_user_account_info + + + + + + + + insert into t_user_account_info + + sessionKey, + access_token, + open_id, + union_id, + nick_name, + avatar, + phone, + birthday, + status, + country, + province, + city, + address, + user_type, + admin_id, + last_login_time, + last_login_ip, + gmt_time, + gmt_update, + + + #{sessionkey}, + #{accessToken}, + #{openId}, + #{unionId}, + #{nickName}, + #{avatar}, + #{phone}, + #{birthday}, + #{status}, + #{country}, + #{province}, + #{city}, + #{address}, + #{userType}, + #{adminId}, + #{lastLoginTime}, + #{lastLoginIp}, + #{gmtTime}, + #{gmtUpdate}, + + + + + update t_user_account_info + + sessionKey = #{sessionkey}, + access_token = #{accessToken}, + open_id = #{openId}, + union_id = #{unionId}, + nick_name = #{nickName}, + avatar = #{avatar}, + phone = #{phone}, + birthday = #{birthday}, + status = #{status}, + country = #{country}, + province = #{province}, + city = #{city}, + address = #{address}, + user_type = #{userType}, + admin_id = #{adminId}, + last_login_time = #{lastLoginTime}, + last_login_ip = #{lastLoginIp}, + gmt_time = #{gmtTime}, + gmt_update = #{gmtUpdate}, + + where id = #{id} + + + + delete from t_user_account_info where id = #{id} + + + + delete from t_user_account_info where id in + + #{id} + + + \ No newline at end of file diff --git a/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserLoginLogMapper.xml b/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserLoginLogMapper.xml new file mode 100644 index 00000000..11a85bc3 --- /dev/null +++ b/spring-boot/ruoyi-system/src/main/resources/mapper/system/TUserLoginLogMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select id, user_type, user_id, code, open_id, ip, gmt_time, gmt_update from t_user_login_log + + + + + + + + insert into t_user_login_log + + user_type, + user_id, + code, + open_id, + ip, + gmt_time, + gmt_update, + + + #{userType}, + #{userId}, + #{code}, + #{openId}, + #{ip}, + #{gmtTime}, + #{gmtUpdate}, + + + + + update t_user_login_log + + user_type = #{userType}, + user_id = #{userId}, + code = #{code}, + open_id = #{openId}, + ip = #{ip}, + gmt_time = #{gmtTime}, + gmt_update = #{gmtUpdate}, + + where id = #{id} + + + + delete from t_user_login_log where id = #{id} + + + + delete from t_user_login_log where id in + + #{id} + + + \ No newline at end of file diff --git a/spring-boot/sql/develop_xiaoyi_wumei.sql b/spring-boot/sql/develop_xiaoyi_wumei.sql new file mode 100644 index 00000000..feb86c2c --- /dev/null +++ b/spring-boot/sql/develop_xiaoyi_wumei.sql @@ -0,0 +1,2340 @@ +/* + Navicat Premium Data Transfer + + Source Server : 51xy.xyz8.0 + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 51xy.xyz:3316 + Source Schema : develop_xiaoyi_wumei + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 02/09/2021 10:03:22 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for gen_table +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table`; +CREATE TABLE `gen_table` ( + `table_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表名称', + `table_comment` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表描述', + `sub_table_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联子表的表名', + `sub_table_fk_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '子表关联的外键名', + `class_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '实体类名称', + `tpl_category` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'crud' COMMENT '使用的模板(crud单表操作 tree树表操作)', + `package_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成包路径', + `module_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成模块名', + `business_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成业务名', + `function_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成功能名', + `function_author` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成功能作者', + `gen_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '生成代码方式(0zip压缩包 1自定义路径)', + `gen_path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '/' COMMENT '生成路径(不填默认项目路径)', + `options` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其它生成选项', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`table_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成业务表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of gen_table +-- ---------------------------- +INSERT INTO `gen_table` VALUES (12, 'iot_category', '设备分类', '', '', 'IotCategory', 'crud', 'com.ruoyi.system', 'system', 'category', '设备分类', 'kerwincui', '0', '/', '{\"parentMenuId\":\"2000\"}', 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58', NULL); +INSERT INTO `gen_table` VALUES (14, 'iot_device_set', '设备配置', NULL, NULL, 'IotDeviceSet', 'crud', 'com.ruoyi.system', 'system', 'set', '设备配置', 'kerwincui', '0', '/', '{\"parentMenuId\":\"2000\"}', 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45', NULL); +INSERT INTO `gen_table` VALUES (15, 'iot_device_status', '设备状态', NULL, NULL, 'IotDeviceStatus', 'crud', 'com.ruoyi.system', 'system', 'status', '设备状态', 'kerwincui', '0', '/', '{\"parentMenuId\":\"2000\"}', 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:15:04', NULL); +INSERT INTO `gen_table` VALUES (17, 'iot_group', '设备分组', NULL, NULL, 'IotGroup', 'crud', 'com.ruoyi.system', 'system', 'group', '分组', 'kerwincui', '0', '/', '{\"parentMenuId\":\"2000\"}', 'admin', '2021-05-18 08:04:15', '', '2021-05-18 08:13:40', NULL); +INSERT INTO `gen_table` VALUES (18, 't_user_account_info', '小程序用户表', NULL, NULL, 'TUserAccountInfo', 'crud', 'com.ruoyi.system', 'system', 'info', '小程序用户', 'wxy', '0', '/', NULL, 'admin', '2021-08-26 14:45:28', '', NULL, NULL); +INSERT INTO `gen_table` VALUES (19, 't_user_login_log', '', NULL, NULL, 'TUserLoginLog', 'crud', 'com.ruoyi.system', 'system', 'log', NULL, 'wxy', '0', '/', NULL, 'admin', '2021-08-26 14:45:29', '', NULL, NULL); +INSERT INTO `gen_table` VALUES (20, 'sys_user', '用户信息表', NULL, NULL, 'SysUser', 'crud', 'com.ruoyi.system', 'system', 'user', '用户信息', 'wxy', '0', '/', NULL, 'admin', '2021-08-26 17:07:44', '', NULL, NULL); +INSERT INTO `gen_table` VALUES (21, 'iot_device_user_relation', '', NULL, NULL, 'IotDeviceUserRelation', 'crud', 'com.ruoyi.system', 'system', 'relation', NULL, 'wxy', '0', '/', NULL, 'admin', '2021-08-27 11:55:05', '', NULL, NULL); +INSERT INTO `gen_table` VALUES (22, 'iot_device', '', NULL, NULL, 'IotDevice', 'crud', 'com.ruoyi.system', 'system', 'device', NULL, 'wxy', '0', '/', NULL, 'admin', '2021-08-27 13:45:40', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for gen_table_column +-- ---------------------------- +DROP TABLE IF EXISTS `gen_table_column`; +CREATE TABLE `gen_table_column` ( + `column_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '编号', + `table_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '归属表编号', + `column_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列名称', + `column_comment` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列描述', + `column_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列类型', + `java_type` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'JAVA类型', + `java_field` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'JAVA字段名', + `is_pk` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否主键(1是)', + `is_increment` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否自增(1是)', + `is_required` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否必填(1是)', + `is_insert` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否为插入字段(1是)', + `is_edit` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否编辑字段(1是)', + `is_list` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否列表字段(1是)', + `is_query` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否查询字段(1是)', + `query_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)', + `html_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)', + `dict_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `sort` int(0) NULL DEFAULT NULL COMMENT '排序', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`column_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 371 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of gen_table_column +-- ---------------------------- +INSERT INTO `gen_table_column` VALUES (217, '12', 'category_id', '序号', 'bigint(20)', 'Long', 'categoryId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (218, '12', 'category_name', '分类名称', 'varchar(100)', 'String', 'categoryName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 2, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (219, '12', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 3, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (220, '12', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 4, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (221, '12', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 5, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (222, '12', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 6, 'admin', '2021-05-06 13:31:29', '', '2021-05-07 08:22:58'); +INSERT INTO `gen_table_column` VALUES (223, '12', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 7, 'admin', '2021-05-06 13:31:30', '', '2021-05-07 08:22:59'); +INSERT INTO `gen_table_column` VALUES (224, '12', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 8, 'admin', '2021-05-06 13:31:30', '', '2021-05-07 08:22:59'); +INSERT INTO `gen_table_column` VALUES (237, '14', 'device_config_id', '序号', 'bigint(20)', 'Long', 'deviceConfigId', '1', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45'); +INSERT INTO `gen_table_column` VALUES (238, '14', 'device_id', '设备', 'bigint(20)', 'Long', 'deviceId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45'); +INSERT INTO `gen_table_column` VALUES (239, '14', 'device_num', '设备编号', 'varchar(64)', 'String', 'deviceNum', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45'); +INSERT INTO `gen_table_column` VALUES (240, '14', 'is_alarm', '报警', 'tinyint(1)', 'Integer', 'isAlarm', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 4, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45'); +INSERT INTO `gen_table_column` VALUES (241, '14', 'is_radar', '雷达感应', 'tinyint(1)', 'Integer', 'isRadar', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 5, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:45'); +INSERT INTO `gen_table_column` VALUES (242, '14', 'is_host', '托管', 'tinyint(1)', 'Integer', 'isHost', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 6, 'admin', '2021-05-06 13:31:32', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (243, '14', 'is_reset', '重启', 'tinyint(1)', 'Integer', 'isReset', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'radio', 'sys_yes_no', 7, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (244, '14', 'is_ap', '打开AP', 'tinyint(1)', 'Integer', 'isAp', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'radio', 'sys_yes_no', 8, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (245, '14', 'is_rf_control', '射频遥控', 'tinyint(1)', 'Integer', 'isRfControl', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 9, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (246, '14', 'is_rf_learn', '遥控配对', 'tinyint(1)', 'Integer', 'isRfLearn', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'radio', 'sys_yes_no', 10, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (247, '14', 'is_rf_clear', '遥控清码', 'tinyint(1)', 'Integer', 'isRfClear', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'radio', 'sys_yes_no', 11, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (248, '14', 'rf_one_func', '按键一', 'tinyint(10)', 'Integer', 'rfOneFunc', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'select', 'rf_function', 12, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:46'); +INSERT INTO `gen_table_column` VALUES (249, '14', 'rf_two_func', '按键二', 'tinyint(10)', 'Integer', 'rfTwoFunc', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'select', 'rf_function', 13, 'admin', '2021-05-06 13:31:33', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (250, '14', 'rf_three_func', '按键三', 'tinyint(10)', 'Integer', 'rfThreeFunc', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'select', 'rf_function', 14, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (251, '14', 'rf_four_func', '按键四', 'tinyint(10)', 'Integer', 'rfFourFunc', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'select', 'rf_function', 15, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (252, '14', 'owner_id', '用户', 'varchar(64)', 'String', 'ownerId', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 16, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (253, '14', 'network_address', '配网地址', 'varchar(255)', 'String', 'networkAddress', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 17, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (254, '14', 'network_ip', '配网IP', 'varchar(32)', 'String', 'networkIp', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 18, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (255, '14', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 19, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (256, '14', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 20, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (257, '14', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, '1', 'BETWEEN', 'datetime', '', 21, 'admin', '2021-05-06 13:31:34', '', '2021-05-06 15:14:47'); +INSERT INTO `gen_table_column` VALUES (258, '14', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 22, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:14:48'); +INSERT INTO `gen_table_column` VALUES (259, '14', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', '1', '1', '1', NULL, NULL, 'EQ', 'datetime', '', 23, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:14:48'); +INSERT INTO `gen_table_column` VALUES (260, '14', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 24, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:14:48'); +INSERT INTO `gen_table_column` VALUES (261, '15', 'device_status_id', '序号', 'bigint(20)', 'Long', 'deviceStatusId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:15:04'); +INSERT INTO `gen_table_column` VALUES (262, '15', 'device_id', '设备', 'bigint(20)', 'Long', 'deviceId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:15:04'); +INSERT INTO `gen_table_column` VALUES (263, '15', 'device_num', '设备编号', 'varchar(64)', 'String', 'deviceNum', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-05-06 13:31:35', '', '2021-05-06 15:15:04'); +INSERT INTO `gen_table_column` VALUES (264, '15', 'relay_status', '继电器', 'tinyint(1)', 'Integer', 'relayStatus', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 4, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (265, '15', 'light_status', '灯状态', 'tinyint(1)', 'Integer', 'lightStatus', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 5, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (266, '15', 'is_online', '在线', 'tinyint(1)', 'Integer', 'isOnline', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', 'sys_yes_no', 6, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (267, '15', 'device_temperature', '设备温度', 'float(6,2)', 'BigDecimal', 'deviceTemperature', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 7, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (268, '15', 'device_humidity', '设备湿度', 'float(6,2)', 'BigDecimal', 'deviceHumidity', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 8, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (269, '15', 'air_temperature', '空气温度', 'float(6,2)', 'BigDecimal', 'airTemperature', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 9, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (270, '15', 'air_humidity', '空气湿度', 'float(6,2)', 'BigDecimal', 'airHumidity', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 10, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (271, '15', 'trigger_source', '触发源', 'tinyint(10)', 'Integer', 'triggerSource', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', 'iot_trigger_source', 11, 'admin', '2021-05-06 13:31:36', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (272, '15', 'brightness', '彩灯亮度', 'tinyint(10) unsigned', 'Integer', 'brightness', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 12, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:05'); +INSERT INTO `gen_table_column` VALUES (273, '15', 'light_interval', '渐变间隔', 'smallint(10)', 'Integer', 'lightInterval', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 13, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (274, '15', 'light_mode', '彩灯模式', 'tinyint(10)', 'Integer', 'lightMode', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'select', 'light_mode', 14, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (275, '15', 'red', '红灯', 'tinyint(255) unsigned', 'Long', 'red', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 15, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (276, '15', 'green', '绿灯', 'tinyint(255) unsigned', 'Long', 'green', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 16, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (277, '15', 'blue', '蓝灯', 'tinyint(255) unsigned', 'Long', 'blue', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 17, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (278, '15', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 18, 'admin', '2021-05-06 13:31:37', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (279, '15', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 19, 'admin', '2021-05-06 13:31:38', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (280, '15', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, '1', 'BETWEEN', 'datetime', '', 20, 'admin', '2021-05-06 13:31:38', '', '2021-05-06 15:15:06'); +INSERT INTO `gen_table_column` VALUES (281, '15', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 21, 'admin', '2021-05-06 13:31:38', '', '2021-05-06 15:15:07'); +INSERT INTO `gen_table_column` VALUES (282, '15', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', '1', '1', '1', NULL, NULL, 'EQ', 'datetime', '', 22, 'admin', '2021-05-06 13:31:38', '', '2021-05-06 15:15:07'); +INSERT INTO `gen_table_column` VALUES (283, '15', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 23, 'admin', '2021-05-06 13:31:38', '', '2021-05-06 15:15:07'); +INSERT INTO `gen_table_column` VALUES (294, '17', 'group_id', '设备分组', 'bigint(20)', 'Long', 'groupId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-05-18 08:04:15', '', '2021-05-18 08:13:40'); +INSERT INTO `gen_table_column` VALUES (295, '17', 'user_id', '用户', 'bigint(20)', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-05-18 08:04:16', '', '2021-05-18 08:13:40'); +INSERT INTO `gen_table_column` VALUES (296, '17', 'group_name', '分组名称', 'varchar(100)', 'String', 'groupName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', '2021-05-18 08:04:16', '', '2021-05-18 08:13:40'); +INSERT INTO `gen_table_column` VALUES (297, '17', 'group_order', '排序', 'smallint(5) unsigned zerofill', 'Integer', 'groupOrder', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'input', '', 4, 'admin', '2021-05-18 08:04:16', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (298, '17', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 5, 'admin', '2021-05-18 08:04:16', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (299, '17', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 6, 'admin', '2021-05-18 08:04:16', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (300, '17', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, '1', '1', 'BETWEEN', 'datetime', '', 7, 'admin', '2021-05-18 08:04:17', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (301, '17', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 8, 'admin', '2021-05-18 08:04:17', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (302, '17', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 9, 'admin', '2021-05-18 08:04:17', '', '2021-05-18 08:13:41'); +INSERT INTO `gen_table_column` VALUES (303, '17', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 10, 'admin', '2021-05-18 08:04:17', '', '2021-05-18 08:13:42'); +INSERT INTO `gen_table_column` VALUES (304, '18', 'id', NULL, 'int', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (305, '18', 'sessionKey', 'sessionKey', 'varchar(255)', 'String', 'sessionkey', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (306, '18', 'access_token', 'accessToken', 'varchar(255)', 'String', 'accessToken', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (307, '18', 'open_id', NULL, 'varchar(50)', 'String', 'openId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (308, '18', 'union_id', NULL, 'varchar(50)', 'String', 'unionId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (309, '18', 'nick_name', '昵称', 'varchar(255)', 'String', 'nickName', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 6, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (310, '18', 'avatar', '头像', 'varchar(255)', 'String', 'avatar', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 7, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (311, '18', 'phone', '手机号', 'varchar(255)', 'String', 'phone', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 8, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (312, '18', 'birthday', '生日', 'varchar(255)', 'String', 'birthday', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 9, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (313, '18', 'status', '用户状态:0-冻结,1-正常', 'int', 'Long', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 10, 'admin', '2021-08-26 14:45:28', '', NULL); +INSERT INTO `gen_table_column` VALUES (314, '18', 'country', '国家', 'varchar(255)', 'String', 'country', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 11, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (315, '18', 'province', '省份', 'varchar(255)', 'String', 'province', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 12, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (316, '18', 'city', '城市', 'varchar(255)', 'String', 'city', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 13, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (317, '18', 'address', '地址', 'varchar(255)', 'String', 'address', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 14, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (318, '18', 'user_type', '用户类型:0-未授权用户,1-消费者,2-商家', 'int', 'Long', 'userType', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'select', '', 15, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (319, '18', 'admin_id', '绑定的管理员编号', 'int', 'Long', 'adminId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 16, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (320, '18', 'last_login_time', NULL, 'timestamp', 'Date', 'lastLoginTime', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'datetime', '', 17, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (321, '18', 'last_login_ip', NULL, 'varchar(255)', 'String', 'lastLoginIp', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 18, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (322, '18', 'gmt_time', NULL, 'timestamp', 'Date', 'gmtTime', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'datetime', '', 19, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (323, '18', 'gmt_update', NULL, 'timestamp', 'Date', 'gmtUpdate', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'datetime', '', 20, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (324, '19', 'id', NULL, 'int', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (325, '19', 'user_type', '用户类型', 'varchar(255)', 'String', 'userType', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 2, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (326, '19', 'user_id', NULL, 'int', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (327, '19', 'code', NULL, 'varchar(50)', 'String', 'code', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (328, '19', 'open_id', NULL, 'varchar(50)', 'String', 'openId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (329, '19', 'ip', 'IP地址', 'varchar(30)', 'String', 'ip', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 6, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (330, '19', 'gmt_time', NULL, 'timestamp', 'Date', 'gmtTime', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 7, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (331, '19', 'gmt_update', NULL, 'timestamp', 'Date', 'gmtUpdate', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 8, 'admin', '2021-08-26 14:45:29', '', NULL); +INSERT INTO `gen_table_column` VALUES (332, '20', 'user_id', '用户ID', 'bigint', 'Long', 'userId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (333, '20', 'dept_id', '部门ID', 'bigint', 'Long', 'deptId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (334, '20', 'open_id', '用户OpenId', 'varchar(40)', 'String', 'openId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (335, '20', 'user_name', '用户账号', 'varchar(30)', 'String', 'userName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (336, '20', 'nick_name', '用户昵称', 'varchar(30)', 'String', 'nickName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 5, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (337, '20', 'user_type', '用户类型(00系统用户)', 'varchar(2)', 'String', 'userType', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 6, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (338, '20', 'email', '用户邮箱', 'varchar(50)', 'String', 'email', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 7, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (339, '20', 'phonenumber', '手机号码', 'varchar(11)', 'String', 'phonenumber', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 8, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (340, '20', 'sex', '用户性别(0男 1女 2未知)', 'char(1)', 'String', 'sex', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 9, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (341, '20', 'avatar', '头像地址', 'varchar(100)', 'String', 'avatar', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 10, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (342, '20', 'password', '密码', 'varchar(100)', 'String', 'password', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 11, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (343, '20', 'status', '帐号状态(0正常 1停用)', 'char(1)', 'String', 'status', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'radio', '', 12, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (344, '20', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 13, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (345, '20', 'login_ip', '最后登录IP', 'varchar(128)', 'String', 'loginIp', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 14, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (346, '20', 'login_date', '最后登录时间', 'datetime', 'Date', 'loginDate', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 15, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (347, '20', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 16, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (348, '20', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 17, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (349, '20', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 18, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (350, '20', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 19, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (351, '20', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 20, 'admin', '2021-08-26 17:07:45', '', NULL); +INSERT INTO `gen_table_column` VALUES (352, '21', 'id', NULL, 'int', 'Long', 'id', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-08-27 11:55:05', '', NULL); +INSERT INTO `gen_table_column` VALUES (353, '21', 'user_id', NULL, 'int', 'Long', 'userId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-08-27 11:55:05', '', NULL); +INSERT INTO `gen_table_column` VALUES (354, '21', 'device_id', NULL, 'int', 'Long', 'deviceId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-08-27 11:55:06', '', NULL); +INSERT INTO `gen_table_column` VALUES (355, '21', 'device_num', NULL, 'varchar(60)', 'String', 'deviceNum', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 4, 'admin', '2021-08-27 11:55:06', '', NULL); +INSERT INTO `gen_table_column` VALUES (356, '21', 'gmt_time', NULL, 'timestamp', 'Date', 'gmtTime', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 5, 'admin', '2021-08-27 11:55:06', '', NULL); +INSERT INTO `gen_table_column` VALUES (357, '21', 'gmt_update', NULL, 'timestamp', 'Date', 'gmtUpdate', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 6, 'admin', '2021-08-27 11:55:06', '', NULL); +INSERT INTO `gen_table_column` VALUES (358, '22', 'device_id', '设备ID', 'bigint', 'Long', 'deviceId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (359, '22', 'device_num', '设备编号', 'varchar(64)', 'String', 'deviceNum', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (360, '22', 'category_id', '设备分类', 'bigint', 'Long', 'categoryId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (361, '22', 'device_name', '设备名称', 'varchar(64)', 'String', 'deviceName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 4, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (362, '22', 'firmware_version', '固件版本', 'varchar(32)', 'String', 'firmwareVersion', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (363, '22', 'owner_id', '设备用户ID', 'varchar(64)', 'String', 'ownerId', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 6, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (364, '22', 'del_flag', '删除标志(0代表存在 2代表删除)', 'char(1)', 'String', 'delFlag', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 7, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (365, '22', 'status', '设备状态:未激活,未绑定,已绑定', 'varchar(255)', 'String', 'status', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'radio', '', 8, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (366, '22', 'create_by', '创建者', 'varchar(64)', 'String', 'createBy', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 9, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (367, '22', 'create_time', '创建时间', 'datetime', 'Date', 'createTime', '0', '0', NULL, '1', NULL, NULL, NULL, 'EQ', 'datetime', '', 10, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (368, '22', 'update_by', '更新者', 'varchar(64)', 'String', 'updateBy', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'input', '', 11, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (369, '22', 'update_time', '更新时间', 'datetime', 'Date', 'updateTime', '0', '0', NULL, '1', '1', NULL, NULL, 'EQ', 'datetime', '', 12, 'admin', '2021-08-27 13:45:40', '', NULL); +INSERT INTO `gen_table_column` VALUES (370, '22', 'remark', '备注', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 13, 'admin', '2021-08-27 13:45:40', '', NULL); + +-- ---------------------------- +-- Table structure for iot_category +-- ---------------------------- +DROP TABLE IF EXISTS `iot_category`; +CREATE TABLE `iot_category` ( + `category_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '设备分类ID', + `category_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备分类名称', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`category_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_category +-- ---------------------------- +INSERT INTO `iot_category` VALUES (1, 'wifi通断器', '0', '', '2021-05-06 01:00:04', '', '2021-05-06 01:05:08', '智能开关,带温湿度传感器,支持手机和射频遥控控制。应用于传统家电设备的控制等。'); +INSERT INTO `iot_category` VALUES (2, '智能灯', '0', '', '2021-05-06 01:01:39', '', '2021-05-06 01:05:32', '智能七彩灯,支持雷达感应、报警,手机和射频遥控控制。应用于环境灯、感应灯和传统灯的控制等。'); +INSERT INTO `iot_category` VALUES (3, '智能门锁', '0', '', '2021-05-06 01:02:34', '', '2021-05-06 01:04:22', '支持手机和射频遥控控制。'); +INSERT INTO `iot_category` VALUES (4, '智能水阀', '0', '', '2021-05-06 01:03:57', '', NULL, '手机和射频遥控控制,应用于浇灌系统。'); +INSERT INTO `iot_category` VALUES (5, '其他', '0', '', '2021-05-28 19:31:05', '', NULL, '其他硬件设备的接入'); + +-- ---------------------------- +-- Table structure for iot_device +-- ---------------------------- +DROP TABLE IF EXISTS `iot_device`; +CREATE TABLE `iot_device` ( + `device_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '设备ID', + `device_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', + `category_id` bigint(0) NULL DEFAULT NULL COMMENT '设备分类', + `device_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备名称', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + `firmware_version` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '固件版本', + `owner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备用户ID', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '未激活' COMMENT '设备状态:未激活,未绑定,已绑定', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`device_id`) USING BTREE, + INDEX `iot_device_category`(`category_id`) USING BTREE, + CONSTRAINT `iot_device_category` FOREIGN KEY (`category_id`) REFERENCES `iot_category` (`category_id`) ON DELETE SET NULL ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_device +-- ---------------------------- +INSERT INTO `iot_device` VALUES (1, '7CDFA1049ADA', 2, '阿拉丁神灯', '阿拉丁灯灯灯灯灯。', '1.0', NULL, '0', '未激活', '', '2021-05-23 14:26:38', '', '2021-06-26 20:25:09'); +INSERT INTO `iot_device` VALUES (2, '7CDFA1049ADB', 1, '智能开关-测试', '暂无', '1.0', NULL, '0', '未激活', '', '2021-05-23 14:26:38', '', '2021-06-15 02:47:52'); +INSERT INTO `iot_device` VALUES (3, '7CDFA1049ADC', 1, '设备名称', 'remark', '1.0', NULL, '0', '未激活', '', '2021-05-23 14:26:38', '', '2021-06-15 02:47:52'); +INSERT INTO `iot_device` VALUES (4, '863488052352472', 4, '4G开关001', '灯等等灯', '1.0', '1', '0', '未绑定', '', NULL, '', '2021-08-31 20:11:17'); + +-- ---------------------------- +-- Table structure for iot_device_group +-- ---------------------------- +DROP TABLE IF EXISTS `iot_device_group`; +CREATE TABLE `iot_device_group` ( + `device_group_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '设备分组ID', + `group_id` bigint(0) NOT NULL COMMENT '分组ID', + `device_id` bigint(0) NOT NULL COMMENT '设备ID', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`device_group_id`) USING BTREE, + INDEX `iot_device_group_group_id`(`group_id`) USING BTREE, + INDEX `iot_device_group_device_id`(`device_id`) USING BTREE, + CONSTRAINT `iot_device_group_device_id` FOREIGN KEY (`device_id`) REFERENCES `iot_device` (`device_id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT `iot_device_group_group_id` FOREIGN KEY (`group_id`) REFERENCES `iot_group` (`group_id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_device_group +-- ---------------------------- +INSERT INTO `iot_device_group` VALUES (1, 1, 1, '2021-06-11 23:25:49'); +INSERT INTO `iot_device_group` VALUES (2, 2, 1, '2021-06-11 23:25:49'); +INSERT INTO `iot_device_group` VALUES (6, 1, 2, '2021-06-11 23:25:49'); +INSERT INTO `iot_device_group` VALUES (7, 2, 2, '2021-06-11 23:25:49'); + +-- ---------------------------- +-- Table structure for iot_device_set +-- ---------------------------- +DROP TABLE IF EXISTS `iot_device_set`; +CREATE TABLE `iot_device_set` ( + `device_set_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '配置id', + `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备ID', + `device_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', + `is_alarm` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用报警', + `is_radar` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用雷达感应', + `is_host` tinyint(1) NULL DEFAULT NULL COMMENT '是否托管', + `is_reset` tinyint(1) NULL DEFAULT NULL COMMENT '是否重启', + `is_ap` tinyint(1) NULL DEFAULT NULL COMMENT '是否打开AP', + `is_smart_config` tinyint(1) NULL DEFAULT NULL COMMENT '是否智能配网', + `is_wifi_offline` tinyint(1) NULL DEFAULT NULL COMMENT '是否离线模式', + `is_open_certifi` tinyint(1) NULL DEFAULT NULL COMMENT '是否使用证书', + `is_rf_control` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用射频遥控', + `is_rf_learn` tinyint(1) NULL DEFAULT NULL COMMENT '是否遥控配对', + `is_rf_clear` tinyint(1) NULL DEFAULT NULL COMMENT '是否遥控清码', + `rf_one_func` tinyint(0) NULL DEFAULT NULL COMMENT 'RF遥控第一个按键功能', + `rf_two_func` tinyint(0) NULL DEFAULT NULL COMMENT 'RF遥控第二个按键功能', + `rf_three_func` tinyint(0) NULL DEFAULT NULL COMMENT 'RF遥控第三个按键功能', + `rf_four_func` tinyint(0) NULL DEFAULT NULL COMMENT 'RF遥控第四个按键功能', + `owner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '设备用户ID,用于记录配网后用户的变更', + `network_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配网地址', + `network_ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配网IP', + `radar_interval` smallint(0) NULL DEFAULT NULL COMMENT '雷达感应间隔,单位秒', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`device_set_id`) USING BTREE, + INDEX `iot_device_config`(`device_id`) USING BTREE, + CONSTRAINT `iot_device_config` FOREIGN KEY (`device_id`) REFERENCES `iot_device` (`device_id`) ON DELETE SET NULL ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 300 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_device_set +-- ---------------------------- +INSERT INTO `iot_device_set` VALUES (1, 1, '7CDFA1049ADA', 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 3, 4, '1', '内网', '127.0.0.1', 5, '0', '', '2021-06-26 20:25:10', '', NULL, NULL); +INSERT INTO `iot_device_set` VALUES (2, 2, '7CDFA1049ADB', 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 3, 4, '1', '内网', '127.0.0.1', 5, '0', '', '2021-06-01 00:12:26', '', '2021-06-23 20:59:33', NULL); +INSERT INTO `iot_device_set` VALUES (3, 4, '863488052352472', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', NULL, '', NULL, NULL); + +-- ---------------------------- +-- Table structure for iot_device_status +-- ---------------------------- +DROP TABLE IF EXISTS `iot_device_status`; +CREATE TABLE `iot_device_status` ( + `device_status_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '设备状态ID', + `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备ID', + `device_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编号', + `relay_status` tinyint(1) NULL DEFAULT NULL COMMENT '继电器状态:0-关,1-开', + `light_status` tinyint(1) NULL DEFAULT NULL COMMENT '灯状态:0-关,1-开', + `is_online` tinyint(1) NULL DEFAULT NULL COMMENT '设备是否在线', + `rssi` tinyint(0) NULL DEFAULT NULL COMMENT 'wifi信号强度', + `device_temperature` float(6, 2) NULL DEFAULT NULL COMMENT '设备温度', + `air_temperature` float(6, 2) NULL DEFAULT NULL COMMENT '空气温度', + `air_humidity` float(6, 2) NULL DEFAULT NULL COMMENT '空气湿度', + `trigger_source` tinyint(0) NULL DEFAULT NULL COMMENT '触发源:0-无、1-按键、2.手机、3-浏览器、4-射频遥控、5-雷达、6-报警、7-定时', + `brightness` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '灯的亮度:0-100', + `light_interval` int(0) NULL DEFAULT NULL COMMENT '渐变、动感模式闪烁间隔,单位秒', + `light_mode` tinyint(0) NULL DEFAULT NULL COMMENT '灯模式:1-、2-、3-、4-、5-、6-', + `fade_time` int(0) NULL DEFAULT NULL COMMENT '灯渐变时间', + `red` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '红灯值:0-255', + `green` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '绿灯值:0-255', + `blue` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '蓝灯值:0-255', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`device_status_id`) USING BTREE, + INDEX `iot_device_status`(`device_id`) USING BTREE, + CONSTRAINT `iot_device_status` FOREIGN KEY (`device_id`) REFERENCES `iot_device` (`device_id`) ON DELETE SET NULL ON UPDATE RESTRICT +) ENGINE = InnoDB AUTO_INCREMENT = 2879 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_device_status +-- ---------------------------- +INSERT INTO `iot_device_status` VALUES (1, 1, '7CDFA1049ADA', 1, 1, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-06-26 20:27:17', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2, 2, '7CDFA1049ADB', 0, 1, 0, -46, 23.78, 0.00, 0.00, 0, 100, 100, 0, 100, 255, 255, 255, '0', '', '2021-06-01 00:13:38', '', '2021-06-23 21:00:37', NULL); +INSERT INTO `iot_device_status` VALUES (2846, 1, '7CDFA1049ADA', 1, 0, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-08-26 18:38:11', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2847, 1, '7CDFA1049ADA', 1, 1, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-08-26 18:38:12', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2848, 1, '7CDFA1049ADA', 1, 0, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-08-26 18:38:13', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2849, 1, '7CDFA1049ADA', 1, 1, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-08-26 18:38:17', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2850, 4, '863488052352472', 1, 1, 1, -80, 36.52, 0.00, 0.00, 0, 100, 432, 0, 259, 255, 254, 241, '0', '', '2021-08-26 18:38:17', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2851, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:11:20', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2852, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:11:22', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2853, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:11:23', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2854, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:14:13', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2855, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:14:13', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2856, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:19:29', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2857, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:19:31', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2858, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:20:02', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2859, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:20:03', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2860, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:23:34', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2861, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:23:40', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2862, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:37', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2863, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:39', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2864, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:41', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2865, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:43', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2866, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:47', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2867, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:50', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2868, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:24:51', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2869, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:08', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2870, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:10', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2871, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:10', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2872, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:11', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2873, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:12', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2874, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:13', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2875, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:14', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2876, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:14', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2877, 4, '863488052352472', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:15', '', NULL, NULL); +INSERT INTO `iot_device_status` VALUES (2878, 4, '863488052352472', 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '', '2021-08-31 20:25:15', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for iot_device_user_relation +-- ---------------------------- +DROP TABLE IF EXISTS `iot_device_user_relation`; +CREATE TABLE `iot_device_user_relation` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `user_id` int(0) NOT NULL, + `device_id` int(0) NOT NULL, + `device_num` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '设备名称', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '设备备注', + `gmt_time` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0), + `gmt_update` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE, + INDEX `user_id`(`user_id`, `device_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户-设备关联表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_device_user_relation +-- ---------------------------- +INSERT INTO `iot_device_user_relation` VALUES (8, 115, 4, '863488052352472', 'wxy测试开关', NULL, '2021-08-28 13:35:23', NULL); +INSERT INTO `iot_device_user_relation` VALUES (10, 114, 4, '863488052352472', '阿拉丁神灯', '灯等等灯', '2021-08-30 10:57:14', '2021-08-30 15:28:25'); +INSERT INTO `iot_device_user_relation` VALUES (13, 116, 4, '863488052352472', '阿拉丁神灯', NULL, '2021-08-31 20:24:31', NULL); + +-- ---------------------------- +-- Table structure for iot_group +-- ---------------------------- +DROP TABLE IF EXISTS `iot_group`; +CREATE TABLE `iot_group` ( + `group_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '设备分组ID', + `user_id` bigint(0) NOT NULL COMMENT '用户ID', + `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备分组名称', + `group_order` smallint(5) UNSIGNED ZEROFILL NULL DEFAULT 00000 COMMENT '分组的排序', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`group_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of iot_group +-- ---------------------------- +INSERT INTO `iot_group` VALUES (1, 114, '一楼', 00001, '0', '', '2021-05-18 16:35:03', '', '2021-05-18 16:35:32', '智能灯'); +INSERT INTO `iot_group` VALUES (2, 114, '二楼', 00002, '0', '', '2021-05-18 16:35:03', '', '2021-05-18 16:35:32', '智能灯'); +INSERT INTO `iot_group` VALUES (3, 114, '三楼', 00003, '0', '', '2021-05-18 16:35:03', '', '2021-05-18 16:35:32', '智能灯'); +INSERT INTO `iot_group` VALUES (4, 114, '四楼', 00004, '0', '', '2021-05-18 16:35:03', '', '2021-05-18 16:35:32', '智能灯'); +INSERT INTO `iot_group` VALUES (5, 114, '五楼', 00005, '0', '', '2021-05-18 16:35:03', '', '2021-05-18 16:35:32', '智能灯'); + +-- ---------------------------- +-- Table structure for qrtz_blob_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_blob_triggers`; +CREATE TABLE `qrtz_blob_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `blob_data` blob NULL, + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_calendars +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_calendars`; +CREATE TABLE `qrtz_calendars` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `calendar_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `calendar` blob NOT NULL, + PRIMARY KEY (`sched_name`, `calendar_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_cron_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_cron_triggers`; +CREATE TABLE `qrtz_cron_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `cron_expression` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `time_zone_id` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_cron_triggers +-- ---------------------------- +INSERT INTO `qrtz_cron_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME1', 'DEFAULT', '0/10 * * * * ?', 'Asia/Shanghai'); +INSERT INTO `qrtz_cron_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME2', 'DEFAULT', '0/15 * * * * ?', 'Asia/Shanghai'); +INSERT INTO `qrtz_cron_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME3', 'DEFAULT', '0/20 * * * * ?', 'Asia/Shanghai'); + +-- ---------------------------- +-- Table structure for qrtz_fired_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_fired_triggers`; +CREATE TABLE `qrtz_fired_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `entry_id` varchar(95) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `instance_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `fired_time` bigint(0) NOT NULL, + `sched_time` bigint(0) NOT NULL, + `priority` int(0) NOT NULL, + `state` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `is_nonconcurrent` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `requests_recovery` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`sched_name`, `entry_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_job_details +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_job_details`; +CREATE TABLE `qrtz_job_details` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `description` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `job_class_name` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `is_durable` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `is_nonconcurrent` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `is_update_data` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `requests_recovery` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_data` blob NULL, + PRIMARY KEY (`sched_name`, `job_name`, `job_group`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_job_details +-- ---------------------------- +INSERT INTO `qrtz_job_details` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME1', 'DEFAULT', NULL, 'com.ruoyi.quartz.util.QuartzDisallowConcurrentExecution', '0', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000174000F5441534B5F50524F504552544945537372001E636F6D2E72756F79692E71756172747A2E646F6D61696E2E5379734A6F6200000000000000010200084C000A636F6E63757272656E747400124C6A6176612F6C616E672F537472696E673B4C000E63726F6E45787072657373696F6E71007E00094C000C696E766F6B6554617267657471007E00094C00086A6F6247726F757071007E00094C00056A6F6249647400104C6A6176612F6C616E672F4C6F6E673B4C00076A6F624E616D6571007E00094C000D6D697366697265506F6C69637971007E00094C000673746174757371007E000978720027636F6D2E72756F79692E636F6D6D6F6E2E636F72652E646F6D61696E2E42617365456E7469747900000000000000010200074C0008637265617465427971007E00094C000A63726561746554696D657400104C6A6176612F7574696C2F446174653B4C0006706172616D7371007E00034C000672656D61726B71007E00094C000B73656172636856616C756571007E00094C0008757064617465427971007E00094C000A75706461746554696D6571007E000C787074000561646D696E7372000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001797B913EF878707400007070707400013174000E302F3130202A202A202A202A203F74001172795461736B2E72794E6F506172616D7374000744454641554C547372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000000000001740018E7B3BBE7BB9FE9BB98E8AEA4EFBC88E697A0E58F82EFBC8974000133740001317800); +INSERT INTO `qrtz_job_details` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME2', 'DEFAULT', NULL, 'com.ruoyi.quartz.util.QuartzDisallowConcurrentExecution', '0', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000174000F5441534B5F50524F504552544945537372001E636F6D2E72756F79692E71756172747A2E646F6D61696E2E5379734A6F6200000000000000010200084C000A636F6E63757272656E747400124C6A6176612F6C616E672F537472696E673B4C000E63726F6E45787072657373696F6E71007E00094C000C696E766F6B6554617267657471007E00094C00086A6F6247726F757071007E00094C00056A6F6249647400104C6A6176612F6C616E672F4C6F6E673B4C00076A6F624E616D6571007E00094C000D6D697366697265506F6C69637971007E00094C000673746174757371007E000978720027636F6D2E72756F79692E636F6D6D6F6E2E636F72652E646F6D61696E2E42617365456E7469747900000000000000010200074C0008637265617465427971007E00094C000A63726561746554696D657400104C6A6176612F7574696C2F446174653B4C0006706172616D7371007E00034C000672656D61726B71007E00094C000B73656172636856616C756571007E00094C0008757064617465427971007E00094C000A75706461746554696D6571007E000C787074000561646D696E7372000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001797B913EF878707400007070707400013174000E302F3135202A202A202A202A203F74001572795461736B2E7279506172616D7328277279272974000744454641554C547372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000000000002740018E7B3BBE7BB9FE9BB98E8AEA4EFBC88E69C89E58F82EFBC8974000133740001317800); +INSERT INTO `qrtz_job_details` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME3', 'DEFAULT', NULL, 'com.ruoyi.quartz.util.QuartzDisallowConcurrentExecution', '0', '1', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000174000F5441534B5F50524F504552544945537372001E636F6D2E72756F79692E71756172747A2E646F6D61696E2E5379734A6F6200000000000000010200084C000A636F6E63757272656E747400124C6A6176612F6C616E672F537472696E673B4C000E63726F6E45787072657373696F6E71007E00094C000C696E766F6B6554617267657471007E00094C00086A6F6247726F757071007E00094C00056A6F6249647400104C6A6176612F6C616E672F4C6F6E673B4C00076A6F624E616D6571007E00094C000D6D697366697265506F6C69637971007E00094C000673746174757371007E000978720027636F6D2E72756F79692E636F6D6D6F6E2E636F72652E646F6D61696E2E42617365456E7469747900000000000000010200074C0008637265617465427971007E00094C000A63726561746554696D657400104C6A6176612F7574696C2F446174653B4C0006706172616D7371007E00034C000672656D61726B71007E00094C000B73656172636856616C756571007E00094C0008757064617465427971007E00094C000A75706461746554696D6571007E000C787074000561646D696E7372000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001797B913EF878707400007070707400013174000E302F3230202A202A202A202A203F74003872795461736B2E72794D756C7469706C65506172616D7328277279272C20747275652C20323030304C2C203331362E3530442C203130302974000744454641554C547372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000000000003740018E7B3BBE7BB9FE9BB98E8AEA4EFBC88E5A49AE58F82EFBC8974000133740001317800); + +-- ---------------------------- +-- Table structure for qrtz_locks +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_locks`; +CREATE TABLE `qrtz_locks` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `lock_name` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`sched_name`, `lock_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_locks +-- ---------------------------- +INSERT INTO `qrtz_locks` VALUES ('RuoyiScheduler', 'STATE_ACCESS'); +INSERT INTO `qrtz_locks` VALUES ('RuoyiScheduler', 'TRIGGER_ACCESS'); + +-- ---------------------------- +-- Table structure for qrtz_paused_trigger_grps +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`; +CREATE TABLE `qrtz_paused_trigger_grps` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`sched_name`, `trigger_group`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_scheduler_state +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_scheduler_state`; +CREATE TABLE `qrtz_scheduler_state` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `instance_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `last_checkin_time` bigint(0) NOT NULL, + `checkin_interval` bigint(0) NOT NULL, + PRIMARY KEY (`sched_name`, `instance_name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_scheduler_state +-- ---------------------------- +INSERT INTO `qrtz_scheduler_state` VALUES ('RuoyiScheduler', 'Admin1630461270994', 1630548198218, 15000); + +-- ---------------------------- +-- Table structure for qrtz_simple_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_simple_triggers`; +CREATE TABLE `qrtz_simple_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `repeat_count` bigint(0) NOT NULL, + `repeat_interval` bigint(0) NOT NULL, + `times_triggered` bigint(0) NOT NULL, + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_simprop_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_simprop_triggers`; +CREATE TABLE `qrtz_simprop_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `str_prop_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `str_prop_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `str_prop_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `int_prop_1` int(0) NULL DEFAULT NULL, + `int_prop_2` int(0) NULL DEFAULT NULL, + `long_prop_1` bigint(0) NULL DEFAULT NULL, + `long_prop_2` bigint(0) NULL DEFAULT NULL, + `dec_prop_1` decimal(13, 4) NULL DEFAULT NULL, + `dec_prop_2` decimal(13, 4) NULL DEFAULT NULL, + `bool_prop_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `bool_prop_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`sched_name`, `trigger_name`, `trigger_group`) REFERENCES `qrtz_triggers` (`sched_name`, `trigger_name`, `trigger_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for qrtz_triggers +-- ---------------------------- +DROP TABLE IF EXISTS `qrtz_triggers`; +CREATE TABLE `qrtz_triggers` ( + `sched_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `job_group` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `description` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `next_fire_time` bigint(0) NULL DEFAULT NULL, + `prev_fire_time` bigint(0) NULL DEFAULT NULL, + `priority` int(0) NULL DEFAULT NULL, + `trigger_state` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `trigger_type` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `start_time` bigint(0) NOT NULL, + `end_time` bigint(0) NULL DEFAULT NULL, + `calendar_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `misfire_instr` smallint(0) NULL DEFAULT NULL, + `job_data` blob NULL, + PRIMARY KEY (`sched_name`, `trigger_name`, `trigger_group`) USING BTREE, + INDEX `sched_name`(`sched_name`, `job_name`, `job_group`) USING BTREE, + CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`sched_name`, `job_name`, `job_group`) REFERENCES `qrtz_job_details` (`sched_name`, `job_name`, `job_group`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of qrtz_triggers +-- ---------------------------- +INSERT INTO `qrtz_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME1', 'DEFAULT', 'TASK_CLASS_NAME1', 'DEFAULT', NULL, 1630461280000, -1, 5, 'PAUSED', 'CRON', 1630461271000, 0, NULL, 2, ''); +INSERT INTO `qrtz_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME2', 'DEFAULT', 'TASK_CLASS_NAME2', 'DEFAULT', NULL, 1630461285000, -1, 5, 'PAUSED', 'CRON', 1630461271000, 0, NULL, 2, ''); +INSERT INTO `qrtz_triggers` VALUES ('RuoyiScheduler', 'TASK_CLASS_NAME3', 'DEFAULT', 'TASK_CLASS_NAME3', 'DEFAULT', NULL, 1630461280000, -1, 5, 'PAUSED', 'CRON', 1630461271000, 0, NULL, 2, ''); + +-- ---------------------------- +-- Table structure for sys_config +-- ---------------------------- +DROP TABLE IF EXISTS `sys_config`; +CREATE TABLE `sys_config` ( + `config_id` int(0) NOT NULL AUTO_INCREMENT COMMENT '参数主键', + `config_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数名称', + `config_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数键名', + `config_value` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '参数键值', + `config_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '系统内置(Y是 N否)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`config_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '参数配置表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_config +-- ---------------------------- +INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2021-05-18 02:23:07', '', NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); +INSERT INTO `sys_config` VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', '2021-05-18 02:23:07', '', NULL, '初始化密码 123456'); +INSERT INTO `sys_config` VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2021-05-18 02:23:07', '', NULL, '深色主题theme-dark,浅色主题theme-light'); + +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '部门id', + `parent_id` bigint(0) NULL DEFAULT 0 COMMENT '父部门id', + `ancestors` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '祖级列表', + `dept_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '部门名称', + `order_num` int(0) NULL DEFAULT 0 COMMENT '显示顺序', + `leader` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人', + `phone` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`dept_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 110 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +INSERT INTO `sys_dept` VALUES (100, 0, '0', '若依科技', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (101, 100, '0,100', '深圳总公司', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (102, 100, '0,100', '长沙分公司', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (103, 101, '0,100,101', '研发部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (104, 101, '0,100,101', '市场部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (105, 101, '0,100,101', '测试部门', 3, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (106, 101, '0,100,101', '财务部门', 4, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (107, 101, '0,100,101', '运维部门', 5, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (108, 102, '0,100,102', '市场部门', 1, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); +INSERT INTO `sys_dept` VALUES (109, 102, '0,100,102', '财务部门', 2, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL); + +-- ---------------------------- +-- Table structure for sys_dict_data +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_data`; +CREATE TABLE `sys_dict_data` ( + `dict_code` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '字典编码', + `dict_sort` int(0) NULL DEFAULT 0 COMMENT '字典排序', + `dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典标签', + `dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典键值', + `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `css_class` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '样式属性(其他样式扩展)', + `list_class` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '表格回显样式', + `is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 119 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典数据表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dict_data +-- ---------------------------- +INSERT INTO `sys_dict_data` VALUES (1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '性别男'); +INSERT INTO `sys_dict_data` VALUES (2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '性别女'); +INSERT INTO `sys_dict_data` VALUES (3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '性别未知'); +INSERT INTO `sys_dict_data` VALUES (4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '显示菜单'); +INSERT INTO `sys_dict_data` VALUES (5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '隐藏菜单'); +INSERT INTO `sys_dict_data` VALUES (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (10, 1, '默认', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '默认分组'); +INSERT INTO `sys_dict_data` VALUES (11, 2, '系统', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '系统分组'); +INSERT INTO `sys_dict_data` VALUES (12, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '系统默认是'); +INSERT INTO `sys_dict_data` VALUES (13, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '系统默认否'); +INSERT INTO `sys_dict_data` VALUES (14, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '通知'); +INSERT INTO `sys_dict_data` VALUES (15, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '公告'); +INSERT INTO `sys_dict_data` VALUES (16, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (17, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '关闭状态'); +INSERT INTO `sys_dict_data` VALUES (18, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '新增操作'); +INSERT INTO `sys_dict_data` VALUES (19, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '修改操作'); +INSERT INTO `sys_dict_data` VALUES (20, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '删除操作'); +INSERT INTO `sys_dict_data` VALUES (21, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '授权操作'); +INSERT INTO `sys_dict_data` VALUES (22, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '导出操作'); +INSERT INTO `sys_dict_data` VALUES (23, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '导入操作'); +INSERT INTO `sys_dict_data` VALUES (24, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '强退操作'); +INSERT INTO `sys_dict_data` VALUES (25, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '生成操作'); +INSERT INTO `sys_dict_data` VALUES (26, 9, '清空数据', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '清空操作'); +INSERT INTO `sys_dict_data` VALUES (27, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '正常状态'); +INSERT INTO `sys_dict_data` VALUES (28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '停用状态'); +INSERT INTO `sys_dict_data` VALUES (100, 0, '按键', '1', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:53:34', 'admin', '2021-05-05 15:54:17', '按键操作'); +INSERT INTO `sys_dict_data` VALUES (101, 0, '手机', '2', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:53:50', '', NULL, '手机操作'); +INSERT INTO `sys_dict_data` VALUES (102, 0, '浏览器', '3', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:54:09', '', NULL, '浏览器操作'); +INSERT INTO `sys_dict_data` VALUES (103, 0, '射频遥控', '4', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:54:44', '', NULL, '433M遥控操作'); +INSERT INTO `sys_dict_data` VALUES (104, 0, '雷达', '5', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:55:03', '', NULL, '雷达触发'); +INSERT INTO `sys_dict_data` VALUES (105, 0, '报警', '6', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:55:44', '', NULL, '报警触发'); +INSERT INTO `sys_dict_data` VALUES (106, 0, '定时', '7', 'iot_trigger_source', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:56:03', '', NULL, '定时触发'); +INSERT INTO `sys_dict_data` VALUES (107, 1, '继电器开关', '1', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:58:36', 'admin', '2021-06-23 22:50:32', '继电器通断'); +INSERT INTO `sys_dict_data` VALUES (108, 2, '七彩灯开关', '2', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:58:57', 'admin', '2021-06-23 22:50:44', '开关灯'); +INSERT INTO `sys_dict_data` VALUES (109, 3, '雷达开关', '3', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-05-05 15:59:34', 'admin', '2021-06-23 22:50:21', '开关雷达'); +INSERT INTO `sys_dict_data` VALUES (110, 4, '报警开关', '4', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:00:01', 'admin', '2021-06-01 15:44:44', '报警开关'); +INSERT INTO `sys_dict_data` VALUES (111, 5, '智能配网', '5', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:00:16', 'admin', '2021-06-01 15:44:51', '智能配网'); +INSERT INTO `sys_dict_data` VALUES (112, 0, '固定颜色', '0', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:07:22', '', NULL, '固定颜色'); +INSERT INTO `sys_dict_data` VALUES (113, 0, '七彩渐变', '1', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:07:41', '', NULL, '七彩渐变'); +INSERT INTO `sys_dict_data` VALUES (114, 0, '动感模式', '2', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:08:44', '', NULL, '动感模式'); +INSERT INTO `sys_dict_data` VALUES (115, 0, '单色渐变', '3', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:09:12', '', NULL, '单色渐变'); +INSERT INTO `sys_dict_data` VALUES (116, 0, '白光', '4', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:09:46', '', NULL, '白光'); +INSERT INTO `sys_dict_data` VALUES (117, 0, '暖光', '5', 'light_mode', NULL, NULL, 'N', '0', 'admin', '2021-05-05 16:10:07', '', NULL, '暖光'); +INSERT INTO `sys_dict_data` VALUES (118, 0, '无', '0', 'rf_function', NULL, NULL, 'N', '0', 'admin', '2021-06-01 15:43:44', 'admin', '2021-06-01 15:44:21', '不进行任何操作'); + +-- ---------------------------- +-- Table structure for sys_dict_type +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict_type`; +CREATE TABLE `sys_dict_type` ( + `dict_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '字典主键', + `dict_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典名称', + `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '字典类型', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`dict_id`) USING BTREE, + UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 103 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典类型表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_dict_type +-- ---------------------------- +INSERT INTO `sys_dict_type` VALUES (1, '用户性别', 'sys_user_sex', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '用户性别列表'); +INSERT INTO `sys_dict_type` VALUES (2, '菜单状态', 'sys_show_hide', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '菜单状态列表'); +INSERT INTO `sys_dict_type` VALUES (3, '系统开关', 'sys_normal_disable', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '系统开关列表'); +INSERT INTO `sys_dict_type` VALUES (4, '任务状态', 'sys_job_status', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '任务状态列表'); +INSERT INTO `sys_dict_type` VALUES (5, '任务分组', 'sys_job_group', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '任务分组列表'); +INSERT INTO `sys_dict_type` VALUES (6, '系统是否', 'sys_yes_no', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '系统是否列表'); +INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '通知类型列表'); +INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '通知状态列表'); +INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '操作类型列表'); +INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2021-05-18 02:23:07', '', NULL, '登录状态列表'); +INSERT INTO `sys_dict_type` VALUES (100, '设备触发源', 'iot_trigger_source', '0', 'admin', '2021-05-05 15:51:26', '', NULL, '设备操作的触发源'); +INSERT INTO `sys_dict_type` VALUES (101, '射频遥控按键功能', 'rf_function', '0', 'admin', '2021-05-05 15:58:05', '', NULL, '射频遥控按键功能列表'); +INSERT INTO `sys_dict_type` VALUES (102, '彩灯模式', 'light_mode', '0', 'admin', '2021-05-05 16:04:53', '', NULL, '彩灯模式,单色、七彩、渐变、动感'); + +-- ---------------------------- +-- Table structure for sys_job +-- ---------------------------- +DROP TABLE IF EXISTS `sys_job`; +CREATE TABLE `sys_job` ( + `job_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '任务ID', + `job_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务名称', + `job_group` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名', + `invoke_target` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调用目标字符串', + `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式', + `misfire_policy` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)', + `concurrent` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '是否并发执行(0允许 1禁止)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '状态(0正常 1暂停)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注信息', + PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_job +-- ---------------------------- +INSERT INTO `sys_job` VALUES (1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_job` VALUES (2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_job` VALUES (3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', '2021-05-18 02:23:07', '', NULL, ''); + +-- ---------------------------- +-- Table structure for sys_job_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_job_log`; +CREATE TABLE `sys_job_log` ( + `job_log_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '任务日志ID', + `job_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务名称', + `job_group` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '任务组名', + `invoke_target` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '调用目标字符串', + `job_message` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志信息', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '执行状态(0正常 1失败)', + `exception_info` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '异常信息', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`job_log_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务调度日志表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_job_log +-- ---------------------------- +INSERT INTO `sys_job_log` VALUES (1, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '系统默认(有参) 总共耗时:1毫秒', '0', '', '2021-06-11 09:23:45'); + +-- ---------------------------- +-- Table structure for sys_logininfor +-- ---------------------------- +DROP TABLE IF EXISTS `sys_logininfor`; +CREATE TABLE `sys_logininfor` ( + `info_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '访问ID', + `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户账号', + `ipaddr` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '登录IP地址', + `login_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '登录地点', + `browser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '浏览器类型', + `os` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作系统', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '登录状态(0成功 1失败)', + `msg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '提示消息', + `login_time` datetime(0) NULL DEFAULT NULL COMMENT '访问时间', + PRIMARY KEY (`info_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 435 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统访问记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_logininfor +-- ---------------------------- +INSERT INTO `sys_logininfor` VALUES (385, 'admin', '172.17.0.1', '内网IP', 'Mobile Safari', 'Android 1.x', '1', '用户不存在/密码错误', '2021-06-30 17:13:17'); +INSERT INTO `sys_logininfor` VALUES (386, 'admin', '172.17.0.1', '内网IP', 'Mobile Safari', 'Android 1.x', '1', '验证码已失效', '2021-06-30 17:13:34'); +INSERT INTO `sys_logininfor` VALUES (387, 'admin', '172.17.0.1', '内网IP', 'Mobile Safari', 'Android 1.x', '0', '登录成功', '2021-06-30 17:14:13'); +INSERT INTO `sys_logininfor` VALUES (388, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '1', '用户不存在/密码错误', '2021-08-26 14:44:02'); +INSERT INTO `sys_logininfor` VALUES (389, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '1', '验证码错误', '2021-08-26 14:44:08'); +INSERT INTO `sys_logininfor` VALUES (390, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-26 14:44:59'); +INSERT INTO `sys_logininfor` VALUES (391, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:35:01'); +INSERT INTO `sys_logininfor` VALUES (392, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:37:13'); +INSERT INTO `sys_logininfor` VALUES (393, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:37:24'); +INSERT INTO `sys_logininfor` VALUES (394, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:37:36'); +INSERT INTO `sys_logininfor` VALUES (395, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:38:40'); +INSERT INTO `sys_logininfor` VALUES (396, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:38:56'); +INSERT INTO `sys_logininfor` VALUES (397, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:39:53'); +INSERT INTO `sys_logininfor` VALUES (398, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:39:56'); +INSERT INTO `sys_logininfor` VALUES (399, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:40:10'); +INSERT INTO `sys_logininfor` VALUES (400, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:40:19'); +INSERT INTO `sys_logininfor` VALUES (401, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:40:49'); +INSERT INTO `sys_logininfor` VALUES (402, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:41:42'); +INSERT INTO `sys_logininfor` VALUES (403, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:42:10'); +INSERT INTO `sys_logininfor` VALUES (404, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:42:26'); +INSERT INTO `sys_logininfor` VALUES (405, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:42:56'); +INSERT INTO `sys_logininfor` VALUES (406, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:43:05'); +INSERT INTO `sys_logininfor` VALUES (407, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:44:38'); +INSERT INTO `sys_logininfor` VALUES (408, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:44:48'); +INSERT INTO `sys_logininfor` VALUES (409, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:45:01'); +INSERT INTO `sys_logininfor` VALUES (410, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:51:20'); +INSERT INTO `sys_logininfor` VALUES (411, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:51:40'); +INSERT INTO `sys_logininfor` VALUES (412, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:51:54'); +INSERT INTO `sys_logininfor` VALUES (413, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:55:17'); +INSERT INTO `sys_logininfor` VALUES (414, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 15:58:28'); +INSERT INTO `sys_logininfor` VALUES (415, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 16:11:13'); +INSERT INTO `sys_logininfor` VALUES (416, 'ozCz80FhaFo6rij0YLwz1aXTzKok', '180.111.206.137', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 16:16:40'); +INSERT INTO `sys_logininfor` VALUES (417, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '1', '用户不存在/密码错误', '2021-08-26 16:23:04'); +INSERT INTO `sys_logininfor` VALUES (418, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '退出成功', '2021-08-26 16:24:11'); +INSERT INTO `sys_logininfor` VALUES (419, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '退出成功', '2021-08-26 16:24:11'); +INSERT INTO `sys_logininfor` VALUES (420, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-26 16:30:13'); +INSERT INTO `sys_logininfor` VALUES (421, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 16:30:59'); +INSERT INTO `sys_logininfor` VALUES (422, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-26 16:54:25'); +INSERT INTO `sys_logininfor` VALUES (423, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 16:56:12'); +INSERT INTO `sys_logininfor` VALUES (424, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-26 16:58:05'); +INSERT INTO `sys_logininfor` VALUES (425, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 16:59:32'); +INSERT INTO `sys_logininfor` VALUES (426, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 16:59:48'); +INSERT INTO `sys_logininfor` VALUES (427, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 17:00:19'); +INSERT INTO `sys_logininfor` VALUES (428, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 17:01:36'); +INSERT INTO `sys_logininfor` VALUES (429, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '222.95.162.245', 'XX XX', 'Mobile Safari', 'iOS 11 (iPhone)', '0', '登录成功', '2021-08-26 17:02:12'); +INSERT INTO `sys_logininfor` VALUES (430, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-26 17:06:05'); +INSERT INTO `sys_logininfor` VALUES (431, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-27 11:53:54'); +INSERT INTO `sys_logininfor` VALUES (432, 'admin', '222.95.162.245', 'XX XX', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-27 11:54:00'); +INSERT INTO `sys_logininfor` VALUES (433, 'admin', '58.212.134.111', 'XX XX', 'Mobile Safari', 'Android 1.x', '0', '登录成功', '2021-08-27 19:20:43'); +INSERT INTO `sys_logininfor` VALUES (434, 'admin', '127.0.0.1', '内网IP', 'Chrome 9', 'Windows 10', '0', '登录成功', '2021-08-28 13:59:02'); + +-- ---------------------------- +-- Table structure for sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '菜单ID', + `menu_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单名称', + `parent_id` bigint(0) NULL DEFAULT 0 COMMENT '父菜单ID', + `order_num` int(0) NULL DEFAULT 0 COMMENT '显示顺序', + `path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由地址', + `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路径', + `is_frame` int(0) NULL DEFAULT 1 COMMENT '是否为外链(0是 1否)', + `is_cache` int(0) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)', + `menu_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', + `visible` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', + `perms` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识', + `icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '#' COMMENT '菜单图标', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注', + PRIMARY KEY (`menu_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2074 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 1, 'system', NULL, 1, 0, 'M', '0', '0', '', 'system', 'admin', '2021-05-18 02:23:06', '', NULL, '系统管理目录'); +INSERT INTO `sys_menu` VALUES (2, '系统监控', 0, 2, 'monitor', NULL, 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2021-05-18 02:23:06', '', NULL, '系统监控目录'); +INSERT INTO `sys_menu` VALUES (3, '系统工具', 0, 3, 'tool', NULL, 1, 0, 'M', '0', '0', '', 'tool', 'admin', '2021-05-18 02:23:06', '', NULL, '系统工具目录'); +INSERT INTO `sys_menu` VALUES (4, '物美官网', 0, 4, 'http://wumei.live', NULL, 0, 0, 'M', '0', '0', '', 'guide', 'admin', '2021-05-18 02:23:06', 'admin', '2021-05-24 14:17:14', '若依官网地址'); +INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2021-05-18 02:23:06', '', NULL, '用户管理菜单'); +INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2021-05-18 02:23:06', '', NULL, '角色管理菜单'); +INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2021-05-18 02:23:06', '', NULL, '菜单管理菜单'); +INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2021-05-18 02:23:06', '', NULL, '部门管理菜单'); +INSERT INTO `sys_menu` VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2021-05-18 02:23:06', '', NULL, '岗位管理菜单'); +INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2021-05-18 02:23:06', '', NULL, '字典管理菜单'); +INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2021-05-18 02:23:06', '', NULL, '参数设置菜单'); +INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', '2021-05-18 02:23:06', '', NULL, '通知公告菜单'); +INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', '2021-05-18 02:23:06', '', NULL, '日志管理菜单'); +INSERT INTO `sys_menu` VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', '2021-05-18 02:23:06', '', NULL, '在线用户菜单'); +INSERT INTO `sys_menu` VALUES (110, '定时任务', 2, 2, 'job', 'monitor/job/index', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', '2021-05-18 02:23:06', '', NULL, '定时任务菜单'); +INSERT INTO `sys_menu` VALUES (111, '数据监控', 2, 3, 'druid', 'monitor/druid/index', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', '2021-05-18 02:23:06', '', NULL, '数据监控菜单'); +INSERT INTO `sys_menu` VALUES (112, '服务监控', 2, 4, 'server', 'monitor/server/index', 1, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', '2021-05-18 02:23:06', '', NULL, '服务监控菜单'); +INSERT INTO `sys_menu` VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', '2021-05-18 02:23:06', '', NULL, '缓存监控菜单'); +INSERT INTO `sys_menu` VALUES (114, '表单构建', 3, 1, 'build', 'tool/build/index', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', '2021-05-18 02:23:06', '', NULL, '表单构建菜单'); +INSERT INTO `sys_menu` VALUES (115, '代码生成', 3, 2, 'gen', 'tool/gen/index', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', '2021-05-18 02:23:06', '', NULL, '代码生成菜单'); +INSERT INTO `sys_menu` VALUES (116, '系统接口', 3, 3, 'swagger', 'tool/swagger/index', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', '2021-05-18 02:23:06', '', NULL, '系统接口菜单'); +INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', '2021-05-18 02:23:06', '', NULL, '操作日志菜单'); +INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2021-05-18 02:23:06', '', NULL, '登录日志菜单'); +INSERT INTO `sys_menu` VALUES (1001, '用户查询', 100, 1, '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1002, '用户新增', 100, 2, '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1003, '用户修改', 100, 3, '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1004, '用户删除', 100, 4, '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1005, '用户导出', 100, 5, '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1006, '用户导入', 100, 6, '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1007, '重置密码', 100, 7, '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1008, '角色查询', 101, 1, '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1009, '角色新增', 101, 2, '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1010, '角色修改', 101, 3, '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1011, '角色删除', 101, 4, '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1012, '角色导出', 101, 5, '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1013, '菜单查询', 102, 1, '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1014, '菜单新增', 102, 2, '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1015, '菜单修改', 102, 3, '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1016, '菜单删除', 102, 4, '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1017, '部门查询', 103, 1, '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1018, '部门新增', 103, 2, '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1019, '部门修改', 103, 3, '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1020, '部门删除', 103, 4, '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1021, '岗位查询', 104, 1, '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1022, '岗位新增', 104, 2, '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1023, '岗位修改', 104, 3, '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1024, '岗位删除', 104, 4, '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1025, '岗位导出', 104, 5, '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1026, '字典查询', 105, 1, '#', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1027, '字典新增', 105, 2, '#', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1028, '字典修改', 105, 3, '#', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1029, '字典删除', 105, 4, '#', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1030, '字典导出', 105, 5, '#', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1031, '参数查询', 106, 1, '#', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1032, '参数新增', 106, 2, '#', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1033, '参数修改', 106, 3, '#', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1034, '参数删除', 106, 4, '#', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1035, '参数导出', 106, 5, '#', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1036, '公告查询', 107, 1, '#', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1037, '公告新增', 107, 2, '#', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1038, '公告修改', 107, 3, '#', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1039, '公告删除', 107, 4, '#', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1040, '操作查询', 500, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1041, '操作删除', 500, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1042, '日志导出', 500, 4, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1043, '登录查询', 501, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1044, '登录删除', 501, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1045, '日志导出', 501, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1046, '在线查询', 109, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1047, '批量强退', 109, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1048, '单条强退', 109, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1049, '任务查询', 110, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1050, '任务新增', 110, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1051, '任务修改', 110, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1052, '任务删除', 110, 4, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1053, '状态修改', 110, 5, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1054, '任务导出', 110, 7, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1055, '生成查询', 115, 1, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1056, '生成修改', 115, 2, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1057, '生成删除', 115, 3, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1058, '导入代码', 115, 2, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1059, '预览代码', 115, 4, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (1060, '生成代码', 115, 5, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', '2021-05-18 02:23:07', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2000, '物联网', 0, 0, 'iot', NULL, 1, 0, 'M', '0', '0', '', 'iot', 'admin', '2021-05-03 17:20:27', 'admin', '2021-05-18 09:32:14', ''); +INSERT INTO `sys_menu` VALUES (2043, '设备分类', 2000, 10, 'category', 'system/category/index', 1, 0, 'C', '0', '0', 'system:category:list', 'category', 'admin', '2021-05-06 15:10:35', 'admin', '2021-05-18 09:32:58', '设备分类菜单'); +INSERT INTO `sys_menu` VALUES (2044, '设备分类查询', 2043, 1, '#', '', 1, 0, 'F', '0', '0', 'system:category:query', '#', 'admin', '2021-05-06 15:10:35', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2045, '设备分类新增', 2043, 2, '#', '', 1, 0, 'F', '0', '0', 'system:category:add', '#', 'admin', '2021-05-06 15:10:35', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2046, '设备分类修改', 2043, 3, '#', '', 1, 0, 'F', '0', '0', 'system:category:edit', '#', 'admin', '2021-05-06 15:10:35', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2047, '设备分类删除', 2043, 4, '#', '', 1, 0, 'F', '0', '0', 'system:category:remove', '#', 'admin', '2021-05-06 15:10:35', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2048, '设备分类导出', 2043, 5, '#', '', 1, 0, 'F', '0', '0', 'system:category:export', '#', 'admin', '2021-05-06 15:10:35', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2049, '设备列表', 2000, 11, 'device', 'system/device/index', 1, 0, 'C', '0', '0', 'system:device:list', 'device', 'admin', '2021-05-06 15:10:50', 'admin', '2021-05-18 09:33:08', '设备菜单'); +INSERT INTO `sys_menu` VALUES (2050, '设备查询', 2049, 1, '#', '', 1, 0, 'F', '0', '0', 'system:device:query', '#', 'admin', '2021-05-06 15:10:50', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2051, '设备新增', 2049, 2, '#', '', 1, 0, 'F', '0', '0', 'system:device:add', '#', 'admin', '2021-05-06 15:10:50', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2052, '设备修改', 2049, 3, '#', '', 1, 0, 'F', '0', '0', 'system:device:edit', '#', 'admin', '2021-05-06 15:10:50', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2053, '设备删除', 2049, 4, '#', '', 1, 0, 'F', '0', '0', 'system:device:remove', '#', 'admin', '2021-05-06 15:10:50', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2054, '设备导出', 2049, 5, '#', '', 1, 0, 'F', '0', '0', 'system:device:export', '#', 'admin', '2021-05-06 15:10:50', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2055, '配置日志', 2000, 13, 'set', 'system/set/index', 1, 0, 'C', '0', '0', 'system:set:list', 'config', 'admin', '2021-05-06 15:11:09', 'admin', '2021-05-26 14:54:24', '设备配置菜单'); +INSERT INTO `sys_menu` VALUES (2056, '设备配置查询', 2055, 1, '#', '', 1, 0, 'F', '0', '0', 'system:set:query', '#', 'admin', '2021-05-06 15:11:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2057, '设备配置新增', 2055, 2, '#', '', 1, 0, 'F', '0', '0', 'system:set:add', '#', 'admin', '2021-05-06 15:11:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2058, '设备配置修改', 2055, 3, '#', '', 1, 0, 'F', '0', '0', 'system:set:edit', '#', 'admin', '2021-05-06 15:11:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2059, '设备配置删除', 2055, 4, '#', '', 1, 0, 'F', '0', '0', 'system:set:remove', '#', 'admin', '2021-05-06 15:11:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2060, '设备配置导出', 2055, 5, '#', '', 1, 0, 'F', '0', '0', 'system:set:export', '#', 'admin', '2021-05-06 15:11:09', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2061, '状态日志', 2000, 12, 'status', 'system/status/index', 1, 0, 'C', '0', '0', 'system:status:list', 'status', 'admin', '2021-05-06 15:11:19', 'admin', '2021-05-26 14:54:38', '设备状态菜单'); +INSERT INTO `sys_menu` VALUES (2062, '设备状态查询', 2061, 1, '#', '', 1, 0, 'F', '0', '0', 'system:status:query', '#', 'admin', '2021-05-06 15:11:19', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2063, '设备状态新增', 2061, 2, '#', '', 1, 0, 'F', '0', '0', 'system:status:add', '#', 'admin', '2021-05-06 15:11:19', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2064, '设备状态修改', 2061, 3, '#', '', 1, 0, 'F', '0', '0', 'system:status:edit', '#', 'admin', '2021-05-06 15:11:19', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2065, '设备状态删除', 2061, 4, '#', '', 1, 0, 'F', '0', '0', 'system:status:remove', '#', 'admin', '2021-05-06 15:11:19', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2066, '设备状态导出', 2061, 5, '#', '', 1, 0, 'F', '0', '0', 'system:status:export', '#', 'admin', '2021-05-06 15:11:19', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2067, '设备分组', 2000, 1, 'group', 'system/group/index', 1, 0, 'C', '0', '0', 'system:group:list', 'group', 'admin', '2021-05-18 08:15:31', 'admin', '2021-05-18 09:40:59', '分组菜单'); +INSERT INTO `sys_menu` VALUES (2068, '分组查询', 2067, 1, '#', '', 1, 0, 'F', '0', '0', 'system:group:query', '#', 'admin', '2021-05-18 08:15:31', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2069, '分组新增', 2067, 2, '#', '', 1, 0, 'F', '0', '0', 'system:group:add', '#', 'admin', '2021-05-18 08:15:31', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2070, '分组修改', 2067, 3, '#', '', 1, 0, 'F', '0', '0', 'system:group:edit', '#', 'admin', '2021-05-18 08:15:31', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2071, '分组删除', 2067, 4, '#', '', 1, 0, 'F', '0', '0', 'system:group:remove', '#', 'admin', '2021-05-18 08:15:31', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2072, '分组导出', 2067, 5, '#', '', 1, 0, 'F', '0', '0', 'system:group:export', '#', 'admin', '2021-05-18 08:15:31', '', NULL, ''); +INSERT INTO `sys_menu` VALUES (2073, 'EMQ管理', 2000, 14, 'http://localhost:18083/#/login?redirect=%2F', NULL, 0, 0, 'C', '0', '0', '', 'mqtt', 'admin', '2021-05-26 14:53:48', 'admin', '2021-05-27 16:11:27', ''); + +-- ---------------------------- +-- Table structure for sys_notice +-- ---------------------------- +DROP TABLE IF EXISTS `sys_notice`; +CREATE TABLE `sys_notice` ( + `notice_id` int(0) NOT NULL AUTO_INCREMENT COMMENT '公告ID', + `notice_title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公告标题', + `notice_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公告类型(1通知 2公告)', + `notice_content` longblob NULL COMMENT '公告内容', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`notice_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '通知公告表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_notice +-- ---------------------------- +INSERT INTO `sys_notice` VALUES (1, '温馨提醒:2018-07-01 若依新版本发布啦', '2', 0xE696B0E78988E69CACE58685E5AEB9, '0', 'admin', '2021-05-18 02:23:07', '', NULL, '管理员'); +INSERT INTO `sys_notice` VALUES (2, '维护通知:2018-07-01 若依系统凌晨维护', '1', 0xE7BBB4E68AA4E58685E5AEB9, '0', 'admin', '2021-05-18 02:23:07', '', NULL, '管理员'); +INSERT INTO `sys_notice` VALUES (3, '111', '2', 0x3C703E3131313131313C2F703E, '0', 'admin', '2021-08-27 19:24:12', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_oper_log +-- ---------------------------- +DROP TABLE IF EXISTS `sys_oper_log`; +CREATE TABLE `sys_oper_log` ( + `oper_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '日志主键', + `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '模块标题', + `business_type` int(0) NULL DEFAULT 0 COMMENT '业务类型(0其它 1新增 2修改 3删除)', + `method` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '方法名称', + `request_method` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求方式', + `operator_type` int(0) NULL DEFAULT 0 COMMENT '操作类别(0其它 1后台用户 2手机端用户)', + `oper_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作人员', + `dept_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '部门名称', + `oper_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求URL', + `oper_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '主机地址', + `oper_location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '操作地点', + `oper_param` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '请求参数', + `json_result` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '返回参数', + `status` int(0) NULL DEFAULT 0 COMMENT '操作状态(0正常 1异常)', + `error_msg` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '错误消息', + `oper_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间', + PRIMARY KEY (`oper_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2663 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志记录' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_oper_log +-- ---------------------------- +INSERT INTO `sys_oper_log` VALUES (1873, '设备状态', 2, 'com.ruoyi.system.controller.IotDeviceStatusController.edit()', 'PUT', 1, 'admin', NULL, '/system/status', '172.17.0.1', '内网IP', '{\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"triggerSource\":1,\"relayStatus\":0,\"updateTime\":1625044821428,\"params\":{}}', '{\"msg\":\"mqtt 发布成功\",\"code\":200}', 0, NULL, '2021-06-30 17:20:21'); +INSERT INTO `sys_oper_log` VALUES (1874, '设备状态', 2, 'com.ruoyi.system.controller.IotDeviceStatusController.edit()', 'PUT', 1, 'admin', NULL, '/system/status', '172.17.0.1', '内网IP', '{\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"triggerSource\":1,\"relayStatus\":1,\"updateTime\":1625044822177,\"params\":{}}', '{\"msg\":\"mqtt 发布成功\",\"code\":200}', 0, NULL, '2021-06-30 17:20:22'); +INSERT INTO `sys_oper_log` VALUES (1875, '设备状态', 2, 'com.ruoyi.system.controller.IotDeviceStatusController.edit()', 'PUT', 1, 'admin', NULL, '/system/status', '172.17.0.1', '内网IP', '{\"lightStatus\":0,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"triggerSource\":1,\"updateTime\":1625044822998,\"params\":{}}', '{\"msg\":\"mqtt 发布成功\",\"code\":200}', 0, NULL, '2021-06-30 17:20:23'); +INSERT INTO `sys_oper_log` VALUES (1876, '设备状态', 2, 'com.ruoyi.system.controller.IotDeviceStatusController.edit()', 'PUT', 1, 'admin', NULL, '/system/status', '172.17.0.1', '内网IP', '{\"lightStatus\":1,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"triggerSource\":1,\"updateTime\":1625044823902,\"params\":{}}', '{\"msg\":\"mqtt 发布成功\",\"code\":200}', 0, NULL, '2021-06-30 17:20:23'); +INSERT INTO `sys_oper_log` VALUES (1877, '代码生成', 6, 'com.ruoyi.generator.controller.GenController.importTableSave()', 'POST', 1, 'admin', NULL, '/tool/gen/importTable', '222.95.162.245', 'XX XX', 't_user_account_info,t_user_login_log', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 14:45:29'); +INSERT INTO `sys_oper_log` VALUES (1878, '代码生成', 8, 'com.ruoyi.generator.controller.GenController.batchGenCode()', 'GET', 1, 'admin', NULL, '/tool/gen/batchGenCode', '222.95.162.245', 'XX XX', '{}', 'null', 0, NULL, '2021-08-26 14:45:39'); +INSERT INTO `sys_oper_log` VALUES (1879, '代码生成', 6, 'com.ruoyi.generator.controller.GenController.importTableSave()', 'POST', 1, 'admin', NULL, '/tool/gen/importTable', '222.95.162.245', 'XX XX', 'sys_user', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 17:07:45'); +INSERT INTO `sys_oper_log` VALUES (1880, '角色管理', 1, 'com.ruoyi.web.controller.system.SysRoleController.add()', 'POST', 1, 'admin', NULL, '/system/role', '222.95.162.245', 'XX XX', '{\"flag\":false,\"roleId\":101,\"admin\":false,\"params\":{},\"roleSort\":\"3\",\"deptCheckStrictly\":true,\"createBy\":\"admin\",\"menuCheckStrictly\":true,\"roleKey\":\"mp\",\"roleName\":\"小程序用户\",\"deptIds\":[],\"menuIds\":[2000,2067,2068,2069,2070,2071,2072,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2061,2062,2063,2064,2065,2066,2055,2056,2057,2058,2059,2060,2073],\"status\":\"0\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 17:26:52'); +INSERT INTO `sys_oper_log` VALUES (1881, '角色管理', 2, 'com.ruoyi.web.controller.system.SysRoleController.edit()', 'PUT', 1, 'admin', NULL, '/system/role', '222.95.162.245', 'XX XX', '{\"flag\":false,\"roleId\":100,\"admin\":false,\"dataScope\":\"1\",\"delFlag\":\"0\",\"params\":{},\"roleSort\":\"8\",\"deptCheckStrictly\":true,\"createTime\":1622248952000,\"updateBy\":\"admin\",\"menuCheckStrictly\":true,\"roleKey\":\"visitor\",\"roleName\":\"游客角色\",\"menuIds\":[2000,2067,2043,2049,2061,2055,1,100,101,102,103,104,105,106,107,108,500,501,2,109,110,3,115,2068,2044,2050,2062,2056,2073,1001,1008,1013,1017,1021,1026,1031,1036,1040,1043,1046,1049,1055,116,4],\"status\":\"0\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 17:27:06'); +INSERT INTO `sys_oper_log` VALUES (1882, '用户管理', 1, 'com.ruoyi.web.controller.system.SysUserController.add()', 'POST', 1, 'admin', NULL, '/system/user', '222.95.162.245', 'XX XX', '{\"admin\":false,\"password\":\"$2a$10$f.KtWGpaUsdvl2E427/H4OnPi2dYx8HetxnBs1uasSNwCBBUDSwjO\",\"postIds\":[],\"nickName\":\"xxx\",\"params\":{},\"userName\":\"aaa\",\"userId\":101,\"createBy\":\"admin\",\"roleIds\":[101],\"status\":\"0\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 17:28:35'); +INSERT INTO `sys_oper_log` VALUES (1883, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"params\":{},\"createTime\":1629974211324}', 'null', 1, '\r\n### Error updating database. Cause: java.sql.SQLException: Field \'device_num\' doesn\'t have a default value\r\n### The error may exist in file [D:\\codes\\IdeaProjects\\wumei-smart-master\\spring-boot\\ruoyi-system\\target\\classes\\mapper\\system\\IotDeviceStatusMapper.xml]\r\n### The error may involve com.ruoyi.system.mapper.IotDeviceStatusMapper.insertIotDeviceStatus-Inline\r\n### The error occurred while setting parameters\r\n### SQL: insert into iot_device_status ( create_time ) values ( ? )\r\n### Cause: java.sql.SQLException: Field \'device_num\' doesn\'t have a default value\n; Field \'device_num\' doesn\'t have a default value; nested exception is java.sql.SQLException: Field \'device_num\' doesn\'t have a default value', '2021-08-26 18:36:50'); +INSERT INTO `sys_oper_log` VALUES (1884, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"lightMode\":0,\"isOnline\":1,\"lightStatus\":0,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"red\":255,\"updateBy\":\"\",\"airHumidity\":0,\"triggerSource\":0,\"lightInterval\":432,\"rssi\":-80,\"green\":254,\"deviceTemperature\":36.52,\"relayStatus\":1,\"fadeTime\":259,\"params\":{},\"createBy\":\"\",\"airTemperature\":0,\"brightness\":100,\"blue\":241,\"createTime\":1629974291015,\"deviceStatusId\":2846}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 18:38:09'); +INSERT INTO `sys_oper_log` VALUES (1885, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"lightMode\":0,\"isOnline\":1,\"lightStatus\":1,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"red\":255,\"updateBy\":\"\",\"airHumidity\":0,\"triggerSource\":0,\"lightInterval\":432,\"rssi\":-80,\"green\":254,\"deviceTemperature\":36.52,\"relayStatus\":1,\"fadeTime\":259,\"params\":{},\"createBy\":\"\",\"airTemperature\":0,\"brightness\":100,\"blue\":241,\"createTime\":1629974292396,\"deviceStatusId\":2847}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 18:38:11'); +INSERT INTO `sys_oper_log` VALUES (1886, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"lightMode\":0,\"isOnline\":1,\"lightStatus\":0,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"red\":255,\"updateBy\":\"\",\"airHumidity\":0,\"triggerSource\":0,\"lightInterval\":432,\"rssi\":-80,\"green\":254,\"deviceTemperature\":36.52,\"relayStatus\":1,\"fadeTime\":259,\"params\":{},\"createBy\":\"\",\"airTemperature\":0,\"brightness\":100,\"blue\":241,\"createTime\":1629974293231,\"deviceStatusId\":2848}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 18:38:12'); +INSERT INTO `sys_oper_log` VALUES (1887, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"lightMode\":0,\"isOnline\":1,\"lightStatus\":1,\"deviceId\":1,\"deviceNum\":\"7CDFA1049ADA\",\"red\":255,\"updateBy\":\"\",\"airHumidity\":0,\"triggerSource\":0,\"lightInterval\":432,\"rssi\":-80,\"green\":254,\"deviceTemperature\":36.52,\"relayStatus\":1,\"fadeTime\":259,\"params\":{},\"createBy\":\"\",\"airTemperature\":0,\"brightness\":100,\"blue\":241,\"createTime\":1629974297356,\"deviceStatusId\":2849}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 18:38:16'); +INSERT INTO `sys_oper_log` VALUES (1888, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '222.95.162.245', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADC\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 18:56:26'); +INSERT INTO `sys_oper_log` VALUES (1889, '设备状态', 1, 'com.ruoyi.system.controller.IotDeviceStatusController.add()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/status', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"params\":{},\"createTime\":1629976059277,\"deviceStatusId\":2850}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:07:38'); +INSERT INTO `sys_oper_log` VALUES (1890, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:16:49'); +INSERT INTO `sys_oper_log` VALUES (1891, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:08'); +INSERT INTO `sys_oper_log` VALUES (1892, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:09'); +INSERT INTO `sys_oper_log` VALUES (1893, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:09'); +INSERT INTO `sys_oper_log` VALUES (1894, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:10'); +INSERT INTO `sys_oper_log` VALUES (1895, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:10'); +INSERT INTO `sys_oper_log` VALUES (1896, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:11'); +INSERT INTO `sys_oper_log` VALUES (1897, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:12'); +INSERT INTO `sys_oper_log` VALUES (1898, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:13'); +INSERT INTO `sys_oper_log` VALUES (1899, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:14'); +INSERT INTO `sys_oper_log` VALUES (1900, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:14'); +INSERT INTO `sys_oper_log` VALUES (1901, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:15'); +INSERT INTO `sys_oper_log` VALUES (1902, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:16'); +INSERT INTO `sys_oper_log` VALUES (1903, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:17'); +INSERT INTO `sys_oper_log` VALUES (1904, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:17'); +INSERT INTO `sys_oper_log` VALUES (1905, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:17:18'); +INSERT INTO `sys_oper_log` VALUES (1906, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-26 19:18:38'); +INSERT INTO `sys_oper_log` VALUES (1907, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', 'null', 1, '设备不存在', '2021-08-26 19:25:16'); +INSERT INTO `sys_oper_log` VALUES (1908, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', 'null', 1, '设备不存在', '2021-08-26 19:25:19'); +INSERT INTO `sys_oper_log` VALUES (1909, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', 'null', 1, '设备不存在', '2021-08-27 10:23:46'); +INSERT INTO `sys_oper_log` VALUES (1910, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', 'null', 1, '设备不存在', '2021-08-27 10:23:59'); +INSERT INTO `sys_oper_log` VALUES (1911, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', 'null', 1, '设备不存在', '2021-08-27 10:24:32'); +INSERT INTO `sys_oper_log` VALUES (1912, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', 'null', 1, '设备不存在', '2021-08-27 10:25:53'); +INSERT INTO `sys_oper_log` VALUES (1913, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:30:18'); +INSERT INTO `sys_oper_log` VALUES (1914, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:30:22'); +INSERT INTO `sys_oper_log` VALUES (1915, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:30:23'); +INSERT INTO `sys_oper_log` VALUES (1916, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:30:30'); +INSERT INTO `sys_oper_log` VALUES (1917, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:33:53'); +INSERT INTO `sys_oper_log` VALUES (1918, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:33:56'); +INSERT INTO `sys_oper_log` VALUES (1919, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:33:57'); +INSERT INTO `sys_oper_log` VALUES (1920, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:33:58'); +INSERT INTO `sys_oper_log` VALUES (1921, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:35:34'); +INSERT INTO `sys_oper_log` VALUES (1922, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:35:35'); +INSERT INTO `sys_oper_log` VALUES (1923, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:35:36'); +INSERT INTO `sys_oper_log` VALUES (1924, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:36:33'); +INSERT INTO `sys_oper_log` VALUES (1925, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:36:34'); +INSERT INTO `sys_oper_log` VALUES (1926, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:36:35'); +INSERT INTO `sys_oper_log` VALUES (1927, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:36:35'); +INSERT INTO `sys_oper_log` VALUES (1928, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:36:36'); +INSERT INTO `sys_oper_log` VALUES (1929, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:04'); +INSERT INTO `sys_oper_log` VALUES (1930, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:06'); +INSERT INTO `sys_oper_log` VALUES (1931, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:10'); +INSERT INTO `sys_oper_log` VALUES (1932, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:10'); +INSERT INTO `sys_oper_log` VALUES (1933, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:21'); +INSERT INTO `sys_oper_log` VALUES (1934, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:40:21'); +INSERT INTO `sys_oper_log` VALUES (1935, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:41:55'); +INSERT INTO `sys_oper_log` VALUES (1936, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:41:55'); +INSERT INTO `sys_oper_log` VALUES (1937, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:41:56'); +INSERT INTO `sys_oper_log` VALUES (1938, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:41:57'); +INSERT INTO `sys_oper_log` VALUES (1939, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:44:07'); +INSERT INTO `sys_oper_log` VALUES (1940, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:44:08'); +INSERT INTO `sys_oper_log` VALUES (1941, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:44:09'); +INSERT INTO `sys_oper_log` VALUES (1942, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 10:44:09'); +INSERT INTO `sys_oper_log` VALUES (1943, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:38:52'); +INSERT INTO `sys_oper_log` VALUES (1944, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:38:54'); +INSERT INTO `sys_oper_log` VALUES (1945, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:53:43'); +INSERT INTO `sys_oper_log` VALUES (1946, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:53:44'); +INSERT INTO `sys_oper_log` VALUES (1947, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:53:54'); +INSERT INTO `sys_oper_log` VALUES (1948, '代码生成', 6, 'com.ruoyi.generator.controller.GenController.importTableSave()', 'POST', 1, 'admin', NULL, '/tool/gen/importTable', '222.95.162.245', 'XX XX', 'iot_device_user_relation', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 11:55:06'); +INSERT INTO `sys_oper_log` VALUES (1949, '代码生成', 8, 'com.ruoyi.generator.controller.GenController.batchGenCode()', 'GET', 1, 'admin', NULL, '/tool/gen/batchGenCode', '222.95.162.245', 'XX XX', '{}', 'null', 0, NULL, '2021-08-27 11:55:34'); +INSERT INTO `sys_oper_log` VALUES (1950, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceName\":\"设备名称\",\"deviceNum\":\"7CDFA1049ADC\",\"categoryId\":1}', 'null', 1, '', '2021-08-27 13:36:40'); +INSERT INTO `sys_oper_log` VALUES (1951, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceName\":\"设备名称\",\"deviceNum\":\"7CDFA1049ADC\",\"categoryId\":1}', '{\"msg\":\"操作失败\",\"code\":500}', 0, NULL, '2021-08-27 13:40:21'); +INSERT INTO `sys_oper_log` VALUES (1952, '代码生成', 8, 'com.ruoyi.generator.controller.GenController.batchGenCode()', 'GET', 1, 'admin', NULL, '/tool/gen/batchGenCode', '222.95.162.245', 'XX XX', '{}', 'null', 0, NULL, '2021-08-27 13:44:37'); +INSERT INTO `sys_oper_log` VALUES (1953, '代码生成', 3, 'com.ruoyi.generator.controller.GenController.remove()', 'DELETE', 1, 'admin', NULL, '/tool/gen/13', '222.95.162.245', 'XX XX', '{tableIds=13}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 13:45:30'); +INSERT INTO `sys_oper_log` VALUES (1954, '代码生成', 6, 'com.ruoyi.generator.controller.GenController.importTableSave()', 'POST', 1, 'admin', NULL, '/tool/gen/importTable', '222.95.162.245', 'XX XX', 'iot_device', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 13:45:40'); +INSERT INTO `sys_oper_log` VALUES (1955, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceName\":\"设备名称\",\"deviceNum\":\"7CDFA1049ADC\",\"categoryId\":1}', 'null', 1, 'Invalid bound statement (not found): com.ruoyi.system.mapper.IotDeviceMapper.selectIotDeviceByNum', '2021-08-27 13:47:50'); +INSERT INTO `sys_oper_log` VALUES (1956, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceName\":\"设备名称\",\"deviceNum\":\"7CDFA1049ADC\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 13:50:33'); +INSERT INTO `sys_oper_log` VALUES (1957, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceName\":\"设备名称\",\"deviceNum\":\"7CDFA1049ADC\",\"categoryId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 13:50:43'); +INSERT INTO `sys_oper_log` VALUES (1958, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"我的灯。\",\"params\":{},\"deviceName\":\"灯灯灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 14:05:05'); +INSERT INTO `sys_oper_log` VALUES (1959, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"我的灯。\",\"params\":{},\"deviceName\":\"灯灯灯\",\"deviceNum\":\"7CDFA1049AD2\",\"categoryId\":2}', 'null', 1, '设备【7CDFA1049AD2】不存在', '2021-08-27 14:07:01'); +INSERT INTO `sys_oper_log` VALUES (1960, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"qg34tq\",\"params\":{},\"deviceName\":\"eq3g3\",\"deviceNum\":\"2133r4r\",\"categoryId\":1}', 'null', 1, '设备【2133r4r】不存在', '2021-08-27 14:11:13'); +INSERT INTO `sys_oper_log` VALUES (1961, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"stu6ru\",\"params\":{},\"deviceName\":\"rtjsht\",\"deviceNum\":\"strjtj\",\"categoryId\":1}', 'null', 1, '设备【strjtj】不存在', '2021-08-27 14:14:40'); +INSERT INTO `sys_oper_log` VALUES (1962, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"stu6ru\",\"params\":{},\"deviceName\":\"rtjsht\",\"deviceNum\":\"strjtj\",\"categoryId\":1}', 'null', 1, '设备【strjtj】不存在', '2021-08-27 14:14:43'); +INSERT INTO `sys_oper_log` VALUES (1963, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"我的灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 14:27:15'); +INSERT INTO `sys_oper_log` VALUES (1964, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:26'); +INSERT INTO `sys_oper_log` VALUES (1965, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:49'); +INSERT INTO `sys_oper_log` VALUES (1966, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:50'); +INSERT INTO `sys_oper_log` VALUES (1967, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:51'); +INSERT INTO `sys_oper_log` VALUES (1968, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:52'); +INSERT INTO `sys_oper_log` VALUES (1969, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:53'); +INSERT INTO `sys_oper_log` VALUES (1970, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 14:31:54'); +INSERT INTO `sys_oper_log` VALUES (1971, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:42'); +INSERT INTO `sys_oper_log` VALUES (1972, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:43'); +INSERT INTO `sys_oper_log` VALUES (1973, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:44'); +INSERT INTO `sys_oper_log` VALUES (1974, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:47'); +INSERT INTO `sys_oper_log` VALUES (1975, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:48'); +INSERT INTO `sys_oper_log` VALUES (1976, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:48'); +INSERT INTO `sys_oper_log` VALUES (1977, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:49'); +INSERT INTO `sys_oper_log` VALUES (1978, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:50'); +INSERT INTO `sys_oper_log` VALUES (1979, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:50'); +INSERT INTO `sys_oper_log` VALUES (1980, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:51'); +INSERT INTO `sys_oper_log` VALUES (1981, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:52'); +INSERT INTO `sys_oper_log` VALUES (1982, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:52'); +INSERT INTO `sys_oper_log` VALUES (1983, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:54'); +INSERT INTO `sys_oper_log` VALUES (1984, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:55'); +INSERT INTO `sys_oper_log` VALUES (1985, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:32:55'); +INSERT INTO `sys_oper_log` VALUES (1986, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"\",\"params\":{},\"deviceName\":\"srts\",\"deviceNum\":\"sh\",\"categoryId\":1}', 'null', 1, '设备【sh】不存在', '2021-08-27 14:34:31'); +INSERT INTO `sys_oper_log` VALUES (1987, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"\",\"params\":{},\"deviceName\":\"srts\",\"deviceNum\":\"sh\",\"categoryId\":1}', 'null', 1, '设备【sh】不存在', '2021-08-27 14:34:32'); +INSERT INTO `sys_oper_log` VALUES (1988, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"\",\"params\":{},\"deviceName\":\"trwhb4n\",\"deviceNum\":\"wt\",\"categoryId\":1}', 'null', 1, '设备【wt】不存在', '2021-08-27 14:34:59'); +INSERT INTO `sys_oper_log` VALUES (1989, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:22'); +INSERT INTO `sys_oper_log` VALUES (1990, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:23'); +INSERT INTO `sys_oper_log` VALUES (1991, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:23'); +INSERT INTO `sys_oper_log` VALUES (1992, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:24'); +INSERT INTO `sys_oper_log` VALUES (1993, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:24'); +INSERT INTO `sys_oper_log` VALUES (1994, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:25'); +INSERT INTO `sys_oper_log` VALUES (1995, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:25'); +INSERT INTO `sys_oper_log` VALUES (1996, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:25'); +INSERT INTO `sys_oper_log` VALUES (1997, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:25'); +INSERT INTO `sys_oper_log` VALUES (1998, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:26'); +INSERT INTO `sys_oper_log` VALUES (1999, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:26'); +INSERT INTO `sys_oper_log` VALUES (2000, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:26'); +INSERT INTO `sys_oper_log` VALUES (2001, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:26'); +INSERT INTO `sys_oper_log` VALUES (2002, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:26'); +INSERT INTO `sys_oper_log` VALUES (2003, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:27'); +INSERT INTO `sys_oper_log` VALUES (2004, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁\",\"params\":{},\"deviceName\":\"灯神\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-27 14:35:27'); +INSERT INTO `sys_oper_log` VALUES (2005, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁灯灯灯灯灯。\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:00:17'); +INSERT INTO `sys_oper_log` VALUES (2006, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:05:11'); +INSERT INTO `sys_oper_log` VALUES (2007, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:06:01'); +INSERT INTO `sys_oper_log` VALUES (2008, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:06:11'); +INSERT INTO `sys_oper_log` VALUES (2009, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:06:20'); +INSERT INTO `sys_oper_log` VALUES (2010, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:07:41'); +INSERT INTO `sys_oper_log` VALUES (2011, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:09:18'); +INSERT INTO `sys_oper_log` VALUES (2012, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:09:28'); +INSERT INTO `sys_oper_log` VALUES (2013, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:17:38'); +INSERT INTO `sys_oper_log` VALUES (2014, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 15:17:41'); +INSERT INTO `sys_oper_log` VALUES (2015, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:18:35'); +INSERT INTO `sys_oper_log` VALUES (2016, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作失败\",\"code\":500}', 0, NULL, '2021-08-27 15:44:27'); +INSERT INTO `sys_oper_log` VALUES (2017, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:45:52'); +INSERT INTO `sys_oper_log` VALUES (2018, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":51,\"deviceName\":\"设备名称\"}', 'null', 1, '设备不存在', '2021-08-27 15:46:30'); +INSERT INTO `sys_oper_log` VALUES (2019, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":5,\"deviceName\":\"设备名称\"}', 'null', 1, '设备不存在', '2021-08-27 15:46:53'); +INSERT INTO `sys_oper_log` VALUES (2020, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":5,\"deviceName\":\"设备名称\"}', 'null', 1, '设备不存在', '2021-08-27 15:46:59'); +INSERT INTO `sys_oper_log` VALUES (2021, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":7,\"deviceName\":\"设备名称\"}', 'null', 1, '设备不存在', '2021-08-27 15:47:18'); +INSERT INTO `sys_oper_log` VALUES (2022, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":7,\"deviceName\":\"设备名称\"}', 'null', 1, '设备不存在', '2021-08-27 15:47:46'); +INSERT INTO `sys_oper_log` VALUES (2023, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:48:03'); +INSERT INTO `sys_oper_log` VALUES (2024, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":0}', 0, NULL, '2021-08-27 15:49:24'); +INSERT INTO `sys_oper_log` VALUES (2025, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 15:51:57'); +INSERT INTO `sys_oper_log` VALUES (2026, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '222.95.162.245', 'XX XX', '{\"remark\":\"remark2\",\"params\":{},\"deviceId\":1,\"deviceName\":\"设备名称\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 15:52:38'); +INSERT INTO `sys_oper_log` VALUES (2027, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:39'); +INSERT INTO `sys_oper_log` VALUES (2028, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:40'); +INSERT INTO `sys_oper_log` VALUES (2029, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:42'); +INSERT INTO `sys_oper_log` VALUES (2030, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:42'); +INSERT INTO `sys_oper_log` VALUES (2031, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:43'); +INSERT INTO `sys_oper_log` VALUES (2032, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:43'); +INSERT INTO `sys_oper_log` VALUES (2033, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:44'); +INSERT INTO `sys_oper_log` VALUES (2034, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:45'); +INSERT INTO `sys_oper_log` VALUES (2035, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:45'); +INSERT INTO `sys_oper_log` VALUES (2036, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:45'); +INSERT INTO `sys_oper_log` VALUES (2037, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:45'); +INSERT INTO `sys_oper_log` VALUES (2038, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:45'); +INSERT INTO `sys_oper_log` VALUES (2039, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:46'); +INSERT INTO `sys_oper_log` VALUES (2040, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:46'); +INSERT INTO `sys_oper_log` VALUES (2041, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:46'); +INSERT INTO `sys_oper_log` VALUES (2042, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:47'); +INSERT INTO `sys_oper_log` VALUES (2043, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:47'); +INSERT INTO `sys_oper_log` VALUES (2044, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:47'); +INSERT INTO `sys_oper_log` VALUES (2045, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:47'); +INSERT INTO `sys_oper_log` VALUES (2046, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:48'); +INSERT INTO `sys_oper_log` VALUES (2047, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:48'); +INSERT INTO `sys_oper_log` VALUES (2048, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:48'); +INSERT INTO `sys_oper_log` VALUES (2049, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:49'); +INSERT INTO `sys_oper_log` VALUES (2050, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:49'); +INSERT INTO `sys_oper_log` VALUES (2051, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:51'); +INSERT INTO `sys_oper_log` VALUES (2052, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:52'); +INSERT INTO `sys_oper_log` VALUES (2053, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:52'); +INSERT INTO `sys_oper_log` VALUES (2054, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:52'); +INSERT INTO `sys_oper_log` VALUES (2055, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:52'); +INSERT INTO `sys_oper_log` VALUES (2056, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:53'); +INSERT INTO `sys_oper_log` VALUES (2057, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:54'); +INSERT INTO `sys_oper_log` VALUES (2058, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:55'); +INSERT INTO `sys_oper_log` VALUES (2059, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:56'); +INSERT INTO `sys_oper_log` VALUES (2060, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:57'); +INSERT INTO `sys_oper_log` VALUES (2061, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:57'); +INSERT INTO `sys_oper_log` VALUES (2062, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:57'); +INSERT INTO `sys_oper_log` VALUES (2063, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:58'); +INSERT INTO `sys_oper_log` VALUES (2064, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:58'); +INSERT INTO `sys_oper_log` VALUES (2065, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:58'); +INSERT INTO `sys_oper_log` VALUES (2066, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:58'); +INSERT INTO `sys_oper_log` VALUES (2067, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:59'); +INSERT INTO `sys_oper_log` VALUES (2068, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:59'); +INSERT INTO `sys_oper_log` VALUES (2069, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:59'); +INSERT INTO `sys_oper_log` VALUES (2070, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:55:59'); +INSERT INTO `sys_oper_log` VALUES (2071, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:00'); +INSERT INTO `sys_oper_log` VALUES (2072, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:00'); +INSERT INTO `sys_oper_log` VALUES (2073, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:00'); +INSERT INTO `sys_oper_log` VALUES (2074, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:00'); +INSERT INTO `sys_oper_log` VALUES (2075, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:01'); +INSERT INTO `sys_oper_log` VALUES (2076, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:01'); +INSERT INTO `sys_oper_log` VALUES (2077, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:01'); +INSERT INTO `sys_oper_log` VALUES (2078, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:01'); +INSERT INTO `sys_oper_log` VALUES (2079, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:01'); +INSERT INTO `sys_oper_log` VALUES (2080, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:02'); +INSERT INTO `sys_oper_log` VALUES (2081, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:02'); +INSERT INTO `sys_oper_log` VALUES (2082, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:02'); +INSERT INTO `sys_oper_log` VALUES (2083, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:02'); +INSERT INTO `sys_oper_log` VALUES (2084, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:03'); +INSERT INTO `sys_oper_log` VALUES (2085, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:04'); +INSERT INTO `sys_oper_log` VALUES (2086, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:04'); +INSERT INTO `sys_oper_log` VALUES (2087, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:04'); +INSERT INTO `sys_oper_log` VALUES (2088, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:04'); +INSERT INTO `sys_oper_log` VALUES (2089, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:04'); +INSERT INTO `sys_oper_log` VALUES (2090, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:05'); +INSERT INTO `sys_oper_log` VALUES (2091, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 15:56:05'); +INSERT INTO `sys_oper_log` VALUES (2092, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:07:26'); +INSERT INTO `sys_oper_log` VALUES (2093, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:08:03'); +INSERT INTO `sys_oper_log` VALUES (2094, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:11:32'); +INSERT INTO `sys_oper_log` VALUES (2095, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1234,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:12:50'); +INSERT INTO `sys_oper_log` VALUES (2096, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1234,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:12:54'); +INSERT INTO `sys_oper_log` VALUES (2097, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:13:42'); +INSERT INTO `sys_oper_log` VALUES (2098, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:14:01'); +INSERT INTO `sys_oper_log` VALUES (2099, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:14:13'); +INSERT INTO `sys_oper_log` VALUES (2100, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:14:14'); +INSERT INTO `sys_oper_log` VALUES (2101, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":12133,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:16:03'); +INSERT INTO `sys_oper_log` VALUES (2102, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":12133,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:16:06'); +INSERT INTO `sys_oper_log` VALUES (2103, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":12133,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:16:15'); +INSERT INTO `sys_oper_log` VALUES (2104, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":12133,\"deviceName\":\"阿拉丁神灯\"}', 'null', 1, '设备不存在', '2021-08-27 16:16:18'); +INSERT INTO `sys_oper_log` VALUES (2105, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceId\":1,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:18:05'); +INSERT INTO `sys_oper_log` VALUES (2106, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:22:53'); +INSERT INTO `sys_oper_log` VALUES (2107, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:23:24'); +INSERT INTO `sys_oper_log` VALUES (2108, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:23:41'); +INSERT INTO `sys_oper_log` VALUES (2109, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:23:43'); +INSERT INTO `sys_oper_log` VALUES (2110, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:26:33'); +INSERT INTO `sys_oper_log` VALUES (2111, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:27:37'); +INSERT INTO `sys_oper_log` VALUES (2112, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:27:54'); +INSERT INTO `sys_oper_log` VALUES (2113, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:28:12'); +INSERT INTO `sys_oper_log` VALUES (2114, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:30:10'); +INSERT INTO `sys_oper_log` VALUES (2115, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:30:32'); +INSERT INTO `sys_oper_log` VALUES (2116, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:30:35'); +INSERT INTO `sys_oper_log` VALUES (2117, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:34:21'); +INSERT INTO `sys_oper_log` VALUES (2118, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:35:01'); +INSERT INTO `sys_oper_log` VALUES (2119, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:39:15'); +INSERT INTO `sys_oper_log` VALUES (2120, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:40:56'); +INSERT INTO `sys_oper_log` VALUES (2121, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:42:53'); +INSERT INTO `sys_oper_log` VALUES (2122, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:45:04'); +INSERT INTO `sys_oper_log` VALUES (2123, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:45:18'); +INSERT INTO `sys_oper_log` VALUES (2124, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:45:29'); +INSERT INTO `sys_oper_log` VALUES (2125, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:46:52'); +INSERT INTO `sys_oper_log` VALUES (2126, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:47:39'); +INSERT INTO `sys_oper_log` VALUES (2127, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:55:23'); +INSERT INTO `sys_oper_log` VALUES (2128, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:55:41'); +INSERT INTO `sys_oper_log` VALUES (2129, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:55:50'); +INSERT INTO `sys_oper_log` VALUES (2130, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:55:50'); +INSERT INTO `sys_oper_log` VALUES (2131, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:56:08'); +INSERT INTO `sys_oper_log` VALUES (2132, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:56:11'); +INSERT INTO `sys_oper_log` VALUES (2133, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:56:21'); +INSERT INTO `sys_oper_log` VALUES (2134, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:23'); +INSERT INTO `sys_oper_log` VALUES (2135, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:24'); +INSERT INTO `sys_oper_log` VALUES (2136, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:25'); +INSERT INTO `sys_oper_log` VALUES (2137, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:25'); +INSERT INTO `sys_oper_log` VALUES (2138, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:27'); +INSERT INTO `sys_oper_log` VALUES (2139, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:28'); +INSERT INTO `sys_oper_log` VALUES (2140, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:28'); +INSERT INTO `sys_oper_log` VALUES (2141, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:29'); +INSERT INTO `sys_oper_log` VALUES (2142, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:29'); +INSERT INTO `sys_oper_log` VALUES (2143, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:56:30'); +INSERT INTO `sys_oper_log` VALUES (2144, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:56:55'); +INSERT INTO `sys_oper_log` VALUES (2145, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:57:00'); +INSERT INTO `sys_oper_log` VALUES (2146, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:57:15'); +INSERT INTO `sys_oper_log` VALUES (2147, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '49.93.129.115', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 16:57:19'); +INSERT INTO `sys_oper_log` VALUES (2148, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:57:22'); +INSERT INTO `sys_oper_log` VALUES (2149, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:57:23'); +INSERT INTO `sys_oper_log` VALUES (2150, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:57:23'); +INSERT INTO `sys_oper_log` VALUES (2151, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:57:24'); +INSERT INTO `sys_oper_log` VALUES (2152, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/updateDeviceInfo', '49.93.129.115', 'XX XX', '{\"remark\":\"12\",\"params\":{},\"deviceId\":1,\"deviceName\":\"remark\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 16:59:38'); +INSERT INTO `sys_oper_log` VALUES (2153, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:59:45'); +INSERT INTO `sys_oper_log` VALUES (2154, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '49.93.129.115', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 16:59:46'); +INSERT INTO `sys_oper_log` VALUES (2155, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"122345678\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"7CDFA1049ADA\",\"categoryId\":2}', 'null', 1, '该设备已被绑定!', '2021-08-27 17:00:56'); +INSERT INTO `sys_oper_log` VALUES (2156, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:27:02'); +INSERT INTO `sys_oper_log` VALUES (2157, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:27:54'); +INSERT INTO `sys_oper_log` VALUES (2158, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:27:56'); +INSERT INTO `sys_oper_log` VALUES (2159, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:27:57'); +INSERT INTO `sys_oper_log` VALUES (2160, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:27:57'); +INSERT INTO `sys_oper_log` VALUES (2161, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"cmd\":\"off\"}', 'null', 1, '设备编号不能为空', '2021-08-27 17:28:00'); +INSERT INTO `sys_oper_log` VALUES (2162, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceNum()', 'GET', 1, 'A1BB9722086A', NULL, '/system/device/getDeviceInfoByDeviceNum', '222.95.162.245', 'XX XX', '{}', 'null', 1, 'nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=\'userId\', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId=\'null\', jdbcTypeName=\'null\', expression=\'null\'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String', '2021-08-27 17:58:25'); +INSERT INTO `sys_oper_log` VALUES (2163, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceNum()', 'GET', 1, 'A1BB9722086A', NULL, '/system/device/getDeviceInfoByDeviceNum', '222.95.162.245', 'XX XX', '{}', 'null', 1, 'nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=\'userId\', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId=\'null\', jdbcTypeName=\'null\', expression=\'null\'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String', '2021-08-27 17:59:54'); +INSERT INTO `sys_oper_log` VALUES (2164, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceNum()', 'GET', 1, 'A1BB9722086A', NULL, '/system/device/getDeviceInfoByDeviceNum', '222.95.162.245', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"12\",\"isOnline\":true,\"deviceName\":\"remark\",\"deviceId\":1}}', 0, NULL, '2021-08-27 18:01:18'); +INSERT INTO `sys_oper_log` VALUES (2165, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.unBindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/unBindDevice', '222.95.162.245', 'XX XX', '{\"params\":{},\"deviceId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 18:02:38'); +INSERT INTO `sys_oper_log` VALUES (2166, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1}}', 0, NULL, '2021-08-27 18:15:10'); +INSERT INTO `sys_oper_log` VALUES (2167, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1}}', 0, NULL, '2021-08-27 18:16:30'); +INSERT INTO `sys_oper_log` VALUES (2168, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"category_name\":\"智能灯\",\"remark\":\"122345678\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1}}', 0, NULL, '2021-08-27 18:22:10'); +INSERT INTO `sys_oper_log` VALUES (2169, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1,\"categoryName\":\"智能灯\",\"categoryId\":2}}', 0, NULL, '2021-08-27 18:25:00'); +INSERT INTO `sys_oper_log` VALUES (2170, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1,\"categoryName\":\"智能灯\",\"categoryId\":2}}', 0, NULL, '2021-08-27 18:26:08'); +INSERT INTO `sys_oper_log` VALUES (2171, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceNum()', 'GET', 1, 'A1BB9722086A', NULL, '/system/device/getDeviceInfoByDeviceNum', '222.95.162.245', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"isOnline\":true,\"lightStatus\":true,\"deviceId\":1,\"categoryName\":\"智能灯\",\"categoryId\":2}}', 0, NULL, '2021-08-27 18:27:17'); +INSERT INTO `sys_oper_log` VALUES (2172, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1,\"categoryName\":\"智能灯\",\"categoryId\":2}}', 0, NULL, '2021-08-27 18:27:36'); +INSERT INTO `sys_oper_log` VALUES (2173, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"7CDFA1049ADA\",\"remark\":\"122345678\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":1,\"categoryName\":\"智能灯\",\"categoryId\":2}}', 0, NULL, '2021-08-27 18:28:40'); +INSERT INTO `sys_oper_log` VALUES (2174, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 18:28:42'); +INSERT INTO `sys_oper_log` VALUES (2175, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 18:28:43'); +INSERT INTO `sys_oper_log` VALUES (2176, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 18:28:44'); +INSERT INTO `sys_oper_log` VALUES (2177, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"7CDFA1049ADA\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 18:28:44'); +INSERT INTO `sys_oper_log` VALUES (2178, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.unBindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/unBindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-27 18:28:51'); +INSERT INTO `sys_oper_log` VALUES (2179, '通知公告', 1, 'com.ruoyi.web.controller.system.SysNoticeController.add()', 'POST', 1, 'admin', NULL, '/system/notice', '222.95.162.245', 'XX XX', '{\"noticeContent\":\"

111111

\",\"createBy\":\"admin\",\"noticeType\":\"2\",\"params\":{},\"noticeTitle\":\"111\",\"status\":\"0\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-27 19:24:12'); +INSERT INTO `sys_oper_log` VALUES (2180, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/bindDevice', '58.212.134.111', 'XX XX', '{\"remark\":\"\",\"params\":{},\"deviceName\":\"wxy测试开关\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-28 13:35:23'); +INSERT INTO `sys_oper_log` VALUES (2181, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:38'); +INSERT INTO `sys_oper_log` VALUES (2182, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:40'); +INSERT INTO `sys_oper_log` VALUES (2183, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:50'); +INSERT INTO `sys_oper_log` VALUES (2184, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:51'); +INSERT INTO `sys_oper_log` VALUES (2185, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:57'); +INSERT INTO `sys_oper_log` VALUES (2186, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:39:58'); +INSERT INTO `sys_oper_log` VALUES (2187, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:40:00'); +INSERT INTO `sys_oper_log` VALUES (2188, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:40:01'); +INSERT INTO `sys_oper_log` VALUES (2189, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:40:01'); +INSERT INTO `sys_oper_log` VALUES (2190, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:40:02'); +INSERT INTO `sys_oper_log` VALUES (2191, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:43:55'); +INSERT INTO `sys_oper_log` VALUES (2192, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:43:56'); +INSERT INTO `sys_oper_log` VALUES (2193, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:44:03'); +INSERT INTO `sys_oper_log` VALUES (2194, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:44:03'); +INSERT INTO `sys_oper_log` VALUES (2195, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:48:43'); +INSERT INTO `sys_oper_log` VALUES (2196, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:50:44'); +INSERT INTO `sys_oper_log` VALUES (2197, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:50:56'); +INSERT INTO `sys_oper_log` VALUES (2198, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:51:02'); +INSERT INTO `sys_oper_log` VALUES (2199, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'A1BB9722086A', NULL, '/system/device/control', '58.212.134.111', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-28 13:51:11'); +INSERT INTO `sys_oper_log` VALUES (2200, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"阿拉丁等等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 10:17:55'); +INSERT INTO `sys_oper_log` VALUES (2201, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:18:41'); +INSERT INTO `sys_oper_log` VALUES (2202, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:18:47'); +INSERT INTO `sys_oper_log` VALUES (2203, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:18:54'); +INSERT INTO `sys_oper_log` VALUES (2204, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:19:08'); +INSERT INTO `sys_oper_log` VALUES (2205, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:19:12'); +INSERT INTO `sys_oper_log` VALUES (2206, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:19:35'); +INSERT INTO `sys_oper_log` VALUES (2207, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:19:37'); +INSERT INTO `sys_oper_log` VALUES (2208, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:20:09'); +INSERT INTO `sys_oper_log` VALUES (2209, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:24:30'); +INSERT INTO `sys_oper_log` VALUES (2210, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:25:17'); +INSERT INTO `sys_oper_log` VALUES (2211, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:25:19'); +INSERT INTO `sys_oper_log` VALUES (2212, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:25:23'); +INSERT INTO `sys_oper_log` VALUES (2213, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:25:27'); +INSERT INTO `sys_oper_log` VALUES (2214, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:25:36'); +INSERT INTO `sys_oper_log` VALUES (2215, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:26:00'); +INSERT INTO `sys_oper_log` VALUES (2216, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:26:18'); +INSERT INTO `sys_oper_log` VALUES (2217, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:26:20'); +INSERT INTO `sys_oper_log` VALUES (2218, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:26:21'); +INSERT INTO `sys_oper_log` VALUES (2219, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:29:11'); +INSERT INTO `sys_oper_log` VALUES (2220, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:31:31'); +INSERT INTO `sys_oper_log` VALUES (2221, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:33:12'); +INSERT INTO `sys_oper_log` VALUES (2222, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:33:20'); +INSERT INTO `sys_oper_log` VALUES (2223, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:38:44'); +INSERT INTO `sys_oper_log` VALUES (2224, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:38:58'); +INSERT INTO `sys_oper_log` VALUES (2225, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:39:41'); +INSERT INTO `sys_oper_log` VALUES (2226, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:40:32'); +INSERT INTO `sys_oper_log` VALUES (2227, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:42:12'); +INSERT INTO `sys_oper_log` VALUES (2228, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:45:49'); +INSERT INTO `sys_oper_log` VALUES (2229, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:45:54'); +INSERT INTO `sys_oper_log` VALUES (2230, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:46:27'); +INSERT INTO `sys_oper_log` VALUES (2231, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:46:32'); +INSERT INTO `sys_oper_log` VALUES (2232, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:48:18'); +INSERT INTO `sys_oper_log` VALUES (2233, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:50:12'); +INSERT INTO `sys_oper_log` VALUES (2234, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:53:58'); +INSERT INTO `sys_oper_log` VALUES (2235, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:54:13'); +INSERT INTO `sys_oper_log` VALUES (2236, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:54:35'); +INSERT INTO `sys_oper_log` VALUES (2237, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:54:40'); +INSERT INTO `sys_oper_log` VALUES (2238, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:55:08'); +INSERT INTO `sys_oper_log` VALUES (2239, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:55:11'); +INSERT INTO `sys_oper_log` VALUES (2240, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:55:34'); +INSERT INTO `sys_oper_log` VALUES (2241, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:55:46'); +INSERT INTO `sys_oper_log` VALUES (2242, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.unBindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/unBindDevice', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceId\":4}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 10:55:59'); +INSERT INTO `sys_oper_log` VALUES (2243, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '180.111.206.137', 'XX XX', '{\"remark\":\"\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":2}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 10:57:14'); +INSERT INTO `sys_oper_log` VALUES (2244, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:57:19'); +INSERT INTO `sys_oper_log` VALUES (2245, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:57:22'); +INSERT INTO `sys_oper_log` VALUES (2246, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 10:57:25'); +INSERT INTO `sys_oper_log` VALUES (2247, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"params\":{},\"deviceId\":4,\"deviceName\":\"阿拉丁\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 10:57:35'); +INSERT INTO `sys_oper_log` VALUES (2248, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 10:57:39'); +INSERT INTO `sys_oper_log` VALUES (2249, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:27:39'); +INSERT INTO `sys_oper_log` VALUES (2250, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:27:44'); +INSERT INTO `sys_oper_log` VALUES (2251, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceId\":4,\"deviceName\":\"阿拉丁\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 15:28:03'); +INSERT INTO `sys_oper_log` VALUES (2252, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:28:05'); +INSERT INTO `sys_oper_log` VALUES (2253, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.updateDeviceInfo()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/updateDeviceInfo', '180.111.206.137', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceId\":4,\"deviceName\":\"阿拉丁神灯\"}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-30 15:28:25'); +INSERT INTO `sys_oper_log` VALUES (2254, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:28:27'); +INSERT INTO `sys_oper_log` VALUES (2255, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 15:28:33'); +INSERT INTO `sys_oper_log` VALUES (2256, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.137', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 15:28:35'); +INSERT INTO `sys_oper_log` VALUES (2257, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:28:55'); +INSERT INTO `sys_oper_log` VALUES (2258, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:30:29'); +INSERT INTO `sys_oper_log` VALUES (2259, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:30:46'); +INSERT INTO `sys_oper_log` VALUES (2260, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.137', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 15:31:12'); +INSERT INTO `sys_oper_log` VALUES (2261, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:53:02'); +INSERT INTO `sys_oper_log` VALUES (2262, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:54:39'); +INSERT INTO `sys_oper_log` VALUES (2263, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:54:46'); +INSERT INTO `sys_oper_log` VALUES (2264, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:11'); +INSERT INTO `sys_oper_log` VALUES (2265, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:19'); +INSERT INTO `sys_oper_log` VALUES (2266, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:22'); +INSERT INTO `sys_oper_log` VALUES (2267, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:30'); +INSERT INTO `sys_oper_log` VALUES (2268, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:34'); +INSERT INTO `sys_oper_log` VALUES (2269, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:57:56'); +INSERT INTO `sys_oper_log` VALUES (2270, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 18:58:26'); +INSERT INTO `sys_oper_log` VALUES (2271, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:00:11'); +INSERT INTO `sys_oper_log` VALUES (2272, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:08:36'); +INSERT INTO `sys_oper_log` VALUES (2273, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:17:25'); +INSERT INTO `sys_oper_log` VALUES (2274, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:17:30'); +INSERT INTO `sys_oper_log` VALUES (2275, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:19:06'); +INSERT INTO `sys_oper_log` VALUES (2276, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-30 19:50:40'); +INSERT INTO `sys_oper_log` VALUES (2277, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:41'); +INSERT INTO `sys_oper_log` VALUES (2278, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:42'); +INSERT INTO `sys_oper_log` VALUES (2279, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:43'); +INSERT INTO `sys_oper_log` VALUES (2280, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:44'); +INSERT INTO `sys_oper_log` VALUES (2281, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:45'); +INSERT INTO `sys_oper_log` VALUES (2282, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:45'); +INSERT INTO `sys_oper_log` VALUES (2283, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:46'); +INSERT INTO `sys_oper_log` VALUES (2284, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:46'); +INSERT INTO `sys_oper_log` VALUES (2285, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:47'); +INSERT INTO `sys_oper_log` VALUES (2286, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:47'); +INSERT INTO `sys_oper_log` VALUES (2287, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:48'); +INSERT INTO `sys_oper_log` VALUES (2288, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:49'); +INSERT INTO `sys_oper_log` VALUES (2289, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:49'); +INSERT INTO `sys_oper_log` VALUES (2290, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:53'); +INSERT INTO `sys_oper_log` VALUES (2291, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:54'); +INSERT INTO `sys_oper_log` VALUES (2292, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:55'); +INSERT INTO `sys_oper_log` VALUES (2293, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:55'); +INSERT INTO `sys_oper_log` VALUES (2294, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-30 19:50:55'); +INSERT INTO `sys_oper_log` VALUES (2295, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 10:35:17'); +INSERT INTO `sys_oper_log` VALUES (2296, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:46:28'); +INSERT INTO `sys_oper_log` VALUES (2297, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:48:05'); +INSERT INTO `sys_oper_log` VALUES (2298, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:48:10'); +INSERT INTO `sys_oper_log` VALUES (2299, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-31 14:48:23'); +INSERT INTO `sys_oper_log` VALUES (2300, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:32'); +INSERT INTO `sys_oper_log` VALUES (2301, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:34'); +INSERT INTO `sys_oper_log` VALUES (2302, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:39'); +INSERT INTO `sys_oper_log` VALUES (2303, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:40'); +INSERT INTO `sys_oper_log` VALUES (2304, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:49'); +INSERT INTO `sys_oper_log` VALUES (2305, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:50'); +INSERT INTO `sys_oper_log` VALUES (2306, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:48:50'); +INSERT INTO `sys_oper_log` VALUES (2307, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:03'); +INSERT INTO `sys_oper_log` VALUES (2308, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:04'); +INSERT INTO `sys_oper_log` VALUES (2309, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:05'); +INSERT INTO `sys_oper_log` VALUES (2310, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:06'); +INSERT INTO `sys_oper_log` VALUES (2311, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:06'); +INSERT INTO `sys_oper_log` VALUES (2312, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:07'); +INSERT INTO `sys_oper_log` VALUES (2313, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:08'); +INSERT INTO `sys_oper_log` VALUES (2314, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:08'); +INSERT INTO `sys_oper_log` VALUES (2315, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:15'); +INSERT INTO `sys_oper_log` VALUES (2316, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:16'); +INSERT INTO `sys_oper_log` VALUES (2317, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:49:34'); +INSERT INTO `sys_oper_log` VALUES (2318, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:49:42'); +INSERT INTO `sys_oper_log` VALUES (2319, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:49:48'); +INSERT INTO `sys_oper_log` VALUES (2320, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.unBindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/unBindDevice', '180.111.206.122', 'XX XX', '{\"params\":{},\"deviceId\":4}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-31 14:49:54'); +INSERT INTO `sys_oper_log` VALUES (2321, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:50:01'); +INSERT INTO `sys_oper_log` VALUES (2322, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-31 14:50:07'); +INSERT INTO `sys_oper_log` VALUES (2323, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:09'); +INSERT INTO `sys_oper_log` VALUES (2324, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:10'); +INSERT INTO `sys_oper_log` VALUES (2325, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 14:50:14'); +INSERT INTO `sys_oper_log` VALUES (2326, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:17'); +INSERT INTO `sys_oper_log` VALUES (2327, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:18'); +INSERT INTO `sys_oper_log` VALUES (2328, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 14:50:22'); +INSERT INTO `sys_oper_log` VALUES (2329, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:25'); +INSERT INTO `sys_oper_log` VALUES (2330, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:50:26'); +INSERT INTO `sys_oper_log` VALUES (2331, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:50:34'); +INSERT INTO `sys_oper_log` VALUES (2332, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:50:38'); +INSERT INTO `sys_oper_log` VALUES (2333, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:50:59'); +INSERT INTO `sys_oper_log` VALUES (2334, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:00'); +INSERT INTO `sys_oper_log` VALUES (2335, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:01'); +INSERT INTO `sys_oper_log` VALUES (2336, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:02'); +INSERT INTO `sys_oper_log` VALUES (2337, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:03'); +INSERT INTO `sys_oper_log` VALUES (2338, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:04'); +INSERT INTO `sys_oper_log` VALUES (2339, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:05'); +INSERT INTO `sys_oper_log` VALUES (2340, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:05'); +INSERT INTO `sys_oper_log` VALUES (2341, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:06'); +INSERT INTO `sys_oper_log` VALUES (2342, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:06'); +INSERT INTO `sys_oper_log` VALUES (2343, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:07'); +INSERT INTO `sys_oper_log` VALUES (2344, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:08'); +INSERT INTO `sys_oper_log` VALUES (2345, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:08'); +INSERT INTO `sys_oper_log` VALUES (2346, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:09'); +INSERT INTO `sys_oper_log` VALUES (2347, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:10'); +INSERT INTO `sys_oper_log` VALUES (2348, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:51:29'); +INSERT INTO `sys_oper_log` VALUES (2349, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:31'); +INSERT INTO `sys_oper_log` VALUES (2350, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:32'); +INSERT INTO `sys_oper_log` VALUES (2351, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:32'); +INSERT INTO `sys_oper_log` VALUES (2352, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:33'); +INSERT INTO `sys_oper_log` VALUES (2353, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:33'); +INSERT INTO `sys_oper_log` VALUES (2354, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:34'); +INSERT INTO `sys_oper_log` VALUES (2355, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:34'); +INSERT INTO `sys_oper_log` VALUES (2356, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:51:35'); +INSERT INTO `sys_oper_log` VALUES (2357, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:52:57'); +INSERT INTO `sys_oper_log` VALUES (2358, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:52:59'); +INSERT INTO `sys_oper_log` VALUES (2359, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:52:59'); +INSERT INTO `sys_oper_log` VALUES (2360, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:01'); +INSERT INTO `sys_oper_log` VALUES (2361, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:02'); +INSERT INTO `sys_oper_log` VALUES (2362, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:02'); +INSERT INTO `sys_oper_log` VALUES (2363, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:02'); +INSERT INTO `sys_oper_log` VALUES (2364, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:02'); +INSERT INTO `sys_oper_log` VALUES (2365, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:03'); +INSERT INTO `sys_oper_log` VALUES (2366, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:03'); +INSERT INTO `sys_oper_log` VALUES (2367, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:03'); +INSERT INTO `sys_oper_log` VALUES (2368, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:03'); +INSERT INTO `sys_oper_log` VALUES (2369, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:03'); +INSERT INTO `sys_oper_log` VALUES (2370, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:04'); +INSERT INTO `sys_oper_log` VALUES (2371, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:04'); +INSERT INTO `sys_oper_log` VALUES (2372, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:04'); +INSERT INTO `sys_oper_log` VALUES (2373, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:04'); +INSERT INTO `sys_oper_log` VALUES (2374, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:05'); +INSERT INTO `sys_oper_log` VALUES (2375, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:05'); +INSERT INTO `sys_oper_log` VALUES (2376, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:05'); +INSERT INTO `sys_oper_log` VALUES (2377, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:05'); +INSERT INTO `sys_oper_log` VALUES (2378, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:05'); +INSERT INTO `sys_oper_log` VALUES (2379, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:06'); +INSERT INTO `sys_oper_log` VALUES (2380, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:06'); +INSERT INTO `sys_oper_log` VALUES (2381, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:07'); +INSERT INTO `sys_oper_log` VALUES (2382, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:07'); +INSERT INTO `sys_oper_log` VALUES (2383, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:07'); +INSERT INTO `sys_oper_log` VALUES (2384, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:07'); +INSERT INTO `sys_oper_log` VALUES (2385, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:07'); +INSERT INTO `sys_oper_log` VALUES (2386, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:08'); +INSERT INTO `sys_oper_log` VALUES (2387, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:08'); +INSERT INTO `sys_oper_log` VALUES (2388, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:08'); +INSERT INTO `sys_oper_log` VALUES (2389, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:08'); +INSERT INTO `sys_oper_log` VALUES (2390, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:09'); +INSERT INTO `sys_oper_log` VALUES (2391, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:09'); +INSERT INTO `sys_oper_log` VALUES (2392, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:17'); +INSERT INTO `sys_oper_log` VALUES (2393, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:18'); +INSERT INTO `sys_oper_log` VALUES (2394, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:18'); +INSERT INTO `sys_oper_log` VALUES (2395, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:18'); +INSERT INTO `sys_oper_log` VALUES (2396, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:18'); +INSERT INTO `sys_oper_log` VALUES (2397, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:53:23'); +INSERT INTO `sys_oper_log` VALUES (2398, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:24'); +INSERT INTO `sys_oper_log` VALUES (2399, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:25'); +INSERT INTO `sys_oper_log` VALUES (2400, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:53:30'); +INSERT INTO `sys_oper_log` VALUES (2401, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:31'); +INSERT INTO `sys_oper_log` VALUES (2402, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:32'); +INSERT INTO `sys_oper_log` VALUES (2403, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:32'); +INSERT INTO `sys_oper_log` VALUES (2404, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:32'); +INSERT INTO `sys_oper_log` VALUES (2405, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:32'); +INSERT INTO `sys_oper_log` VALUES (2406, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2407, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2408, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2409, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2410, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2411, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:33'); +INSERT INTO `sys_oper_log` VALUES (2412, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:34'); +INSERT INTO `sys_oper_log` VALUES (2413, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:34'); +INSERT INTO `sys_oper_log` VALUES (2414, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:34'); +INSERT INTO `sys_oper_log` VALUES (2415, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:34'); +INSERT INTO `sys_oper_log` VALUES (2416, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:34'); +INSERT INTO `sys_oper_log` VALUES (2417, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:35'); +INSERT INTO `sys_oper_log` VALUES (2418, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:35'); +INSERT INTO `sys_oper_log` VALUES (2419, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:35'); +INSERT INTO `sys_oper_log` VALUES (2420, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:35'); +INSERT INTO `sys_oper_log` VALUES (2421, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:35'); +INSERT INTO `sys_oper_log` VALUES (2422, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:36'); +INSERT INTO `sys_oper_log` VALUES (2423, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:36'); +INSERT INTO `sys_oper_log` VALUES (2424, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:44'); +INSERT INTO `sys_oper_log` VALUES (2425, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:45'); +INSERT INTO `sys_oper_log` VALUES (2426, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:45'); +INSERT INTO `sys_oper_log` VALUES (2427, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:45'); +INSERT INTO `sys_oper_log` VALUES (2428, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:45'); +INSERT INTO `sys_oper_log` VALUES (2429, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:46'); +INSERT INTO `sys_oper_log` VALUES (2430, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:47'); +INSERT INTO `sys_oper_log` VALUES (2431, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:53:48'); +INSERT INTO `sys_oper_log` VALUES (2432, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:03'); +INSERT INTO `sys_oper_log` VALUES (2433, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:09'); +INSERT INTO `sys_oper_log` VALUES (2434, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:32'); +INSERT INTO `sys_oper_log` VALUES (2435, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:34'); +INSERT INTO `sys_oper_log` VALUES (2436, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:35'); +INSERT INTO `sys_oper_log` VALUES (2437, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:36'); +INSERT INTO `sys_oper_log` VALUES (2438, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:37'); +INSERT INTO `sys_oper_log` VALUES (2439, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:37'); +INSERT INTO `sys_oper_log` VALUES (2440, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:38'); +INSERT INTO `sys_oper_log` VALUES (2441, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:39'); +INSERT INTO `sys_oper_log` VALUES (2442, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:40'); +INSERT INTO `sys_oper_log` VALUES (2443, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:41'); +INSERT INTO `sys_oper_log` VALUES (2444, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:42'); +INSERT INTO `sys_oper_log` VALUES (2445, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:43'); +INSERT INTO `sys_oper_log` VALUES (2446, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:44'); +INSERT INTO `sys_oper_log` VALUES (2447, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:45'); +INSERT INTO `sys_oper_log` VALUES (2448, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:46'); +INSERT INTO `sys_oper_log` VALUES (2449, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:47'); +INSERT INTO `sys_oper_log` VALUES (2450, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:48'); +INSERT INTO `sys_oper_log` VALUES (2451, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:48'); +INSERT INTO `sys_oper_log` VALUES (2452, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:49'); +INSERT INTO `sys_oper_log` VALUES (2453, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:50'); +INSERT INTO `sys_oper_log` VALUES (2454, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:51'); +INSERT INTO `sys_oper_log` VALUES (2455, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:52'); +INSERT INTO `sys_oper_log` VALUES (2456, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:52'); +INSERT INTO `sys_oper_log` VALUES (2457, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:53'); +INSERT INTO `sys_oper_log` VALUES (2458, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:53'); +INSERT INTO `sys_oper_log` VALUES (2459, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:54'); +INSERT INTO `sys_oper_log` VALUES (2460, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:54'); +INSERT INTO `sys_oper_log` VALUES (2461, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:54:55'); +INSERT INTO `sys_oper_log` VALUES (2462, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:56'); +INSERT INTO `sys_oper_log` VALUES (2463, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:54:59'); +INSERT INTO `sys_oper_log` VALUES (2464, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 14:58:05'); +INSERT INTO `sys_oper_log` VALUES (2465, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '180.111.206.122', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 14:58:11'); +INSERT INTO `sys_oper_log` VALUES (2466, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:16'); +INSERT INTO `sys_oper_log` VALUES (2467, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:17'); +INSERT INTO `sys_oper_log` VALUES (2468, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:19'); +INSERT INTO `sys_oper_log` VALUES (2469, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:20'); +INSERT INTO `sys_oper_log` VALUES (2470, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:21'); +INSERT INTO `sys_oper_log` VALUES (2471, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:21'); +INSERT INTO `sys_oper_log` VALUES (2472, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:23'); +INSERT INTO `sys_oper_log` VALUES (2473, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:23'); +INSERT INTO `sys_oper_log` VALUES (2474, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:58:33'); +INSERT INTO `sys_oper_log` VALUES (2475, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:35'); +INSERT INTO `sys_oper_log` VALUES (2476, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:35'); +INSERT INTO `sys_oper_log` VALUES (2477, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:58:49'); +INSERT INTO `sys_oper_log` VALUES (2478, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:58:54'); +INSERT INTO `sys_oper_log` VALUES (2479, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:58:58'); +INSERT INTO `sys_oper_log` VALUES (2480, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:59:01'); +INSERT INTO `sys_oper_log` VALUES (2481, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:05'); +INSERT INTO `sys_oper_log` VALUES (2482, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:06'); +INSERT INTO `sys_oper_log` VALUES (2483, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:07'); +INSERT INTO `sys_oper_log` VALUES (2484, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:08'); +INSERT INTO `sys_oper_log` VALUES (2485, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:59:14'); +INSERT INTO `sys_oper_log` VALUES (2486, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:59:16'); +INSERT INTO `sys_oper_log` VALUES (2487, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:18'); +INSERT INTO `sys_oper_log` VALUES (2488, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:21'); +INSERT INTO `sys_oper_log` VALUES (2489, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:22'); +INSERT INTO `sys_oper_log` VALUES (2490, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:23'); +INSERT INTO `sys_oper_log` VALUES (2491, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:24'); +INSERT INTO `sys_oper_log` VALUES (2492, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:25'); +INSERT INTO `sys_oper_log` VALUES (2493, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:59:36'); +INSERT INTO `sys_oper_log` VALUES (2494, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:38'); +INSERT INTO `sys_oper_log` VALUES (2495, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:39'); +INSERT INTO `sys_oper_log` VALUES (2496, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:40'); +INSERT INTO `sys_oper_log` VALUES (2497, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:41'); +INSERT INTO `sys_oper_log` VALUES (2498, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:43'); +INSERT INTO `sys_oper_log` VALUES (2499, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:44'); +INSERT INTO `sys_oper_log` VALUES (2500, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:45'); +INSERT INTO `sys_oper_log` VALUES (2501, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:45'); +INSERT INTO `sys_oper_log` VALUES (2502, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:46'); +INSERT INTO `sys_oper_log` VALUES (2503, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 14:59:46'); +INSERT INTO `sys_oper_log` VALUES (2504, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 14:59:52'); +INSERT INTO `sys_oper_log` VALUES (2505, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:54:30'); +INSERT INTO `sys_oper_log` VALUES (2506, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:32'); +INSERT INTO `sys_oper_log` VALUES (2507, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:33'); +INSERT INTO `sys_oper_log` VALUES (2508, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:34'); +INSERT INTO `sys_oper_log` VALUES (2509, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:35'); +INSERT INTO `sys_oper_log` VALUES (2510, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:35'); +INSERT INTO `sys_oper_log` VALUES (2511, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:54:36'); +INSERT INTO `sys_oper_log` VALUES (2512, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:58:06'); +INSERT INTO `sys_oper_log` VALUES (2513, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:08'); +INSERT INTO `sys_oper_log` VALUES (2514, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:09'); +INSERT INTO `sys_oper_log` VALUES (2515, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:10'); +INSERT INTO `sys_oper_log` VALUES (2516, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:12'); +INSERT INTO `sys_oper_log` VALUES (2517, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:13'); +INSERT INTO `sys_oper_log` VALUES (2518, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:13'); +INSERT INTO `sys_oper_log` VALUES (2519, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:14'); +INSERT INTO `sys_oper_log` VALUES (2520, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:15'); +INSERT INTO `sys_oper_log` VALUES (2521, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:15'); +INSERT INTO `sys_oper_log` VALUES (2522, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:58:17'); +INSERT INTO `sys_oper_log` VALUES (2523, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:59:07'); +INSERT INTO `sys_oper_log` VALUES (2524, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:59:25'); +INSERT INTO `sys_oper_log` VALUES (2525, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:59:32'); +INSERT INTO `sys_oper_log` VALUES (2526, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 15:59:33'); +INSERT INTO `sys_oper_log` VALUES (2527, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:59:46'); +INSERT INTO `sys_oper_log` VALUES (2528, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 15:59:51'); +INSERT INTO `sys_oper_log` VALUES (2529, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:00:05'); +INSERT INTO `sys_oper_log` VALUES (2530, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:00:08'); +INSERT INTO `sys_oper_log` VALUES (2531, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:00:13'); +INSERT INTO `sys_oper_log` VALUES (2532, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:00:14'); +INSERT INTO `sys_oper_log` VALUES (2533, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:00:15'); +INSERT INTO `sys_oper_log` VALUES (2534, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:01:01'); +INSERT INTO `sys_oper_log` VALUES (2535, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:01:07'); +INSERT INTO `sys_oper_log` VALUES (2536, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:01:14'); +INSERT INTO `sys_oper_log` VALUES (2537, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:01:30'); +INSERT INTO `sys_oper_log` VALUES (2538, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:01:33'); +INSERT INTO `sys_oper_log` VALUES (2539, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:02:15'); +INSERT INTO `sys_oper_log` VALUES (2540, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:02:19'); +INSERT INTO `sys_oper_log` VALUES (2541, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:02:43'); +INSERT INTO `sys_oper_log` VALUES (2542, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 16:02:46'); +INSERT INTO `sys_oper_log` VALUES (2543, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:02:48'); +INSERT INTO `sys_oper_log` VALUES (2544, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 16:02:53'); +INSERT INTO `sys_oper_log` VALUES (2545, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:29:05'); +INSERT INTO `sys_oper_log` VALUES (2546, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:29:05'); +INSERT INTO `sys_oper_log` VALUES (2547, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:29:05'); +INSERT INTO `sys_oper_log` VALUES (2548, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '117.136.45.101', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 19:29:05'); +INSERT INTO `sys_oper_log` VALUES (2549, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:30:16'); +INSERT INTO `sys_oper_log` VALUES (2550, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:30:30'); +INSERT INTO `sys_oper_log` VALUES (2551, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:31:21'); +INSERT INTO `sys_oper_log` VALUES (2552, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:31:56'); +INSERT INTO `sys_oper_log` VALUES (2553, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:32:02'); +INSERT INTO `sys_oper_log` VALUES (2554, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:32:03'); +INSERT INTO `sys_oper_log` VALUES (2555, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:32:08'); +INSERT INTO `sys_oper_log` VALUES (2556, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:32:20'); +INSERT INTO `sys_oper_log` VALUES (2557, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:32:39'); +INSERT INTO `sys_oper_log` VALUES (2558, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:32:47'); +INSERT INTO `sys_oper_log` VALUES (2559, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '117.136.45.101', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 19:32:52'); +INSERT INTO `sys_oper_log` VALUES (2560, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:32:52'); +INSERT INTO `sys_oper_log` VALUES (2561, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:32:57'); +INSERT INTO `sys_oper_log` VALUES (2562, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:01'); +INSERT INTO `sys_oper_log` VALUES (2563, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/bindDevice', '117.136.45.101', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":1}', 'null', 1, '该设备已被绑定!', '2021-08-31 19:33:05'); +INSERT INTO `sys_oper_log` VALUES (2564, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:05'); +INSERT INTO `sys_oper_log` VALUES (2565, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:11'); +INSERT INTO `sys_oper_log` VALUES (2566, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:18'); +INSERT INTO `sys_oper_log` VALUES (2567, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:20'); +INSERT INTO `sys_oper_log` VALUES (2568, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:33:22'); +INSERT INTO `sys_oper_log` VALUES (2569, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:38:01'); +INSERT INTO `sys_oper_log` VALUES (2570, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:38:07'); +INSERT INTO `sys_oper_log` VALUES (2571, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:40:39'); +INSERT INTO `sys_oper_log` VALUES (2572, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:40:42'); +INSERT INTO `sys_oper_log` VALUES (2573, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:41:12'); +INSERT INTO `sys_oper_log` VALUES (2574, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:20'); +INSERT INTO `sys_oper_log` VALUES (2575, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:21'); +INSERT INTO `sys_oper_log` VALUES (2576, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:23'); +INSERT INTO `sys_oper_log` VALUES (2577, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:41:27'); +INSERT INTO `sys_oper_log` VALUES (2578, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:31'); +INSERT INTO `sys_oper_log` VALUES (2579, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:41:35'); +INSERT INTO `sys_oper_log` VALUES (2580, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:37'); +INSERT INTO `sys_oper_log` VALUES (2581, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:41:41'); +INSERT INTO `sys_oper_log` VALUES (2582, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:54'); +INSERT INTO `sys_oper_log` VALUES (2583, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:41:55'); +INSERT INTO `sys_oper_log` VALUES (2584, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:41:57'); +INSERT INTO `sys_oper_log` VALUES (2585, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:43:27'); +INSERT INTO `sys_oper_log` VALUES (2586, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:30'); +INSERT INTO `sys_oper_log` VALUES (2587, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:35'); +INSERT INTO `sys_oper_log` VALUES (2588, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:38'); +INSERT INTO `sys_oper_log` VALUES (2589, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:42'); +INSERT INTO `sys_oper_log` VALUES (2590, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:43'); +INSERT INTO `sys_oper_log` VALUES (2591, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:45'); +INSERT INTO `sys_oper_log` VALUES (2592, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:43:47'); +INSERT INTO `sys_oper_log` VALUES (2593, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:52:01'); +INSERT INTO `sys_oper_log` VALUES (2594, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:52:06'); +INSERT INTO `sys_oper_log` VALUES (2595, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:53:21'); +INSERT INTO `sys_oper_log` VALUES (2596, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:53:25'); +INSERT INTO `sys_oper_log` VALUES (2597, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:53:41'); +INSERT INTO `sys_oper_log` VALUES (2598, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:59:40'); +INSERT INTO `sys_oper_log` VALUES (2599, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:59:42'); +INSERT INTO `sys_oper_log` VALUES (2600, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:59:45'); +INSERT INTO `sys_oper_log` VALUES (2601, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 19:59:46'); +INSERT INTO `sys_oper_log` VALUES (2602, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 19:59:50'); +INSERT INTO `sys_oper_log` VALUES (2603, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 20:02:10'); +INSERT INTO `sys_oper_log` VALUES (2604, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:30'); +INSERT INTO `sys_oper_log` VALUES (2605, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 20:02:33'); +INSERT INTO `sys_oper_log` VALUES (2606, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"lightStatus\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"wifi通断器\",\"categoryId\":1}}', 0, NULL, '2021-08-31 20:02:36'); +INSERT INTO `sys_oper_log` VALUES (2607, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:37'); +INSERT INTO `sys_oper_log` VALUES (2608, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:40'); +INSERT INTO `sys_oper_log` VALUES (2609, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:43'); +INSERT INTO `sys_oper_log` VALUES (2610, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:45'); +INSERT INTO `sys_oper_log` VALUES (2611, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:46'); +INSERT INTO `sys_oper_log` VALUES (2612, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:55'); +INSERT INTO `sys_oper_log` VALUES (2613, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:55'); +INSERT INTO `sys_oper_log` VALUES (2614, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:02:55'); +INSERT INTO `sys_oper_log` VALUES (2615, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:11:29'); +INSERT INTO `sys_oper_log` VALUES (2616, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:14:10'); +INSERT INTO `sys_oper_log` VALUES (2617, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:14:11'); +INSERT INTO `sys_oper_log` VALUES (2618, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:14:12'); +INSERT INTO `sys_oper_log` VALUES (2619, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:14:18'); +INSERT INTO `sys_oper_log` VALUES (2620, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:18:14'); +INSERT INTO `sys_oper_log` VALUES (2621, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:19:27'); +INSERT INTO `sys_oper_log` VALUES (2622, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:19:28'); +INSERT INTO `sys_oper_log` VALUES (2623, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '180.111.206.122', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:19:30'); +INSERT INTO `sys_oper_log` VALUES (2624, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '180.111.206.122', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:19:32'); +INSERT INTO `sys_oper_log` VALUES (2625, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:20:00'); +INSERT INTO `sys_oper_log` VALUES (2626, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:20:01'); +INSERT INTO `sys_oper_log` VALUES (2627, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:20:02'); +INSERT INTO `sys_oper_log` VALUES (2628, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:20:12'); +INSERT INTO `sys_oper_log` VALUES (2629, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:20:16'); +INSERT INTO `sys_oper_log` VALUES (2630, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:25'); +INSERT INTO `sys_oper_log` VALUES (2631, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:28'); +INSERT INTO `sys_oper_log` VALUES (2632, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:23:32'); +INSERT INTO `sys_oper_log` VALUES (2633, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":true,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:35'); +INSERT INTO `sys_oper_log` VALUES (2634, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, 'EB5312FB4A26', NULL, '/system/device/control', '117.136.45.101', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:23:38'); +INSERT INTO `sys_oper_log` VALUES (2635, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:43'); +INSERT INTO `sys_oper_log` VALUES (2636, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:48'); +INSERT INTO `sys_oper_log` VALUES (2637, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:55'); +INSERT INTO `sys_oper_log` VALUES (2638, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:23:55'); +INSERT INTO `sys_oper_log` VALUES (2639, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.unBindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/unBindDevice', '117.136.45.72', 'XX XX', '{\"params\":{},\"deviceId\":4}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-31 20:23:58'); +INSERT INTO `sys_oper_log` VALUES (2640, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, 'EB5312FB4A26', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.101', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"deviceNum\":\"863488052352472\",\"relayStatus\":false,\"remark\":\"灯等等灯\",\"isOnline\":true,\"deviceName\":\"阿拉丁神灯\",\"deviceId\":4,\"categoryName\":\"智能水阀\",\"categoryId\":4}}', 0, NULL, '2021-08-31 20:24:04'); +INSERT INTO `sys_oper_log` VALUES (2641, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '117.136.45.72', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":4}', '{\"msg\":\"操作成功\",\"code\":200,\"data\":1}', 0, NULL, '2021-08-31 20:24:31'); +INSERT INTO `sys_oper_log` VALUES (2642, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:31'); +INSERT INTO `sys_oper_log` VALUES (2643, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:35'); +INSERT INTO `sys_oper_log` VALUES (2644, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:38'); +INSERT INTO `sys_oper_log` VALUES (2645, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:40'); +INSERT INTO `sys_oper_log` VALUES (2646, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:41'); +INSERT INTO `sys_oper_log` VALUES (2647, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:46'); +INSERT INTO `sys_oper_log` VALUES (2648, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:49'); +INSERT INTO `sys_oper_log` VALUES (2649, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:50'); +INSERT INTO `sys_oper_log` VALUES (2650, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:24:55'); +INSERT INTO `sys_oper_log` VALUES (2651, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.bindDevice()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/bindDevice', '117.136.45.72', 'XX XX', '{\"remark\":\"灯等等灯\",\"params\":{},\"deviceName\":\"阿拉丁神灯\",\"deviceNum\":\"863488052352472\",\"categoryId\":4}', 'null', 1, '该设备已被绑定!', '2021-08-31 20:25:05'); +INSERT INTO `sys_oper_log` VALUES (2652, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.getDeviceInfoByDeviceId()', 'GET', 1, '6F1B3F33DD38', NULL, '/system/device/getDeviceInfoByDeviceId', '117.136.45.72', 'XX XX', '{}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:05'); +INSERT INTO `sys_oper_log` VALUES (2653, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:07'); +INSERT INTO `sys_oper_log` VALUES (2654, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:08'); +INSERT INTO `sys_oper_log` VALUES (2655, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:09'); +INSERT INTO `sys_oper_log` VALUES (2656, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:10'); +INSERT INTO `sys_oper_log` VALUES (2657, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:11'); +INSERT INTO `sys_oper_log` VALUES (2658, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:12'); +INSERT INTO `sys_oper_log` VALUES (2659, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:12'); +INSERT INTO `sys_oper_log` VALUES (2660, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:13'); +INSERT INTO `sys_oper_log` VALUES (2661, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"on\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:14'); +INSERT INTO `sys_oper_log` VALUES (2662, '设备', 2, 'com.ruoyi.system.controller.IotDeviceController.control()', 'POST', 1, '6F1B3F33DD38', NULL, '/system/device/control', '117.136.45.72', 'XX XX', '{\"deviceNum\":\"863488052352472\",\"cmd\":\"off\"}', '{\"msg\":\"操作成功\",\"code\":200}', 0, NULL, '2021-08-31 20:25:14'); + +-- ---------------------------- +-- Table structure for sys_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_post`; +CREATE TABLE `sys_post` ( + `post_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '岗位ID', + `post_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '岗位编码', + `post_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '岗位名称', + `post_sort` int(0) NOT NULL COMMENT '显示顺序', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态(0正常 1停用)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`post_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '岗位信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_post +-- ---------------------------- +INSERT INTO `sys_post` VALUES (1, 'ceo', '董事长', 1, '0', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_post` VALUES (2, 'se', '项目经理', 2, '0', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_post` VALUES (3, 'hr', '人力资源', 3, '0', 'admin', '2021-05-18 02:23:06', '', NULL, ''); +INSERT INTO `sys_post` VALUES (4, 'user', '普通员工', 4, '0', 'admin', '2021-05-18 02:23:06', '', NULL, ''); + +-- ---------------------------- +-- Table structure for sys_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `role_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '角色ID', + `role_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色名称', + `role_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色权限字符串', + `role_sort` int(0) NOT NULL COMMENT '显示顺序', + `data_scope` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', + `menu_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '菜单树选择项是否关联显示', + `dept_check_strictly` tinyint(1) NULL DEFAULT 1 COMMENT '部门树选择项是否关联显示', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`role_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 102 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, '1', 1, 1, '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL, '超级管理员'); +INSERT INTO `sys_role` VALUES (2, '普通角色', 'common', 2, '2', 1, 1, '0', '0', 'admin', '2021-05-18 02:23:06', '', NULL, '普通角色'); +INSERT INTO `sys_role` VALUES (100, '游客角色', 'visitor', 8, '1', 1, 1, '0', '0', 'admin', '2021-05-29 08:42:32', 'admin', '2021-08-26 17:27:05', NULL); +INSERT INTO `sys_role` VALUES (101, '小程序用户', 'mp', 3, '1', 1, 1, '0', '0', 'admin', '2021-08-26 17:26:52', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_role_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_dept`; +CREATE TABLE `sys_role_dept` ( + `role_id` bigint(0) NOT NULL COMMENT '角色ID', + `dept_id` bigint(0) NOT NULL COMMENT '部门ID', + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和部门关联表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_role_dept +-- ---------------------------- +INSERT INTO `sys_role_dept` VALUES (2, 100); +INSERT INTO `sys_role_dept` VALUES (2, 101); +INSERT INTO `sys_role_dept` VALUES (2, 105); + +-- ---------------------------- +-- Table structure for sys_role_menu +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_menu`; +CREATE TABLE `sys_role_menu` ( + `role_id` bigint(0) NOT NULL COMMENT '角色ID', + `menu_id` bigint(0) NOT NULL COMMENT '菜单ID', + PRIMARY KEY (`role_id`, `menu_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_role_menu +-- ---------------------------- +INSERT INTO `sys_role_menu` VALUES (2, 1); +INSERT INTO `sys_role_menu` VALUES (2, 2); +INSERT INTO `sys_role_menu` VALUES (2, 3); +INSERT INTO `sys_role_menu` VALUES (2, 4); +INSERT INTO `sys_role_menu` VALUES (2, 100); +INSERT INTO `sys_role_menu` VALUES (2, 101); +INSERT INTO `sys_role_menu` VALUES (2, 102); +INSERT INTO `sys_role_menu` VALUES (2, 103); +INSERT INTO `sys_role_menu` VALUES (2, 104); +INSERT INTO `sys_role_menu` VALUES (2, 105); +INSERT INTO `sys_role_menu` VALUES (2, 106); +INSERT INTO `sys_role_menu` VALUES (2, 107); +INSERT INTO `sys_role_menu` VALUES (2, 108); +INSERT INTO `sys_role_menu` VALUES (2, 109); +INSERT INTO `sys_role_menu` VALUES (2, 110); +INSERT INTO `sys_role_menu` VALUES (2, 111); +INSERT INTO `sys_role_menu` VALUES (2, 112); +INSERT INTO `sys_role_menu` VALUES (2, 113); +INSERT INTO `sys_role_menu` VALUES (2, 114); +INSERT INTO `sys_role_menu` VALUES (2, 115); +INSERT INTO `sys_role_menu` VALUES (2, 116); +INSERT INTO `sys_role_menu` VALUES (2, 500); +INSERT INTO `sys_role_menu` VALUES (2, 501); +INSERT INTO `sys_role_menu` VALUES (2, 1000); +INSERT INTO `sys_role_menu` VALUES (2, 1001); +INSERT INTO `sys_role_menu` VALUES (2, 1002); +INSERT INTO `sys_role_menu` VALUES (2, 1003); +INSERT INTO `sys_role_menu` VALUES (2, 1004); +INSERT INTO `sys_role_menu` VALUES (2, 1005); +INSERT INTO `sys_role_menu` VALUES (2, 1006); +INSERT INTO `sys_role_menu` VALUES (2, 1007); +INSERT INTO `sys_role_menu` VALUES (2, 1008); +INSERT INTO `sys_role_menu` VALUES (2, 1009); +INSERT INTO `sys_role_menu` VALUES (2, 1010); +INSERT INTO `sys_role_menu` VALUES (2, 1011); +INSERT INTO `sys_role_menu` VALUES (2, 1012); +INSERT INTO `sys_role_menu` VALUES (2, 1013); +INSERT INTO `sys_role_menu` VALUES (2, 1014); +INSERT INTO `sys_role_menu` VALUES (2, 1015); +INSERT INTO `sys_role_menu` VALUES (2, 1016); +INSERT INTO `sys_role_menu` VALUES (2, 1017); +INSERT INTO `sys_role_menu` VALUES (2, 1018); +INSERT INTO `sys_role_menu` VALUES (2, 1019); +INSERT INTO `sys_role_menu` VALUES (2, 1020); +INSERT INTO `sys_role_menu` VALUES (2, 1021); +INSERT INTO `sys_role_menu` VALUES (2, 1022); +INSERT INTO `sys_role_menu` VALUES (2, 1023); +INSERT INTO `sys_role_menu` VALUES (2, 1024); +INSERT INTO `sys_role_menu` VALUES (2, 1025); +INSERT INTO `sys_role_menu` VALUES (2, 1026); +INSERT INTO `sys_role_menu` VALUES (2, 1027); +INSERT INTO `sys_role_menu` VALUES (2, 1028); +INSERT INTO `sys_role_menu` VALUES (2, 1029); +INSERT INTO `sys_role_menu` VALUES (2, 1030); +INSERT INTO `sys_role_menu` VALUES (2, 1031); +INSERT INTO `sys_role_menu` VALUES (2, 1032); +INSERT INTO `sys_role_menu` VALUES (2, 1033); +INSERT INTO `sys_role_menu` VALUES (2, 1034); +INSERT INTO `sys_role_menu` VALUES (2, 1035); +INSERT INTO `sys_role_menu` VALUES (2, 1036); +INSERT INTO `sys_role_menu` VALUES (2, 1037); +INSERT INTO `sys_role_menu` VALUES (2, 1038); +INSERT INTO `sys_role_menu` VALUES (2, 1039); +INSERT INTO `sys_role_menu` VALUES (2, 1040); +INSERT INTO `sys_role_menu` VALUES (2, 1041); +INSERT INTO `sys_role_menu` VALUES (2, 1042); +INSERT INTO `sys_role_menu` VALUES (2, 1043); +INSERT INTO `sys_role_menu` VALUES (2, 1044); +INSERT INTO `sys_role_menu` VALUES (2, 1045); +INSERT INTO `sys_role_menu` VALUES (2, 1046); +INSERT INTO `sys_role_menu` VALUES (2, 1047); +INSERT INTO `sys_role_menu` VALUES (2, 1048); +INSERT INTO `sys_role_menu` VALUES (2, 1049); +INSERT INTO `sys_role_menu` VALUES (2, 1050); +INSERT INTO `sys_role_menu` VALUES (2, 1051); +INSERT INTO `sys_role_menu` VALUES (2, 1052); +INSERT INTO `sys_role_menu` VALUES (2, 1053); +INSERT INTO `sys_role_menu` VALUES (2, 1054); +INSERT INTO `sys_role_menu` VALUES (2, 1055); +INSERT INTO `sys_role_menu` VALUES (2, 1056); +INSERT INTO `sys_role_menu` VALUES (2, 1057); +INSERT INTO `sys_role_menu` VALUES (2, 1058); +INSERT INTO `sys_role_menu` VALUES (2, 1059); +INSERT INTO `sys_role_menu` VALUES (2, 1060); +INSERT INTO `sys_role_menu` VALUES (100, 1); +INSERT INTO `sys_role_menu` VALUES (100, 2); +INSERT INTO `sys_role_menu` VALUES (100, 3); +INSERT INTO `sys_role_menu` VALUES (100, 4); +INSERT INTO `sys_role_menu` VALUES (100, 100); +INSERT INTO `sys_role_menu` VALUES (100, 101); +INSERT INTO `sys_role_menu` VALUES (100, 102); +INSERT INTO `sys_role_menu` VALUES (100, 103); +INSERT INTO `sys_role_menu` VALUES (100, 104); +INSERT INTO `sys_role_menu` VALUES (100, 105); +INSERT INTO `sys_role_menu` VALUES (100, 106); +INSERT INTO `sys_role_menu` VALUES (100, 107); +INSERT INTO `sys_role_menu` VALUES (100, 108); +INSERT INTO `sys_role_menu` VALUES (100, 109); +INSERT INTO `sys_role_menu` VALUES (100, 110); +INSERT INTO `sys_role_menu` VALUES (100, 115); +INSERT INTO `sys_role_menu` VALUES (100, 116); +INSERT INTO `sys_role_menu` VALUES (100, 500); +INSERT INTO `sys_role_menu` VALUES (100, 501); +INSERT INTO `sys_role_menu` VALUES (100, 1001); +INSERT INTO `sys_role_menu` VALUES (100, 1008); +INSERT INTO `sys_role_menu` VALUES (100, 1013); +INSERT INTO `sys_role_menu` VALUES (100, 1017); +INSERT INTO `sys_role_menu` VALUES (100, 1021); +INSERT INTO `sys_role_menu` VALUES (100, 1026); +INSERT INTO `sys_role_menu` VALUES (100, 1031); +INSERT INTO `sys_role_menu` VALUES (100, 1036); +INSERT INTO `sys_role_menu` VALUES (100, 1040); +INSERT INTO `sys_role_menu` VALUES (100, 1043); +INSERT INTO `sys_role_menu` VALUES (100, 1046); +INSERT INTO `sys_role_menu` VALUES (100, 1049); +INSERT INTO `sys_role_menu` VALUES (100, 1055); +INSERT INTO `sys_role_menu` VALUES (100, 2000); +INSERT INTO `sys_role_menu` VALUES (100, 2043); +INSERT INTO `sys_role_menu` VALUES (100, 2044); +INSERT INTO `sys_role_menu` VALUES (100, 2049); +INSERT INTO `sys_role_menu` VALUES (100, 2050); +INSERT INTO `sys_role_menu` VALUES (100, 2055); +INSERT INTO `sys_role_menu` VALUES (100, 2056); +INSERT INTO `sys_role_menu` VALUES (100, 2061); +INSERT INTO `sys_role_menu` VALUES (100, 2062); +INSERT INTO `sys_role_menu` VALUES (100, 2067); +INSERT INTO `sys_role_menu` VALUES (100, 2068); +INSERT INTO `sys_role_menu` VALUES (100, 2073); +INSERT INTO `sys_role_menu` VALUES (101, 2000); +INSERT INTO `sys_role_menu` VALUES (101, 2043); +INSERT INTO `sys_role_menu` VALUES (101, 2044); +INSERT INTO `sys_role_menu` VALUES (101, 2045); +INSERT INTO `sys_role_menu` VALUES (101, 2046); +INSERT INTO `sys_role_menu` VALUES (101, 2047); +INSERT INTO `sys_role_menu` VALUES (101, 2048); +INSERT INTO `sys_role_menu` VALUES (101, 2049); +INSERT INTO `sys_role_menu` VALUES (101, 2050); +INSERT INTO `sys_role_menu` VALUES (101, 2051); +INSERT INTO `sys_role_menu` VALUES (101, 2052); +INSERT INTO `sys_role_menu` VALUES (101, 2053); +INSERT INTO `sys_role_menu` VALUES (101, 2054); +INSERT INTO `sys_role_menu` VALUES (101, 2055); +INSERT INTO `sys_role_menu` VALUES (101, 2056); +INSERT INTO `sys_role_menu` VALUES (101, 2057); +INSERT INTO `sys_role_menu` VALUES (101, 2058); +INSERT INTO `sys_role_menu` VALUES (101, 2059); +INSERT INTO `sys_role_menu` VALUES (101, 2060); +INSERT INTO `sys_role_menu` VALUES (101, 2061); +INSERT INTO `sys_role_menu` VALUES (101, 2062); +INSERT INTO `sys_role_menu` VALUES (101, 2063); +INSERT INTO `sys_role_menu` VALUES (101, 2064); +INSERT INTO `sys_role_menu` VALUES (101, 2065); +INSERT INTO `sys_role_menu` VALUES (101, 2066); +INSERT INTO `sys_role_menu` VALUES (101, 2067); +INSERT INTO `sys_role_menu` VALUES (101, 2068); +INSERT INTO `sys_role_menu` VALUES (101, 2069); +INSERT INTO `sys_role_menu` VALUES (101, 2070); +INSERT INTO `sys_role_menu` VALUES (101, 2071); +INSERT INTO `sys_role_menu` VALUES (101, 2072); +INSERT INTO `sys_role_menu` VALUES (101, 2073); + +-- ---------------------------- +-- Table structure for sys_user +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `user_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `dept_id` bigint(0) NULL DEFAULT NULL COMMENT '部门ID', + `open_id` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户OpenId', + `user_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户账号', + `nick_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户昵称', + `user_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '00' COMMENT '用户类型(00系统用户)', + `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户邮箱', + `phonenumber` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '手机号码', + `sex` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', + `avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像地址', + `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '密码', + `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', + `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '最后登录IP', + `login_date` datetime(0) NULL DEFAULT NULL COMMENT '最后登录时间', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`user_id`) USING BTREE, + UNIQUE INDEX `open_id`(`open_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +INSERT INTO `sys_user` VALUES (1, 103, NULL, 'admin', '物美智能', '00', '164770707@qq.com', '15888888888', '1', '', '$2a$10$PXtk.97BgFUAK/7lpmxZ4eNPS6zL0VVHR7g.sjrdG5XUiX7pfGaRa', '0', '0', '127.0.0.1', '2021-05-18 02:23:06', 'admin', '2021-05-18 02:23:06', '', NULL, '管理员'); +INSERT INTO `sys_user` VALUES (2, 105, NULL, 'wumei', '物美智能', '00', 'admin@wumei.com', '15666666666', '1', '', '$2a$10$uLlHqgW4b5oAqoS81Rhkk.7Tf6wnGvh9FE9V160Dv2Kn9doOrB4qe', '0', '0', '127.0.0.1', '2021-05-18 02:23:06', 'admin', '2021-05-18 02:23:06', 'admin', '2021-06-19 09:31:14', '测试员'); +INSERT INTO `sys_user` VALUES (100, NULL, NULL, 'public', '访客', '00', '', '', '0', '', '$2a$10$E8d4gZ3.QQzDE7LBfY7XpuuGX.LvWFcA982AAdAzk24u91bQ1nete', '0', '0', '', NULL, 'admin', '2021-05-29 08:37:36', 'admin', '2021-06-19 09:31:20', NULL); +INSERT INTO `sys_user` VALUES (101, NULL, NULL, 'aaa', 'xxx', '00', '', '', '0', '', '$2a$10$f.KtWGpaUsdvl2E427/H4OnPi2dYx8HetxnBs1uasSNwCBBUDSwjO', '0', '0', '', NULL, 'admin', '2021-08-26 17:28:34', '', NULL, NULL); +INSERT INTO `sys_user` VALUES (114, NULL, 'oRHbg4lwGVJYu7GjfVwRv6pYygzQ', 'EB5312FB4A26', '微信注册用户', '00', '', '', '0', '', '$2a$10$iWySi4cYQ.0DFSMFCzofbu1H13Dd03WW7h/0OZPzQcBd.7f1fWjV.', '0', '0', '', NULL, '微信小程序', '2021-08-26 18:06:16', '', NULL, NULL); +INSERT INTO `sys_user` VALUES (115, NULL, 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', 'A1BB9722086A', '微信注册用户', '00', '', '', '0', '', '$2a$10$rAoFt5nuPw/2CXhRsa/uoOjExW0XH3xM009kcWWo12rzFiSgIK.n2', '0', '0', '', NULL, '微信小程序', '2021-08-26 18:41:21', '', NULL, NULL); +INSERT INTO `sys_user` VALUES (116, NULL, 'oRHbg4kHhyFV8DPX-wpGREyjfQsM', '6F1B3F33DD38', '微信注册用户', '00', '', '', '0', '', '$2a$10$SUR7vd7YIiMkFBFSTKba7uTc5FdpAdwyMuzUsUpMjkgTC0NfiRpqK', '0', '0', '', NULL, '微信小程序', '2021-08-31 14:47:58', '', NULL, NULL); + +-- ---------------------------- +-- Table structure for sys_user_post +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_post`; +CREATE TABLE `sys_user_post` ( + `user_id` bigint(0) NOT NULL COMMENT '用户ID', + `post_id` bigint(0) NOT NULL COMMENT '岗位ID', + PRIMARY KEY (`user_id`, `post_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户与岗位关联表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_user_post +-- ---------------------------- +INSERT INTO `sys_user_post` VALUES (1, 1); +INSERT INTO `sys_user_post` VALUES (2, 2); + +-- ---------------------------- +-- Table structure for sys_user_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_role`; +CREATE TABLE `sys_user_role` ( + `user_id` bigint(0) NOT NULL COMMENT '用户ID', + `role_id` bigint(0) NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户和角色关联表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of sys_user_role +-- ---------------------------- +INSERT INTO `sys_user_role` VALUES (1, 1); +INSERT INTO `sys_user_role` VALUES (2, 100); +INSERT INTO `sys_user_role` VALUES (100, 100); +INSERT INTO `sys_user_role` VALUES (101, 101); + +-- ---------------------------- +-- Table structure for t_user_account_info +-- ---------------------------- +DROP TABLE IF EXISTS `t_user_account_info`; +CREATE TABLE `t_user_account_info` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `sessionKey` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'sessionKey', + `access_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'accessToken', + `open_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, + `union_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, + `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '昵称', + `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '头像', + `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '手机号', + `birthday` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '生日', + `status` int(0) NOT NULL DEFAULT 1 COMMENT '用户状态:0-冻结,1-正常', + `country` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '国家', + `province` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '省份', + `city` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '城市', + `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '地址', + `user_type` int(0) NOT NULL DEFAULT 0 COMMENT '用户类型:0-未授权用户,1-消费者,2-商家', + `admin_id` int(0) NULL DEFAULT NULL COMMENT '绑定的管理员编号', + `last_login_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `last_login_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, + `gmt_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `gmt_update` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `open_id`(`open_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 200030 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '小程序用户表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of t_user_account_info +-- ---------------------------- +INSERT INTO `t_user_account_info` VALUES (200029, 'wd4/hPuBQ+ummo/NOv1Rsw==', 'ced50c3733424484becfa6a68e4066fc', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', NULL, '新注册用户', 'https://c-ssl.duitang.com/uploads/item/201912/27/20191227145714_rtHRc.thumb.1000_0.jpeg', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, '2021-08-26 17:02:10', '127.0.0.1', '2021-08-26 16:30:57', '2021-08-26 17:02:08'); + +-- ---------------------------- +-- Table structure for t_user_login_log +-- ---------------------------- +DROP TABLE IF EXISTS `t_user_login_log`; +CREATE TABLE `t_user_login_log` ( + `id` int(0) NOT NULL AUTO_INCREMENT, + `user_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户类型', + `user_id` int(0) NOT NULL, + `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `open_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `ip` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'IP地址', + `gmt_time` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0), + `gmt_update` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0), + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1725 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of t_user_login_log +-- ---------------------------- +INSERT INTO `t_user_login_log` VALUES (1718, '未授权用户', 200029, '023mpv0w3w8VXW22mg2w34Vlyj3mpv01', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 16:30:57', NULL); +INSERT INTO `t_user_login_log` VALUES (1719, '未授权用户', 200029, '083hBWkl269zD74Ioxol2Rqaaq0hBWkA', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 16:56:12', NULL); +INSERT INTO `t_user_login_log` VALUES (1720, '未授权用户', 200029, '073d93000npdjM15qS100TtVyj3d930s', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 16:59:18', NULL); +INSERT INTO `t_user_login_log` VALUES (1721, '未授权用户', 200029, '053NjS000cfoiM1siM300P1HhV1NjS0W', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 16:59:42', NULL); +INSERT INTO `t_user_login_log` VALUES (1722, '未授权用户', 200029, '043nlS000U9niM1a6I0007YZCb3nlS0u', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 17:00:07', NULL); +INSERT INTO `t_user_login_log` VALUES (1723, '未授权用户', 200029, '0039Zull2tOZC74R3Pnl2Hpg8l49Zul1', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 17:00:51', NULL); +INSERT INTO `t_user_login_log` VALUES (1724, '未授权用户', 200029, '013pCmFa1E5TDB0fpIIa138qab2pCmFl', 'oRHbg4mTdANmQwDhuQAD8vBbkNG0', '127.0.0.1', '2021-08-26 17:02:08', NULL); + +SET FOREIGN_KEY_CHECKS = 1;